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

Prerequisites are not upgrade/downgrade

Wed Sep 07, 2022 9:34 am

Hi community,
I have two AIP projects created for producing bootstrapper/Executable. Let say AIP1 and AIP2.
Both these AIP projects are having feature based prerequisite "kernel.msi".
Below are the version details for both AIPs:
For AIP1 :
AIP1 product version : 1.2.2001
kernel.msi: 21.3.3009

For AIP2 :
AIP2 product version : 1.2.2005
kernel.msi : 21.3.3125

We have implemented functionality to support upgrade/downgrade feature.

Scenario :

1. If suppose AIP1 is already installed on a system. You can find their versions under "Add/ remove program". i.e. AIP1 is having version as 1.2.2001 and prerequisite kernel msi is having 21.3.3009.
2. When we try to install AIP2 which is higher versipon of AIP1. We find that AIP1 gets upgraded and when we find their versions we get below information :
AIP2 : 1.2.2005 and kernel.msi : 21.3.3009
3. That means only AIP gets upgraded and not the prerequisite msi.

Vice a versa when you try to achieve downgrade scenario only AIP gets downgraded and not the prerequisite.

We want to upgrade/downgrade both AIP as well as the prerequisite i.e. kernel.msi.

Can you help me to resolve this issue?

Thanks!
Balaji

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Prerequisites are not upgrade/downgrade

Thu Sep 08, 2022 8:55 am

Hello Balaji,

I'm not sure why this happens. Does it works when you manually install the prerequisite? For example, install kernel.msi v21.3.3009 and then manually install kernel.msi v21.3.3125 and see if it works.

Otherwise, to further investigate this, please forward to us by email to support at advancedinstaller dot com the following resources:

1. both .AIP setup projects (v1.2.2001 and v1.2.2005).
2. a download link for your both installers.
3. a download link for both kernel.msi setups (v21.3.3009 and v21.3.3125).

Looking forward to hearing from you.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

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

Re: Prerequisites are not upgrade/downgrade

Tue Sep 13, 2022 11:41 am

HI Liviu,
I have tried all possible scenarios at my end and now, I am able to upgrade the kernel.
But, still I am facing issue while downgrading it. Whenever I try to downgrade the bootstrapper only main bootstrapper gets downgraded and kernel remains unchanged.
For your reference I have attached the bootstrapper and kernel AIP projects. Please go through it and let me know what mistake I have done in this?

Case 1 : Higher version projects :

1. Bootstrapper project :
BootstrapperPrj.aip
(84.04KiB)Downloaded 299 times
2. Kernel Project :
Kernel_MSI1.aip
(61.5KiB)Downloaded 315 times

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

Re: Prerequisites are not upgrade/downgrade

Tue Sep 13, 2022 11:46 am

Case 2 : Lower version projects :

1. Bootstrapper project :
BootstrapperPrj.aip
(84.04KiB)Downloaded 445 times
2. Kernel Project :
Kernel_MSI1.aip
(61.5KiB)Downloaded 431 times

Please find the attached aip projects for both lower and higher versions, and help me out to resolve the downgrade scenario.

Thanks in advance!
Balaji

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Prerequisites are not upgrade/downgrade

Wed Sep 14, 2022 10:29 am

Hello Balaji,

As I can see, you had this problem in the past and my colleague Catalin has helped you with it. It is the same problem.

Please have a look on your below forum thread:

how to add upgrade/downgrade feature in bootstrapper exe

- 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:

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).

Also, we created a tutorial here:

How to create a downgradable setup

Please follow the steps from these forum threads in order to achieve your desired scenario.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

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

Re: Prerequisites are not upgrade/downgrade

Wed Sep 14, 2022 11:21 am

Hi Liviu,
I agree Catalin helped me to upgrade/downgrade executables but, it is working only when the versions are like
Bootstrapper1 = 1.2.2001
Bootstrapper2 = 1.3.2005

That means middle field from version string must be changed.
If the middle filed is not changed and only the last field is varying then it is not working for downgrade.
e.g. Bootstrapper1 = 1.2.2001
Bootstrapper2 = 1.2.2005

Can you check provided AIP projects for more details?

Thanks!
Balaji

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Prerequisites are not upgrade/downgrade

Thu Sep 15, 2022 9:58 am

Hello Balaji,

I have investigated your projects and it seems that you have not implemented any of the steps described by my colleague Catalin in the other similar topic you opened.

