防止以管理权限启动
目标:
这听起来有点奇怪,但我必须防止软件以管理权限启动。
问题:
我有一个安装工具,可以很好地安装该软件。完成安装后,软件会自行启动。由于安装工具以管理权限运行,因此安装后自动启动的软件也会执行相同的操作。
但是程序需要的所有设置此时都将无法正确写入/读取,因为由于 UAC 虚拟化,config 目录与用户在没有管理权限的情况下拥有的 config 目录不同。
问题:
如果父进程拥有管理权限,是否有办法从管理权限降级为用户权限。应用程序配置?启动参数?或其他
信息:我正在使用 INNOSETUP 来构建设置工具。
谢谢你的帮助
Goal:
It sounds a little bit odd, but I have to prevent that a software starts with administrative rights.
Problem:
I have a setup tool that installs the software very well. After completion the setup starts the software itself. Because the setup tool runs with administrative rights, the software that will be startet automatically after the setup does the same.
But all Settings that the program need, won't be written/read correctly that time, because due to the UAC virtualization, the config directory is different to the config directory the user would have without administrative rights.
Question:
Is there any way to downgrade from admnistrative rights to user rights, if the parent process owns administrative rights. App.config? StartParameter? or something else
Info: I'm using the INNOSETUP to build the setup tool.
Thx for your help
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只需为正在运行的应用程序设置 runasoriginaluser 标志即可。
Just set runasoriginaluser flag for running application.
是的,您可以启动一个非提升的进程,但是我不确定它如何与 InnoSetup 集成。说明是 如何以桌面用户身份从提升的应用程序启动程序。
考虑使用适当的清单标记您的应用程序以抑制 UAC 虚拟化,它然后将在两种情况下使用相同的目录:非提升和提升。更好地使用用户配置文件中的目录,而不依赖虚拟化。
Yes, you can start a process non-elevated, however I'm not sure how this integrates with InnoSetup. The instructions are How do I start a program as the desktop user from an elevated app.
Consider marking your application with appropriate manifest to suppress UAC virtualization, it will then use the same directories in both cases: non-elevated and elevated. And better use directories in user's profile without relying on virtualization.