I have the following situation.
My product installs the binaries inside c:\Program Files (x86)\MyCompany\MyApp\
and a shortcut under C:\ProgramData\Microsoft\Windows\Start Menu\Programs\MyCompany
.
I build the msi using this great example: https://helgeklein.com/blog/2014/09/real-world-example-wix-msi-application-installer/
I just added the following piece of code
<!-- ApplicationShortcut-->
<Directory Id="ProgramMenuFolder">
<Directory Id="ApplicationProgramsFolder" Name="!(loc.ManufacturerName)">
<Component Id="ApplicationShortcut" Guid="F4B7EAFA-FF19-41B4-8267-3AEFC12235A7">
<Shortcut Id="ApplicationStartMenuShortcut"
Name="!(loc.ApplicationName)"
Description="!(loc.ProductDescription)"
Target="[INSTALLDIR]MyApp.exe"
WorkingDirectory="INSTALLDIR"
/>
<RemoveFolder Id="RemoveApplicationProgramsFolder" Directory="ApplicationProgramsFolder" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\!(loc.ManufacturerName)\!(loc.ApplicationName)" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</Directory>
</Directory>
The problem is the following
- I install the application the fist time, it will install the shortcut just fine
- Now I start the app and choose
Pin to taskbar, this will create a shortcut in
C:\Users\\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar` - If I rebuild the msi and execute the setup again, the taskbar shortcut is not clickable anymore, because the shortcut in
C:\Users\<user>\AppData\Roaming\Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar
is missing
Is it possible to maintain the taskbar shortcut during an update?