【发布时间】:2014-06-18 19:28:09
【问题描述】:
我在这里搜索过答案,但由于每个案例似乎都是独一无二的,到目前为止没有任何答案对我有帮助,所以我决定发布自己的答案。出于某种原因,我收到有关以下代码的以下错误。我似乎找不到任何问题。据我所知,它没有非法字符。我尝试了使用和不使用 " 并没有什么区别。错误中特别引用的行是动词行。
错误:
C:\Users\kylec\Desktop\SampleFirst\SampleFirst.wxs(25) : error LGHT0094 :
Unresolved reference to symbol 'File:Viewer.exe' in section
'Product:{00000000-0000-0000-0000000000000000}'.
代码:
<?xml version='1.0' encoding='windows-1252'?>
<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'>
<Product Name='Viewer 1.0' Id='PUT-GUID-HERE' UpgradeCode='PUT-GUID-HERE'
Language='1033' Codepage='1252' Version='1.0.0' Manufacturer='Direct'>
<Package Id='*' Keywords='Installer' Description="Installer"
Comments='Installer is a registered trademark of Direct'
Manufacturer='Direct' InstallerVersion='100' Languages='1033'
Compressed='yes' SummaryCodepage='1252' />
<Media Id='1' Cabinet='Sample.cab' EmbedCab='yes' DiskPrompt="CD-ROM #1" />
<Property Id='DiskPrompt' Value="Installation [1]" />
<Directory Id='TARGETDIR' Name='SourceDir'>
<Directory Id='ProgramFilesFolder' Name='PFiles'>
<Directory Id='DataMotionDirect' Name='DMD'>
<Directory Id='INSTALLDIR' Name='Viewer'>
<Component Id='MainExecutable' Guid='*'>
<Shortcut Id="startmenuViewer" Directory="ProgramMenuDir"
Name="Viewer" WorkingDirectory='INSTALLDIR'
Icon="Viewer.exe" IconIndex="0" Advertise="yes" />
<Shortcut Id="desktopViewer" Directory="DesktopFolder"
Name="Viewer" WorkingDirectory='INSTALLDIR'
Icon="Viewer.exe" IconIndex="0" Advertise="yes" />
<File Id='EXE' Name='Viewer.exe' DiskId='1'
Source='Viewer.exe' KeyPath='yes'>
</File>
<ProgId Id="DMDCCDAV" Description="Viewer">
<Extension Id="xml" >
<Verb Id="open" Argument=""%1"" TargetFile="Viewer.exe" />
</Extension>
</ProgId>
</Component>
</Directory>
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ProgramMenuDir" Name="Viewer">
<Component Id="ProgramMenuDir" Guid="*">
<RemoveFolder Id='ProgramMenuDir' On='uninstall' />
<RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]'
Type='string' Value='' KeyPath='yes' />
</Component>
</Directory>
</Directory>
<Directory Id="DesktopFolder" Name="Desktop" />
</Directory>
<Feature Id='Complete' Level='1'>
<ComponentRef Id='MainExecutable' />
<ComponentRef Id='ProgramMenuDir' />
</Feature>
<Icon Id="Viewer.exe" SourceFile="Viewer.exe" />
</Product>
</Wix>
【问题讨论】:
-
您确定错误是在引用该代码(即在第 25 行)吗?我在该代码 sn-p 中没有看到与“Viewer.exe”相关的任何内容。
-
糟糕更新了问题。忘了我改了可执行文件名。
-
您在哪里定义了
File元素(在Component中)与“Viewer.exe”的Name或Id? -
@PeterRitchie 我已经更新了我的问题以包含条目组件。它的 ID 是 MainExecutable 但包含一个名为 Viewer.exe 的文件
标签: wix installation windows-installer