How to uninstall the previous version of prerequisite? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

mentalmushroom
Posts: 63
Joined: Wed Feb 08, 2012 8:08 am

How to uninstall the previous version of prerequisite?

Hello. I want to silently install the prerequisite for my software. That is possible passing the command line arguments, BUT if there was an old version installed it shows the uninstaller GUI. I know, normally applications store a special registry key for uninstalling, so I could run it first in the silent mode, but I don't see any way to execute something before installing a prerequisite.
No milk today
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to uninstall the previous version of prerequisite?

Hello,

Here's what you can try:
- add the prerequisite as feature based
- add a search in the Search page for the previous version
- add a custom action after AppSearch standard action that silently removes the old version. This custom action should be conditioned using the search name.

Please keep in mind that by using feature based prerequisites you cannot silently install the main installation package.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mentalmushroom
Posts: 63
Joined: Wed Feb 08, 2012 8:08 am

Re: How to uninstall the previous version of prerequisite?

Perhaps, I don't understand something, but it seems like AppSearch is executed almost in the very beginning (right after Begin standard action). The prerequisite I am talking about is rather an extension application, installed as an optional prerequisite. It can be turned off by a user (I use Prerequisite Selection Control), so I don't think it is correct to uninstall the old version in the beginning of installation.
No milk today
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to uninstall the previous version of prerequisite?

Hello,

In this case you can try to execute the custom action when the user preses the "Next" button, if the prerequisite was selected:
http://www.advancedinstaller.com/user-g ... te-ca.html

The condition for the UI custom action should look something like:

Code: Select all

YOUR_PREREQUISITE_PREVIOUS_VERSION_SEARCH_NAME AND &YourPrerequisiteFeature=INSTALLSTATE_LOCAL
All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mentalmushroom
Posts: 63
Joined: Wed Feb 08, 2012 8:08 am

Re: How to uninstall the previous version of prerequisite?

Ok, this should do the job, only I can't get "&MyPrerequisiteFeature=INSTALLSTATE_LOCAL" to work. It seems like it is always false.
No milk today
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to uninstall the previous version of prerequisite?

Hello,

INSTALLSTATE_LOCAL = 3

You can try:

Code: Select all

&MyPrerequisiteFeature=3
My testing proved it works.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mentalmushroom
Posts: 63
Joined: Wed Feb 08, 2012 8:08 am

Re: How to uninstall the previous version of prerequisite?

I noticed "&MyPrerequisiteFeature=3" works different than "&MyPrerequisiteFeature=INSTALLSTATE_LOCAL". It almost do what I want except it is true when prerequisite selector says "Skip". I don't need the action to be called when the feature is checked, but is not going to be installed (skipped).
No milk today
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to uninstall the previous version of prerequisite?

I don't need the action to be called when the feature is checked, but is not going to be installed (skipped).
I'm afraid I don't understand what you mean. Please be more specific and exemplify.

Best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
mentalmushroom
Posts: 63
Joined: Wed Feb 08, 2012 8:08 am

Re: How to uninstall the previous version of prerequisite?

As you can see on the image, installer is going to skip prerequisite installation, but &MyPrerequisiteFeature=3 is still true, so it will try to run uninstaller when it is not needed. Is there any way to know whether the prerequisite is going to be installed or not?
Image
No milk today
mihai.petcu
Posts: 3860
Joined: Thu Aug 05, 2010 8:01 am

Re: How to uninstall the previous version of prerequisite?

Hello,

"&YourPrerequisiteFeature=3" determines whether the feature will be installed or not.
With the Prerequisite Selector control you can install the feature but skip the corresponding prerequisite installation if it's already installed.
Is there any way to know whether the prerequisite is going to be installed or not?
This is done based on the search criteria defined in the install conditions group:
http://www.advancedinstaller.com/user-g ... tions.html

You can try to recreate those searches in the Search page and use the names to condition your custom action.

All the best,
Mihai
Mihai Petcu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”