mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
inno-installer: fix stop service before installation
This commit is contained in:
1 parent
5b53f6260d
commit
cbace0dba3
2 files changed
+10
-34
No files matched your search
@@ -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;
|
||||
Exec('cmd.exe', '/C sc.exe stop v2rayA', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
|
||||
end
|
||||
@@ -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;
|
||||
Exec('cmd.exe', '/C sc.exe stop v2rayA', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
|
||||
end
|
||||
Reference in new issue
Block a user