waspy
Posts: 64
Joined: Fri Oct 03, 2008 10:58 am

Shared merge module problem

Hello Guys,
I encounter the following problem:
I have created a merge module (with custom action on Uninstall), which is included in two installers. When I uninstall one of them, installed files from the merge module remain intacted (correct), but the Uninstall action gets executed!!! This shouldn't be the case, since the installer should detect that the merge module is used elsewhere and ignore uninstall action completely... Is there a workaround for this issue?

P.S. I've seen "Shared Amongst Packages" option in organization, but it's specific to Installer 4.5...

Thank you very much for your help...
Alex
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Shared merge module problem

Hi Alex,

Please note that the custom actions are not affected by the share mechanism used by Windows Installer. If the condition of the custom action allows it, Windows Installer will execute the custom action. A solution would be to use a search to determine if the merge module was installed by another package. The property of this search can then be used to condition the custom action.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
waspy
Posts: 64
Joined: Fri Oct 03, 2008 10:58 am

Re: Shared merge module problem

Hello Cosmin,
I also thought about it, but what should I search for? Is there a special trick to determine if a merge module is installed or I need to search for a file from that module?

Thanks a lot,
Alex
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Shared merge module problem

Hi Alex,

After a merge module is merged with a MSI, everything in the merge module is a part of the installation package. Therefore, the merge module is not a separate entity anymore. However, you can try searching for a file contained by it. Please note that the search should not use the install location of the package which contains it (otherwise it would find the file installed by the package which is being uninstalled).

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
waspy
Posts: 64
Joined: Fri Oct 03, 2008 10:58 am

Re: Shared merge module problem

Hello guys,
I'm still stuck here... :(

The problem is:
My custom action unregisters component in the configuration file of my program. Obviously I don't want to unregister shared components...
Now, Uninstall custom action is triggered before removing files, so I can't use Search, because the file will always be there. At the same time I can't run the custom action on file removal action, because it removes my custom action file first and throws an exception.
I need some condition to find out if a merged module is shared or not at uninstall time in order to decide whether to run custom action or not.

I really need your advice here...
Thanks a lot in advance,
Alex
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Shared merge module problem

Hi Alex,
I need some condition to find out if a merged module is shared or not at uninstall time in order to decide whether to run custom action or not.
I'm afraid that this is not supported by Windows Installer. There isn't a condition which can be used for this.
My custom action unregisters component in the configuration file of my program. Obviously I don't want to unregister shared components...
Perhaps you can manage this from inside the custom action. By using custom code in your custom action you can try to determine if the component is shared and uninstall it only if it's not.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”