Hello,
I have an installer which also setups windows service for background jobs.
When updating, prompt to close application appears and shows that service.
When CloseApplications=true (by default), installer sucessfully kills the service in time before installing.
When CloseApplications=force, installer fails on Install window, and you need to click "Try again".
This does not happen randomly, it happens everytime. Looks like with force setup does not wait for closing of files?
This is how I setup the service:
[Run]
; Register the Windows service
Filename: "{cmd}"; Parameters: "/C sc create ABC.MyService binPath=""{app}\ABC.MyService.exe"" start= auto"; Flags: runhidden
; Start the service after installation
Filename: "{cmd}"; Parameters: "/C sc start ABC.MyService"; Flags: runhidden
[UninstallRun]
; Stop the service before uninstalling
Filename: "{cmd}"; Parameters: "/C sc stop ABC.MyService"; Flags: runhidden; RunOnceId: "Stop ABC Print Service"
; Delete the service during uninstallation
Filename: "{cmd}"; Parameters: "/C sc delete ABC.MyService"; Flags: runhidden; RunOnceId: "Delete ABC Print Service"
BTW, is there an option to hide that step from user and just force closing apps?
I thought force would do so, but looking at documentation there is not really a difference between yes and force.
I did it in function PrepareToInstall(var NeedsRestart: Boolean): String; but maybe there is better option?
Regards
AW