2021-01-17 17:16:47 +08:00
; Script generated by the Inno Setup Script Wizard.
2016-08-18 18:17:14 +08:00
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
;
; This script creates an installable FlightGear package for Win32 using the
; "Inno Setup" package builder. Inno Setup is free (but probably not open
; source?.) The official web site for this package building software is:
;
; http://www.jrsoftware.org/isinfo.php
;
2021-01-17 17:16:47 +08:00
; Note: Files root path is defined in the FgHarnessPath (in InstallConfig.iss)
;
; For example if You want to use X: drive as a root path
2016-08-18 18:17:14 +08:00
; You can do this with the command below:
;
; subst X: path_to_files
;
; For example:
;
; C:\> subst X: F:\Path\to\FlightGear\root
; C:\> subst X: F:\
2016-09-29 06:11:14 +08:00
;
2021-02-10 00:14:49 +08:00
; TRANSLATION NOTE:
; - external i18n files HAVE to be UTF-8 with BOM encoded. Otherwise the installer can
; not detect correct file encoding
2021-01-17 17:16:47 +08:00
;
; InstallConfig.iss example content:
;
; #define FGHarnessPath "x:"
; #define FGVersion "2020.4.1"
; #define FGVersionGroup "2020.4"
; #define OSGVersion "3.0.0"
; #define OSGSoNumber "2"
; #define OTSoNumber "3"
; #define FGDetails "-nightly"
; #define IncludeData "FALSE"
2021-02-22 05:26:28 +08:00
; #define IncludeWeb "FALSE"
2021-01-17 17:16:47 +08:00
;
; Uninstall procedure with --uninstall flag:
; executed by fgfs.exe (fg_init.cxx):
; - removes all under the FG_HOME directory
; - removes all from Download dir/Terrasync
; - removes all from Download dir/Aircraft
2016-08-18 18:17:14 +08:00
#include "InstallConfig.iss"
2021-01-17 17:24:46 +08:00
#include "FlightGear-i18n.iss"
2021-01-17 17:16:47 +08:00
#define FGSourcePath FgHarnessPath + "\flightgear"
#define InstallDir32 FgHarnessPath + "\install\msvc140"
#define InstallCompositor32 FgHarnessPath + "\install\msvc140\compositor"
2016-08-18 18:17:14 +08:00
#define OSGInstallDir InstallDir32 + "\OpenSceneGraph"
#define OSGPluginsDir OSGInstallDir + "\bin\osgPlugins-" + OSGVersion
2021-01-17 17:16:47 +08:00
#define InstallDir64 FgHarnessPath + "\install\msvc140-64"
#define InstallCompositor64 FgHarnessPath + "\install\msvc140-64\compositor"
2016-08-18 18:17:14 +08:00
#define OSG64InstallDir InstallDir64 + "\OpenSceneGraph"
#define OSG64PluginsDir OSG64InstallDir + "\bin\osgPlugins-" + OSGVersion
2021-01-17 17:16:47 +08:00
#define ThirdPartyDir FgHarnessPath + "\windows-3rd-party\msvc140"
2021-02-21 16:45:42 +08:00
#define DecompressDir FgHarnessPath + "\windows-3rd-party\decompress"
2016-08-18 18:17:14 +08:00
; we copy everything in install/<arch>/bin except these, which aren't
; useful to the end-user to ship
2020-05-25 04:12:24 +08:00
#define ExcludedBinaries "*smooth.exe,metar.exe"
2016-08-18 18:17:14 +08:00
2021-03-03 01:04:03 +08:00
; Exclude XCF files from FGData to keep the size down
2021-03-12 04:42:56 +08:00
#define FGDataExcludes "*.xcf,*.xcf.gz"
2021-03-03 01:04:03 +08:00
2021-01-17 17:24:46 +08:00
#include "FlightGear-files.iss"
2016-08-18 18:17:14 +08:00
[Setup]
2021-01-17 17:16:47 +08:00
AppId=FlightGear_{#FGVersionGroup}
2016-08-18 18:17:14 +08:00
AppName=FlightGear
AppPublisher=The FlightGear Team
OutputBaseFilename=FlightGear-{#FGVersion}{#FGDetails}
AppVerName=FlightGear v{#FGVersion}
2021-01-17 17:16:47 +08:00
AppVersion={#FGVersion}
2016-08-18 18:17:14 +08:00
AppPublisherURL=http://www.flightgear.org
AppSupportURL=http://www.flightgear.org
AppUpdatesURL=http://www.flightgear.org
2021-01-17 17:16:47 +08:00
DefaultDirName={pf}\FlightGear {#FGVersionGroup}
2021-04-11 15:25:36 +08:00
DirExistsWarning=auto
UsePreviousAppDir=yes
2021-01-17 17:16:47 +08:00
DefaultGroupName=FlightGear {#FGVersionGroup}
2016-08-18 18:17:14 +08:00
UsePreviousGroup=no
2021-01-17 17:16:47 +08:00
LicenseFile={#FGSourcePath}\COPYING
2016-08-18 18:17:14 +08:00
Uninstallable=yes
2021-01-17 17:24:46 +08:00
SetupIconFile={#FgHarnessPath}\windows\flightgear.ico
2016-08-18 18:17:14 +08:00
VersionInfoVersion={#FGVersion}.0
2021-01-17 17:24:46 +08:00
WizardImageFile={#FgHarnessPath}\windows\setupimg.bmp
2016-08-18 18:17:14 +08:00
WizardImageStretch=No
2021-01-17 17:24:46 +08:00
WizardSmallImageFile={#FgHarnessPath}\windows\setupsmall.bmp
2016-08-18 18:17:14 +08:00
VersionInfoCompany=The FlightGear Team
UninstallDisplayIcon={app}\bin\fgfs.exe
ArchitecturesInstallIn64BitMode=x64
ArchitecturesAllowed=x86 x64
; Sign tool must be defined in the Inno Setup GUI, to avoid
; exposing the certificate password
2017-10-02 19:36:40 +08:00
; SignTool=fg_code_sign1
2016-08-18 18:17:14 +08:00
[Tasks]
2021-01-17 17:42:27 +08:00
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:CreateDesktopIconGroup}"
2016-08-18 18:17:14 +08:00
2021-01-17 17:16:47 +08:00
[Languages]
2021-02-10 00:14:49 +08:00
Name: "en"; MessagesFile: "compiler:Default.isl"; InfoBeforeFile: "{#FgHarnessPath}\windows\info-before-en.txt"
Name: "pl"; MessagesFile: "compiler:Languages\Polish.isl"; InfoBeforeFile: "{#FgHarnessPath}\windows\info-before-pl.txt"
2021-01-17 17:24:46 +08:00
Name: "es"; MessagesFile: "compiler:Languages\Spanish.isl";
Name: "nl"; MessagesFile: "compiler:Languages\Dutch.isl";
Name: "de"; MessagesFile: "compiler:Languages\German.isl";
2021-02-11 23:23:35 +08:00
Name: "fr"; MessagesFile: "compiler:Languages\French.isl";
2021-01-17 17:16:47 +08:00
2016-08-18 18:17:14 +08:00
[Dirs]
; Make the user installable scenery directory
2021-01-17 17:24:46 +08:00
Name: "{%USERPROFILE}\FlightGear\Downloads"; Permissions: creatorowner-modify; Check: not DirExists(ExpandConstant('{%USERPROFILE}\FlightGear\Downloads'))
Name: "{%USERPROFILE}\FlightGear\Custom Aircraft"; Permissions: creatorowner-modify; Check: not DirExists(ExpandConstant('{%USERPROFILE}\FlightGear\Custom Aircraft'))
Name: "{%USERPROFILE}\FlightGear\Custom Scenery"; Permissions: creatorowner-modify; Check: not DirExists(ExpandConstant('{%USERPROFILE}\FlightGear\Custom Scenery'))
2016-08-18 18:17:14 +08:00
[Icons]
2021-01-17 17:16:47 +08:00
Name: "{userdesktop}\FlightGear {#FGVersionGroup}"; Filename: "{app}\bin\fgfs.exe"; Parameters: "--launcher"; WorkingDir: "{app}\bin"; Tasks: desktopicon;
Name: "{group}\FlightGear {#FGVersionGroup}"; Filename: "{app}\bin\fgfs.exe"; Parameters: "--launcher"; WorkingDir: "{app}\bin";
Name: "{group}\FlightGear {#FGVersionGroup} - Compositor"; Filename: "{app}\bin\fgfs-compositor.exe"; Parameters: "--launcher"; WorkingDir: "{app}\bin";
2021-04-11 08:36:18 +08:00
Name: "{group}\FlightGear Manual"; Filename: "http://flightgear.sourceforge.net/manual/{#FGVersionGroup}/"
2016-08-18 18:17:14 +08:00
Name: "{group}\Flightgear Wiki"; Filename: "http://wiki.flightgear.org"
Name: "{group}\Tools\Uninstall FlightGear"; Filename: "{uninstallexe}"
Name: "{group}\Tools\fgjs"; Filename: "cmd"; Parameters: "/k fgjs.exe ""--fg-root={app}\data"""; WorkingDir: "{app}\bin"
Name: "{group}\Tools\yasim"; Filename: "cmd"; Parameters: "/k ""{app}\bin\yasim.exe"" -h"; WorkingDir: "{app}\bin"
Name: "{group}\Tools\fgpanel"; Filename: "cmd"; Parameters: "/k ""{app}\bin\fgpanel.exe"" -h"; WorkingDir: "{app}\bin"
Name: "{group}\Tools\FGCom"; Filename: "{app}\bin\fgcom.exe"; WorkingDir: "{app}\bin"
Name: "{group}\Tools\FGCom-testing"; Filename: "{app}\bin\fgcom.exe"; Parameters: "--frequency=910"; WorkingDir: "{app}\bin"
Name: "{group}\Tools\Explore Documentation Folder"; Filename: "{app}\data\Docs"
[Code]
const
NET_FW_SCOPE_ALL = 0;
NET_FW_IP_VERSION_ANY = 2;
NET_FW_ACTION_ALLOW = 1;
NET_FW_RULE_DIR_ALL = 0;
NET_FW_RULE_DIR_IN = 1;
NET_FW_RULE_DIR_OUT = 2;
NET_FW_IP_PROTOCOL_ALL = 0;
NET_FW_IP_PROTOCOL_TCP = 6;
NET_FW_IP_PROTOCOL_UDP = 17;
NET_FW_PROFILE2_DOMAIN = 1;
NET_FW_PROFILE2_PRIVATE = 2;
NET_FW_PROFILE2_PUBLIC = 4;
2021-02-21 16:45:42 +08:00
var
UninstallCheckCleanPage: TNewNotebookPage;
UninstallBackButton: TNewButton;
UninstallNextButton: TNewButton;
DoCleanCheckbox : TNewCheckBox;
CleanHelp : TNewStaticText;
DownloadPage: TDownloadWizardPage;
2021-02-22 05:26:28 +08:00
DownloadPageId: Integer;
2021-02-21 16:45:42 +08:00
ExtractDownload: TOutputProgressWizardPage;
ResultCode: Integer;
function OnDownloadProgress(const Url, FileName: String; const Progress, ProgressMax: Int64): Boolean;
begin
if Progress = ProgressMax then
Log(Format('Successfully downloaded file to {tmp}: %s', [FileName]));
Result := True;
end;
procedure InitializeWizard;
begin
DownloadPage := CreateDownloadPage(SetupMessage(msgWizardPreparing), SetupMessage(msgPreparingDesc), @OnDownloadProgress);
2021-02-22 05:26:28 +08:00
DownloadPageId := DownloadPage.ID;
2021-02-21 16:45:42 +08:00
ExtractDownload := CreateOutputProgressPage(ExpandConstant('{cm:ExtractingDownloadContentTitle}'), ExpandConstant('{cm:ExtractingDownloadContentMessage}'));
end;
2016-08-18 18:17:14 +08:00
procedure URLLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://www.flightgear.org', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
procedure CreateURLLabel(ParentForm: TSetupForm; CancelButton: TNewButton);
var
URLLabel: TNewStaticText;
begin
URLLabel := TNewStaticText.Create(ParentForm);
URLLabel.Caption := 'www.flightgear.org';
URLLabel.Cursor := crHand;
URLLabel.OnClick := @URLLabelOnClick;
URLLabel.Parent := ParentForm;
{ Alter Font *after* setting Parent so the correct defaults are inherited first }
URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
URLLabel.Font.Color := clBlue;
URLLabel.Top := CancelButton.Top + CancelButton.Height - URLLabel.Height - 2;
URLLabel.Left := ScaleX(20);
end;
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
var
S: String;
begin
S := '';
S := S + MemoDirInfo + NewLine + NewLine;
S := S + MemoGroupInfo + NewLine + NewLine;
S := S + MemoTasksInfo + NewLine + NewLine;
Result := S;
end;
procedure AddBasicFirewallException(AppName, FileName: String);
var
FirewallObject: variant;
RuleObject: variant;
begin
try
FirewallObject := CreateOleObject('HNetCfg.FwMgr');
RuleObject := CreateOleObject('HNetCfg.FwAuthorizedApplication');
RuleObject.ProcessImageFileName := FileName;
RuleObject.Name := AppName;
RuleObject.Scope := NET_FW_SCOPE_ALL;
RuleObject.IpVersion := NET_FW_IP_VERSION_ANY;
RuleObject.Enabled := true;
FirewallObject.LocalPolicy.CurrentProfile.AuthorizedApplications.Add(RuleObject);
except
end;
end;
procedure AddAdvancedFirewallException(AppName, AppDescription, FileName: String; Protocol: Integer; LocalPorts, RemotePorts: String; Direction: Integer);
var
FirewallObject: variant;
RuleObject: variant;
begin
try
FirewallObject := CreateOleObject('HNetCfg.FwPolicy2');
RuleObject := CreateOleObject('HNetCfg.FWRule');
RuleObject.Name := AppName;
RuleObject.Description := AppDescription;
RuleObject.ApplicationName := FileName;
if (Protocol <> NET_FW_IP_PROTOCOL_ALL) then
RuleObject.Protocol := Protocol;
if (LocalPorts <> '') then
RuleObject.LocalPorts := LocalPorts;
if (RemotePorts <> '') then
RuleObject.RemotePorts := RemotePorts;
if (Direction <> NET_FW_RULE_DIR_ALL) then
RuleObject.Direction := Direction;
RuleObject.Enabled := true;
RuleObject.Grouping := 'FlightGear';
RuleObject.Profiles := NET_FW_PROFILE2_DOMAIN + NET_FW_PROFILE2_PRIVATE + NET_FW_PROFILE2_PUBLIC;
RuleObject.Action := NET_FW_ACTION_ALLOW;
RuleObject.RemoteAddresses := '*';
FirewallObject.Rules.Add(RuleObject);
except
end;
end;
procedure RemoveFirewallException(AppName, FileName: String);
var
FirewallObject: variant;
Version: TWindowsVersion;
begin
GetWindowsVersionEx(Version);
try
if (Version.Major >= 6) then
begin
FirewallObject := CreateOleObject('HNetCfg.FwPolicy2');
FirewallObject.Rules.Remove(AppName);
end
else if (Version.Major = 5) and (((Version.Minor = 1) and (Version.ServicePackMajor >= 2)) or ((Version.Minor = 2) and (Version.ServicePackMajor >= 1))) then
begin
FirewallObject := CreateOleObject('HNetCfg.FwMgr');
FirewallObject.LocalPolicy.CurrentProfile.AuthorizedApplications.Remove(FileName);
end;
except
end;
end;
2021-02-22 05:26:28 +08:00
function ShouldSkipPage(PageID: Integer): Boolean;
begin;
if (PageID = DownloadPageId) then
begin
if (ExpandConstant('{#IncludeWeb}') = 'FALSE') then begin
Result := True;
end else begin
Result := False;
end
end
else
begin
Result := False;
end;
end;
2021-02-21 16:45:42 +08:00
function NextButtonClick(CurPageID: Integer): Boolean;
2018-01-18 05:48:21 +08:00
var
2021-02-21 16:45:42 +08:00
fgDataInstalled: Cardinal;
2021-02-22 05:26:28 +08:00
diskFreeMB, diskTotalMB: Cardinal;
2021-02-21 16:45:42 +08:00
begin
2021-02-22 05:26:28 +08:00
if CurPageID = wpSelectDir then begin
// check disk free space - installationFolder
if GetSpaceOnDisk(ExpandConstant('{app}'), True, diskFreeMB, diskTotalMB) then
begin
if diskFreeMB < 6000 then begin
MsgBox(ExpandConstant('{cm:NotEnoughSpaceOnInstallationDisk}'), mbError, MB_OK);
Result := False;
end
else begin
Result := True;
end;
end;
// check disk free space - tempFolder
if GetSpaceOnDisk(ExpandConstant('{tmp}'), True, diskFreeMB, diskTotalMB) then
begin
if diskFreeMB < 6000 then begin
MsgBox(ExpandConstant('{cm:NotEnoughSpaceOnTemporaryDisk}'), mbError, MB_OK);
Result := False;
end
else begin
Result := True;
end;
end;
// if cannot determine disk size, defaults to move on
if diskFreeMB = 0 then begin
Result := True;
end;
end
else if CurPageID = wpReady then begin
2021-02-21 16:45:42 +08:00
DownloadPage.Clear;
fgDataInstalled := 0;
// checking registry entry, if fgdata was installed
if RegKeyExists(HKEY_LOCAL_MACHINE, ExpandConstant('Software\FlightGear\{#FGVersionGroup}')) then
begin
if RegQueryDWordValue(HKEY_LOCAL_MACHINE, ExpandConstant('Software\FlightGear\{#FGVersionGroup}'), 'fgdata-installed', fgDataInstalled) then
begin
Log('Previous fgdata installed. Downloading delta package');
end;
end;
// selecting fgdata installation packages
if (fgDataInstalled = 1) then
2021-04-12 19:50:52 +08:00
begin
DownloadPage.Add('https://sourceforge.net/projects/flightgear/files/release-{#FGVersionGroup}/FlightGear-{#FGVersion}-update-data.txz/download', 'fgdata-downloaded.txz', '');
2021-02-21 16:45:42 +08:00
end
else
begin
2021-04-12 19:50:52 +08:00
DownloadPage.Add('https://sourceforge.net/projects/flightgear/files/release-{#FGVersionGroup}/FlightGear-{#FGVersion}-data.txz/download', 'fgdata-downloaded.txz', '');
2021-02-21 16:45:42 +08:00
end;
DownloadPage.Show;
try
try
DownloadPage.Download;
// show extract progress page
try
ExtractDownload.Show;
2021-04-11 08:36:18 +08:00
ExtractDownload.SetText(ExpandConstant('{cm:ExtractingDownloadedFile}'), 'fgdata-downloaded.txz');
ExtractTemporaryFile('xz.exe');
ExtractTemporaryFile('liblzma.dll');
if Exec(ExpandConstant('{tmp}\xz.exe'), ExpandConstant('-d "{tmp}\fgdata-downloaded.txz"'), ExpandConstant('{tmp}'), SW_HIDE, ewWaitUntilTerminated, ResultCode) then
2021-02-21 16:45:42 +08:00
begin
2021-04-11 08:36:18 +08:00
Log(Format('Successfully expanded file: %s', [ExpandConstant('{tmp}\fgdata-downloaded.txz')]));
2021-02-21 16:45:42 +08:00
ExtractDownload.SetText(ExpandConstant('{cm:UntarringDownloadedFile}'), ExpandConstant('fgdata-downloaded.tar'));
ExtractTemporaryFile('tar.exe');
ExtractTemporaryFile('libiconv-2.dll');
ExtractTemporaryFile('libintl-2.dll');
CreateDir(ExpandConstant('{tmp}\fgdata-extracted'));
if Exec(ExpandConstant('{tmp}\tar.exe'), ExpandConstant('-xf fgdata-downloaded.tar -C fgdata-extracted'), ExpandConstant('{tmp}'), SW_HIDE, ewWaitUntilTerminated, ResultCode) then
begin
Log(Format('Successfully untarred file: %s', [ExpandConstant('{tmp}\fgdata-downloaded.tar')]));
end
else begin
Log(Format('ERROR untarring file: %s', [ExpandConstant('{tmp}\fgdata-downloaded.tar')]));
end;
end
else begin
2021-04-11 08:36:18 +08:00
Log(Format('ERROR expanding file: %s', [ExpandConstant('{tmp}\fgdata-downloaded.txz')]));
2021-02-21 16:45:42 +08:00
end;
finally
ExtractDownload.Hide;
end;
Result := True;
except
// FIXME - available in IS 6.1.3-dev
//if DownloadPage.AbortedByUser then
// Log('Aborted by user.')
//else
2021-02-22 05:26:28 +08:00
SuppressibleMsgBox(Format(ExpandConstant('{cm:ErrorDownloadingFile}'), [AddPeriod(GetExceptionMessage)]), mbCriticalError, MB_OK, IDOK);
2021-02-21 16:45:42 +08:00
Result := False;
end;
finally
DownloadPage.Hide;
end;
end
else
Result := True;
end;
2018-01-18 05:48:21 +08:00
procedure InitializeUninstallProgressForm();
begin
UninstallCheckCleanPage := TNewNotebookPage.Create(UninstallProgressForm);
UninstallCheckCleanPage.Notebook := UninstallProgressForm.InnerNotebook;
UninstallCheckCleanPage.Parent := UninstallProgressForm.InnerNotebook;
UninstallCheckCleanPage.Align := alClient
DoCleanCheckbox := TNewCheckBox.Create(UninstallProgressForm);
DoCleanCheckbox.Parent := UninstallCheckCleanPage;
2021-01-17 17:16:47 +08:00
DoCleanCheckbox.Caption := ExpandConstant('{cm:RemoveAllSettings}');
2018-01-18 05:48:21 +08:00
DoCleanCheckbox.Left := ScaleX(10);
DoCleanCheckbox.Top := ScaleY(10);
DoCleanCheckbox.Width := UninstallProgressForm.InnerNotebook.Width - ScaleX(20)
DoCleanCheckbox.Height := ScaleY(30)
CleanHelp := TNewStaticText.Create(UninstallProgressForm);
CleanHelp.Parent := UninstallCheckCleanPage;
CleanHelp.Top := DoCleanCheckbox.Top + DoCleanCheckbox.Height + ScaleY(10);
CleanHelp.Left := DoCleanCheckbox.Left;
CleanHelp.Width := DoCleanCheckbox.Width;
CleanHelp.Height := CleanHelp.AdjustHeight();
CleanHelp.WordWrap := True;
2021-01-17 17:16:47 +08:00
CleanHelp.Caption := ExpandConstant('{cm:RemoveAllSettingsDescription}');
2018-01-18 05:48:21 +08:00
UninstallProgressForm.InnerNotebook.ActivePage := UninstallCheckCleanPage;
UninstallNextButton := TNewButton.Create(UninstallProgressForm);
UninstallNextButton.Caption := 'Next';
UninstallNextButton.Parent := UninstallProgressForm;
UninstallNextButton.Left :=
UninstallProgressForm.CancelButton.Left -
UninstallProgressForm.CancelButton.Width -
ScaleX(10);
UninstallNextButton.Top := UninstallProgressForm.CancelButton.Top;
UninstallNextButton.Width := UninstallProgressForm.CancelButton.Width;
UninstallNextButton.Height := UninstallProgressForm.CancelButton.Height;
UninstallNextButton.ModalResult := mrOk;
UninstallProgressForm.CancelButton.Enabled := True;
UninstallProgressForm.CancelButton.ModalResult := mrCancel;
if UninstallProgressForm.ShowModal = mrCancel then Abort;
UninstallProgressForm.InnerNotebook.ActivePage := UninstallProgressForm.InstallingPage;
end;
2016-08-18 18:17:14 +08:00
procedure CurStepChanged(CurStep: TSetupStep);
var
Version: TWindowsVersion;
begin
if CurStep = ssPostInstall then
begin
2021-02-21 16:45:42 +08:00
// firewall rules
2016-08-18 18:17:14 +08:00
GetWindowsVersionEx(Version);
if (Version.Major >= 6) then
begin
{ IN and OUT rules must be specified separately, otherwise the firewall will create only the IN rule }
2021-01-17 17:16:47 +08:00
AddAdvancedFirewallException('FlightGear', ExpandConstant('{cm:FirewallFgException}'), ExpandConstant('{app}') + '\bin\fgfs.exe', NET_FW_IP_PROTOCOL_ALL, '', '', NET_FW_RULE_DIR_IN);
AddAdvancedFirewallException('FlightGear', ExpandConstant('{cm:FirewallFgException}'), ExpandConstant('{app}') + '\bin\fgfs.exe', NET_FW_IP_PROTOCOL_ALL, '', '', NET_FW_RULE_DIR_OUT);
AddAdvancedFirewallException('FlightGear FGCom', ExpandConstant('{cm:FirewallFgcomException}'), ExpandConstant('{app}') + '\bin\fgcom.exe', NET_FW_IP_PROTOCOL_ALL, '', '', NET_FW_RULE_DIR_IN);
AddAdvancedFirewallException('FlightGear FGCom', ExpandConstant('{cm:FirewallFgcomException}'), ExpandConstant('{app}') + '\bin\fgcom.exe', NET_FW_IP_PROTOCOL_ALL, '', '', NET_FW_RULE_DIR_OUT);
2016-08-18 18:17:14 +08:00
end
else if (Version.Major = 5) and (((Version.Minor = 1) and (Version.ServicePackMajor >= 2)) or ((Version.Minor = 2) and (Version.ServicePackMajor >= 1))) then
begin
{ The Windows XP/Server 2003 firewall does not block outgoing connections at all, so only listening processes should be added }
AddBasicFirewallException('FlightGear', ExpandConstant('{app}') + '\bin\fgfs.exe');
AddBasicFirewallException('FlightGear FGCom', ExpandConstant('{app}') + '\bin\fgcom.exe');
end;
2021-02-21 16:45:42 +08:00
// registry entries
RegWriteDWordValue(HKEY_LOCAL_MACHINE, ExpandConstant('Software\FlightGear\{#FGVersionGroup}'), 'fgdata-installed', 1);
2016-08-18 18:17:14 +08:00
end;
end;
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
2018-01-18 05:48:21 +08:00
var ResultCode: Integer;
2016-08-18 18:17:14 +08:00
begin
2018-01-18 05:48:21 +08:00
if CurUninstallStep = usUninstall then
begin
if DoCleanCheckbox.Checked = True then
begin
Log('Running clean uninstall');
Exec(ExpandConstant('{app}\bin\fgfs.exe'), '--uninstall', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
Log('clean uninstall completed');
end;
end;
2016-08-18 18:17:14 +08:00
if CurUninstallStep = usPostUninstall then
begin
RemoveFirewallException('FlightGear', ExpandConstant('{app}') + '\bin\fgfs.exe');
RemoveFirewallException('FlightGear FGCom', ExpandConstant('{app}') + '\bin\fgcom.exe');
2021-02-21 16:45:42 +08:00
// registry entries
RegDeleteValue(HKEY_LOCAL_MACHINE, ExpandConstant('Software\FlightGear\{#FGVersionGroup}'), 'fgdata-installed');
2016-08-18 18:17:14 +08:00
end;
end;