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

Commit cd24663

Browse files
committed
Move zip downloading into IDP library
1 parent 6be1e0f commit cd24663

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

Elixir.iss

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#include <idp.iss>
2+
13
[Setup]
24
AppName=Elixir
35
AppVerName=Elixir
@@ -9,9 +11,15 @@ Name: "{group}\Elixir"; Filename: "{app}\bin\iex.bat"; WorkingDir: "{userdocs}";
911
Name: "{group}\Uninstall Elixir"; Filename: "{uninstallexe}"; IconFilename: "{app}\drop_gs.ico"
1012

1113
[Files]
12-
Source: "Precompiled\*"; DestDir: "{app}"; Flags: createallsubdirs recursesubdirs
1314
Source: "assets\drop.ico"; DestDir: "{app}"
1415
Source: "assets\drop_gs.ico"; DestDir: "{app}"
16+
Source: "extract-zip.ps1"; DestDir: "{app}"; Flags: deleteafterinstall
17+
18+
[Run]
19+
Filename: "powershell.exe"; Parameters: "-File .\extract-zip.ps1 {tmp}\Precompiled.zip"; WorkingDir: "{app}"; Flags: waituntilterminated runhidden; StatusMsg: "Extracting..."
20+
21+
[UninstallDelete]
22+
Type: filesandordirs; Name: "{app}"
1523

1624
[Code]
1725
function ErlangIsInstalled: Boolean;
@@ -20,3 +28,9 @@ var
2028
begin
2129
Result := Exec('erl.exe', '+V', '', SW_HIDE, ewWaitUntilTerminated, ResultCode)
2230
end;
31+
32+
procedure InitializeWizard();
33+
begin
34+
idpAddFile('https://github.com/elixir-lang/elixir/releases/download/v0.14.1/Precompiled.zip', ExpandConstant('{tmp}\Precompiled.zip'));
35+
idpDownloadAfter(wpReady);
36+
end;

extract-zip.ps1

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
$cd = (split-path $MyInvocation.MyCommand.Path -parent)
2+
$zipPath = $args[0]
3+
Write-Host " * Extracting files into $cd..." -foregroundcolor "green"
4+
$shell = New-Object -com Shell.Application
5+
$zipFile = $shell.NameSpace($zipPath)
6+
foreach($item in $zipFile.items())
7+
{
8+
$shell.Namespace($cd).copyhere($item)
9+
}

0 commit comments

Comments
 (0)