在WiX中安装或卸载时,“已安装”条件始终为真

时间:2013-06-03 15:50:27

标签: wix windows-installer

我有一个WiX安装程序可以完成一些工作,最后启动RSYNC安装程序(它是一个EXE文件,同时工作没问题)。

但卸载时,我也想删除RSYNC。

<CustomAction Id="InstallRSyncDaemon" FileKey="cwRsyncServer_4.0.5_Installer.exe" ExeCommand="/q" Execute="deferred" Return="ignore" Impersonate="no" />
<CustomAction Id="UninstallRSyncDaemon" FileKey="rsync_uninstall.bat" ExeCommand="[INSTALLDIR]" Execute="deferred" Return="check" Impersonate="no" />
<CustomAction Id="EditConf" FileKey="rsync.bat" ExeCommand="[INSTALLDIR]" Execute="deferred" Return="ignore" Impersonate="no"/>

<InstallExecuteSequence>
  <Custom Action='InstallRSyncDaemon' Before='InstallFinalize'>(NOT remove="ALL")</Custom>
  <Custom Action='EditConf' After='InstallRSyncDaemon'>(NOT remove="ALL")</Custom>
  <Custom Action='UninstallRSyncDaemon' Before='RemoveFiles'>remove="ALL"</Custom>
</InstallExecuteSequence>

我的问题是在卸载过程中,会跳过自定义操作'UninstallRSyncDaemon':

MSI (s) (58:78) [17:37:40:475]: Skipping action: UninstallRSyncDaemon (condition is false)

我尝试过“已安装”和其他条件,结果相同。

在开始日志文件时,我有:

MSI (c) (9C:80) [17:37:36:772]: PROPERTY CHANGE: Adding ACTION property. Its value is 'INSTALL'.
MSI (c) (9C:80) [17:37:36:772]: Doing action: INSTALL
Action 17:37:36: INSTALL.
Action start 17:37:36: INSTALL.
MSI (c) (9C:80) [17:37:36:772]: UI Sequence table 'InstallUISequence' is present and populated.
MSI (c) (9C:80) [17:37:36:772]: Running UISequence
MSI (c) (9C:80) [17:37:36:772]: PROPERTY CHANGE: Adding EXECUTEACTION property. Its value is 'INSTALL'.

如果我在安装过程中尝试更改为启动它的条件,它正在工作,所以对我而言,这只是条件的陈述。

但是我不明白为什么,这是在教程或Stack Overflow的答案中总是使用的条件。

1 个答案:

答案 0 :(得分:0)

我认为删除应该是大写的。试试这个。

REMOVE="ALL"

但它也会在修改和升级中运行。查看有关此条件的更多信息here