通过自定义操作运行流程 [英] Running a Process from Custom Action

查看:89
本文介绍了通过自定义操作运行流程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


安装程序后,我需要打开程序.我在AfterInstall方法中执行此操作.通过开始新的过程.

Hi,
I need to open my program after it has been installed. I do this in the AfterInstall method. By starting a new process.

Process p = new Process();
                    p.StartInfo.FileName = "filepath";
                    p.Start();


问题在于该程序需要在HKEY_CURRENT_USER注册表中获取/设置一个值,但它正在HKEY_USERS注册表中查找.这是因为该过程在"NT AUTHORITY \ SYSTEM"下启动.据我所知,我无法获取用户密码,因此我无法以其他用户身份启动该过程.当程序正常启动时,一切正常,这只是通过自定义操作"打开时的一个问题.关于如何以其他方式运行它或进入正确的注册表的任何想法?


The issue is that the program needs to get/set a value in the HKEY_CURRENT_USER registry but it is instead is looking in the HKEY_USERS registry. This is because the process starts under "NT AUTHORITY\SYSTEM". I have no of getting the users password so as far as I can tell I can''t start the process as a different user. Everything works fine when the program is started normally, it''s only an issue when opened by the Custom Action. Any idea''s on how I can run it differently or get in to the correct registry?

推荐答案

使用当前已登录用户的Active Directory ...

一旦您可以做到这一点,其余的应该很简单...
Use the Active Directory of the Current Logged in User...

once you can do this the rest should be straight forward...


这篇关于通过自定义操作运行流程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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