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

Commit 9a454da

Browse files
committed
Generalized version string
1 parent 49a40b5 commit 9a454da

File tree

1 file changed

+23
-4
lines changed

1 file changed

+23
-4
lines changed

ElixirWeb.iss

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ WizardImageBackColor=clWhite
2828
Uninstallable=no
2929

3030
[CustomMessages]
31-
NameAndVersion=the latest version of %1
31+
NameAndVersion=%1
3232

3333
[Files]
3434
; Zip extraction helper
@@ -50,7 +50,7 @@ Source: "compiler:SetupLdr.e32"; DestDir: "{tmp}\_offlineinstaller"; Flags: dele
5050

5151
[Run]
5252
Filename: "powershell.exe"; Parameters: "-File {tmp}\extract-zip.ps1 {tmp}\Precompiled.zip {tmp}\_offlineinstaller\elixir"; Flags: waituntilterminated runhidden; StatusMsg: "Extracting precompiled package..."
53-
Filename: "{tmp}\_offlineinstaller\ISCC.exe"; Parameters: "/dElixirVersion=0.14.1 /dSkipPages /dNoCompression Elixir.iss"; WorkingDir: "{tmp}\_offlineinstaller"; Flags: waituntilterminated runhidden; StatusMsg: "Preparing Elixir installer..."
53+
Filename: "{tmp}\_offlineinstaller\ISCC.exe"; Parameters: "/dElixirVersion={code:GetSelectedReleaseVersion} /dSkipPages /dNoCompression Elixir.iss"; WorkingDir: "{tmp}\_offlineinstaller"; Flags: waituntilterminated runhidden; StatusMsg: "Preparing Elixir installer..."
5454
Filename: "{tmp}\_offlineinstaller\Output\elixir-v0.14.1-setup.exe"; Flags: waituntilterminated; StatusMsg: "Running Elixir installer..."
5555

5656
[Code]
@@ -136,6 +136,22 @@ begin
136136
end;
137137
end;
138138
139+
function GetSelectedRelease(): TElixirRelease;
140+
var
141+
i: Integer;
142+
begin
143+
for i := 0 to GetArrayLength(ElixirReleases) - 1 do begin
144+
if PSelectVerListBox.Checked[i] then begin
145+
Result := ElixirReleases[i];
146+
end;
147+
end;
148+
end;
149+
150+
function GetSelectedReleaseVersion(Param: String): String;
151+
begin
152+
Result := GetSelectedRelease().Version;
153+
end;
154+
139155
procedure CurPageChanged(CurPageID: Integer);
140156
begin
141157
if CurPageID = PSelectVerPage.ID then begin
@@ -147,6 +163,11 @@ begin
147163
ReleasesProcessed := True;
148164
end;
149165
end;
166+
167+
if CurPageID = wpReady then begin
168+
idpAddFile(GetSelectedRelease().URL, ExpandConstant('{tmp}\Precompiled.zip'));
169+
idpDownloadAfter(wpPreparing);
170+
end;
150171
end;
151172
152173
procedure CreatePages();
@@ -170,8 +191,6 @@ procedure InitializeWizard();
170191
begin
171192
ReleasesProcessed := False;
172193
CreatePages;
173-
idpAddFile('https://github.com/elixir-lang/elixir/releases/download/v0.14.1/Precompiled.zip', ExpandConstant('{tmp}\Precompiled.zip'));
174-
idpDownloadAfter(wpPreparing);
175194
end;
176195
177196
function PrepareToInstall(var NeedsRestart: Boolean): String;

0 commit comments

Comments
 (0)