@@ -67,7 +67,8 @@ Filename: "{tmp}\Output\elixir-v{code:ConstGetSelectedReleaseVersion}-setup.exe"
6767Name : " erlang" ; Description : " Install Erlang" ; GroupDescription: " Erlang" ; Check : CheckToInstallErlang
6868Name : " erlang\32" ; Description : " {code:ConstGetErlangName32}" ; GroupDescription: " Erlang" ; Flags : exclusive
6969Name : " erlang\64" ; Description : " {code:ConstGetErlangName64}" ; GroupDescription: " Erlang" ; Flags : exclusive ; Check : IsWin64
70- Name : " erlpath" ; Description : " Append Erlang directory to Path environment variable" ; GroupDescription: " Erlang" ; Check : CheckToAddErlangPath
70+ Name : " erlang\newpath" ; Description : " Append Erlang directory to Path environment variable" ; GroupDescription: " Erlang"
71+ Name : " existingpath" ; Description : " Append {code:ConstGetExistingErlangPath}\bin to Path environment variable" ; GroupDescription: " Erlang" ; Check : CheckToAddErlangPath
7172
7273[Code]
7374#include " src\u til.iss"
8889
8990 CacheSelectedRelease: TElixirRelease;
9091
92+ function GetExistingErlangPath (PrefVersion: String): String;
93+ begin
94+ Result := ' ' ;
95+ if IsWin64 then
96+ Result := GetErlangPath(True, PrefVersion);
97+ if Result = ' ' then
98+ Result := GetErlangPath(False, PrefVersion);
99+ end ;
100+
91101procedure AppendErlangPathIfTaskSelected (Of64Bit: Boolean);
92102begin
93- if IsTaskSelected(' erlpath ' ) then
103+ if IsTaskSelected(' erlang\newpath ' ) or IsTaskSelected( ' existingpath ' ) then
94104 AppendErlangPath(Of64Bit, GlobalErlangData.ERTSVersion);
95105end ;
96106
@@ -179,16 +189,19 @@ begin
179189end ;
180190
181191function CheckToInstallErlang : Boolean; begin
182- Result := (not ErlangInPath) and
183- (
184- (GetErlangPath(False, GlobalErlangData.ERTSVersion) = ' ' ) or
185- (GetErlangPath(True, GlobalErlangData.ERTSVersion) = ' ' )
186- ); end ;
192+ Result := (not ErlangInPath) and (GetExistingErlangPath(GlobalErlangData.ERTSVersion) = ' ' ); end ;
187193function CheckToAddErlangPath : Boolean; begin
188194 Result := not ErlangInPath; end ;
189195
190- function ConstGetErlangName32 (Param: String): String; begin Result := GlobalErlangData.Name32; end ;
191- function ConstGetErlangName64 (Param: String): String; begin Result := GlobalErlangData.Name64; end ;
192- function ConstGetErlangExe32 (Param: String): String; begin Result := GlobalErlangData.Exe32; end ;
193- function ConstGetErlangExe64 (Param: String): String; begin Result := GlobalErlangData.Exe64; end ;
194- function ConstGetSelectedReleaseVersion (Param: String): String; begin Result := CacheSelectedRelease.Version; end ;
196+ function ConstGetErlangName32 (Param: String): String; begin
197+ Result := GlobalErlangData.Name32; end ;
198+ function ConstGetErlangName64 (Param: String): String; begin
199+ Result := GlobalErlangData.Name64; end ;
200+ function ConstGetErlangExe32 (Param: String): String; begin
201+ Result := GlobalErlangData.Exe32; end ;
202+ function ConstGetErlangExe64 (Param: String): String; begin
203+ Result := GlobalErlangData.Exe64; end ;
204+ function ConstGetExistingErlangPath (Param: String): String; begin
205+ Result := GetExistingErlangPath(GlobalErlangData.ERTSVersion); end ;
206+ function ConstGetSelectedReleaseVersion (Param: String): String; begin
207+ Result := CacheSelectedRelease.Version; end ;
0 commit comments