我在自定义UninstallProgressForm
(Custom Uninstall page (not MsgBox))中使用此代码在卸载后定义消息(没有原始卸载程序消息):
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
case CurUninstallStep of
usPostUninstall:
if not WizardVerySilent and UninstallSilent then begin
MsgBox(CustomMessage('UninstallComplete'), mbInformation, MB_OK);
end;
end;
end;
我想在确定的时刻隐藏此消息,在卸载我之前的版本(如果存在)。对于卸载我以前的版本,我使用此代码:How to detect old installation and offer removal?。我已使用此代码修改了上一个链接的代码,以便在以前的版本中运行卸载程序:Executing UninstallString in Inno Setup
答案 0 :(得分:2)
在执行卸载以卸载先前版本时,将自定义开关添加到卸载程序。像/UPDATE
:
Exec(UninstallPath, UninstallParams + ' /UPDATE', '', SW_SHOW,
wWaitUntilTerminated, iResultCode)
然后检查开关:
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
case CurUninstallStep of
usPostUninstall:
if UninstallSilent and (not WizardVerySilent) and
(not CmdLineParamExists('/UPDATE')) then
begin
MsgBox(CustomMessage('UninstallComplete'), mbInformation, MB_OK);
end;
end;
end;
CmdLineParamExists
功能来自Passing conditional parameter in Inno Setup。