PDA

View Full Version : Uninstall Shortcut for Standard Project



JoeThompson
07-30-2002, 11:10 AM
Hi,

I've searched around a bit for examples on how to create a shortcut that allows the user to uninstall my application.

I have a Standard project but I need to ask the user some questions during uninstallation. If I double click on setup.exe (which I have copied to the hard drive), or select my app from the "Add/Remove Programs" applet, I get the desired behavior. If I try the suggestion in KB Q105629, I am just asked to verify that I want to uninstall and the UI is skipped but the program is uninstalled.

So my question is, how do I create a shortcut that behaves like the Add/Remove Programs?

Thank you,
Joe

Joshua
07-30-2002, 02:55 PM
Joe,

If this is a Standard project, I would recommend the following:

1. Note the following value:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\<GUID>\UninstallString

2. Use script to retrieve this value, and launch it.

This should allow you to exactly reproduce the behavior that occurs when you launch this via the Add/Remove Programs applet.

JoeThompson
07-30-2002, 02:59 PM
Hi Joshua,

Yes, it is a Standard project. How do I get at script from the Shortcut? I am just using the IDEs Shortcut/Folders view.

Thank you,
Joe

LewisQ
07-30-2002, 03:06 PM
If you just want a shortcut to uninstall the thing without user interface, just do an msiexec /x {Prod_GUID} /qb.

That will only place a gauge on screen with no user input.

JoeThompson
07-30-2002, 03:09 PM
That's how I did it. The problem is that I do need a UI to ask some further questions, etc.

Thank you,
Joe

LewisQ
07-30-2002, 04:16 PM
Then you are going to have to use OnMaintUIBefore() and OnMainUIAfter()

JoeThompson
07-30-2002, 05:26 PM
Hi,

I do use OnMaintUIBefore to get my screens. The problem I'm trying to solve is if I use the /x {guid} approach, the OnMaintUIBefore is skipped and it just uninstalls.

Thank you,
Joe