I am trying to create an uninstall shortcut for my application and I am using the exact markup from this link:
http://wixtoolset.org/documentation/manual/v3/howtos/files_and_registry/create_uninstall_shortcut.html
It creates a shortcut in the application directory under programs menu folder.
The problem is that on clicking the uninstall shortcut, I get the following error message: "This installation package could not be opened. Verify that the package exists and that you can access it, or contact the application vendor to verify that this is a valid Windows Installer Package"
Below is what I have in the.wxs file
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="APPLICATIONROOTDIRECTORY" Name="MyApplication"/>
</Directory>
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="MyApplication"/>
</Directory>
</Directory>
<DirectoryRef Id="APPLICATIONROOTDIRECTORY">
<Component Id="myapplication.exe" Guid="xxxxxxxx-1BF3-4394-ABE4-CABB29D6454C">
<File Id="myapplication.exe" Source="myapplication.exe" KeyPath="yes" Checksum="yes"/>
</Component>
<Component Id="documentation.html" Guid="xxxxxxxx-44F3-4E6C-87B9-903CF17EF002">
<File Id="documentation.html" Source="documentation.html" KeyPath="yes"/>
</Component>
</DirectoryRef>
<DirectoryRef Id="ApplicationProgramsFolder">
<Component Id="ApplicationShortcut" Guid="xxxxxxxx-F7C4-40D6-930C-3BD78143A0EF">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="MyApplication"
Description="Uninstall Test"
Target="[#myapplication.exe]"
WorkingDirectory="APPLICATIONROOTDIRECTORY"/>
<!-- Step 1: Add the uninstall shortcut to your installer package -->
<Shortcut Id="UninstallProduct"
Name="Uninstall My Application"
Description="Uninstalls My Application"
Target="[System64Folder]msiexec.exe"
Arguments="/x xxxxxxxx-1D27-4656-AB3F-41A2047CB6C0"/>
<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\Microsoft\UninstallTest" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<Feature Id="MainApplication" Title="Main Application" Level="1">
<ComponentRef Id="myapplication.exe" />
<ComponentRef Id="documentation.html" />
<ComponentRef Id="ApplicationShortcut" />
</Feature>
</Product>
I am unable to find a solution to this problem yet. Any help would be appreciated. Thanks