Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Installation 如何在wix安装程序中添加复选框_Installation_Wix_Backup_Conditional Statements - Fatal编程技术网

Installation 如何在wix安装程序中添加复选框

Installation 如何在wix安装程序中添加复选框,installation,wix,backup,conditional-statements,Installation,Wix,Backup,Conditional Statements,我正在使用wix安装程序。我在产品安装期间实现了文件夹备份功能。我需要在安装程序中添加一个复选框,要求用户进行备份。如果他们选中该复选框,则只有系统需要进行备份。 如何在安装程序中添加复选框,以及如何在wix文件中添加条件以进行备份 谢谢, Santhosh这应该给你一个想法:请注意:复选框控件可能违反直觉。该复选框不会在两个值(如0和1或true和false)之间进行选择。复选框值的工作方式更像C/C++中的#define。如果属性设置为任何值,则选中相应的复选框。如果该属性具有未定义的值,则

我正在使用wix安装程序。我在产品安装期间实现了文件夹备份功能。我需要在安装程序中添加一个复选框,要求用户进行备份。如果他们选中该复选框,则只有系统需要进行备份。 如何在安装程序中添加复选框,以及如何在wix文件中添加条件以进行备份

谢谢,
Santhosh

这应该给你一个想法:

请注意:复选框控件可能违反直觉。该复选框不会在两个值(如0和1或true和false)之间进行选择。复选框值的工作方式更像C/C++中的#define。如果属性设置为任何值,则选中相应的复选框。如果该属性具有未定义的值,则该框处于未选中状态。此外,使用set/unset属性的WiX条件将属性视为bool,与它是否定义有关,而与它的值无关。例如,如果将该值设置为“0”,则属性的条件测试将返回true


跟随@imagi提供的链接,帮助我添加并了解如何添加复选框。我想我会在这里粘贴代码,以防某一天给定的链接不再存在:

<?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>

...