Reputation: 2379
I have searched here for answers but as every case seems to be unique and so far no answers helped me, I decided to post my own. For some reason I am getting the following error about the following code. I can't seem to find anything wrong with it. It has no illegal characters as far as I can see. I've tried with and without the " and it doesn't make a difference. The line specifically referenced in the error is the verb line.
Error:
C:\Users\kylec\Desktop\SampleFirst\SampleFirst.wxs(25) : error LGHT0094 :
Unresolved reference to symbol 'File:Viewer.exe' in section
'Product:{00000000-0000-0000-0000000000000000}'.
Code:
<?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>
Upvotes: 6
Views: 5909
Reputation: 814
From the piece of source code you specified it is not clear what actual string wix references in fact. Would you kindly either highlight the string or post the entire file?
Ok then after you posted your entire file I see the problematic line. You must use file ID instead of file name there.
Upvotes: 1
Reputation: 42136
I don't have Wix set up to try this, but you can try to move the Shortcut element up to be nested under the Component element and not the File element. Then set the WorkingFolder attribute. Try something like this.
Like I said, I can't compile and test, but try to set the Target attribute to: Target="[#Viewer.exe]"
<Shortcut Id="ApplicationStartMenuShortcut"
Name="My Application Name"
Description="My Application Description"
Target="[#Viewer.exe]"
WorkingDirectory="INSTALLDIR"/>
Upvotes: 0