@@ -59,10 +59,10 @@ Filename: "{sys}\sc.exe"; Parameters: "description ""{#MyServiceName}"" ""Cleanu
59
59
60
60
; For updates - stop service if running, wait for complete shutdown, then restart
61
61
Filename : " {sys} \sc.exe" ; Parameters : " stop " " {#MyServiceName}" " " ; Flags : runhidden ; Check : ServiceExists(' {#MyServiceName}' ) and IsServiceRunning(' {#MyServiceName}' ) and IsTaskSelected(' installservice' )
62
- Filename : " {sys} \sc.exe" ; Parameters : " start " " {#MyServiceName}" " " ; Tasks: installservice; Flags : runhidden ; Check : ServiceExists(' {#MyServiceName}' ) and WasServiceExisting
62
+ Filename : " {sys} \sc.exe" ; Parameters : " start " " {#MyServiceName}" " " ; Tasks: installservice; Flags : runhidden ; Check : ServiceExists(' {#MyServiceName}' ) and ServiceExistedBefore
63
63
64
64
; For fresh installs - start the newly created service
65
- Filename : " {sys} \sc.exe" ; Parameters : " start " " {#MyServiceName}" " " ; Tasks: installservice; Flags : runhidden ; Check : not WasServiceExisting
65
+ Filename : " {sys} \sc.exe" ; Parameters : " start " " {#MyServiceName}" " " ; Tasks: installservice; Flags : runhidden ; Check : not ServiceExistedBefore
66
66
67
67
; Open web interface (only if service is selected)
68
68
Filename : " http://localhost:11011" ; Description : " Open Cleanuparr Web Interface" ; Flags : postinstall shellexec nowait ; Check : IsTaskSelected(' installservice' )
@@ -77,7 +77,7 @@ Filename: "{sys}\sc.exe"; Parameters: "delete ""{#MyServiceName}"""; Flags: runh
77
77
78
78
[Code]
79
79
var
80
- WasServiceExisting : Boolean;
80
+ ServiceExistedBefore : Boolean;
81
81
82
82
procedure CreateConfigDirs ;
83
83
begin
@@ -166,10 +166,10 @@ var
166
166
ResultCode: Integer;
167
167
begin
168
168
// Remember if service existed before installation
169
- WasServiceExisting := ServiceExists(' {#MyServiceName}' );
169
+ ServiceExistedBefore := ServiceExists(' {#MyServiceName}' );
170
170
171
171
// Only stop service if it exists and is running
172
- if WasServiceExisting and IsServiceRunning(' {#MyServiceName}' ) then
172
+ if ServiceExistedBefore and IsServiceRunning(' {#MyServiceName}' ) then
173
173
begin
174
174
if MsgBox(' Cleanuparr service is currently running and needs to be stopped for the installation. Continue?' ,
175
175
mbConfirmation, MB_YESNO) = IDYES then
0 commit comments