Skip to content

Commit 80736d0

Browse files
authored
0166 - Added download + install of the missing Eurostile font.
* Added download + install of the missing Eurostile font. * Fixed naming in the installer.
1 parent a673d47 commit 80736d0

File tree

1 file changed

+49
-3
lines changed

1 file changed

+49
-3
lines changed

Installer/EdScoutInstaller.iss

Lines changed: 49 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,13 @@
33
; Start Menu instead of in a subfolder, and also creates a desktop icon.
44

55
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING .ISS SCRIPT FILES!
6-
#define Version GetFileVersion('dist-singlefile\EdScout.exe')
6+
#define Version GetVersionNumbersString('dist-singlefile\EdScout.exe')
7+
#define FullVersion GetStringFileInfo('dist-singlefile\EDScout.exe', 'ProductVersion')
78

89
[Setup]
910
AppId={{2C9BD960-4759-4484-80D2-70047F48AAC4}
1011
AppName=Elite Dangerous Scout
11-
AppVersion=LoadStringFromFile('version.txt', ANSIStr)
12+
AppVersion={#FullVersion}
1213
WizardStyle=modern
1314
DefaultDirName={autopf}\EDScout
1415
; Since no icons will be created in "{group}", we don't need the wizard
@@ -24,11 +25,56 @@ SetupIconFile=..\EDScoutWebUI\static\favicon.ico
2425

2526
[Files]
2627
Source: "dist-singlefile\EDScout.exe"; DestDir: "{app}"
27-
; Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
28+
Source: "{tmp}\eurostile.TTF"; DestDir: "{autofonts}"; FontInstall: "Eurostile"; Flags: onlyifdoesntexist uninsneveruninstall external
2829

2930
[Icons]
3031
Name: "{autoprograms}\EDScout"; Filename: "{app}\EDScout.exe"
3132
Name: "{autodesktop}\EDScout"; Filename: "{app}\EDScout.exe"
3233

3334
[Run]
3435
Filename: {app}\EDScout.exe; Description: Run EDScout now; Flags: postinstall nowait skipifsilent
36+
37+
[Code]
38+
const
39+
SHCONTCH_NOPROGRESSBOX = 4;
40+
SHCONTCH_RESPONDYESTOALL = 16;
41+
42+
procedure dw(ZipPath, TargetPath: string);
43+
var
44+
Shell: Variant;
45+
ZipFile: Variant;
46+
TargetFolder: Variant;
47+
begin
48+
Shell := CreateOleObject('Shell.Application');
49+
50+
ZipFile := Shell.NameSpace(ZipPath);
51+
if VarIsClear(ZipFile) then
52+
RaiseException(Format('ZIP file "%s" does not exist or cannot be opened', [ZipPath]));
53+
54+
TargetFolder := Shell.NameSpace(TargetPath);
55+
if VarIsClear(TargetFolder) then
56+
RaiseException(Format('Target path "%s" does not exist', [TargetPath]));
57+
58+
TargetFolder.CopyHere(ZipFile.Items, SHCONTCH_NOPROGRESSBOX or SHCONTCH_RESPONDYESTOALL);
59+
end;
60+
61+
function OnDownloadProgress(const Url, Filename: string; const Progress, ProgressMax: Int64): Boolean;
62+
begin
63+
if ProgressMax <> 0 then
64+
Log(Format(' %d of %d bytes done.', [Progress, ProgressMax]))
65+
else
66+
Log(Format(' %d bytes done.', [Progress]));
67+
Result := True;
68+
end;
69+
70+
function InitializeSetup: Boolean;
71+
begin
72+
try
73+
DownloadTemporaryFile('https://www.cufonfonts.com/download/rf/eurostile', 'eurostile-cufonfonts.zip', '', @OnDownloadProgress);
74+
dw(ExpandConstant('{tmp}')+'\eurostile-cufonfonts.zip', ExpandConstant('{tmp}'));
75+
Result := True;
76+
except
77+
Log(GetExceptionMessage);
78+
Result := False;
79+
end;
80+
end;

0 commit comments

Comments
 (0)