<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" UpgradeCode="1" Version="1.0.0.0" Language="1033" Name="My Application Name" Manufacturer="My Manufacturer Name">
<Package InstallerVersion="300" Compressed="yes"/>
<Media Id="1" Cabinet="myapplication.cab" EmbedCab="yes" />
<!-- Step 1: Define the directory structure -->
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="My Application Name"/>
</Directory>
</Directory>
<!-- Step 2: Add files to your installer package -->
<!-- Copied from output from heat.exe -->
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Directory Id="dirBF6284DAE096656A1A0B06AE3DCAA0C9" Name="MyAppName">
<Component Id="cmp26BABDEF350D4D06E3894ED92A9EA86E" Guid="8E1DA6FE-08EA-4D2E-8EBA-85131387A359">
<File Id="filEBD2DA63132D753815D44CEDC2ED5E88" KeyPath="yes" Source="SourceDir\benutzer.csv" />
</Component>
</Directory>
</DirectoryRef>
</Fragment>
<Fragment>
<ComponentGroup Id="MyComponentGroup">
<ComponentRef Id="cmp26BABDEF350D4D06E3894ED92A9EA86E" />
</ComponentGroup>
</Fragment>
<!-- Step 3: Tell WiX to install the files -->
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentGroupRef Id="MyComponentGroup" />
</Feature>
</Product>
</Wix>
错误:
error LGHT0094 : Unresolved reference to symbol ’Component:MyComponentGroup’ in section ’Product:*’.
我减少了这个例子的完整代码,通常我会有更多的文件要打包。组件收集由heat.exe完成,我将组件部分复制到此wix文件中。 虽然错误表明存在什么问题,但我不知道到底要找什么。
代码从bat文件运行:
set WIX_BIN=c:\Program Files (x86)\WiX Toolset v3.11\bin\
echo Wix Toolset Bin Path: %WIX_BIN%
"%WIX_BIN%candle.exe" out.wxs -ext WixUtilExtension
if exist out.wixobj (
"%WIX_BIN%light.exe" -out out.msi out.wixobj -ext WixUIExtension -ext WixUtilExtension
)
pause