@@ -28,7 +28,7 @@ WizardImageBackColor=clWhite
2828Uninstallable = 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]
5252Filename : " 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..."
5454Filename : " {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 ;
137137end ;
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+
139155procedure CurPageChanged (CurPageID: Integer);
140156begin
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 ;
150171end ;
151172
152173procedure CreatePages ();
@@ -170,8 +191,6 @@ procedure InitializeWizard();
170191begin
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);
175194end ;
176195
177196function PrepareToInstall (var NeedsRestart: Boolean): String;
0 commit comments