cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
SaberRider
Level 5

Userinteraction during uninstall

Hi,

what's the best way to do the following things:

Uninstall starts -> Ask the user if he wants to continue the setup, including the uninstallation of the installed SQL instance -> if the users chooses "cancel" the uninstallprocess will abort and the applikations remains fully functional on the system / if the user chooses "ok", the uninstallatio will continue an a custom action will run at the end of the uninstallationprocess, running the uninstaller for the SQL Instance.

Thank you for you help 🙂

P.S.: I'm using a Basic MSI Install Project.
Labels (1)
0 Kudos
(4) Replies
SaberRider
Level 5

Ok, I nearly solved my "problem".

Currently I'm using a Custom Action

(screenshot1)
to ask the user, if he wants to abort the uninstallation and run a backup using our application. I'm using a InstallScript Function to do this.

export prototype AskForBackup(HWND);
function AskForBackup(hMSI)

begin

// Display the AskYesNo dialog. The default is set to Yes.
if (AskYesNo("blablabla?\r\n" +
"blablabla.\r\n" +
"blablabla", YES) = YES)
then
Do(EXIT);
endif;

end;


If the user chooses YES, the setup aborts ( as wanted), but prompts the user again

(screenshot2)
for if he really wants to quit the (un)install process. Choosing yes, the Installer quits with an hard error 😞

(screenshot3).

Hopefully anybody can help me to prevent the last two messageboxes.

Thank you for your help in advance.

Greetings,
Gøran
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

To abort cleanly from a custom action, you can try either the abort; statement, but I would generally recommend returning the value 1602 (user canceled) or 1603 (failure) depending on the scenario. This scenario sounds like a time to return 1602.
0 Kudos
SaberRider
Level 5

Thank you for your help, I'll test your hint at once 🙂
0 Kudos
SaberRider
Level 5

Yeah, it works great 🙂

Return Processing: Synchronous (check exit code)

and switching in the InstallScript from Do(EXIT); to return 1602;


THX a lot 🙂
0 Kudos