Page 1 of 1

How to determine if called from uninstall shortcut.

Posted: Mon Jan 17, 2011 11:31 am
by NickDay
My installer (for reasons I won't go into) uninstalls any existing version of the product when it enters (existing version detected as MAINTENANCE is TRUE). It then offers a choice of items to be installed.

This is working fine; however when my installer is called from an uninstall shortcut (which was created in the normal way by my installer), it uninstalls the existing product, but then continues, offering the choice of items.

I wish to be able to detect, within the installer, that it was called from an uninstall link, and exit the installer after the uninstall has finished.

On entry, when called from the uninstall link, REMOVE is FALSE. I had hoped that it would be TRUE.

How can I tell that I've been called from an uninstall shortcut?

Thanks for any advice.

Re: How to determine if called from uninstall shortcut.

Posted: Mon Jan 17, 2011 12:12 pm
by giaviv
Dear NickDay,

What I would do is go to the shortcut that IA creates (Design tab -> Setup Architecture -> Shortcuts). You will see there the uninstall shortcut (assuming you created your installation using an IA template). Click on the uninstall shortcut and add a command line parameter (e.g, "uninstall"). In your MSIcode, you could check the CMDLINE pre-defined variable and look for the parameter you passed in the uninstall shortcut.

Good luck!

Re: How to determine if called from uninstall shortcut.

Posted: Tue Jan 18, 2011 4:34 am
by NickDay
Thank you Aviv, that was just the advice I needed.
Nick

Re: How to determine if called from uninstall shortcut.

Posted: Tue Jan 18, 2011 10:25 am
by giaviv
Dear Nick,

Great! Should you have any further questions please do not hesitate to ask.

Best regards