未解决的WiX中的符号引用(LGHT0094)(没有非法字符?)

时间:2014-06-18 19:28:09

标签: wix installer windows-installer

我在这里寻找答案但是因为每个案例似乎都是独一无二的,到目前为止没有答案帮助我,我决定发布自己的答案。由于某种原因,我收到以下有关以下代码的错误。我似乎无法找到任何问题。据我所知,它没有非法字符。我曾尝试使用和不使用"它并没有什么不同。错误中特别引用的行是动词行。

错误:

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="&quot;%1&quot;" 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>

2 个答案:

答案 0 :(得分:1)

从您指定的源代码中,不清楚实际的字符串wix引用是什么。您是否要突出显示字符串或发布整个文件?

好的,然后在您发布整个文件后,我看到了有问题的行。您必须使用文件ID而不是文件名。

答案 1 :(得分:0)

我没有设置Wix尝试此操作,但您可以尝试将快捷方式元素移动到嵌套在组件元素下面而不是文件元素。然后设置 WorkingFolder属性。尝试类似this的内容。

就像我说的,我无法编译和测试,但尝试将目标属性设置为: 的目标=&#34; [#Viewer.exe]&#34;

<Shortcut Id="ApplicationStartMenuShortcut" 
          Name="My Application Name" 
          Description="My Application Description"
          Target="[#Viewer.exe]"
          WorkingDirectory="INSTALLDIR"/>