diff --git a/install/windows-inno/windows_arm64.iss b/install/windows-inno/windows_arm64.iss index 7cc57151..d1163c4f 100644 --- a/install/windows-inno/windows_arm64.iss +++ b/install/windows-inno/windows_arm64.iss @@ -70,22 +70,10 @@ Type: files; Name: "{app}\v2rayA-service.err.log" Type: files; Name: "{app}\v2rayA-service.err.log.old" [Code] -function InitializeSetup(): Boolean; -var - ResultCode: integer; +function InitializeSetup() : Boolean; +var + ResultCode: Integer; begin - if FileExists('{dir}\v2rayA-service.exe') then - begin - if Exec(ExpandConstant('{sys}\sc.exe'), 'stop v2rayA', '', SW_HIDE, - ewWaitUntilTerminated, resultcode) then - begin - if (resultcode <> 0) then - begin - MsgBox('Failed to stop current v2rayA service, installation cannot continue, please try again!', mbInformation, MB_OK); - Result := False; - Exit; - end; - end; - end; Result := True; -end; \ No newline at end of file + Exec('cmd.exe', '/C sc.exe stop v2rayA', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); +end \ No newline at end of file diff --git a/install/windows-inno/windows_x86_64.iss b/install/windows-inno/windows_x86_64.iss index 3349e782..bd2a31e0 100644 --- a/install/windows-inno/windows_x86_64.iss +++ b/install/windows-inno/windows_x86_64.iss @@ -70,22 +70,10 @@ Type: files; Name: "{app}\v2rayA-service.err.log" Type: files; Name: "{app}\v2rayA-service.err.log.old" [Code] -function InitializeSetup(): Boolean; -var - ResultCode: integer; +function InitializeSetup() : Boolean; +var + ResultCode: Integer; begin - if FileExists('{dir}\v2rayA-service.exe') then - begin - if Exec(ExpandConstant('{sys}\sc.exe'), 'stop v2rayA', '', SW_HIDE, - ewWaitUntilTerminated, resultcode) then - begin - if (resultcode <> 0) then - begin - MsgBox('Failed to stop current v2rayA service, installation cannot continue, please try again!', mbInformation, MB_OK); - Result := False; - Exit; - end; - end; - end; Result := True; -end; \ No newline at end of file + Exec('cmd.exe', '/C sc.exe stop v2rayA', '', SW_HIDE, ewWaitUntilTerminated, ResultCode); +end \ No newline at end of file