DnsServerSetup.iss 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. ; Script generated by the Inno Setup Script Wizard.
  2. ; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
  3. #define MyAppName "Technitium DNS Server"
  4. #define MyAppVersion "8.1"
  5. #define MyAppPublisher "Technitium"
  6. #define MyAppURL "https://technitium.com/dns/"
  7. #define MyAppExeName "DnsServerSystemTrayApp.exe"
  8. [Setup]
  9. ; NOTE: The value of AppId uniquely identifies this application. Do not use the same AppId value in installers for other applications.
  10. ; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
  11. AppId={{1052DB5E-35BD-4F67-89CD-1F45A1688E77}
  12. AppName={#MyAppName}
  13. AppVersion={#MyAppVersion}
  14. ;AppVerName={#MyAppName} {#MyAppVersion}
  15. AppPublisher={#MyAppPublisher}
  16. AppPublisherURL={#MyAppURL}
  17. AppSupportURL={#MyAppURL}
  18. AppUpdatesURL={#MyAppURL}
  19. VersionInfoVersion=2.0.0.0
  20. VersionInfoCopyright="Copyright (C) 2022 Technitium"
  21. DefaultDirName={commonpf32}\Technitium\DNS Server
  22. DefaultGroupName={#MyAppName}
  23. DisableProgramGroupPage=yes
  24. PrivilegesRequired=admin
  25. OutputDir=.\Release
  26. OutputBaseFilename=DnsServerSetup
  27. SetupIconFile=.\logo.ico
  28. WizardSmallImageFile=.\logo.bmp
  29. Compression=lzma
  30. SolidCompression=yes
  31. WizardStyle=modern
  32. UninstallDisplayIcon={app}\{#MyAppExeName}
  33. [Languages]
  34. Name: "english"; MessagesFile: "compiler:Default.isl"
  35. [Tasks]
  36. Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
  37. [Files]
  38. Source: ".\publish\{#MyAppExeName}"; DestDir: "{app}"; Flags: ignoreversion
  39. Source: ".\publish\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
  40. ; NOTE: Don't use "Flags: ignoreversion" on any shared system files
  41. [Icons]
  42. Name: "{group}\DNS Server App"; Filename: "{app}\{#MyAppExeName}"
  43. Name: "{group}\Dashboard"; Filename: "http://localhost:5380/"
  44. Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
  45. Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
  46. Name: "{autodesktop}\DNS Server App"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
  47. [Run]
  48. Filename: "{app}\{#MyAppExeName}"; Parameters: "--first-run"; Description: "{cm:LaunchProgram,{#StringChange("DNS Server App", '&', '&&')}}"; Flags: nowait postinstall skipifsilent runascurrentuser
  49. #include "helper.iss"
  50. #include "legacy.iss"
  51. #include "dotnet.iss"
  52. #include "appinstall.iss"
  53. [Code]
  54. {
  55. Skips the tasks page if it is an upgrade install
  56. }
  57. function ShouldSkipPage(PageID: Integer): Boolean;
  58. begin
  59. Result := ((PageID = wpSelectTasks) or (PageID = wpSelectDir)) and (IsLegacyInstallerInstalled or IsUpgrade);
  60. end;
  61. function InitializeSetup: Boolean;
  62. begin
  63. CheckDotnetDependency;
  64. Result := true;
  65. end;
  66. procedure CurStepChanged(CurStep: TSetupStep);
  67. begin
  68. if CurStep = ssInstall then begin //Step happens just before installing files
  69. WizardForm.StatusLabel.Caption := 'Stopping Tray App...';
  70. KillTrayApp(); //Stop the tray app if running
  71. if IsLegacyInstallerInstalled then
  72. begin
  73. WizardForm.StatusLabel.Caption := 'Stopping Service...';
  74. DoStopService(); //Stop the service if running
  75. WizardForm.StatusLabel.Caption := 'Removing Legacy Installer...';
  76. UninstallLegacyInstaller(); //Uninstall Legacy Installer if Installed already
  77. end else
  78. begin
  79. WizardForm.StatusLabel.Caption := 'Uninstalling Service...';
  80. DoRemoveService(); //Stop and remove the service if installed
  81. end;
  82. end;
  83. if CurStep = ssPostInstall then begin //Step happens just after installing files
  84. WizardForm.StatusLabel.Caption := 'Installing Service...';
  85. DoInstallService(); //Install service after all files installed, if not a portable install
  86. end;
  87. end;
  88. procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
  89. begin
  90. if CurUninstallStep = usUninstall then //Step happens before processing uninstall log
  91. begin
  92. UninstallProgressForm.StatusLabel.Caption := 'Stopping Tray App...';
  93. KillTrayApp(); //Stop the tray app if running
  94. UninstallProgressForm.StatusLabel.Caption := 'Uninstalling Service...';
  95. DoRemoveService(); //Stop and remove the service
  96. end;
  97. end;