We are using WiX for our windows installation.
We were supporting major upgrade without any issues until recently.
I was asked to change the shortcut name as we changed our product name. So i changed it.
After a major upgrade, 2 shortcuts are being displayed instead of one.
The beauty is while we are installing all the feature migrated in same machine ,it deleted the old shortcut properly it seems.
But when we are installing one of the features (webserver feature ) in (webserver) machine, 2 shortcuts appear.
I verified that the shortcut component is also added in webserver feature.
<DirectoryRef Id="ProgramMenu.OrganizationName.MyProj">
<Component Id="CoreInterface_Shortcuts" Guid="3e3c3733-9b53-42cf-a641-b5b3e3da88cf">
<Shortcut Id="MyOrgMESUrl" Name="Home" Description="MyOrg Intuition URL" Target="[INSTALLDIR]MyOrg MES.url" WorkingDirectory="INSTALLDIR"/>
<RemoveFolder Id="RemProgramMenu.MyOrg" Directory="ProgramMenu.MyOrg" On="uninstall"/>
<RemoveFolder Id="RemProgramMenu.MyOrg.MyProj" Directory="ProgramMenu.MyOrg.MyProj" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\MyOrg\MyProj" Name="installed" Type="integer" Value="1" KeyPath="yes"/>
</Component>
</DirectoryRef>
<Feature Id="WEBSERVER" Title="WEBSERVER Customized Component(s)" Level="1">
<ComponentRef Id="CoreInterface_Shortcuts"/>
</Feature>
Why does it maintain old shortcut (If old shortcut is clicked it is not working)? How to avoid this?
the reason is easy. you are not following the best practices.
When you change names, you have to change the component guid.
see documentation:
Any change that has not been shown by testing to be compatible with previous versions of the component. In this case, you must also change the name or target location of every resource in the component.
A change in the name or target location of any file, registry key, shortcut, or other resource in the component. In this case, you must also change the name or target location of every resource in the component.
The addition or removal of any file, registry key, shortcut, or other resource from the component. In this case, you must also change the name or target location of every resource in the component.
Changing the Component Code (Windows)
A update only reinstalls/overwrites files. the sourcefiles and names are taken from the new msi. the reference to the old filename gets lost, when you are rename a file/shortcut. this is the reason why the old link is untouched und not overwritten by the installer.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With