Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

how to add upgrade/downgrade feature in bootstrapper exe

Hi,
Greetings of the day!
Actually, we are new for this Advanced Installer. So, we are learning new things.
We are working on advanced installer to create a bootstrapper package,
which will install couple of MSIs on my machine.

For that purpose, we have created a project for bootstrapper exe which contains couple of MSIs as it's prerequisites. Whenever, I will execute this bootstrapper exe it will install it's prerequisites.

For each msi we have created separate project.
In case of bootstrapper exe project, we have added various features. But,we are stuck at Upgrade/Downgrade feature

Use case : Use upgrade/downgrade feature if it is already installed

1. If suppose bootstrapper EXE 1.0 is already installed and if I am trying to install EXE 1.1 then it must be upgraded.
2. similarly, if EXE 1.0 is installed and I am trying to install EXE 1.0 then it must be downgraded on my machine.

I have made changes under "Upgrades" but it is not showing me option for upgrade.

Right now, I am able to add featu8res upgrade and downgrade for MSIs but not incase of
bootstrapper.

So, please help me out to resolve this problem.
If you give some references it will really helpful for me.

Thanks in advance,
Balaji
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hello Balaji (and to your team) and welcome to Advanced Installer forums,

Please keep in mind that it is not recommended to use such a scenario (a downgrade scenario). However, in order to achieve what you want you can proceed like this:

- Go to "Upgrades" page and check the "Customize Advanced Installer upgrades rules" option.
- In the "Upgrades" group add an additional upgrade rule by right clicking on the "Upgrade" section --> "New upgrade".
- In the "Product Info" tab of the "New Upgrade" dialog set the following option:
  • Upgrade Code: [|UpgradeCode]
  • Min. Version: [|ProductVersion]
After doing so, please double click on the rule that contains the AI_NEWERPRODUCTFOUND property and set its minimum version - e.g. 10000.

This will allow you to downgrade a newer version.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hi Catalin,
Thanks for your reply.
Yes, actually as I mentioned in previous post that I have did modifications under "Upgrades" section.
As you have mentioned, I have followed all these steps. But,I am not able to upgrade bootstrapper.

Thanks and regards,
Balaji
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hello Balaji,

This is quite strange, indeed. I have tested this yesterday and everything worked as expected.
But,I am not able to upgrade bootstrapper.
Could you please give me some more details about this? For instance, do you receive any error message?

Additionally, could you please create a sample project (it does not have to contain any files) which reproduces this and forward it to me so I can further investigate it? You can either attach it to a forum thread or send it over e-mail at support at advancedinstaller dot com.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hi Catalin,
I have resolved upgrade issue.
But, I am facing an issue related to downgrade feature.
Let me explain the scenario :
1. I have created bootstrapper EXE projects containing 2 MSIs as it's prerequisites(Feature Based).
2. Bootstrapper EXE version : 2.0.1
MSI 1 version : 2.0.1
MSI 2 version : 2.0.1
3. I have installed this EXE along with two prerequisite MSIs.
4. Now, another bootstrapper EXE containing two MSIs as it's prerequisites(Feature Based).
5. Bootstrapper EXE version : 1.0.1
MSI 1 version : 1.0.1
MSI 2 version : 1.0.1
6. I am trying to execute this second bootstrapper EXE(with older version).
7. Now, Bootstrapper EXE version gets changed (i.e. 1.0.1), but the MSI version has not changed(that means prerequisite MSIs not installed only bootstrapper version gets changed)
8. At the end I want when I execute EXE(with older version) then downgrade versions of EXE and prerequisites MSIs as well.

So, I hope it will help you to understand the scenario. Please help me to resolve this problem.

Thanks,
Balaji
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hello Balaji,

In order to achieve that, we need to first uninstall the other version of our prerequisite.

This can be done by going to "Upgrades" page and adding a new upgrade rule that will uninstall the other version of the prerequisite.

The uninstallation of the prerequisite happens when the main package is installed.

With that in mind, it means that the prerequisite must now be added as a post-install prerequisite.

Let's consider the following example so you can better understand:

- main package v2.0.0 and prerequisite v2.0.0

- we install both on machine

- we no build version 1.0.0 of prerequisite

- change the version to 1.0.0 in the main package as well

(at this point, we consider the main package is already configured for a downgrade)

- in the "Upgrades" page of the main package, we add a new upgrade rule that will uninstall v2.0.0 of our prerequiste. It can look something as it follows:

uninstallPrereq.png
uninstallPrereq.png (33.16 KiB) Viewed 7162 times

By doing so, the main installer will uninstall the prerequisite.

- we now move the prerequisite from "feature-based" to the "post-install" stage.

This way, the main package will first uninstall the prerequisite, then install itself and then install the prerequisite (the older version).

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hi Catalin,
I have gone through your reply.
Just one question, why we need to add MSIs under Post-install?
Is it not achievable using Feature-Based Installaton ?

Thanks,
Balaji
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hello Balaji,

I have explained in the above thread why this is required.

Basically, the package will first check if the prerequisite requires installation. It will see that it does not (because the other version is already installed). After doing so, it will proceed with uninstalling the other version of the prerequisite and then with the installation of the main package.

Basically, the order of operations is this:

