Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

how to uninstall shared merge module conditionally

Hi,
Greetings of the day! I hope you all are doing well!!
I have created a .msm project(i.e created one merge module). This merge module contains some required DLLs for our functionality.
Now, I have two bootstrapper projects.
I have configured same merge module in both the projects.

Use Case : Uninstall merge module only when it is not referenced by another bootstrapper.

Scenario to achieve:

1. Suppose, sharedMergeMod.msm is a merge module.
2. Create bootstrapper1.aip project add sharedMergeMod.msm file into this bootstrapper.
3. Create bootstrapper2.aip project add sharedMergeMod.msm file into this bootstrapper.
4. Install bootstrapper1. You can see bootstrapper1's entry in system app. and merge module is extracted at respective APPDIR.
5. Install bootstrapper2. You can see bootstrapper2's entry in system app. and merge module is extracted at respective APPDIR.
6. Now, again try to install bootstrapper1 -> it will ask to uninstall it(as it is already installed on the system).
7. But,if sharedMergeMod is referenced by another project(i.e. if bbootstrapper2 is installed) then only uninstall bootstrapper1 and not the merege module.
8. If only bootstrapper1 is installed and sharedMergeMod is not referenced by another bootstrapper(i.e. bootstrapper2 is not installed) then uninstall both bootstrapper as well as merge module.

Can we achieve above scenario using AI?
Let us know your view on this.

Thanks in advance,
Balaji
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: how to uninstall shared merge module conditionally

Hi Balaji,
7. But,if sharedMergeMod is referenced by another project(i.e. if bbootstrapper2 is installed) then only uninstall bootstrapper1 and not the merege module.
8. If only bootstrapper1 is installed and sharedMergeMod is not referenced by another bootstrapper(i.e. bootstrapper2 is not installed) then uninstall both bootstrapper as well as merge module.
Since you added the same merge module to both packages, it will happen exactly what you described. This is the way merge modules are handled by Windows Installer.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

Re: how to uninstall shared merge module conditionally

Hi,
I have gone through your reply. Also, once again checked same scenario at our end.
As I have already explained I have two bootstrapper containing common merge module. Merge module contains DLL files.

I have listed my observation. Please go through it.

1. I have installed first bootstrapper at location .../Bootstrapper1
2. Merge module gets extracted at same location.
3. Now, I have installed second bootstrapper at location .../Bootstrapper2. Merge module gets extracted at this location.
4. That means merge module extracted on two different locations.
5. When again I am trying to install bootstrapper1 it will uninstall bootstrapper1 and remove merge module from .../Bootstrapper1 location.
6. Merge module remains unchanged at .../Bootstrapper2 location.

Also, I have following queries :
1. Is it expected behavior of installer?
2. Can we install merge module only once for same product version?
3. Can we apply upgrade downgrade feature for merge module?

Please let me know your comments on this.

Thanks and regards,
Balaji
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: how to uninstall shared merge module conditionally

Hi Balaji,
1. Is it expected behavior of installer?
Yes, this is the normal behavior.
2. Can we install merge module only once for same product version?
Yes, a product can install its merge module only once. If you have the same merge module added to more products and you want to install that merge module just once, so all the products use its resources from the same location, then you need to set all the products to install that merge module to the same location.

Please take a look on the "Merger Modules and DLL Registration" thread for more details of how merge modules work.
3. Can we apply upgrade downgrade feature for merge module?
Yes, the merge modules can be upgraded/downgraded.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

Re: how to uninstall shared merge module conditionally

Hi,
Thanks for your reply.
Can we manage installation directory of merge module different than bootstrapper install directory?

e.g. bootstrapper 1 contains merge module. On execution of bootstrapper exe can I install bootstrapper at .../bootstrapperDir and merge module at ../mergeModDir ?

Thanks,
Balaji
Eusebiu
Posts: 4931
Joined: Wed Nov 14, 2012 2:04 pm

Re: how to uninstall shared merge module conditionally

Hi Balaji,

Yes, you can create a property-based folder in your merge module and place the files in that folder. In this case, the merge module files will be installed at the location you set for that property-based folder.

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”