I've a problem with WizardForm
's, when I trying to uninstall the program I have this error:
Runtime Error:
Internal error: An attempt was made to access WizardForm before it has been created.
I need to create soft abort uninstallation process with loop (e.g. when application is running and user run the uninstall, program must check processes and if application is running, notify user and if user press the cancel button the program abort uninstallation), I've tried with ExitProcess(0);
but it isn't gentle.
Code section:
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
case CurUninstallStep of
usUninstall:
begin
if MsgBox('Close the {#AppName}, before uninstallation.', mbConfirmation, MB_YESNO) = IDYES then
begin
{ user clicked Yes }
end
else
begin
MsgBox('Error',mbError,MB_OK);
CancelWithoutPrompt := true;
{ ExitProcess(0); }
WizardForm.close;
end
end;
end;
end;