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!

weberse
Posts: 7
Joined: Tue Mar 31, 2015 2:39 pm

Ask before uninstalling older version

Hi,

I am looking for a way to make my installer ask whether it should uninstall a previous version. If the user declines the installation should be aborted. Right now the installer removes previous versions silently (as stated on the Upgrade Page).

Upgrade Page:
  • "Automatically upgrade older product versions"
  • "Use original installation path when upgrading"
  • "Uninstall old version first and then install new version" enabled.
Media --> Configuration Page:
  • "Single EXE setup (resources inside)"
  • "Uninstall a package with the same version (if found)"
I want neither uninstall to run silently but always require a user confirmation.

Is there a way to achieve that?

Best Regards

Sebastian
Irina
Posts: 113
Joined: Mon Apr 27, 2015 11:42 am

Re: Ask before uninstalling older version

Hi Sebastian,

In order to obtain this behavior, you should add in your project two sequenced predefined custom actions, as seen in the attached screenshots.
The first custom action, MessageBox, will appear if an older version is detected installed on the system through the OLDPRODUCTS property. This MessageBox will require the user to answer with "Yes" or "No", setting the BTN_PRESSED property.
uninst prev_messagebox.jpg
uninst prev_messagebox.jpg (153.74 KiB) Viewed 3819 times
In case the answer is No so the BTN_PRESSED property = IDNO, the error custom action is performed, ErrorMessage. An error message appears, letting the user know that the installation has stopped.
uninst prev_err.jpg
uninst prev_err.jpg (101.06 KiB) Viewed 3819 times
Please take into account that these actions are ignored in case of a (silent) no UI installation.
In case you wish to cover also this possibility, you should create your own two custom actions with similar functionality and add them in the Install Execution Stage also.

Kind regards,
Irina
Ecaterina Irina Grosu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
weberse
Posts: 7
Joined: Tue Mar 31, 2015 2:39 pm

Re: Ask before uninstalling older version

Hi Irina,

that worked! :)

Thanks for your help!

Sebastian
Irina
Posts: 113
Joined: Mon Apr 27, 2015 11:42 am

Re: Ask before uninstalling older version

You're always welcome Sebastian,
If you have any questions we'll be glad to answer them.

Kind regards,
Irina
Ecaterina Irina Grosu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”