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!

confounded
Posts: 4
Joined: Mon Oct 21, 2019 12:30 pm

Upgrading a single version

Hi there,

I am building an installer for a use case where it is common to install more than one version side by side, but then to want to upgrade one of them. So if we had an install in folder 10.2.3, 10.2.1 and 10.2.0 and we want to install 10.2.7, the user should be able to select 10.2.3 as the folder to upgrade, and the installer will install into a new folder 10.2.7 using 10.2.3 as the old version, leaving the other versions alone.

I have an idea of how to do this but I thought I'd ask and see if there was an easier way or any other features of the installer that I could use.

So it is my understanding that advanced installer looks for previous versions and stores them in the OLDPRODUCTS property for uninstalls and the MIGRATE property for feature migrations. I plan on setting these 2 properties to just be a single product code, which is chosen by the user when they want to upgrade. To display a list of currently installed versions to the user in a nice way (showing the path and the product version) I can search the registry location "Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{PRODUCTCODE}" to get the DisplayVersion and the InstallLocation, to be shown in a listview or something like that.

Does this sound like the right sort of approach, or are the better ways of doing it? My fear with doing things like this is that it will be fragile and not work in all cases, but any insight or suggestions about what I'm trying to do would be appreciated.

Thank you.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Upgrading a single version

Hello and welcome to Advanced Installer forums,

So basically, if I understand right, you want, if multiple versions are installed, to update only the most recent one, is this correct?

Let's have a look over your request so we can better understand this:
I am building an installer for a use case where it is common to install more than one version side by side
This can be achieved by selecting the "Allow side by side installs of different product versions" radio button in the "Upgrades" page.

Together with this option, we can use the "UpgradeDlg". This dialog will ask the user whether he wants to remove the older versions or to install the new version side by side with the older version. In order to add this dialog to your dialogs sequence, you can go to "Dialogs" page --> click on "WelcomeDlg" --> "Add Dialog" button from the toolbar --> select "UpgradeDlg".

The dialog look something as it follows:
UpgradeDlg_0.png
UpgradeDlg_0.png (24.73 KiB) Viewed 5209 times
A cool thing about this dialog is that, if the user leaves the default path, the dialog changes as it follows:
UpgradeDlg.png
UpgradeDlg.png (25.49 KiB) Viewed 5209 times
As you can see, it states that:

"The setup has detected that you chose an install location which is also used by the x.x.x version of Your Application. This version must be uninstalled. Do you also want to remove any other older version?"

As you can see, you can choose to remove the respective version or all the versions.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
confounded
Posts: 4
Joined: Mon Oct 21, 2019 12:30 pm

Re: Upgrading a single version

Hi,

Thanks for your reply. I wanted to be able to choose a version to uninstall, (would could be the most recent but doesn't have). The way I wanted to do it seemed to work but it doesn't matter now anyway as our requirements changed so I don't need to do this anymore.

Thanks,
Robert.
Catalin
Posts: 7853
Joined: Wed Jun 13, 2018 7:49 am

Re: Upgrading a single version

You are always welcome, Robert.

Just let me know if you have any other questions and I will be glad to assist.

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

Return to “Building Installers”