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

Commit db2b44d

Browse files
committed
GetErlangPath gets Erlang Path from registry keys
1 parent 50449ca commit db2b44d

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

ElixirWeb.iss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,26 @@ begin
197197
Result := GetVersion(GetSelectedRelease());
198198
end;
199199
200+
function GetErlangPath: String;
201+
var
202+
Versions: TArrayOfString;
203+
Path: String;
204+
begin
205+
Result := '';
206+
207+
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'SOFTWARE\Ericsson\Erlang', Versions) then begin
208+
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Ericsson\Erlang' + '\' + Versions[GetArrayLength(Versions) - 1], '', Path);
209+
Result := Path;
210+
end;
211+
212+
if IsWin64 then begin
213+
if RegGetSubkeyNames(HKEY_LOCAL_MACHINE, 'SOFTWARE\Wow6432Node\Ericsson\Erlang', Versions) then begin
214+
RegQueryStringValue(HKEY_LOCAL_MACHINE, 'SOFTWARE\Wow6432Node\Ericsson\Erlang' + '\' + Versions[GetArrayLength(Versions) - 1], '', Path);
215+
Result := Path;
216+
end;
217+
end;
218+
end;
219+
200220
function ErlangIsInstalled: Boolean;
201221
begin
202222
Result := Exec('erl.exe', '+V', '', SW_HIDE, ewWaitUntilTerminated, _int);
@@ -234,6 +254,8 @@ procedure InitializeWizard();
234254
var
235255
LatestRelease, LatestPrerelease: TStrings;
236256
begin
257+
MsgBox(GetErlangPath, mbInformation, MB_OK);
258+
237259
idpSetOption('DetailsButton', '0');
238260
239261
PSelInstallType := CreateInputOptionPage(wpWelcome, 'Select Elixir installation type', 'Select which installation type you want to perform, then click Next.', 'I want to:', True, False);

0 commit comments

Comments
 (0)