安装更改不要求UAC权限

发布于 2024-12-22 23:24:59 字数 983 浏览 1 评论 0 原文

我为我们的产品实现了一个安装程序。 安装程序需要管理员权限,因此我将安装引导程序与清单文件一起使用(按照建议此处)在启用了 UAC 的 Windows 计算机上获取这些权限。安装和卸载都很顺利——用户会被请求许可,安装程序会做它需要做的事情。

但是,如果您运行控制面板程序和功能并为已安装的程序选择“更改”*,则会出现错误(自定义,来自安装程序 LaunchConditions) ),告诉安装程序需要管理权限。在这种情况下,我找不到任何方法来请求权限 - Windows 只是运行 MSI 文件,并且不知道有关所需权限的任何信息。

更奇怪的是修复功能 - 它请求许可,但随后无法使用 SetupBootstrapper 执行安装期间允许的某些操作。

我发现了类似的问题此处

但在我们的案例中,所提出的解决方案是不可接受的。

现在更改功能的唯一解决方法是始终使用SetupBootstrapper,而不使用“程序和功能”菜单,但这对用户不太友好,并且迫使用户将安装程序保留在他/她的身上硬盘。

有没有人更好的建议?

PS:我使用 WiX 来创建安装程序,因此很高兴听到 WiX 解决方案,但我很确定它不依赖于安装程序创建语言,而仅依赖于 MSI具体细节。

I implemented an installer for our product. Installer needs administrator privileges, so I used setup bootstrapper with a manifest file (as recommended here) to get these privileges on a Windows machines with UAC enabled. Installation and uninstall goes fine - the user is asked for permission and the installer does what it needs to do.

But if you run Control panelPrograms and Features and select "Change"* for installed program, an error occurs (custom, from installer LaunchConditions), telling that the installer needs administrative privileges. And I can't find any way to ask for permission in a such case - Windows simply runs the MSI file and doesn't know anything about required permissions.

Even more strange is the repair functionality - it asks for permission, but then fails to do some actions that were allowed during installation, using SetupBootstrapper.

I found a similar problem here:

But the proposed solutions are unacceptable in our case.

The only workaround for the change functionality now is to always use SetupBootstrapper and do not use the Programs and Features menu, but that is not very user-friendly and forces the user to keep the installer on his/her hard drive.

Has anybody better advise?

PS: I use WiX for creating the installer, so it would be great to hear about WiX solutions, but I'm pretty sure that it doesn't depend on the installer creation language, but only on MSI specifics.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

冷清清 2024-12-29 23:24:59

哪些行动失败了?如果它们是您添加到安装中的操作,请确保使用 Impersonate="no"Execute="deferred" (或 " 定义此类操作commit”“rollback”),并且它们按 InstallInitializeInstallFinalize 之间的某个位置排序。

What actions are failing? If they are actions that you added to the installation, make sure that such actions are defined with Impersonate="no" and Execute="deferred" (or "commit" or "rollback") and that they are sequenced somewhere between InstallInitialize and InstallFinalize.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文