Problem:
I need to create a start menu shortcut to a file, that will be placed to an underterminate path by the installation.
During the installation, the user can choose to install a feature, which will then install a folder with the needed file, at the chosen path.
The shortcut I want to create should then point towards this file.
My Code:
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFiles64Folder">
<Directory Id="INSTALLFOLDER" Name="Main Program">
<!-- Also other stuff -->
<Directory Id="FEATUREFOLDERDIR" Name="sub feature" />
</Directory>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="[ProductName]" />
</Directory>
</Directory>
<Feature Id="Complete" Level="1" Title="Main Feature" Display="expand" ConfigurableDirectory="INSTALLFOLDER">
<!-- Also other stuff -->
<ComponentGroupRef Id="FeatureRef" />
</Feature>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="*">
<Shortcut Id="ApplicationStartMenuShortcut" Name="[ProductName]" Target="CreatedFile.exe" WorkingDirectory="DEMOPROJECTFOLDERDIR" />
<RemoveFolder Id="CleanUpShortCut" Directory="ApplicationProgramsFolder" On="uninstall" />
<RegistryValue Root="HKCU" Key="********" Name="installed" Type="integer" Value="1" KeyPath="yes" />
</Component>
</DirectoryRef>
<Feature Id="SubFeatureID" Level="1001" Title="Sub Feature" Display="collapse" ConfigurableDirectory="FEATUREFOLDERDIR">
<ComponentGroupRef Id="FeatureRef" />
<ComponentRef Id="ApplicationShortcut" />
</Feature>
The WIX Tutorial for creating shortcuts uses the filename in the target. However when I do that the execution of my build script return the error error LGHT0204: ICE67: The shortcut 'ApplicationStartMenuShortcut' is a non-advertised shortcut with a file target, but the target file does not exist.
Question:
How can I create a shortcut to a file which, at the time of the build, is not at the shortcut location?