安装更改不要求 UAC 权限 [英] Installation change do not ask for UAC permissions

查看:17
本文介绍了安装更改不要求 UAC 权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我为我们的产品实施了安装程序.安装程序需要管理员权限,所以我使用 setup bootstrapper 和清单文件(推荐 这里) 在启用了 UAC 的 Windows 机器上获得这些权限.安装和卸载都很好 - 用户被要求获得许可,安装程序会做它需要做的事情.

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.

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

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.

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

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.

现在更改功能的唯一解决方法是始终使用 SetupBootstrapper,而不使用 Programs and Features 菜单,但这对用户不是很友好,并且会强制用户保持安装程序处于打开状态他/她的硬盘.

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.

有没有更好的建议?

PS:我使用 WiX 来创建安装程序,因此很高兴听到有关 WiX 解决方案的信息,但我很确定它不依赖于安装程序创建语言,但是仅针对 MSI 细节.

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.

推荐答案

哪些操作失败了?如果它们是您添加到安装中的操作,请确保使用 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.

这篇关于安装更改不要求 UAC 权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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