WiX 未解决的参考错误
我使用的是 Wix 版本 3.0.5419.0。我有两个 .wxs 文件,一个是片段,另一个使用该片段创建 .msi 文件。
这是使用片段 (DaisyFarmer.wxs) 的文件:
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension'>
<Product Name='Daisy Web Site 1.0'
Id='BB7FBBE4-0A25-4cc7-A39C-AC916B665220'
UpgradeCode='8A5311DE-A125-418f-B0E1-5A30B9C667BD'
Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='the man'>
<Package Id='5F341544-4F95-4e01-A2F8-EF74448C0D6D' Keywords='Installer'
Description="desc" Manufacturer='the man' InstallerVersion='100'
Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="the man" />
<PropertyRef Id="NETFRAMEWORK35"/>
<Condition Message='This setup requires the .NET Framework 3.5.'>
<![CDATA[Installed OR (NETFRAMEWORK35)]]>
</Condition>
<Feature Id='DaisyFarmer' Title='DaisyFarmer' Level='1'>
<ComponentRef Id='SchedulerComponent' />
</Feature>
</Product>
</Wix>
我引用的片段是 (Scheduler.wxs):
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Directory Id="dir2787390E4B7313EB8005DE08108EFEA4" Name="scheduler">
<Component Id="SchedulerComponent"
Guid="{9254F7E1-DE41-4EE5-BC0F-BA668AF051CB}">
<File Id="fil9A013D0BFB837BAC71FED09C59C5501B"
KeyPath="yes"
Source="SourceDir\DTBookMonitor.exe" />
<File Id="fil4F0D8D05F53E6AFBDB498E7C75C2D98F"
KeyPath="no"
Source="SourceDir\DTBookMonitor.exe.config" />
<File Id="filF02F4686267D027CB416E044E8C8C2FA"
KeyPath="no"
Source="SourceDir\monitor.bat" />
<File Id="fil05B8FF38A3C85FE6C4A58CD6FDFCD2FB"
KeyPath="no"
Source="SourceDir\output.txt" />
<File Id="fil397F04E2527DCFDF7E8AC1DD92E48264"
KeyPath="no"
Source="SourceDir\pipelineOutput.txt" />
<File Id="fil83DFACFE7F661A9FF89AA17428474929"
KeyPath="no"
Source="SourceDir\process.bat" />
<File Id="fil2809039236E0072642C52C6A52AD6F2F"
KeyPath="no"
Source="SourceDir\README.txt" />
</Component>
</Directory>
</DirectoryRef>
</Fragment>
</Wix>
然后我运行以下命令:
candle -ext WixUtilExtension -ext WiXNetFxExtension DaisyFarmer.wxs Scheduler.wxs
light -sice:ICE20 -ext WixUtilExtension -ext WiXNetFxExtension Scheduler.wixobj DaisyFarmer.wixobj -out DaisyFarmer.msi
当我运行 light.exe 时出现错误,其中显示
“DaisyFarmer.wxs(20):错误 LGHT0094:“产品:{BB7FBBE4-0A25-4CC7-A39C-AC916B665220}”部分中对符号“Component:SchedulerComponent”的引用未解析。”
我缺少什么?
I'm using Wix version 3.0.5419.0. I have two .wxs files, one which is a fragment, and another which uses the fragment to create the .msi file.
Here is the file which uses the fragment (DaisyFarmer.wxs):
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'
xmlns:iis='http://schemas.microsoft.com/wix/IIsExtension'>
<Product Name='Daisy Web Site 1.0'
Id='BB7FBBE4-0A25-4cc7-A39C-AC916B665220'
UpgradeCode='8A5311DE-A125-418f-B0E1-5A30B9C667BD'
Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='the man'>
<Package Id='5F341544-4F95-4e01-A2F8-EF74448C0D6D' Keywords='Installer'
Description="desc" Manufacturer='the man' InstallerVersion='100'
Languages='1033' Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="the man" />
<PropertyRef Id="NETFRAMEWORK35"/>
<Condition Message='This setup requires the .NET Framework 3.5.'>
<![CDATA[Installed OR (NETFRAMEWORK35)]]>
</Condition>
<Feature Id='DaisyFarmer' Title='DaisyFarmer' Level='1'>
<ComponentRef Id='SchedulerComponent' />
</Feature>
</Product>
</Wix>
The fragment I'm referencing is (Scheduler.wxs):
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Fragment>
<DirectoryRef Id="TARGETDIR">
<Directory Id="dir2787390E4B7313EB8005DE08108EFEA4" Name="scheduler">
<Component Id="SchedulerComponent"
Guid="{9254F7E1-DE41-4EE5-BC0F-BA668AF051CB}">
<File Id="fil9A013D0BFB837BAC71FED09C59C5501B"
KeyPath="yes"
Source="SourceDir\DTBookMonitor.exe" />
<File Id="fil4F0D8D05F53E6AFBDB498E7C75C2D98F"
KeyPath="no"
Source="SourceDir\DTBookMonitor.exe.config" />
<File Id="filF02F4686267D027CB416E044E8C8C2FA"
KeyPath="no"
Source="SourceDir\monitor.bat" />
<File Id="fil05B8FF38A3C85FE6C4A58CD6FDFCD2FB"
KeyPath="no"
Source="SourceDir\output.txt" />
<File Id="fil397F04E2527DCFDF7E8AC1DD92E48264"
KeyPath="no"
Source="SourceDir\pipelineOutput.txt" />
<File Id="fil83DFACFE7F661A9FF89AA17428474929"
KeyPath="no"
Source="SourceDir\process.bat" />
<File Id="fil2809039236E0072642C52C6A52AD6F2F"
KeyPath="no"
Source="SourceDir\README.txt" />
</Component>
</Directory>
</DirectoryRef>
</Fragment>
</Wix>
I then run the following commands:
candle -ext WixUtilExtension -ext WiXNetFxExtension DaisyFarmer.wxs Scheduler.wxs
light -sice:ICE20 -ext WixUtilExtension -ext WiXNetFxExtension Scheduler.wixobj DaisyFarmer.wixobj -out DaisyFarmer.msi
I'm getting an error when I run light.exe which says
"DaisyFarmer.wxs(20) : error LGHT0094 : Unresolved reference to symbol 'Component:SchedulerComponent' in section 'Product:{BB7FBBE4-0A25-4CC7-A39C-AC916B665220}'."
What am I missing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我遇到此问题的原因是我没有在 DaisyFarmer.wxs 中指定 TARGETDIR。如果我修改 DaisyFarmer.wxs 以便指定 TARGETDIR,例如:
然后一切正常。
The reason why I am having this problem is that I do not specify the TARGETDIR in DaisyFarmer.wxs. If I modify DaisyFarmer.wxs so that the TARGETDIR is specified, like:
Then everything works.