简体   繁体   English

通过 Inno Setup 创建的安装程序,在 Windows 10 上安装期间无法关闭应用程序

[英]Installer created via Inno Setup, can't close applications during installation on Windows 10

I have created an installer for my application using Inno Setup.我已经使用 Inno Setup 为我的应用程序创建了一个安装程序。 For a while everything works fine but recently installer failing to close explorer.exe (Windows Explorer) on Windows 10 during installation.有一段时间一切正常,但最近安装程序无法在安装过程中关闭 Windows 10 上的explorer.exe (Windows 资源管理器)。 Installer needs to restart it to replace existing context menu handler with new, but the more strange thing is that same installer works fine on Windows 8 and 8.1.安装程序需要重新启动它以用新的替换现有的上下文菜单处理程序,但更奇怪的是同一个安装程序在 Windows 8 和 8.1 上运行良好。 Adding restartreplace flag does not helps.添加restartreplace标志没有帮助。

I also noticed that the installer can't close currently running application (old one which needs to be updated) and like the previous problem the application can be closed in Windows 8 or 8.1 with same installer.我还注意到安装程序无法关闭当前正在运行的应用程序(需要更新的旧应用程序),并且像上一个问题一样,可以使用相同的安装程序在 Windows 8 或 8.1 中关闭该应用程序。

Here is the log from Inno Setup installer:这是 Inno Setup 安装程序的日志:

[11:22:34.819]   Setup application started
[11:22:34.983]   Setup version: Inno Setup version 5.5.9 (a)
[11:22:34.984]   Original Setup EXE: ***
[11:22:34.984]   Setup command line: /SL5="$C0928,15589089,85504,***" /DEBUGWND=$30464 
[11:22:34.985]   Windows version: 10.0.14393  (NT platform: Yes)
[11:22:34.985]   64-bit Windows: Yes
[11:22:34.985]   Processor architecture: x64
[11:22:34.985]   User privileges: Administrative
[11:22:34.987]   64-bit install mode: Yes
[11:22:34.991]   Created temporary directory: C:\Users\Azat\AppData\Local\Temp\is-M4710.tmp
[11:22:37.584]   RestartManager found an application using one of our files: Windows Explorer
[11:22:37.585]   Can use RestartManager to avoid reboot? Yes (0)
[11:22:39.780]   Starting the installation process.
[11:22:39.789]   Shutting down applications using our files.
[11:23:09.944]   Some applications could not be shut down.
[11:23:09.945]   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.
[11:25:30.543]   User chose Abort.
[11:25:30.544]   User canceled the installation process.
[11:25:30.545]   Rolling back changes.
[11:25:30.547]   Starting the uninstallation process.
[11:25:30.548]   Uninstallation process succeeded.
[11:25:32.049]   Deinitializing Setup.
[11:25:32.071]   Setup exit code: 5

I do not know why the installer is failing to close the applications.我不知道为什么安装程序无法关闭应用程序。

But you can try the force option to work it around:但是您可以尝试使用force选项来解决它:

CloseApplications=force

I had a case that CloseApplications=force didn't help, and the only solution was to manually kill the running app.我遇到了CloseApplications=force没有帮助的情况,唯一的解决方案是手动CloseApplications=force正在运行的应用程序。

I eventually used something like this:我最终使用了这样的东西:

[Files]
Source: "My Service 1.exe"; DestDir: "{app}"; Flags: ignoreversion; BeforeInstall: TaskKill('My Service 1.exe')

[Code]
procedure TaskKill(fileName: String);
var
    resultCode: Integer;
begin
    Exec(ExpandConstant('taskkill.exe'), '/f /im ' + '"' + fileName + '"', '', SW_HIDE, ewWaitUntilTerminated, resultCode);
end;

Source - https://stackoverflow.com/a/33776406/426315来源 - https://stackoverflow.com/a/33776406/426315

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在卸载过程中删除注册表项(不是由安装程序创建的)(Inno Setup) - Remove registry entry (which is not created by installer) during uninstallation (Inno Setup) Inno安装程序创建的安装游戏期间出现随机错误 - Random error during installation game created by Inno setup 尝试关闭应用程序时 inno setup 崩溃 - inno setup crashed when trying to close applications Inno Setup:如果程序文件夹中存在文件,则关闭安装程序向导 - Inno Setup: Close installer wizard if file exists in the program's folder Inno Setup:MinVersion 不适用于 Windows 10 - Inno Setup: MinVersion not working for Windows 10 如何在Windows Installer安装过程中运行第三者exe(使用安装和部署项目) - how to run a 3rd party exe during a windows installer installation (using setup and deployment project) Inno Setup在安装过程中获取当前的.BIN文件 - Inno Setup Get Current .BIN file during Installation 在 Inno Setup 安装过程中编写 Node app .js 配置 - Write Node app .js configuration during installation process in Inno Setup 强制Inno安装程序在安装过程中显示UAC提示 - Force Inno Setup to show UAC prompt during installation 如何让 Inno Setup 安装程序在安装完成后或 VSTO 安装程序完成后保留临时文件? - How to make Inno Setup installer keep temporary files either after installation completes or after VSTO installer completes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM