Henrique Mesquita
Posts: 7
Joined: Thu Apr 27, 2023 12:22 pm

Suite Installation - Uninstall prerequisites by random product code

Thu Dec 07, 2023 6:31 pm

Hello,

We have a single installation (Suite Installations), where the main application is installed and bring with its prerequisites (Its child services). We configure to remove the prerequisites when the main application is uninstalled.

The settings are:

Image

However, when one of the prerequisites are updated, its product code is updated, making it not being able to uninstall when the main application is uninstalled.

We’ve created a custom action to make the uninstall of the prerequisites in this situation, however did not succeded.
Any suggestions in the case? Or any other way?

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

Re: Suite Installation - Uninstall prerequisites by random product code

Tue Dec 12, 2023 3:14 pm

Hello Henrique,
However, when one of the prerequisites are updated, its product code is updated, making it not being able to uninstall when the main application is uninstalled.
When a new version of the prerequisite is online, don't you replace it in your main package? If so, does that not change the ProductCode? It should change the ProductCode and the prerequisite should be uninstalled just like the first one.

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

Henrique Mesquita
Posts: 7
Joined: Thu Apr 27, 2023 12:22 pm

Re: Suite Installation - Uninstall prerequisites by random product code

Wed Dec 13, 2023 8:41 pm

Catalin wrote:
Tue Dec 12, 2023 3:14 pm
Hello Henrique,
However, when one of the prerequisites are updated, its product code is updated, making it not being able to uninstall when the main application is uninstalled.
When a new version of the prerequisite is online, don't you replace it in your main package? If so, does that not change the ProductCode? It should change the ProductCode and the prerequisite should be uninstalled just like the first one.

Best regards,
Catalin

Hello,

Sorry for the misundesrtanding.

The new prerequisites are updated by the old one separetely.

The service downloads the new packages and updates it.

Then, when it tries to uninstall, he (main package, the suite installation) didn't know the new ProductCode of the updated prerequisite, uninstall all the other prerequisites and not the updated one.

Sometimes we need to make this process for fixes for the single service (A prerequisite) itself.

Is there any way to make the main package know dynamically the new ProductCode of the updated prerequisite?

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

Re: Suite Installation - Uninstall prerequisites by random product code

Wed Dec 20, 2023 9:32 am

Hello Henrique,

If you do not have the "Uninstall using this command line" option checked, then the prerequisite should not be uninstalled by your main package.

The upgrade process is something quite automatic in Windows Installer. This means that you do not have to firstly remove the old prerequisite.

When the new version of the prerequisite will be scheduled for install, it will automatically remove the previous version.

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

Henrique Mesquita
Posts: 7
Joined: Thu Apr 27, 2023 12:22 pm

Re: Suite Installation - Uninstall prerequisites by random product code

Fri Dec 22, 2023 2:47 pm

Hello Catalin,

Sorry, I think I still haven't managed to make it clear where our problem is.

The problem is uninstalling a prerequisite that has been updated.

The steps are:

1. We have the main package (Suite Installation), with the main service and all its prerequisites;
2. We install the package (Let's use as an example: Main Package v1.0.0, Prerequisite A v1.0.0 and Prerequisite B v1.0.0;
3. At some point, for whatever reason, we created a v1.0.1 version of prerequisite A;
4. We updated prerequisite B on the computer in question, not in the Advanced Installer project;
5. Now, the following are installed: Main Package v1.0.0, Prerequisite B v1.0.1 and Prerequisite B v1.0.0;
6. We uninstall the main package (Which will uninstall the prerequisites together, via command line: /x {ProductCode} /qb, as shown in the screenshot of the first post), however, Prerequisite B v1.0.1 (Which is no longer the same Prerequisite B v1.0.0 that was installed at the beginning) is not uninstalled, for having a ProductCode different from the previous version of Prerequisite A;

We are looking for a solution for item 6, to enable the uninstallation of separately updated packages when the main package is uninstalled.

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

Re: Suite Installation - Uninstall prerequisites by random product code

Wed Jan 03, 2024 4:06 pm

Hello Henrique,

Thank you very much for the explanation.

I indeed understand what the scenario is now.

Now, the reason why it is not uninstalled by your package is because the package does not recognize the newer version, and this is normal.

The only way I can think of to achieve what you want (i.e. prerequisite A version 1.0.1) to be uninstalled when Main 1.0.0 is uninstalled is through a custom action in the Main package.

This custom action should detect the prerequisite and then prompt for uninstallation.

Something similar, which you could use as a strarting poin would be the following article:

How do I uninstall another MSI package when my application is uninstalled?

Now, this solution is mostly meant for the scenario where you discovered this corner case beforehand. If you already delivered Main 1.0.0 to your customer and then manually installer A 1.0.1, then I'm afraid there isn't much we can do. One possible thing would be delivering Main 1.0.1 which also contains A 1.0.1.

This package will install itself and then upon uninstall, it will know to uninstall 1.0.1 as well.

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

Henrique Mesquita
Posts: 7
Joined: Thu Apr 27, 2023 12:22 pm

Re: Suite Installation - Uninstall prerequisites by random product code

Wed Jan 17, 2024 5:27 pm

Good morning,

I understand, but for my scenario, it wouldn't be ideal.

I tried to uninstall it in another way but without success, see if you can help me:

I set up my applications to include in their installation files a .txt containing their updated GUID. I created a custom action (.dll) in the MAIN application that will navigate to the installation path of the applications and capture the content of the txt file and execute the uninstall command when the main application is uninstalled, however, without success. When uninstalling the MAIN application, the prerequisites were not removed.

Is it possible to perform this procedure? If so, at what stage of uninstallation should I place the dll of the custom action?

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

Re: Suite Installation - Uninstall prerequisites by random product code

Mon Jan 22, 2024 5:06 pm

Hello Henrique,

Unfortunately, I'm not sure whether your scenario is possible due to some Windows Installer limiations.

First of all, two install/uninstall processes can not happen at the same time - this is a really old limitation.

Now, another thing we have to take care of is your DLL and TXT file not being removed by your setup.

The files are uninstalled during the "Remove Resources" action group (you can see this in the Custom Actions page) - this includes your DLL custom action and the TXT file it looks for.

Our Custom Action has to be scheduled after the "Finish Resources" action group.

Additionally, it should be run asyncrhonously, meaning the following 2 options should be unchecked, as per the following screenshot:
Screenshot_101.png
Screenshot_101.png (74.88KiB)Viewed 20132 times

Using the above configuration, I have been able to succeed in uninstalling v2.0 of the prerequisite when uninstalling v1.0 of the main setup.

However, all these changes have to be made before actually handling the setup to the customer.

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

Return to “Common Problems”