Windows 7 WiX msi自定义操作未在Windows 7上以有限权限运行
我一直在尝试为我的最新项目创建WiX安装程序。我有一个奇怪的问题,如果我以管理员的身份通过cmd提示符运行msi,它工作正常,自定义操作开始时没有任何麻烦,一切正常,但是如果我双击msi,自定义操作不工作,安装程序失败。我正在使用Visual Studio 2012和Windows 7Windows 7 WiX msi自定义操作未在Windows 7上以有限权限运行,windows-7,visual-studio-2012,wix,windows-installer,custom-action,Windows 7,Visual Studio 2012,Wix,Windows Installer,Custom Action,我一直在尝试为我的最新项目创建WiX安装程序。我有一个奇怪的问题,如果我以管理员的身份通过cmd提示符运行msi,它工作正常,自定义操作开始时没有任何麻烦,一切正常,但是如果我双击msi,自定义操作不工作,安装程序失败。我正在使用Visual Studio 2012和Windows 7 <!--Custom Actions--> <Binary Id='customShortcut' SourceFile='$(var.CustomDir)\TestInstallerCusto
<!--Custom Actions-->
<Binary Id='customShortcut' SourceFile='$(var.CustomDir)\TestInstallerCustom.CA.dll'/>
<Binary Id='customDir' SourceFile='$(var.CustomDir)\TestInstallerCustom.CA.dll'/>
<Binary Id='removeDir' SourceFile='$(var.CustomDir)\TestInstallerCustom.CA.dll'/>
<CustomAction Id='customShortcutId' BinaryKey='customShortcut' DllEntry='CustomShortcut'
Execute='immediate' Impersonate='no' Return='check' />
<CustomAction Id='customDirId' BinaryKey='customDir' DllEntry='CustomDir'
Execute='immediate' Impersonate='no' Return='check'/>
<CustomAction Id='removeDirId' BinaryKey='removeDir' DllEntry='RemoveDir'
Execute='immediate' Impersonate='no' Return='check'/>
<InstallExecuteSequence>
<Custom Action='customDirId' Before='InstallFinalize'/>
<Custom Action='customShortcutId' After='InstallFinalize'/>
<Custom Action="removeDirId" After="InstallValidate">REMOVE="ALL"</Custom>
</InstallExecuteSequence>
REMOVE=“全部”
安装的提升部分不会执行'immediate'
自定义操作。因此,它们仅在安装过程中提升,而在运行提升时(如您所见)。要提升自定义操作,它们必须是事务脚本的一部分。为此,设置CustomAction
元素Execute='deferred'
属性
注意:延迟的自定义操作具有MSI SDK中记录的其他限制:。因为看起来自定义操作正在修改机器状态,所以您还需要考虑添加回滚自定义操作以撤消延迟自定义操作所做的更改
编写好定制动作是一项相当具有挑战性的工作。这就是为什么自定义操作是安装失败的最大原因之一。如果您可以避免编写自定义操作,我强烈建议您这样做。:) 谢谢你的回复。联机是否有任何有关回滚自定义操作的信息?是的,在上标记为“回滚自定义操作”的主题中