MSI 是否能够自动启动具有提升权限的程序/文件?
我正在尝试使 .msi 文件能够打开一个可执行文件,该可执行文件将注册浏览器帮助程序对象。由于这涉及写入注册表,因此必须使用管理权限提升 cmd.exe。我可以操纵 ShellExecute() 函数来弹出 UAC 对话框,并询问用户是否要以管理员身份运行 cmd,但是,我不想让用户对安装进行任何控制。大量在线研究使我得出结论,没有管理权限就不可能使用浏览器帮助程序对象,所以我的问题是:假设安装程序已经运行,cmd.exe 是否能够继承 msi 安装程序的权限行政权?无济于事,我也尝试过以管理员身份自动运行cmd。我感谢任何指导或帮助,非常感谢!
I am trying to make it possible for an .msi file to open an executable which will register a Browser Helper Object. Since this involves writing to the registry, cmd.exe must be elevated with administrative privelages. I am able to manipulate the ShellExecute() function to make a UAC dialog pop up and ask whether the user wants to run cmd as an administrator, however, I would not like to give the user any control over the installation. Much research online has lead me to conclude that it is impossible to user a Browser Helper Object without administrative rights, so my question is: Would cmd.exe be able to inherit the permissions of the msi installer, assuming that the installer is already running with administrative rights? To no avail, I have also tried to automatically run cmd as an administrator. I appreciate any direction or help given, thank you very much!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您应该能够在大约 100 行 WiX 中无需使用 CMD 来实现此目的,只需手动编写所需的注册表项即可,无需执行cmd.exe或regsvr32。请注意,自我注册(您正在尝试做的事情)是一种非常糟糕的做法,并且会导致安装混乱。
以下命令应该可以帮助您开始:
You should be able to achieve this without using CMD in around 100 lines of WiX and just write the required registry entries manually, no need to execute cmd.exe or regsvr32. Note that self-registration (what you're trying to do) is a really bad practice and leads to messy installs.
The following command should get you started:
我的理解是,如果启用了 UAC,则应该没有办法绕过它。如果存在,则属于漏洞利用,应避免。
My understanding is that IF UAC is enabled there should be no way to get around it. If there is it is an exploit and should be avoided.