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

Commit def7475

Browse files
committed
Use macros for OTP names and paths
1 parent 8e91415 commit def7475

File tree

1 file changed

+17
-8
lines changed

1 file changed

+17
-8
lines changed

ElixirWeb.iss

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,16 @@
1616
; "Elixir" and the Elixir logo are copyright (c) 2012 Plataformatec.
1717

1818
#define COMPAT_MASK 1
19-
#define PATH_TO_7ZA "C:\Users\Chris\Documents\7za920"
19+
#define PATH_TO_7ZA 'C:\Users\Chris\Documents\7za920'
20+
21+
#define OTP_32_NAME 'OTP 17.1 (32-bit)'
22+
#define OTP_32_URL 'http://www.erlang.org/download/otp_win32_17.1.exe'
23+
#define OTP_32_EXE 'otp_win32_17.1.exe'
24+
25+
#define OTP_64_NAME 'OTP 17.1 (64-bit)'
26+
#define OTP_64_URL 'http://www.erlang.org/download/otp_win64_17.1.exe'
27+
#define OTP_64_EXE 'otp_win64_17.1.exe'
28+
2029
#include <idp.iss>
2130

2231
[Setup]
@@ -52,16 +61,16 @@ Source: "compiler:Setup.e32"; DestDir: "{tmp}"; Flags: deleteafterinstall
5261
Source: "compiler:SetupLdr.e32"; DestDir: "{tmp}"; Flags: deleteafterinstall
5362

5463
[Run]
55-
Filename: "{tmp}\otp_win32_17.1.exe"; Flags: hidewizard; StatusMsg: "Installing OTP 17.1 (32-bit)..."; Tasks: erlang\32
56-
Filename: "{tmp}\otp_win64_17.1.exe"; Flags: hidewizard; StatusMsg: "Installing OTP 17.1 (64-bit)..."; Tasks: erlang\64
64+
Filename: "{tmp}\{#OTP_32_EXE}"; Flags: hidewizard; StatusMsg: "Installing {#OTP_32_NAME}..."; Tasks: erlang\32
65+
Filename: "{tmp}\{#OTP_64_EXE}"; Flags: hidewizard; StatusMsg: "Installing {#OTP_64_NAME}..."; Tasks: erlang\64
5766
Filename: "{tmp}\7za.exe"; Parameters: "x -oelixir Precompiled.zip"; WorkingDir: "{tmp}"; StatusMsg: "Extracting Precompiled.zip archive..."
5867
Filename: "{tmp}\ISCC.exe"; Parameters: "/dElixirVersion={code:ConstGetSelectedReleaseVersion} /dSkipWelcome /dNoCompression Elixir.iss"; WorkingDir: "{tmp}"; StatusMsg: "Compiling Elixir installer..."
5968
Filename: "{tmp}\Output\elixir-v{code:ConstGetSelectedReleaseVersion}-setup.exe"; Flags: nowait; StatusMsg: "Starting Elixir installer..."
6069

6170
[Tasks]
6271
Name: "erlang"; Description: "Install Erlang"; GroupDescription: "Erlang"; Check: CheckToInstallErlang
63-
Name: "erlang\32"; Description: "OTP 17.1 (32-bit)"; GroupDescription: "Erlang"; Flags: exclusive
64-
Name: "erlang\64"; Description: "OTP 17.1 (64-bit)"; GroupDescription: "Erlang"; Flags: exclusive; Check: IsWin64
72+
Name: "erlang\32"; Description: "{#OTP_32_NAME}"; GroupDescription: "Erlang"; Flags: exclusive
73+
Name: "erlang\64"; Description: "{#OTP_64_NAME}"; GroupDescription: "Erlang"; Flags: exclusive; Check: IsWin64
6574
Name: "erlpath"; Description: "Append Erlang directory to Path environment variable"; GroupDescription: "Erlang"; Check: CheckToAddErlangPath
6675

6776
[Code]
@@ -226,7 +235,7 @@ end;
226235
227236
function CheckToInstallErlang: Boolean;
228237
begin
229-
Result := (GetErlangPath = '')
238+
Result := (GetErlangPath = '');
230239
end;
231240
232241
function CheckToAddErlangPath: Boolean;
@@ -238,10 +247,10 @@ procedure CurPageChanged(CurPageID: Integer);
238247
begin
239248
if CurPageID = wpPreparing then begin
240249
if IsTaskSelected('erlang\32') then begin
241-
idpAddFile('http://www.erlang.org/download/otp_win32_17.1.exe', ExpandConstant('{tmp}\otp_win32_17.1.exe'));
250+
idpAddFile('{#OTP_32_URL}', ExpandConstant('{tmp}\{#OTP_32_EXE}'));
242251
end;
243252
if IsTaskSelected('erlang\64') then begin
244-
idpAddFile('http://www.erlang.org/download/otp_win64_17.1.exe', ExpandConstant('{tmp}\otp_win64_17.1.exe'));
253+
idpAddFile('{#OTP_64_URL}', ExpandConstant('{tmp}\{#OTP_64_EXE}'));
245254
end;
246255
idpAddFile(GetURL(GetSelectedRelease()), ExpandConstant('{tmp}\Precompiled.zip'));
247256
idpDownloadAfter(wpPreparing);

0 commit comments

Comments
 (0)