prop.exe在Wix中提升执行

时间:2014-06-12 04:13:35

标签: wix administrator

这个问题似乎已在本网站上得到了解答,但我无法让Wix运行具有管理员权限的操作系统(Windows 8.1 64位)。

我开发的安装程序将prop.exe实用程序(http://prop.codeplex.com/)复制到Program Files(appfolder)下的文件夹以及需要由prop.exe注册/取消注册的文件(my_file.propdesc)像:

prop schema register my_file.propdesc (at the end of installation)

prop schema unregister my_file (at the beginning of uninstallation)

这两个命令行需要以管理员权限运行。因为这些也应该在没有命令提示符的情况下运行,我已经使用CAQuietExec和另一个为CAQuietExec准备参数的CustomAction(prop.exe是32位,所以如果我没有弄错的话,它是CAQuietExec而不是CAQuietExec64)

<CustomAction Id='PropReg_Prep' Property='PropReg' Value='"[appfolder]prop.exe" schema register "[appfolder]my_file.propdesc"' Execute='immediate' />
<CustomAction Id='PropUnReg_Prep' Property='PropUnReg' Value='"[appfolder]prop.exe" schema unregister "[appfolder]my_file.propdesc"' Execute='immediate' />
<CustomAction Id="PropReg" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no" />
<CustomAction Id="PropUnReg" BinaryKey="WixCA" DllEntry="CAQuietExec" Execute="deferred" Return="ignore" Impersonate="no" />

自定义操作按以下方式执行:

<InstallExecuteSequence>
<Custom Action="PropReg_Prep" After="CostFinalize" >NOT Installed</Custom>
<Custom Action="PropUnReg_Prep" After="CostFinalize" >Installed</Custom>
<Custom Action="PropUnReg" After="InstallInitialize" >Installed</Custom>
<Custom Action="PropReg" After="InstallFiles" >NOT Installed</Custom>
</InstallExecuteSequence>

我无法获得注册/取消注册my_file.propdesc的支持。有人可以帮忙吗?

2 个答案:

答案 0 :(得分:0)

您正在将操作安排为Execute='immediate',它以执行安装程序的用户身份运行。

切换到使用Execute='deferred'这将作为系统帐户运行。假设prop.exe不需要运行完整的配置文件,这应该可行。

答案 1 :(得分:0)

如果您没有假冒您正在使用系统帐户运行,那么它具有管理员权限,但如果您希望它是用户帐户,那么可能会出现问题。

对我来说很奇怪的是[appfolder] prop.exe有很多原因。它看起来不像一个正确的应用程序文件夹,所以请确保它是正确的。它也需要是大写的,使其成为公共属性,你应该在属性元素中将其标记为Secure =“yes”。问题是它可能无法从您的直接CA正确转移到使用它的执行序列中。

P.S。安装是否创建详细日志,以便您可以查看这些目录值在运行时是如何实际解析的。