Inno Setup 从 "Setup has detected that ... is currently running" 中删除版本号

Inno Setup Remove version number from "Setup has detected that ... is currently running"

我已将行 AppMutex={#MyAppName} 添加到我的 InnoSetup 脚本中,并且 #MyAppName 不包括版本号。但是,当我的 Setup.exe 运行时,它会显示 "Your App v1.01 is already running" (或其他)以及我不想要的版本号。有没有办法让消息不显示版本号?

原因:假设我的应用程序是 运行 v1.00,并且我启动了 "MyApp_101_Setup.exe"(使用 Inno Setup 制作)。显示的消息是 "Your App v1.01 is already running",这不是真的,我正在尝试安装 v1.01,而 v1.00 是 运行。这可能会让我的用户感到困惑。

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

你错了。

留言是:

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 所说:

Do not include the version number, as that is defined by the AppVersion and/or AppVerName directives.