Add more than one checkbox when install with Wix is over

隐身守侯 提交于 2019-12-06 05:29:17

You must create own edited UI with custom dialog.

1.First go to official GIT repository and copy files WixUI_Minimal.wxs and ExitDialog.wxs , or copy whole repository and find files locally. Create own copies of this files to you project/Solution and rename them for example to WixUI_Custom.wxs and MyExitDialog.wxs .

Replace content of new files too, for WixUI_Minimal.wxs replace

<UI Id="WixUI_Minimal"> to <UI Id="WixUI_Custom">,

for ExitDialog.wxs replace

<Dialog Id="ExitDialog" Width="370" Height="270" Title="!(loc.ExitDialog_Title)"> to <Dialog Id="MyExitDialog" Width="370" Height="270" Title="!(loc.ExitDialog_Title)">

and both

<Show Dialog="ExitDialog" OnExit="success" Overridable="yes" /> to <Show Dialog="MyExitDialog" OnExit="success" Overridable="yes" />

2.Change <UIRef Id="WixUI_Minimal"/> in your Product to <UIRef Id="WixUI_Custom"/>

3.Now you installer should open with exact UI as before, but from your classes

4.Open WixUI_Custom and change

<Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999"> to <Publish Dialog="ExitDialog" Control="Finish" Event="EndDialog" Value="Return" Order="999">

so UI will open our new Dialog.

5.Open MyExitDialog.wxs and add new Control block, as it is already present

<Control Id="OptionalCheckBox" Type="CheckBox" X="135" Y="190" Width="220" Height="40" Hidden="yes" Property="WIXUI_EXITDIALOGOPTIONALCHECKBOX" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT]">
  <Condition Action="show">
    WIXUI_EXITDIALOGOPTIONALCHECKBOXTEXT AND NOT Installed
  </Condition>
</Control>

Change identificator Id to anything, X,Y for new position in dialog, Property for new property, in which will be checkbox value stored and Text for new property, in which will be displayed text stored. Place Text property to Condition too, so display will depend on text property set, as in existing checkbox.

<Control Id="SecondCheckBox" Type="CheckBox" X="135" Y="220" Width="220" Height="40" Hidden="yes" Property="WIXUI_SECONDCHECKBOXVALUE" CheckBoxValue="1" Text="[WIXUI_EXITDIALOGSECONDCHECKBOXTEXT]">
  <Condition Action="show">
    WIXUI_EXITDIALOGSECONDCHECKBOXTEXT AND NOT Installed
  </Condition>
</Control>

6.Now you can do the same things with new Checkbox as with existing using new properties defined in new Control.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!