Wix不会根据unistall上的复选框设置属性值

时间:2017-05-17 12:50:44

标签: checkbox wix windows-installer

我的 MyVerifyReadyDlg.wxs 复选框控件内部定义如下:

      <Control Id="REMOVELOGSFILESCHECKBOX" Type="CheckBox" X="170" Y="170" Width="80" Height="17"
            Property="REMOVINGLOGSPROPERTY" CheckBoxValue="0" Text="Remove logs files">
      <Condition Action="show">Installed</Condition>
      <Condition Action="hide">NOT Installed</Condition>
    </Control>

Product.wxs 内部我已将该属性定义为:

<Property Id="REMOVINGLOGSPROPERTY" Secure="yes"/>

以及 Product.wxs 内部我有这个组件来删除卸载时的日志文件:

  <Component Id="logsFolderComponent" Guid="*" Directory="logsFolder">
  <Condition>REMOVINGLOGSPROPERTY</Condition>
  <RemoveFile Id="allLogsFiles" Name="*.log" On="uninstall"></RemoveFile>
 </Component>

问题是:在卸载过程中选中复选框时,它不会设置属性(保持为空),但如果我在安装时使用复选框,则会删除日志文件。

如何在卸载时设置属性?

1 个答案:

答案 0 :(得分:0)

在安装和后续操作之间的任何位置都不会自动保留属性。 WiX提供&#34;记住属性&#34;这种模式。

http://robmensching.com/blog/posts/2010/5/2/the-wix-toolsets-remember-property-pattern/