Browse Source

Package only imported DLLs and log firewall command output

master
evgeny 6 days ago
parent
commit
5f9cb86ff0
  1. 6
      tools/chatgui/installer/vibechat.iss

6
tools/chatgui/installer/vibechat.iss

@ -59,10 +59,10 @@ var
ResultCode: Integer; ResultCode: Integer;
begin begin
Parameters := 'advfirewall firewall delete rule name="VibeChat (installer)" program=' + AddQuotes(ExpandConstant('{app}\vibechat.exe')); 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])) Log(Format('WARNING: cannot run firewall rule removal: error=%d', [ResultCode]))
else if ResultCode <> 0 then 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 else
Log('Firewall: previous VibeChat rule removed'); Log('Firewall: previous VibeChat rule removed');
end; end;
@ -78,7 +78,7 @@ begin
RemoveFirewallRule; RemoveFirewallRule;
Parameters := 'advfirewall firewall add rule name="VibeChat (installer)" dir=in action=allow program=' + Parameters := 'advfirewall firewall add rule name="VibeChat (installer)" dir=in action=allow program=' +
AddQuotes(ExpandConstant('{app}\vibechat.exe')) + ' enable=yes profile=any'; 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])); Log(Format('ERROR: cannot run firewall rule creation: error=%d', [ResultCode]));
RaiseException(CustomMessage('FirewallFailed')); RaiseException(CustomMessage('FirewallFailed'));
end; end;

Loading…
Cancel
Save