How to add checkbox to wix installer

I am working with a wix installer. During the installation of the product, I implemented the backup folder function. I need to add a checkbox in my installation to ask the user about the backup. if they check the box, then only the system should take a backup. how to add a checkbox to the installer and how to add a condition to my wix file to make a backup.

Thanks Santhosh

+6
source share
3 answers

Be careful: the Checkbox control can be intuitive. The checkbox does not choose between two values, such as 0 and 1, or true and false. Checkbox values ​​work more than #define in C / C ++. If the property is set to any value, the corresponding check box is selected. If the property is undefined, the field is unchecked. In addition, WiX conditions using set / unset properties treat the property as a bool with respect to whether it is defined and not what it represents. For instance. if you set the value to 0, conditional testing of the property will return true.

Further discussion of flag semantics

+2
source

By following the link provided by @imagi, I learned how to add a checkbox. I figured I would insert the code here in case this link ceases to exist once:

<?xml version="1.0" encoding="UTF-8"?> <!-- Copyright (c) Microsoft Corporation. All rights reserved. --> <Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"> <Fragment> <UI> <Dialog Id="MyInstallDirDlg" Width="370" Height="270" Title="!(loc.InstallDirDlg_Title)"> ... <Control Id="DesktopShortcutCheckBox" Type="CheckBox" X="20" Y="160" Width="290" Height="17" Property="INSTALLDESKTOPSHORTCUT" CheckBoxValue="1" Text="Create a shortcut for this program on the desktop." /> </Dialog> </UI> </Fragment> </Wix> 
0
source

Source: https://habr.com/ru/post/1388306/


All Articles