Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.

Commit 709684d

Browse files
committed
Initialize CSV paths once
1 parent 3f475a6 commit 709684d

File tree

1 file changed

+11
-14
lines changed

1 file changed

+11
-14
lines changed

ElixirWeb.iss

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -83,17 +83,10 @@ var
8383
GlobalElixirReleases: array of TElixirRelease;
8484
GlobalErlangData: TErlangData;
8585
86-
CacheSelectedRelease: TElixirRelease;
86+
GlobalElixirCSVFilePath: String;
87+
GlobalErlangCSVFilePath: String;
8788
88-
function GetElixirCSVFilePath: String;
89-
begin
90-
Result := ExpandConstant('{tmp}\' + GetURLFilePart('{#ELIXIR_CSV_URL}'));
91-
end;
92-
93-
function GetErlangCSVFilePath: String;
94-
begin
95-
Result := ExpandConstant('{tmp}\' + GetURLFilePart('{#ERLANG_CSV_URL}'));
96-
end;
89+
CacheSelectedRelease: TElixirRelease;
9790
9891
procedure AppendErlangPathIfTaskSelected(Of64Bit: Boolean);
9992
begin
@@ -149,7 +142,7 @@ begin
149142
True, True
150143
);
151144
152-
GlobalElixirReleases := CSVToElixirReleases(GetElixirCSVFilePath);
145+
GlobalElixirReleases := CSVToElixirReleases(GlobalElixirCSVFilePath);
153146
ElixirReleasesToListBox(GlobalElixirReleases, GlobalPageSelRelease.CheckListBox);
154147
155148
with FindFirstReleaseOfType(GlobalElixirReleases, rtLatestRelease) do begin
@@ -163,18 +156,22 @@ begin
163156
'', 0, False, True, nil
164157
);
165158
166-
GlobalErlangData := CSVToErlangData(GetErlangCSVFilePath);
159+
GlobalErlangData := CSVToErlangData(GlobalErlangCSVFilePath);
167160
end;
168161
169162
function InitializeSetup(): Boolean;
170163
begin
171164
Result := True;
172-
if not idpDownloadFile('{#ELIXIR_CSV_URL}', GetElixirCSVFilePath) then begin
165+
166+
GlobalElixirCSVFilePath := ExpandConstant('{tmp}\' + GetURLFilePart('{#ELIXIR_CSV_URL}'));
167+
GlobalElixirCSVFilePath := ExpandConstant('{tmp}\' + GetURLFilePart('{#ERLANG_CSV_URL}'));
168+
169+
if not idpDownloadFile('{#ELIXIR_CSV_URL}', GlobalElixirCSVFilePath) then begin
173170
MsgBox('Error: Downloading {#ELIXIR_CSV_URL} failed. Setup cannot continue.', mbInformation, MB_OK);
174171
Result := False;
175172
exit;
176173
end;
177-
if not idpDownloadFile('{#ERLANG_CSV_URL}', GetErlangCSVFilePath) then begin
174+
if not idpDownloadFile('{#ERLANG_CSV_URL}', GlobalErlangCSVFilePath) then begin
178175
MsgBox('Error: Downloading {#ERLANG_CSV_URL} failed. Setup cannot continue.', mbInformation, MB_OK);
179176
Result := False;
180177
exit;

0 commit comments

Comments
 (0)