Package only imported DLLs and log firewall command output
This commit is contained in:
1 parent
a62540800b
commit
5f9cb86ff0
1 file changed
+3
-3
@@ -59,10 +59,10 @@ var
|
||||
ResultCode: Integer;
|
||||
begin
|
||||
Parameters := 'advfirewall firewall delete rule name="VibeChat (installer)" program=' + AddQuotes(ExpandConstant('{app}\vibechat.exe'));
|
||||
if not Exec(ExpandConstant('{sys}\netsh.exe'), Parameters, '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then
|
||||
if not ExecAndLogOutput(ExpandConstant('{sys}\netsh.exe'), Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode, nil) then
|
||||
Log(Format('WARNING: cannot run firewall rule removal: error=%d', [ResultCode]))
|
||||
else if ResultCode <> 0 then
|
||||
Log(Format('Firewall removal: rule absent or removal failed, exit=%d', [ResultCode]))
|
||||
Log(Format('WARNING: firewall rule removal returned exit=%d; see netsh output above', [ResultCode]))
|
||||
else
|
||||
Log('Firewall: previous VibeChat rule removed');
|
||||
end;
|
||||
@@ -78,7 +78,7 @@ begin
|
||||
RemoveFirewallRule;
|
||||
Parameters := 'advfirewall firewall add rule name="VibeChat (installer)" dir=in action=allow program=' +
|
||||
AddQuotes(ExpandConstant('{app}\vibechat.exe')) + ' enable=yes profile=any';
|
||||
if not Exec(ExpandConstant('{sys}\netsh.exe'), Parameters, '', SW_HIDE, ewWaitUntilTerminated, ResultCode) then begin
|
||||
if not ExecAndLogOutput(ExpandConstant('{sys}\netsh.exe'), Parameters, '', SW_SHOWNORMAL, ewWaitUntilTerminated, ResultCode, nil) then begin
|
||||
Log(Format('ERROR: cannot run firewall rule creation: error=%d', [ResultCode]));
|
||||
RaiseException(CustomMessage('FirewallFailed'));
|
||||
end;
|
||||
|
||||
Reference in new issue
Block a user