Is there a reason why you have not implemented them? For example, if you do not change the prerequisite to "Post-Install", then the downgrade will not work as Catalin explained.

In order to achieve the downgrade, please follow these steps:

1. in the old .AIP project (main project) go to the Upgrades page and add add a new upgrade rule that will uninstall v21.3.3125 of your prerequiste. It looks as it follows:

upgrades page.png
upgrades page.png (112.87KiB)Viewed 10838 times

2. now go to the Prerequisites page and move your prerequisite to the Post-install stage.

You also need to change your install condition rule. For testing purposes I selected the "Always install prerequisite" option and everything works as expected. The default condition is as in the below screenshot which will be false since a higher version (21.3.3125) is already installed.
prereq condition.png
prereq condition.png (79.3KiB)Viewed 10838 times
prereq.png
prereq.png (92.44KiB)Viewed 10838 times
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.

Please follow the above steps and you should be able to downgrade your prerequisite also.

Hope this helps!

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

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

Re: Prerequisites are not upgrade/downgrade

Mon Sep 19, 2022 11:22 am

Hi Liviu,
I have made changes into the AIP projects. Still it is not working as per the requirement(prerequuisite i.e. kernel can't gets downgraded ).

Newer version bootstrapper project :
BootstrapperPrj.aip
(83.99KiB)Downloaded 299 times
Newer version kernel project :
Kernel_MSI1.aip
(61.28KiB)Downloaded 302 times
In these project I have made changes as suggested by catalin.
Please check it.

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

Re: Prerequisites are not upgrade/downgrade

Mon Sep 19, 2022 11:28 am

Older version bootstrapper project :
BootstrapperPrj.aip
(84.16KiB)Downloaded 300 times
older version kernel project :
Kernel_MSI1.aip
(61.28KiB)Downloaded 295 times
For older version aip project I have added upgrade rule for kernel msi as you suggested in last reply.
Still it is not downgrading kernel.
Please let me know your observation on the same.

Thanks!
Balaji

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Prerequisites are not upgrade/downgrade

Tue Sep 20, 2022 10:18 am

Hello Balaji,

As I already explained, you also need to define a new install condition rule for your prerequisite.

The default condition is as in the above screenshot (from my previous reply) which will be false since a higher version (21.3.3125) is already installed.

Please test it with the "Always install prerequisite" option enabled or find a new install condition for your prerequisite.

For example, you can add the below install condition (in the old project):
prereq condition.png
prereq condition.png (105.67KiB)Viewed 10748 times

Let me know if you have any other questions.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

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

Re: Prerequisites are not upgrade/downgrade

Fri Sep 23, 2022 7:16 am

Hi Liviu,
I have tried using "Always install prerequisite" option enabled still I am facing same issue.
Also, tried new install condition as you suggested in last reply, still issue is not resolved.
Could you please send working projects from your side?

Thanks!
Balaji

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Prerequisites are not upgrade/downgrade

Fri Sep 23, 2022 12:59 pm

Hello Balaji

Please find attached the .AIP projects. Please note I've removed your custom actions from the project in order to be able to build and install your dummy packages.

You can also check the below gif file to see that everything worked as expected on my machine:

.GIF Demo

Hope this helps!

Best regards,
Liviu
Attachments
BootstrapperPrj old.aip
(82.85KiB)Downloaded 294 times
BootstrapperPrj new.aip
(84KiB)Downloaded 295 times
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

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

Re: Prerequisites are not upgrade/downgrade

Mon Sep 26, 2022 9:57 am

Dear Liviu,
Thank you for your bootstrapper packages.
I have tried them at my end but they are not working properly. It is giving the same issue as of mine.
I have uploaded error as below:
error.jpg
error.jpg (33.88KiB)Viewed 10634 times
Also, I have updated the product code but still facing same issue.
Only bootstrapper version updated and kernel prerequisite remains same.

What do you think about this behaviour?

Thanks!
Balaji

Liviu
Posts: 1035
Joined: Tue Jul 13, 2021 11:29 am
Contact:  Website

Re: Prerequisites are not upgrade/downgrade

Mon Sep 26, 2022 1:16 pm

Hello Balaji,

This is quite strange as everything worked as expected on my machine.

Have you changed the prerequisite file path in your projects?

Please forward to me the updated .AIP projects (the ones I previously attached and you modified the path for prereq) so I can further investigate this.

Also, you can download the setup packages from here. These packages are generated from the previous attached project and they work as expected as you could see in the video.

Best regards,
Liviu
________________________________________
Liviu Sandu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”