vdms-mark
Posts: 9
Joined: Thu Apr 19, 2018 9:33 pm

Multiple Projects with Shared Services

Hi,

I'm just wondering what the best practice would be for the following scenario. I'm more than happy to refer to a guide if there is one, but I couldn't find anything specific to what I'm dealing with. We have four AI projects, each of which install several Windows services. Three or four of those services are common across all or some of the projects. In some cases, multiple products can be installed on the same machine.

Is there any best practice for handling this type of scenario? I began experimenting a little with merge modules (splitting each shared service into its own merge module), but I want to make sure I don't waste time going down that road if there is a better way.

Thanks
Daniel
Posts: 8238
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Multiple Projects with Shared Services

Hello Mark,

Indeed going with the merge module implementation is the correct approach.

Just create a merge module which will include all the common services and make sure each common service will be installed by each different setup package at the same location. The common services should not be deployed by the related setups to different locations on disk because in this case the shared components of the common services could get in conflict on uninstall and you may end up with the service binary files being deleted after a product uninstall even there are still other products installed which use the common service components.

Hope this helped.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
ppep
Posts: 5
Joined: Thu Feb 04, 2021 10:25 pm

Re: Multiple Projects with Shared Services

Hello,

I have a similar scenario but I’m wondering if there is a way to handle this with msi files instead.

My situation is this: we have a Shared Service product which has its own msi. It can be installed in the following ways:

1. Standalone installation
2. Installed with our applications A, B or C
3. Note that applications A, B & C are allowed to be installed on the same PC using the same installation of the Shared Service in the same location.

What we need is for the Shared Service to be uninstalled when the last application (A, B or C) that is using it is uninstalled. Prior to using Advanced Installer, I believe we accomplished this with a merge module and Shared Dll counts for the files in Shared Service.

However, now that we are converting all of our applications to use Advanced Installer I’d like to know how to accomplish this. We have the Professional licenses so we are not able to create Merge Modules.

Our approach so far was to include the Shared Service msi as a prerequisite in the installers for applications A, B & C. We have to use a custom action to uninstall the Shared Service when we uninstall the applications, but this does not allow us to leave the Shared Service when another application that uses it is still installed.

What can we do to work through this problem?

Thank you,

Peter
Catalin
Posts: 6584
Joined: Wed Jun 13, 2018 7:49 am

Re: Multiple Projects with Shared Services

Hello Peter,

Although I did not test this, I believe it may be achievable with your scenario.

For instance, in order to achieve what you need, we may need to somehow replicate the logic used by the "shared components" Windows Installer's algorithm.

For instance, for each of your setup,we can have it counted in the registries. Let's say you install setup A, the registry value becomes 1, you install setup B, the registry value becomes 2, etc.

After doing so, you can have, in each of your setups, a script that will uninstall the prerequisite, the condition being the registry value being "1" - meaning that only one setup is installed at that time on the machine (if the value is "2", it means that two setups are installed, therefore the script should not run and the prerequisite should be left untouched).

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”