@@ -51,7 +51,6 @@ Compression=none
5151
5252; Visual
5353SetupIconFile = assets\drop.ico
54- WizardImageBackColor = clWhite
5554WizardImageFile = assets\drop_banner.bmp
5655WizardSmallImageFile = assets\null.bmp
5756UninstallDisplayIcon = {app} \drop.ico
@@ -61,34 +60,43 @@ Source: "assets\drop.ico"; DestDir: "{app}"
6160Source : " elixir\*" ; DestDir : " {app} " ; Flags : recursesubdirs createallsubdirs
6261
6362[Icons]
64- Name : " {group} \Elixir" ; Filename : " werl.exe" ; WorkingDir : " %userprofile %" ; IconFilename: " {app} \drop.ico" ; IconIndex: 0 ; Parameters : " -env ERL_LIBS " " {app} \lib" " -user Elixir.IEx.CLI -extra --no-halt"
63+ Name : " {group} \Elixir" ; Filename : " {code:GetScriptString|ErlangBinPath}\ werl.exe" ; WorkingDir : " %userprofile %" ; IconFilename: " {app} \drop.ico" ; IconIndex: 0 ; Parameters : " -env ERL_LIBS " " {app} \lib" " -user Elixir.IEx.CLI -extra --no-halt"
6564
6665[Tasks]
66+ Name : erlangpath; Description : " Append {code:GetScriptString|ErlangBinPath} to system PATH" ; Check : CheckToAppendErlangPath
6767Name : elixirpath; Description : " Append {#ELIXIR_PATH} to system PATH" ; Check : CheckToAppendElixirPath
6868Name : escriptpath; Description : " Append {#ESCRIPT_PATH} to system PATH" ; Check : CheckToAppendEscriptPath
6969
7070[Code]
7171#include " src\u til.iss"
7272#include " src\p ath.iss"
73+ #include " src\e rlang_env.iss"
74+
75+ var
76+ GlobalPageErlangDir: TInputDirWizardPage;
77+
78+ function GetScriptString (Param: String): String;
79+ begin
80+ Result := ' ' ;
81+ if Param = ' ErlangBinPath' then
82+ Result := GlobalPageErlangDir.Values[0 ] + ' \bin' ;
83+ end ;
7384
7485procedure CurStepChanged (CurStep: TSetupStep);
7586begin
7687 if CurStep = ssPostInstall then begin
77- if IsTaskSelected(' elixirpath' ) then begin
88+ if IsTaskSelected(' erlangpath' ) then
89+ AppendPath(GetScriptString(' ErlangBinPath' ));
90+ if IsTaskSelected(' elixirpath' ) then
7891 AppendPath(ExpandConstant(' {#ELIXIR_PATH}' ));
79- end ;
80- if IsTaskSelected(' escriptpath' ) then begin
92+ if IsTaskSelected(' escriptpath' ) then
8193 AppendPath(ExpandConstant(' {#ESCRIPT_PATH}' ));
82- end ;
8394 end ;
8495end ;
8596
8697procedure CurUninstallStepChanged (CurUninstallStep: TUninstallStep);
8798var
8899 SelTaskString: String;
89- SelTasks: TStringList;
90- ElixirIdx: Integer;
91- EscriptIdx: Integer;
92100begin
93101 if CurUninstallStep = usUninstall then begin
94102 SelTaskString := ' ' ;
@@ -102,6 +110,23 @@ begin
102110 end ;
103111end ;
104112
113+ procedure InitializeWizard ();
114+ begin
115+ GlobalPageErlangDir := CreateInputDirPage(
116+ wpWelcome,
117+ ' Confirm Erlang Directory' ,
118+ ' Confirm the location of your Erlang installation, then click Next.' ,
119+ ' Setup will configure Elixir to use the following Erlang installation path.' ,
120+ False, ' '
121+ );
122+
123+ GlobalPageErlangDir.Add(' ' );
124+ GlobalPageErlangDir.Values[0 ] := GetLatestErlangPath();
125+ end ;
126+
127+ function CheckToAppendErlangPath : Boolean; begin
128+ Result := not ContainsPath(GetScriptString(' ErlangBinPath' )); end ;
129+
105130function CheckToAppendElixirPath : Boolean; begin
106131 Result := not ContainsPath(ExpandConstant(' {#ELIXIR_PATH}' )); end ;
107132
0 commit comments