JonathanQ
Posts: 6
Joined: Fri Feb 01, 2008 10:26 pm

Skipping Custom Action when auto-uninstall/install occurs

Fri Feb 01, 2008 10:33 pm

I am trying to stop a Custom Action from running when the installer is doing an upgrade. I know that the Expression: (REMOVE="ALL" AND (NOT UPGRADINGPRODUCTCODE)) Is supposed to make this work.

However even with that set - when an installer of a newer version is run and it automatically uninstalls the old version and installs the new it still runs the script. I am assuming that when an installer automatically removes and old version and installs a new one it is NOT considered an "Upgrade" so this expression is TRUE. As opposed to creating an upgrade installer which would probably set this to false.

However I need to determine if the user is Uninstalling (Removing) - and it is NOT caused by the auto-remove/install of a newer version. So only if they specifically asked to remove it from their computer.

If this is not possible via the expression - is there a way I can set a property that could be passed to my vbs script so I can check in there and not perform an action in that case?

Thanks,

Jonathan

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Mon Feb 04, 2008 8:49 am

Hi,

Please note that the (REMOVE="ALL" AND (NOT UPGRADINGPRODUCTCODE)) condition will make the custom action run only during an upgrade.

If you want the custom action to run only during the first installation you can use: NOT Installed
However I need to determine if the user is Uninstalling (Removing) - and it is NOT caused by the auto-remove/install of a newer version.
If you want the custom action to run only during the uninstall process you can use: REMOVE="ALL"
I am assuming that when an installer automatically removes and old version and installs a new one it is NOT considered an "Upgrade" so this expression is TRUE.
This is considered an upgrade, therefore the expression is TRUE. If the expression of the condition is TRUE the custom action will run.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

JonathanQ
Posts: 6
Joined: Fri Feb 01, 2008 10:26 pm

Mon Feb 04, 2008 6:15 pm

Thank you for your response,

However I am still confused. You said that: (REMOVE="ALL" AND (NOT UPGRADINGPRODUCTCODE)) would mean the custom action would only run during an upgrade. While the description of that predefined condition within AdvancedInstaller states: "Test if the application is uninstalled but not by an upgrade" - which is why I used it and did not understand why it was not working.

I am still looking for a condition that would be true if and only if the application is uninstalled - and this uninstall process is not caused by the user running an installer for a newer version of the application. Not an upgrade, but a newer installer is run which automatically removes the old version of the application.

Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact:  Website

Tue Feb 05, 2008 8:14 am

Hi,

I'm sorry, I was a little hasty with this (I was thinking of the condition which doesn't use NOT). You are correct, this condition should make the custom action run only during a complete uninstall and not during an upgrade.

However, I'm not sure why in your case it doesn't work. Can you please send us the AIP (if it doesn't contain confidential information) or a small test case reproducing this behavior to support at advancedinstaller dot com so we can investigate this problem?

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

JonathanQ
Posts: 6
Joined: Fri Feb 01, 2008 10:26 pm

Tue Feb 05, 2008 11:55 pm

Cosmin,

Thank you for helping me through this. I can't seem to reproduce this issue anymore. I suspect that I had something out of date when I observed the script running during the upgrade. Because now when I run it - it does not run the script except during uninstall.

Thanks again for the help, I will contact support if I encounter any problems with it. But so far it seems to be working fine!

Jonathan

Return to “Common Problems”