inno: fixed service path not in quotes issue. Added ResetNetworkDNS() method to reset network dns when uninstalling the dns server.

This commit is contained in:
Shreyas Zare
2022-11-12 15:35:25 +05:30
parent cf38013413
commit 5afc2cbbe1
2 changed files with 14 additions and 1 deletions

View File

@@ -104,6 +104,9 @@ procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep = usUninstall then //Step happens before processing uninstall log
begin
UninstallProgressForm.StatusLabel.Caption := 'Resetting Network DNS...';
ResetNetworkDNS(); //Reset Network DNS to default
UninstallProgressForm.StatusLabel.Caption := 'Stopping Tray App...';
KillTrayApp(); //Stop the tray app if running

View File

@@ -16,6 +16,16 @@ begin
TaskKill('{#TRAYAPP_FILENAME}');
end;
{
Resets Network DNS to default
}
procedure ResetNetworkDNS;
var
ResultCode: Integer;
begin
Exec(ExpandConstant('{app}\{#TRAYAPP_FILENAME}'), '--network-dns-default-exit', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
{
Stops the service
}
@@ -107,7 +117,7 @@ begin
Log('Service: Already installed, skip install service');
end else begin
Log('Service: Begin Install');
InstallSuccess := InstallService(ExpandConstant('{app}\DnsService.exe'), '{#SERVICE_NAME}', '{#SERVICE_DISPLAY_NAME}', '{#SERVICE_DESCRIPTION}', SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START);
InstallSuccess := InstallService(ExpandConstant('"{app}\DnsService.exe"'), '{#SERVICE_NAME}', '{#SERVICE_DISPLAY_NAME}', '{#SERVICE_DESCRIPTION}', SERVICE_WIN32_OWN_PROCESS, SERVICE_AUTO_START);
if not InstallSuccess then
begin
Log('Service: Install Fail ' + ServiceErrorToMessage(GetLastError()));