inno-setup - Inno Setup - 检测另一个进程何时为特定任务自动运行(卸载)安装程序

标签 inno-setup

我在自定义 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

最佳答案

当您执行卸载以前的版本时,向卸载程序添加自定义开关。就像/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 .

关于inno-setup - Inno Setup - 检测另一个进程何时为特定任务自动运行(卸载)安装程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47078888/

相关文章:

c++ - 使用MFC以编程方式更改文件扩展名关联?

.net - 在 Inno Setup 中显示 .NET Framework 安装进度

path - 来自 CD/DVD 驱动器的 Inno Setup 安装脚本(可变路径)

windows - 使用 Inno Setup 将序列号写入文件

unicode - 在 Inno Setup 中对所有语言使用 .islu 翻译文件是否安全?

performance - 从安装程序中提取 isxdl.dll 需要很长时间

installshield - 在安装过程中使用 Inno Setup 删除另一个未使用 Inno Setup 安装的应用程序

inno-setup - wpSelectComponents 上的 Inno Setup 文本

inno-setup - TStringList vs 字符串数组 vs TArrayOfString

installation - 在 Inno Setup 中安装之前检测重启是否挂起