mirror of
https://github.com/fergalmoran/DnsServer.git
synced 2026-05-23 19:46:06 +00:00
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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()));
|
||||
|
||||
Reference in New Issue
Block a user