bdampmpc
Posts: 6
Joined: Fri Mar 08, 2024 9:39 pm

AI_INSTALL Always True (1)

I've built an installer and tested that it upgrades fine. Subsequently the product team has asked me to ensure that a required property is passed into the installer and to fail it is not. This should only occur on the initial install and not on upgrades, repairs, or uninstall.

This seemed simple enough and that seems to be the default behavior for AI; the Launch Condition are gated behind 'Not Installed' which gets stored in AI_INSTALL.

My problem is: upon upgrade AI_INSTALL is being set to True (value is 1) and the launch conditions are thus being evaluated forcing the passing of the parameter. If I pass the parameters the upgrades succeed, AI_INSTALL=1, AI_MAINT does not exist, and OLDVERSIONS and MIGRATE are populated with the ProductCode of the older version.

We are doing Major upgrades., side-by-side is not supported, I have verified that the upgrade code remains the same while the ProductCode is updated each time. We have "Include maximum version in range" enabled so that we can upgrade based on the fourth digit of the version. However, I've tested with updating the 3rd digit as well with the same results.

My immediate plan is to just use the OLDPRODUCTS property on the launch condition ... but it still feels like something is amiss here. It would seem like AI_INSTALL should not be true when OLDVERSIONS are found.
I'm running Version 22.3 (4E21175D)
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: AI_INSTALL Always True (1)

Hello,

As I understand correctly, you want to fail the installation if that property is not passed?

Well then, as a condition, we can only make use of that property and OLDPRODUCTS property (which showcases an upgrade).

Since OLDPRODUCTS showcases an upgrade, we can similarly ensure that "NOT OLDPRODUCT" showcases a first time installation - exactly what we need here.

Could you please try this and let me know if it works?

Regarding the AI_INSTALL property, are you saying that this property exists on an upgrade as well?

From the "Windows Installer Properties" article, we can see that this property is never empty:
Screenshot_229.png
Screenshot_229.png (12.37 KiB) Viewed 8191 times
If a property always has a value, we have to be specific as we can not use the same logic as above, e.g.:

OLDPRODUCTS --> property is set, meaning it exists. Here, the value of the property does not really matter.

NOT OLDPRODUCTS --> property is not set, meaning it does not exist.

Instead, if a property is always set to a value, we have to be specific with that value, e.g. if we have a property that has a default value of "Empty" and is then set to:

INSTALLED = "True"

or

INSTALLED = "False"

then we can not use the conditions as above, because the condition "INSTALLED" will be always true, because the property always exists.

Hope this helps :)

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
bdampmpc
Posts: 6
Joined: Fri Mar 08, 2024 9:39 pm

Re: AI_INSTALL Always True (1)

Thanks for the response Catalin.

>As I understand correctly, you want to fail the installation if that property is not passed?
Correct, but _only_ on the initial install of the product.

>Could you please try this [OLDPRODUCTS] and let me know if it works?
Yes, that was the solution I ended u with adn I can confirm that it seems to work.

>Regarding the AI_INSTALL property, are you saying that this property exists on an upgrade as well?
It's not that it exists, it's that it's always set of a value of 1; both on initial install (correct) and on upgrades (incorrect?). If OLDPRODUCTS is populated then does that not suggest AI_INSTALL should equal 0?

I'm wondering if this is because on upgrade I'm uninstalling the old version before installing the new one. Thus, technically, upon install it's IS the initial install.
Catalin
Posts: 7492
Joined: Wed Jun 13, 2018 7:49 am

Re: AI_INSTALL Always True (1)

Hello,

First of all, I'm glad you managed to get this to work as you wanted. :)

Regarding this:
I'm wondering if this is because on upgrade I'm uninstalling the old version before installing the new one. Thus, technically, upon install it's IS the initial install.
I think that this is the case as well. Basically the older version is uninstalled and the newer one installed.

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

Return to “Common Problems”