【发布时间】:2017-01-17 07:51:28
【问题描述】:
刚刚开始在 Visual Studio 中使用 WiX。找不到很多引导程序项目模板的文档。
我创建了一个空白的 WPF 应用程序。然后我创建了一个安装项目...
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="WiXBenchInstaller" Language="1033" Version="1.0.0.0" Manufacturer="None" UpgradeCode="9d845a6d-3e16-45d6-b0c4-7e818e465bfe">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<Feature Id="ProductFeature" Title="WiXBenchInstaller" Level="1">
<ComponentGroupRef Id="ProductComponents" />
</Feature>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="WiXBench" />
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. -->
<Component Id="ProductComponent">
<File Source="$(var.WiXBench.TargetPath)"/>
</Component>
</ComponentGroup>
</Fragment>
然后我创建了一个引导程序项目...
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Bundle Name="WixBenchBootstrap" Version="1.0.0.0" Manufacturer="None" UpgradeCode="4b1049ed-38ba-4289-8d8d-e291160201e0">
<BootstrapperApplicationRef Id="WixStandardBootstrapperApplication.RtfLicense" />
<Chain>
<MsiPackage SourceFile="$(var.WiXBenchInstaller.TargetPath)"/>
</Chain>
</Bundle>
一切正常。我的问题是这是否是正确的方法。为一个简单的应用程序拥有 2 个安装程序项目似乎有点过头了。我可以简单地拥有一个包含所有需要的引导程序项目吗?
【问题讨论】:
标签: visual-studio wix