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

Commit 9a51574

Browse files
committed
Replace Erlang warning with checked tasks
1 parent 0c5f721 commit 9a51574

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

ElixirWeb.iss

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -57,10 +57,10 @@ Filename: "{tmp}\ISCC.exe"; Parameters: "/dElixirVersion={code:ConstGetSelectedR
5757
Filename: "{tmp}\Output\elixir-v{code:ConstGetSelectedReleaseVersion}-setup.exe"; Flags: nowait; StatusMsg: "Starting Elixir installer..."
5858

5959
[Tasks]
60-
Name: "erlang"; Description: "Install Erlang"; GroupDescription: "Erlang"
60+
Name: "erlang"; Description: "Install Erlang"; GroupDescription: "Erlang"; Check: CheckToInstallErlang
6161
Name: "erlang\32"; Description: "OTP 17.1 (32-bit)"; GroupDescription: "Erlang"; Flags: exclusive
6262
Name: "erlang\64"; Description: "OTP 17.1 (64-bit)"; GroupDescription: "Erlang"; Flags: exclusive; Check: IsWin64
63-
Name: "erlpath"; Description: "Append Erlang directory to Path environment variable"; GroupDescription: "Erlang"
63+
Name: "erlpath"; Description: "Append Erlang directory to Path environment variable"; GroupDescription: "Erlang"; Check: CheckToAddErlangPath
6464

6565
[Code]
6666
type
@@ -217,11 +217,21 @@ begin
217217
end;
218218
end;
219219
220-
function ErlangIsInstalled: Boolean;
220+
function ErlangInPath: Boolean;
221221
begin
222222
Result := Exec('erl.exe', '+V', '', SW_HIDE, ewWaitUntilTerminated, _int);
223223
end;
224224
225+
function CheckToInstallErlang: Boolean;
226+
begin
227+
Result := (GetErlangPath = '')
228+
end;
229+
230+
function CheckToAddErlangPath: Boolean;
231+
begin
232+
Result := not ErlangInPath;
233+
end;
234+
225235
procedure CurPageChanged(CurPageID: Integer);
226236
begin
227237
if CurPageID = wpPreparing then begin
@@ -239,17 +249,6 @@ begin
239249
end;
240250
end;
241251
242-
function PrepareToInstall(var NeedsRestart: Boolean): String;
243-
begin
244-
if not ErlangIsInstalled then begin
245-
if MsgBox('Warning: Erlang does not seem to be installed.' + #13#10#13#10 +
246-
'In order for Elixir to run, you will need to install Erlang from http://www.erlang.org/ and then add it to your Path environment variable.' + #13#10#13#10 +
247-
'Proceed anyway?', mbConfirmation, MB_YESNO or MB_DEFBUTTON2) = IDNO then begin
248-
Result := 'Erlang not installed.';
249-
end;
250-
end;
251-
end;
252-
253252
procedure InitializeWizard();
254253
var
255254
LatestRelease, LatestPrerelease: TStrings;

0 commit comments

Comments
 (0)