@@ -59,10 +59,10 @@ Filename: "{sys}\sc.exe"; Parameters: "description ""{#MyServiceName}"" ""Cleanu
5959
6060; For updates - stop service if running, wait for complete shutdown, then restart
6161Filename : " {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
6363
6464; 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
6666
6767; Open web interface (only if service is selected)
6868Filename : " 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
7777
7878[Code]
7979var
80- WasServiceExisting : Boolean;
80+ ServiceExistedBefore : Boolean;
8181
8282procedure CreateConfigDirs ;
8383begin
@@ -166,10 +166,10 @@ var
166166 ResultCode: Integer;
167167begin
168168 // Remember if service existed before installation
169- WasServiceExisting := ServiceExists(' {#MyServiceName}' );
169+ ServiceExistedBefore := ServiceExists(' {#MyServiceName}' );
170170
171171 // Only stop service if it exists and is running
172- if WasServiceExisting and IsServiceRunning(' {#MyServiceName}' ) then
172+ if ServiceExistedBefore and IsServiceRunning(' {#MyServiceName}' ) then
173173 begin
174174 if MsgBox(' Cleanuparr service is currently running and needs to be stopped for the installation. Continue?' ,
175175 mbConfirmation, MB_YESNO) = IDYES then
0 commit comments