我正在使用/verysilent /suppressmessagebox /norestart
运行安装程序来升级我的应用程序(Windows服务)。在PrepareToInstall()
中,我有代码使用net stop <ServiceName>
来检查和停止已经运行的服务实例。我记录net stop
生成的输出,它表明服务确实已经停止。但是,有时,安装程序会提示:
消息框(中止/重试/忽略):
安装程序无法自动关闭所有应用程序。建议您在继续之前使用需要由安装程序更新的文件关闭所有应用程序。
单击“重试”再试一次,“忽略”仍然继续,或者“中止”取消安装。
日志显示:
2017-05-10 23:47:38.851 Log opened. (Time zone: UTC-07:00) 2017-05-10 23:47:38.851 Setup version: Inno Setup version 5.5.9 (u) 2017-05-10 23:47:38.851 Original Setup EXE: C:\Windows\TEMP\installer.exe 2017-05-10 23:47:38.851 Setup command line: /SL5="$FD006E,3807712,131584,C:\Windows\TEMP\installer.exe" /verysilent /suppressmessagebox /norestart /log=C:\ProgramData\<ServiceName>\installer_2026493391.txt 2017-05-10 23:47:38.851 Windows version: 6.1.7601 SP1 (NT platform: Yes) 2017-05-10 23:47:38.851 64-bit Windows: Yes 2017-05-10 23:47:38.851 Processor architecture: x64 2017-05-10 23:47:38.851 User privileges: Administrative 2017-05-10 23:47:38.867 64-bit install mode: Yes 2017-05-10 23:47:38.867 Created temporary directory: C:\Windows\TEMP\is-OO761.tmp ..... ..... Some logs irrelevant to the issue at hand ..... 2017-05-10 23:47:39.148 Stopping <ServiceName> Service - begin 2017-05-10 23:47:39.148 Command : /S /C ""net" stop <ServiceName> > "C:\Windows\TEMP\is-OO761.tmp\~execwithresult.txt" 2>&1" 2017-05-10 23:47:39.257 Stopping <ServiceName> Service - done 2017-05-10 23:47:39.257 The <Service Display Name> service is stopping. The <Service Display Name> service was stopped successfully. 2017-05-10 23:47:39.366 RestartManager found an application using one of our files: <Service Display Name> 2017-05-10 23:47:39.366 Can use RestartManager to avoid reboot? Yes (0) 2017-05-10 23:47:39.366 Starting the installation process. 2017-05-10 23:47:39.366 Shutting down applications using our files. 2017-05-10 23:47:39.382 Some applications could not be shut down. 2017-05-10 23:47:39.382 Message box (Abort/Retry/Ignore): Setup was unable to automatically close all applications. It is recommended that you close all applications using files that need to be updated by Setup before continuing. Click Retry to try again, Ignore to proceed anyway, or Abort to cancel installation.
有两个问题:
/verysilent
模式显示?根据{{3}},它不应以静默模式显示。根据{{3}},我确实看到:
/ SILENT,/ VERYSILENT 指示安装程序保持沉默或非常安静。安装程序静默时,不显示向导和后台窗口,但安装进度窗口为。当设置非常安静时,不会显示此安装进度窗口。其他一切都很正常,例如显示安装过程中的错误消息,启动提示符(如果您没有使用DisableStartupPrompt或&#39; / SP - &#39;命令行选项如上所述。
net stop
命令后添加5秒暂停)答案 0 :(得分:1)
它是/SUPPRESSMSGBOXES
,而不是/SUPPRESSMESSAGEBOX
。
它可以是防病毒软件或类似文件,阻止文件。如果您尝试在net stop
之后立即移动/删除二进制文件,它会成功吗?