Page 1 of 1

How to detect uninstall link launch vs. original setup.exe?

Posted: Wed Oct 11, 2006 3:05 pm
by Bob Lawblaw
Given this backgorund...
- User downloads setup.exe to desktop.
- User runs setup.exe & installs fine.

... How can I differentiate in script between these 2 scenarios:
1. User clicks the Uninstall Shortcut on the start menu OR
Runs uninstall from the Add/Remove CP.
2. User re-runs the setup.exe on the desktop.

It's not clear to me if I can use MAINTENANCE and NEEDSUPGRADE variables to differentiate. Will REMOVE be initialized to TRUE in the case of #1?

Thank you.

Posted: Wed Oct 11, 2006 5:34 pm
by MichaelNesmith
The uninstall shortcut usually sets REMOVE to TRUE, so it should be pre-selected when the uninstall wizard starts up, and this should give you detection capability.

MAINTENANCE and NEEDSUPGRADE report the installation state of the current product - and not the location where setup is running from. So they won't be of help.

You can then test for the presence of the instance.dat file next to the running setup.exe file using the pre-defined variable $EXEDIR$, this will let you know if you are running the downloaded main setup file or not.

Posted: Wed Oct 11, 2006 6:53 pm
by Bob Lawblaw
Thank you

Re: How to detect uninstall link launch vs. original setup.e

Posted: Mon Jul 21, 2014 7:03 am
by premjeet.singh
I am also stuck in the same situation and the solution given in this post is not working for me. The Uninstall shortcut is not setting the REMOVE variable to TRUE.
Since this is an old post may be the current behavior changed now. I am using installaware 18.04

Please let me know how can i differentiate between the two scenarios mentioned by Bob in this post?

Re: How to detect uninstall link launch vs. original setup.e

Posted: Mon Jul 21, 2014 11:09 am
by FrancescoT
Dear User,

the easiest way that comes to my mind is,

- try with passing a custom command line parameter with the Uninstall shortcut and then check the presence of that parameter in the "CMDLINE" pre-defined variable from your script.

Regards

Re: How to detect uninstall link launch vs. original setup.e

Posted: Mon Jul 21, 2014 11:49 pm
by premjeet.singh
Is the command line parameter solution going to work when user uninstalls from Control Panel using the Add/Remove?

If not then please provide a generic solution which works in all uninstall scenarios.

Re: How to detect uninstall link launch vs. original setup.e

Posted: Tue Jul 22, 2014 10:50 am
by FrancescoT
Unfortunately, It doesn't exist a generic solution that can be used to track from where the Un-install action has been issue.

For sure, when the user select to un-install a package from Control Panel, the REMOVE pre-defined variable will be TRUE ... and you can easily verify this, using a Message-Box to report the variable value, at the very beginning of your main script.

Hope this helps you.

Regards

Re: How to detect uninstall link launch vs. original setup.e

Posted: Wed Jul 23, 2014 5:31 am
by premjeet.singh
Using your suggestions I found a generic solution to set
REMOVE=TRUE MODIFY=FALSE REPAIR=FALSE
in Command Line Parameters of the Uninstall Shortcut.

Now I get REMOVE=TRUE whether user Uninstall from Control Panel or using the shortcut... :D
Thanks for your help.

Re: How to detect uninstall link launch vs. original setup.e

Posted: Wed Jul 23, 2014 11:20 am
by FrancescoT
Happy you solved :D !

Regards