Side by side installs only for minors/majors - Advanced Installer Community
antoinel
Posts: 5
Joined: Thu Apr 09, 2020 2:20 pm

Side by side installs only for minors/majors

Hello,

We are trying to author a package which allows side by side installs for minors/majors but upgrade older versions when it's a patch.

For example, with following versions : 1.0.0, 1.1.0, 1.1.1:

- "1.0.0" and "1.1.0" can be installed at the same time/side by side
- When "1.1.1" is installed it replaces/upgrades "1.1.0" if present
- If "1.1.0" is launched when "1.1.1" is already installed, then the setup fails (prevent downgrade)

Is there a way to produce this behavior? In "Upgrades" page, it seems we can't have both side by side and downgrade prevention (AI_NEWERPRODUCTFOUND).

Could we use the first option and change the upgrade code? But then component ids are not regenerated, is there a problem with that (with possibly side by side installs)? Could we use custom actions?

Thanks for your help
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Side by side installs only for minors/majors

Hello and welcome to Advanced Installer forums,

I think that this can be achieved in the following way:

- go to "Upgrades" page and check the "Allow side-by-side installs of different product versions"

- in the "Dialogs" page, please add the "UpgradeDlg" dialog. To do so, please select "WelcomeDlg" and then press the "Add dialog" button from the ribbon. From the list, please select the "UpgradeDlg" dialog

By default, this dialog contains a radio button group with two options: either remove the older installation or allow side by side. The default value of the radio button group is set to allow the side by side installation.

We will change this to default to "remove older versions" instead. To do so, select the "No, install side by side with older versions" button and, on the right side, under "Value" section, set its "Selected" attribute to "False".


selected.png
selected.png (92.29 KiB) Viewed 2655 times

Repeat this step for the "Yes, remove older versions" button, but this time set its "Selected" attribute to "True".

Now that we have this done, here is how I'm thinking about this behavior:

- by default, we will let the user decide whether he wants to remove the older installation or perform a side by side installation

- otherwise, I believe you will need a custom action to perform the checks you need. Based on those checks, the custom action should set an installer property, which will further be used to condition your dialog (right click on dialog --> "Show only if..." option).

In this case, if your condition is fulfilled, then the dialog will not be shown and the user will be "forced" to remove the older version (because the default on the dialog is "Yes, remove older version" and since the dialog is not displayed, the user can not change that).

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
antoinel
Posts: 5
Joined: Thu Apr 09, 2020 2:20 pm

Re: Side by side installs only for minors/majors

Thank you for your detailled answer.

Does the "UpgradeDlg" prevent downgrades? It's the root of our problem: we can't have the downgrade prevention check when using "Allow side-by-side installs of different product versions". It's a bit of an edge case, but one user should not be able to install "1.1.0" if "1.1.1" is already installed.

The option mentionned above forces the regeneration of ComponentIds when the ProductCode is changed. Would that be a problem if we were to ship two versions installable side-by-side (ex. 1.1.0 and 1.2.0) without changing ComponentIds (by using "Automatically upgrade older product versions" and different UpgradeCodes)? Should a ComponentId be unique?

Thanks again
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: Side by side installs only for minors/majors

Hello,

By default, the downgrade behavior is not supported.

If, let's say, there is version 1.1.0 installed on the computer and you try to run version 1.0.0, the installer should fail with the following message:
A more recent version of "Your Application Name" is already installed on the computer.
In what regards your second question, having the same GUID for a component that is installed by two products will make that component shared between the packages. You can read more about shared components in our "Component Properties" article.

Hope this helps.

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

Return to “Building Installers”