【问题标题】:Inno Setup Remove version number from "Setup has detected that ... is currently running"Inno Setup 从“Setup has detected that ... is current running”中删除版本号
【发布时间】:2020-05-25 15:38:46
【问题描述】:

我已将行 AppMutex={#MyAppName} 添加到我的 InnoSetup 脚本中,而 #MyAppName 不包括版本号。但是,当我的 Setup.exe 运行时,它会显示“您的应用程序 v1.01 已经在运行”(或其他任何内容)以及我不想要的版本号。有没有办法让消息不显示版本号?

原因:假设我正在运行我的应用程序的 v1.00,我启动了“MyApp_101_Setup.exe”(使用 Inno Setup 制作)。显示的消息是“您的应用程序 v1.01 已在运行”,这不是真的,我正在尝试在 v1.00 运行时安装 v1.01。这可能会让我的用户感到困惑。

有什么建议吗?谢谢! :)

【问题讨论】:

    标签: inno-setup


    【解决方案1】:

    你错了。

    消息是:

    SetupAppRunningError=Setup has detected that %1 is currently running.%n%nPlease close all instances of it now, then click OK to continue, or Cancel to exit.
    

    %1AppName directive 的值替换:

    ExpandedAppName := ExpandConst(SetupHeader.AppName);
    
    ...
    
    { Check if app is running }
    while CheckForMutexes(ExpandedAppMutex) do
      if LoggedMsgBox(FmtSetupMessage1(msgSetupAppRunningError, ExpandedAppName),
         SetupMessages[msgSetupAppTitle], mbError, MB_OKCANCEL, True, IDCANCEL) <> IDOK then
        Abort;
    

    因此,只有在 AppName 指令中包含该版本时,该版本才会包含在消息中。有什么问题,指令值可能不包括版本,正如documentation 所说:

    不包括版本号,这是由 AppVersion 和/或 AppVerName 指令定义的。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-05-11
      • 2019-03-28
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-07-04
      相关资源
      最近更新 更多