launch main package --> verify if the prerequisite needs to be installed (and at this point, it does not, since other version is already installed --> uninstall the prerequisite --> install the main package

Due to this, the prerequisite should be added as a post install, so the order of operations will be this:

launch main package --> uninstall the prerequisite --> install main package --> install the prerequisite

Hope things are more clear now.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hi Catalin,
Sorry for late reply.
I have followed all the steps as you have suggested.
But, still it has not resolved my problem.

Thanks,
Balaji
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hello Balaji,
I have followed all the steps as you have suggested.
But, still it has not resolved my problem.
Could you please give me some more details about what exactly is not working?

Additionally, in order for me to have a closer look on this, could you please forward me the following resources by e-mail at support at advancedinstaller dot com:

- the AIP file for the older version of your main package

- the .AIP file for the newer version of your main package

- the .AIP file for the older prerequisite

- the .AIP file for the newer prerequisite

- a download link for the older setup (main package)

- a download link for the newer setup (main package)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hi Catalin,
I have tried to send you aip projects using mail but I am faing some issues. So, just find attachments I have added below.
As you have asked to send .aip projects of bootstrapper and prerequisites.

I have added bootstrapper and prerequisites for older version i.e. 1.0.1
1. BootstrapperPrj.aip
BootstrapperPrj.aip
(84.5 KiB) Downloaded 247 times
2. Prereq_MSI1.aip
Prereq_MSI1.aip
(60.72 KiB) Downloaded 241 times
3. Prereq_MSI2.aip
Prereq_MSI2.aip
(60.72 KiB) Downloaded 235 times
Please check it and let me know your comment on it.

Actually, I am not able to add more than three files. So, for newer version i.e. 1.0.2 I will add it on another response.

Thanks,
Balaji
Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hi Catalin,
In this reply I have attached aip files for newer version i.e. 1.0.2.
Please download these on your end.
1. BootstrapperPrj.aip
BootstrapperPrj.aip
(84.32 KiB) Downloaded 233 times
2. Prereq_MSI1.aip
Prereq_MSI1.aip
(60.72 KiB) Downloaded 242 times
3. Prereq_MSI2.aip
Prereq_MSI2.aip
(60.72 KiB) Downloaded 241 times
So, download these files and build it on your side.
Please let me know if any problem.
Thanks,
Balaji
Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hi Catalin,
Right now I am not able to send you setup files for main package.
It is not accepting .exe files here.
So, please build prerequisite MSIs i.e Prereq_MSI1 and Prereq_MSI2 for both 1.0.1 and 1.0.2.
Replace post-install prerequisites path from BootstrapperPrj and build it.
If is there any other way to send setup files then also, suggest me I will send it to you.

I hope it will help you to understand my problem thoroughly.

Thanks,
Balaji
Catalin
Posts: 6608
Joined: Wed Jun 13, 2018 7:49 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hello Balaji,

Thank you for the provided files.

I have investigated the AIP files and also tested this scenario and I was able to reproduce the issue.

First of all, you have made quite a lot of modifications outside of the instructions I gave you above, which resulted in this issue.

In order to achieve what you want, please proceed as it follows:

For version 1.0.2:

Prereq1:

- open the Prereq1 .AIP file

- go to "Table Editor" page --> "Install Execute Sequence" table and revert the "AI_DOWNGRADE" row (right click on it --> "Revert")

- now please go to "CustomAction" table and revert the "AI_DOWNGRADE" row (right click on it --> "Revert")

- go to "Upgrades" page. Here, double click on "OLDPRODUCTS" rule. Here, in the "Max. Version" field, input the following:

Code: Select all

255.255.6555.6555
and check the "Include Maximum version in range" option.

- now please double click on the "AI_NEWERPRODUCTFOUND" rule. Here, in the "Min. Version" field, input the following:

Code: Select all

255.255.6555.6555
and check the "Include Minimum version in rage" option.

- now please go to "Upgrade Action" tab (of the "AI_NEWERPRODUCTFOUND" rule) and check the "Detect only, placing results in property" option.

- rebuild the project.

Prereq2:

- repeat all the above steps.

- rebuild the project

Bootstrapper:

- open the project

- revert the "AI_DOWNGRADE" rows (as we did on the prerequisite)

- go to "Prerequisites" page.

- select one of your prerequisites --> "Install Conditions" tab --> double click on the condition --> set the "Maximum" field to "1.0.1" as well.

- repeat the above step for the second prerequisite as well.

- now please go to "Upgrades" page.

- double click on the "OLDPRODUCTS" rule and in the "Max. Version" field, input the following:

Code: Select all

255.255.6555.6555
and check the "Include Maximum version in range" option.

- now click on the "AI_NEWERPRODUCTFOUND" rule and in the "Min. Version" field, input the following:

Code: Select all

255.255.6555.6555
and check the "Include Minimum version in range" option.

- in the "Upgrade Action" tab of the "AI_NEWERPRODUCTFOUND" rule, select the "Detect only, placing results in property" option.

- delete the custom upgrade rule you have created (the one that is supposed to detect your prerequisite).

- rebuild and install. Versions 1.0.2 for the Bootstrapper and for Prereq_MSI1 should appear in the Control Panel.

For version 1.0.1:

- repeat the exact same steps as presented above

- rebuild and install

- now versions 1.0.1 should appear for both the Bootstrapper and for the Prereq_MSI1 in the Control Panel.

Please find below, for your reference, a download link for both versions with the modification I've presented above:

https://drive.google.com/file/d/1isn7I2 ... sp=sharing

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
Balaji
Posts: 53
Joined: Wed May 06, 2020 9:15 am

Re: how to add upgrade/downgrade feature in bootstrapper exe

Hi Catalin,
Yes, I agree with you. I have removed entries of AI_DOWNGRADE from table editor.
Because, I have read somewhere on AI community itself to remove those entries.
But, that's fine I have replicated whatever changes you have mention in your previous post.
It is working fine for upgrade and downgrade.

Current Issue:
While downgrading it is showing "Agree and Upgrade" button(and we want Agree and Downgrade button for downgrade).
Before making above changes it was showing "Agree and Downgrade" button.
Please let me know why it is behaving like this.

Note : Also, tested package that you have sent to me. But, it is also behaving same.

Thanks,
Balaji

Return to “Building Installers”