Removing prerequisites during uninstallation of main package - Advanced Installer Community
nchounlapane
Posts: 34
Joined: Tue Mar 31, 2020 10:01 pm

Removing prerequisites during uninstallation of main package

On my main installer, I've added pre-requisites using the /NewPrerequisite command. Is there a way to uninstall the pre-requisites when the main installer is being uninstalled? It seems that using a powershell script wouldn't work since running it blocks any uninstalls if there is already one running?

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

Re: Removing prerequisites during uninstallation of main package

Hello Nick,

In order to uninstall the prerequisite when the main package is uninstalled, you should use the "Allow uninstall" option.
Screenshot_239.png
Screenshot_239.png (4.16 KiB) Viewed 14904 times

If the prerequisite is an MSI package, the uninstlal command line will be completed automatically.

Otherwise, you would have to do so yourself (e.g. adding an uninstall command line).

Hope this helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
nchounlapane
Posts: 34
Joined: Tue Mar 31, 2020 10:01 pm

Re: Removing prerequisites during uninstallation of main package

This is actually what I needed. Since I added the prerequisite using /NewPrerequisite command, is there any way to update the prerequisite's Uninstall Command Line and enable Allow Uninstall from advanced installer command line?
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

Re: Removing prerequisites during uninstallation of main package

Hello Nick,

I'm afraid that we do not have automation support for that specific request.

However, i will add this on our TODO list of improvements and it should be added in a future version of Advanced Installer.

Until that, you can check the checkbox manually and input the uninstall command line.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

Re: Removing prerequisites during uninstallation of main package

You are always welcome, Nick!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Catalin
Posts: 7847
Joined: Wed Jun 13, 2018 7:49 am

Re: Removing prerequisites during uninstallation of main package

Hello Nick,

This improvement has been added in version 22.9 of Advanced Installer, released July 23rd, 2025.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
nchounlapane
Posts: 34
Joined: Tue Mar 31, 2020 10:01 pm

Re: Removing prerequisites during uninstallation of main package

Catalin,

Thank you for the update! My follow up question: How do you set Command Line (Full UI) for Install and the Command Line for Uninstall with different values? I've found a solution to use /NewPrerequisite to set Command Line (Full UI) with -cmd_line, then add a one second delay, then use /UpdatePrequisite with -cmd_line "<enter command line>" -add_stage Uninstall. I would think there would be a more efficient way on doing this?

Nick
Liviu
Posts: 1419
Joined: Tue Jul 13, 2021 11:29 am
Contact: Website

Re: Removing prerequisites during uninstallation of main package

Hello Nick,

Currently, it’s not possible to use the -cmd_line switch more than once.

The only available workaround is the one you’ve already implemented, using the /UpdatePrerequisite option to add the command line for the Uninstall action with the -add_stage switch.

I’ll forward this to our development team to explore the possibility of improving this behavior in a future release.

We apologize for the inconvenience.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”