diff --git a/DnsServerWindowsSetup/DnsServerSetup.iss b/DnsServerWindowsSetup/DnsServerSetup.iss index e0f1ba4f..78c24197 100644 --- a/DnsServerWindowsSetup/DnsServerSetup.iss +++ b/DnsServerWindowsSetup/DnsServerSetup.iss @@ -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 diff --git a/DnsServerWindowsSetup/appinstall.iss b/DnsServerWindowsSetup/appinstall.iss index b03847ac..64cab2b3 100644 --- a/DnsServerWindowsSetup/appinstall.iss +++ b/DnsServerWindowsSetup/appinstall.iss @@ -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()));