【发布时间】:2014-08-20 11:47:26
【问题描述】:
我是 wix 安装程序的新手。我为我的应用程序开发了一个使用 wix 安装程序的设置,我需要执行自定义操作以在 cmd.exe 中运行命令。在 XP 中它工作正常。但在 Windows 8 和 7 中,cmd 提示符需要以管理员身份运行。
我在 Google 上搜索并发现关键字 提升权限和冒充 可能对我有帮助。
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" InstallPrivileges="elevated"></Package>
正如您在上面看到的,我使用了设置为 perMachine 的 InstallScope 属性,并且在 CustomAction 元素中使用了 Impersonate="No":
<CustomAction Id='comReg' Directory='INSTALLLOCATION' Impersonate='no'
ExeCommand='"[NETFRAMEWORK40CLIENTINSTALLROOTDIR]regasm.exe" "[INSTALLLOCATION]myProduct.dll" /codebase' Return='check' />
但我在安装时没有得到任何更改。我需要命令提示符才能在管理员模式下打开并运行上述命令。
谁能告诉我这些关键字“提升权限和冒充”
<InstallExecuteSequence>
<Custom Action='comReg' After='InstallFinalize'>NOT REMOVE</Custom>
<Custom Action='comUnreg' Before='RemoveFiles'>REMOVE</Custom>
</InstallExecuteSequence>
怎么做?
【问题讨论】:
标签: wix installation impersonation wix3.7 elevated-privileges