Quantcast
Channel: Indigo Rose Software Forums - Forums
Viewing all articles
Browse latest Browse all 2105

How to cancel the Uninstall process

$
0
0
Hi,

i'm trying to cancel the uninstall process at the "On Pre Uninstall" Action.

At this point i start an other application get the ReturnCode via File.Run(...)
I evaluate this ReturnCode and under certain conditions i show a Messagebox. In this Messagebox the user can cancel the Uninstallation.
However the uninstall.exe is ever be deleted - how can i prevent this?

Code:

local fileName = SessionVar.Get("%AppFolder%") .."\\Uninstall\\UninstallCheck.exe"
local headerText = SetupData.GetLocalizedString("MSG_UNINSTALL_HEADER");
local messageText = SetupData.GetLocalizedString("MSG_UNINSTALL_MESSAGE");


ReturnCode = File.Run(fileName, "", "", SW_MINIMIZE, true);
--Dialog.Message("Error!", ReturnCode, MB_RETRYCANCEL);

if (ReturnCode == 1 ) then
        -- Confirm that the uninstallation executable should be launched.
        result = Dialog.Message(headerText, messageText, MB_YESNOCANCEL, MB_ICONQUESTION, MB_DEFBUTTON1);
        if (result == IDNO or result == IDCANCEL) then
            Application.Exit();
        end
end

Thanks,
Tobias

Viewing all articles
Browse latest Browse all 2105

Trending Articles