【发布时间】:2011-11-29 06:43:11
【问题描述】:
我有以下属性:
<Property Id="UPDATEDB">1</Property>
绑定到该属性的 UI 中的复选框:
<Control Id="updateDatabase" Type="CheckBox" CheckBoxValue="1" Height="15" Width="95" X="20" Y="74" Text="Update Database" Property="UPDATEDB" />
还有一个基于此属性的值执行某些操作的自定义操作
<CustomAction Id="RunDbMigration" Directory="INSTALLDIR" Return="check"
ExeCommand='[DBMIGRATIONDIR]\DbMigration.exe' />
<InstallExecuteSequence>
<Custom Action="RunDbMigration" After="InstallFinalize">UPDATEDB=1 AND NOT Installed</Custom>
</InstallExecuteSequence>
如果我尝试从命令行为 UPDATEDB 传递值 0:
msiexec /i "Setup.msi" /l* UPDATEDB=0
或
msiexec /i "Setup.msi" /l* UPDATEDB="0"
复选框的值无论如何都会被选中。也就是说,传入的 0 似乎受到尊重,并且未运行 RunDbMigration 操作...
这里发生了什么?为什么这是火箭科学?
【问题讨论】:
标签: wix windows-installer wix3.5