简单的设置
此示例假定已存在名为 MyApp 的应用程序的解决方案。
- 
向解决方案添加新项目:  
- 
在 Setup 项目中,从 Projects 选项卡添加对 MyApp的新引用: 
- 
在 Product.wxs文件中,使用HelloWorld对Product节点的Manufacturer属性进行增值:
<Product Id="*" Name="MyApp.Setup" Language="1033" Version="1.0.0.0" Manufacturer="HelloWorld" UpgradeCode="52f2c69b-5901-4d18-bb96-8c1c86cd1a3e">
在包含 Directory 节点的 Fragment 节点中,用新的 Directory 包裹最后一个节点:
<Directory Id="ManufacturerFolder" Name="!(bind.property.Manufacturer)">
    <Directory Id="INSTALLFOLDER" Name="MyApp.Setup" />
</Directory>
在 ComponentGroup 节点中,取消注释注释节点并删除 TODO 然后在 Component 中添加 File 节点:
<File Source="$(var.MyApplication.TargetPath)" />
Source 属性指定在构建期间在哪里查找要打包的文件。我们使用传递给 WiX 编译器的 WiX 预处理器变量,而不是将这些属性的值硬编码到源代码中。
- 构建 WiX 项目。
而已! 现在你有了一个可以安装和卸载应用程序的工作安装程序。
完整的 Product.wxs 文件:
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product Id="*" Name="MyApp.Setup" Language="1033" Version="1.0.0.0" Manufacturer="HelloWorld" UpgradeCode="52f2c69b-5901-4d18-bb96-8c1c86cd1a3e">
        <Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
        <MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
        <MediaTemplate />
        <Feature Id="ProductFeature" Title="MyApp.Setup" Level="1">
            <ComponentGroupRef Id="ProductComponents" />
        </Feature>
    </Product>
    <Fragment>
        <Directory Id="TARGETDIR" Name="SourceDir">
            <Directory Id="ProgramFilesFolder">
                <Directory Id="ManufacturerFolder" Name="!(bind.property.Manufacturer)">
                    <Directory Id="INSTALLFOLDER" Name="MyApp.Setup" />
                </Directory>
            </Directory>
        </Directory>
    </Fragment>
    <Fragment>
        <ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
            <Component Id="ProductComponent">
                <File Source="$(var.MyApp.TargetPath)" />
            </Component>
        </ComponentGroup>
    </Fragment>
</Wix>