dmh_nrltd
Posts: 20
Joined: Mon Dec 12, 2005 5:35 pm

Detecting Re-install of Identical Versions

Hi,

Is it possible to detect that a user is trying to install the same version of a product / msi a second time?

When the user tries to install an older version, this is correctly halted, and the user is informed.

When the user tries to install the same version, the installer runs, but does nothing (or so it appears). The problem is that, in our case, we have custom actions that run on upgrade (actually we do this by checking AI_UPGRADE<>"No" - is this reasonable?). We would like to avoid these custom actions running when the user is installing the same version.

Thanks in advance,
David.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
Is it possible to detect that a user is trying to install the same version of a product / msi a second time?
Yes you can do this by checking the value of the property AI_MAINT. If the user is trying to install the same version/msi then this property is set to 1 else null.
The problem is that, in our case, we have custom actions that run on upgrade (actually we do this by checking AI_UPGRADE<>"No" - is this reasonable?)
If you want to run a custom action only when the package is upgraded then use the following property as condition for the custom action:

Code: Select all

(AI_UPGRADE = "Yes") AND OLDPRODUCTS
We would like to avoid these custom actions running when the user is installing the same version.
With this condition the custom action runs for the upgrade package and does not runs when the package is installed for the first time.

Regards,
Gigi
__________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
Last edited by gigi on Fri May 26, 2006 10:47 am, edited 1 time in total.
dmh_nrltd
Posts: 20
Joined: Mon Dec 12, 2005 5:35 pm

Gigi,
Many thanks for your helpful response - this has fixed both our issues.
Cheers, David. :)
dmh_nrltd
Posts: 20
Joined: Mon Dec 12, 2005 5:35 pm

Hi,

We've hit a couple of further problems.

First we have a custom action that needs to run when the user runs the same msi (i.e. installs the same version they already have). We are running with a limited UI, and it appears that AI_MAINT is not set in this case. Therefore I copied the AI_MAINT condition from the InstallUISequence, and copied it to our custom action. This seems to work fine. Am I right in thinking the AI_MAINT isn't set with the limited UI?

Second, we added a ForceReboot Standard Action to the msi, using ORCA, and the condition you specified with a minor mod:

Code: Select all

(AI_UPGRADE = "Yes") AND OLDPRODUCTS AND (NOT AFTERREBOOT)
This condition doesn't seem to work for us :(
Any thoughts?

Cheers, David.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,
Am I right in thinking the AI_MAINT isn't set with the limited UI?
Yes the AI_MAINT property is set only when the package running with full UI. So the condition that you use for the custom action is correct.

Regarding the ForceReboot standard action please tell me where you schedule it because this standard action have a restriction on where you can place it. Also please give me more details about what does not work.

Regards,
Gigi
________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com
dmh_nrltd
Posts: 20
Joined: Mon Dec 12, 2005 5:35 pm

- We've tried inserting the ForceReboot Standard Action in the Uninstall section, following AI's Uninstall custom actions (sequence 1653).
- We are running with a simple UI
- This action is in the upgrade/new package, not in the package already installed on the PC
- The action isn't executed at all.

Any help gratefuly recieved!
Thanks, David.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

Please try with the following condition, I test it and it works just fine:

Code: Select all

OLDPRODUCTS AND (NOT AFTERREBOOT)
Regards,
Gigi
___________________
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com

Return to “Common Problems”