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

Got a problem you cannot solve? Try here.
Bob Lawblaw
Posts: 5
Joined: Wed Jul 19, 2006 4:51 pm

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

Postby Bob Lawblaw » Wed Oct 11, 2006 3:05 pm

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.

MichaelNesmith
Posts: 3452
Joined: Thu Dec 22, 2005 7:17 pm
Contact:

Postby MichaelNesmith » Wed Oct 11, 2006 5:34 pm

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.
Michael Nesmith
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/

Bob Lawblaw
Posts: 5
Joined: Wed Jul 19, 2006 4:51 pm

Postby Bob Lawblaw » Wed Oct 11, 2006 6:53 pm

Thank you

premjeet.singh
Posts: 12
Joined: Thu Feb 13, 2014 12:17 am

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

Postby premjeet.singh » Mon Jul 21, 2014 7:03 am

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?

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

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

Postby FrancescoT » Mon Jul 21, 2014 11:09 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

premjeet.singh
Posts: 12
Joined: Thu Feb 13, 2014 12:17 am

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

Postby premjeet.singh » Mon Jul 21, 2014 11:49 pm

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

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

Postby FrancescoT » Tue Jul 22, 2014 10:50 am

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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

premjeet.singh
Posts: 12
Joined: Thu Feb 13, 2014 12:17 am

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

Postby premjeet.singh » Wed Jul 23, 2014 5:31 am

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.

FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

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

Postby FrancescoT » Wed Jul 23, 2014 11:20 am

Happy you solved :D !

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 44 guests