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!

sysadm@prs.de
Posts: 2
Joined: Tue Sep 30, 2014 1:36 pm

Avoid deinstallation when one program depends on another

Please consider the following scenario:

1. installer A for product a, created with advancedinstaller
2. installer B for product b, created with advancedinstaller

B requires A (maybe in some version). I can add a check in B for installed A, so user has to first install A, then B. During installation of B the proper version of A is checked. Now user performs:

3. uninstall A
4. reinstall A, but older version, the prerequisite test in B would fail.

Now the question: Is there a way to make sure that A can not be deinstalled before deinsyalling B first?
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Avoid deinstallation when one program depends on another

Hi and welcome to Advanced Installer forums.

I'm afraid I do not fully understand what you want to achieve. Do you want the user to not be allowed to uninstall the product A from Control Panel if product B is installed?

Best regards,
Eusebiu
Eusebiu Aria - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sysadm@prs.de
Posts: 2
Joined: Tue Sep 30, 2014 1:36 pm

Re: Avoid deinstallation when one program depends on another

Yes exactly. Since A is required for B to run, I want to avoid that A is uninstalled before B. At best a message like: uninstall B before uninstalling A since B is dependent on A!
Eusebiu
Posts: 4971
Joined: Wed Nov 14, 2012 2:04 pm

Re: Avoid deinstallation when one program depends on another

Hi,

In order to achieve this you can follow the steps below:
- go in the Search page of the product A and create a "Product Version (identify by Upgrade Code)" extended search and rename it (i.e. PRODUCT_B)
- go in the Custom Actions page and add a "Display error message" custom action after the "Wizard Dialogs Stage -> Searches" action group
- set that custom action to run only on "Uninstall" and set the above search as a condition for it: PRODUCT_B
- while the "Shift" keyboard button is pressed, drag and drop it after the "Install Execution Stage -> Searches" action group
- select the "Advanced execution scenarios..." blue link and select the "Skip action in Install Execution Stage if executed in Dialogs Stage" option
- build and run the project

Let us know if this helped, otherwise give us more details about your scenario.

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

Return to “Building Installers”