以不同的身份或HKCU和安装程序启动程序 [英] Launching a program in different creds or HKCU and installers

查看:142
本文介绍了以不同的身份或HKCU和安装程序启动程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个安装程序,需要一个人担任管理员(至少将东西放到c:\ program files \ app dir中) 我还需要在HKCU中创建一堆条目 问题是,如果安装程序以admin身份运行,则HKCU会移到哪里,大概是admin.
但是我需要已登录用户的HKCU,因此我想启动一个应用程序,它将执行很多工作,包括注册表项.
如果我从安装程序启动此应用程序,则它将以管理员身份或登录用户身份运行. 如何从以admin身份运行的进程中以登录用户身份启动应用程序

I have an installer that needs to a person to be an admin ( well at least drop stuff in the c:\program files\app dir ) I also need to create a bunch of entries in HKCU the thing is if if the installer is running as admin where will the HKCU go , presumably the admin.
But I want the HKCU of the logged in user, so I would like to launch an application which will do a bunch of stuff including the registry entries.
If I launch this application from the installer then will it run as admin or logged in user. How can I launch the application as the logged in user from a process that is running as admin

我看错了吗?我真正的要求是
我想部署一个可以输入HKCU的应用程序
我的安装程序通常需要管理员凭据(包括Vista UAC方案)
一旦升高,哪个HKCU将成为目标?
管理员或提升权限的用户
我如何确保条目最终出现在用户的HKCU配置单元中,而不是管理员?
谢谢

Am I looking at this all wrong. My real requirement is
I want to deploy an application that makes entries to HKCU
my installer will typically need admin creds ( vista UAC scenarios included )
once elevated which HKCU will be targeted?
the admin or the user who elevated
how can i make sure it is the user's HKCU hive that the entries end up in and not the admin.
Thanks

推荐答案

简单.只需稍微重新设计您的应用程序即可.

Easy. Just redesign your application ever-so-slightly...

  • 在安装过程中将条目写入HKLM
  • 在第一次运行应用程序时,检查HKCU条目,如果不存在,则从HKLM复制到HKCU

如果需要按用户配置,然后才能启动您的应用程序,并且如上所述不适合更新应用程序,则可以使用

If per-user configuration needs to be in place before your app will even launch and updating the app as suggested above isn't suitable then look into using ActiveSetup and schedule a reboot post-install.

这篇关于以不同的身份或HKCU和安装程序启动程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