Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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. For a while everything works fine but recently installer failing to close explorer.exe (Windows Explorer) on Windows 10 during installation. 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. Adding restartreplace flag does not helps.

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.

Here is the log from Inno Setup installer:

[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
like image 838
zapredelom Avatar asked Jul 26 '16 12:07

zapredelom


People also ask

What is an Inno Setup file?

Inno Setup is a free software script-driven installation system created in Delphi by Jordan Russell. The first version was released in 1997.

How do I Setup Inno Setup?

Go to Menu, Project, then Compile to compile and create the setup file. This will create a complete installer. Run the Setup and your application will be installed correctly. Innosetup offers an awesome alternative to create great looking Installers for free.

What is Inno Script Studio?

Inno Script Studio is a new intuitive graphical interface for generating and compiling scripts for the award winning Inno Setup compiler from Jordan Russell.

What language is Inno?

It defines two languages: English, based on the standard Default. isl file, and Dutch, based on a third-party translation.


2 Answers

I do not know why the installer is failing to close the applications.

But you can try the force option to work it around:

CloseApplications=force
like image 143
Martin Prikryl Avatar answered Dec 21 '22 23:12

Martin Prikryl


I had a case that CloseApplications=force didn't help, and the only solution was to manually kill the running app.

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

like image 29
itsho Avatar answered Dec 22 '22 01:12

itsho