cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
eladef
Level 7

component will not be removed, so that icon will not be removed.

Hi

I have basic MSI project that 2 or more versions of it can be installed in parallel
Each one to a different location except for a single exe which is shared and has a shortcut in the desktop.

In version 1.0 MSI I have
Component – install files to \Program Files\prod_1.0
Shared files component A - install exe to \Program Files\prod_shared
Shared shortcut component B - create a shortcut on desktop to exe in component A

In version 2.0 MSI I have
Component – install files to \Program Files\prod_2.0
Shared files component A - install exe to \Program Files\prod_shared
Shared shortcut component B - create a shortcut on desktop to exe in component A

The component GUID are the same for both MSI versions and the icon I’m using in the Shared shortcut component isn’t used by other shortcuts.
The problem I have is that if I have 2 version? installed in parallel and then I uninstall one version I want the desktop shortcut will be removed.
I added this line to the code
MsiSetComponentState(hMSI,"Shared_Shortcut_Desktop",INSTALLSTATE_ABSENT);

But when I uninstall I get this message
component will not be removed, so that 'NewShortcut74_AE5D17DE4C4B4737ABB20A0D0358B69E.exe' icon will not be removed.

Any idea how to solve it ?
Labels (1)
0 Kudos
(1) Reply
MichaelU
Level 12 Flexeran
Level 12 Flexeran

Installing the same component GUID to multiple different locations is a violation of component rules (see Changing the Component Code and the related What happens if the component rules are broken?). It's up to Windows Installer what it will do in this scenario, and I expect you need to change the component's GUID.
0 Kudos