|
23 | 23 |
|
24 | 24 | #include <idp.iss> |
25 | 25 |
|
| 26 | +#define StrInspectSignature(str Value) 'Const_' + StringChange(Value, '.', '__') |
| 27 | +#define StrInspectScriptConst(str Value) '{code:' + StrInspectSignature(Value) + '}' |
| 28 | +#define StrInspectFuncDef(str Value) 'function ' + StrInspectSignature(Value) + '(Param: String): String; begin Result := ' + Value + '; end;' |
| 29 | + |
26 | 30 | [Setup] |
27 | 31 | AppName=Elixir |
28 | 32 | AppVersion=0.57 |
@@ -58,18 +62,18 @@ Source: "compiler:Setup.e32"; DestDir: "{tmp}"; Flags: deleteafterinstall |
58 | 62 | Source: "compiler:SetupLdr.e32"; DestDir: "{tmp}"; Flags: deleteafterinstall |
59 | 63 |
|
60 | 64 | [Run] |
61 | | -Filename: "{tmp}\{code:ConstGetErlangExe32}"; Flags: hidewizard; StatusMsg: "Installing {code:ConstGetErlangName32}..."; Tasks: erlang\32 |
62 | | -Filename: "{tmp}\{code:ConstGetErlangExe64}"; Flags: hidewizard; StatusMsg: "Installing {code:ConstGetErlangName64}..."; Tasks: erlang\64 |
| 65 | +Filename: "{tmp}\{#StrInspectScriptConst('GlobalErlangData.Exe32')}"; Flags: hidewizard; StatusMsg: "Installing {#StrInspectScriptConst('GlobalErlangData.Name32')}..."; Tasks: erlang\32 |
| 66 | +Filename: "{tmp}\{#StrInspectScriptConst('GlobalErlangData.Exe64')}"; Flags: hidewizard; StatusMsg: "Installing {#StrInspectScriptConst('GlobalErlangData.Name64')}..."; Tasks: erlang\64 |
63 | 67 | Filename: "{tmp}\7za.exe"; Parameters: "x -oelixir Precompiled.zip"; WorkingDir: "{tmp}"; StatusMsg: "Extracting Precompiled.zip archive..." |
64 | | -Filename: "{tmp}\ISCC.exe"; Parameters: "/dElixirVersion={code:ConstGetSelectedReleaseVersion} /dSkipWelcome /dNoCompression Elixir.iss"; WorkingDir: "{tmp}"; StatusMsg: "Compiling Elixir installer..." |
65 | | -Filename: "{tmp}\Output\elixir-v{code:ConstGetSelectedReleaseVersion}-setup.exe"; Flags: nowait; StatusMsg: "Starting Elixir installer..." |
| 68 | +Filename: "{tmp}\ISCC.exe"; Parameters: "/dElixirVersion={#StrInspectScriptConst('CacheSelectedRelease.Version')} /dSkipWelcome /dNoCompression Elixir.iss"; WorkingDir: "{tmp}"; StatusMsg: "Compiling Elixir installer..." |
| 69 | +Filename: "{tmp}\Output\elixir-v{#StrInspectScriptConst('CacheSelectedRelease.Version')}-setup.exe"; Flags: nowait; StatusMsg: "Starting Elixir installer..." |
66 | 70 |
|
67 | 71 | [Tasks] |
68 | 72 | Name: "erlang"; Description: "Install Erlang"; Check: CheckToInstallErlang |
69 | | -Name: "erlang\32"; Description: "{code:ConstGetErlangName32}"; Flags: exclusive |
70 | | -Name: "erlang\64"; Description: "{code:ConstGetErlangName64}"; Flags: exclusive; Check: IsWin64 |
| 73 | +Name: "erlang\32"; Description: "{#StrInspectScriptConst('GlobalErlangData.Name32')}"; Flags: exclusive |
| 74 | +Name: "erlang\64"; Description: "{#StrInspectScriptConst('GlobalErlangData.Name64')}"; Flags: exclusive; Check: IsWin64 |
71 | 75 | Name: "erlang\newpath"; Description: "Append Erlang directory to Path environment variable" |
72 | | -Name: "existingpath"; Description: "Append {code:ConstGetLatestErlangPath}\bin to Path environment variable"; Check: CheckToAddExistingErlangPath |
| 76 | +Name: "existingpath"; Description: "Append {#StrInspectScriptConst('GetLatestErlangPath')}\bin to Path environment variable"; Check: CheckToAddExistingErlangPath |
73 | 77 |
|
74 | 78 | [Code] |
75 | 79 | #include "src\util.iss" |
@@ -187,16 +191,10 @@ function CheckToInstallErlang: Boolean; begin |
187 | 191 | Result := (GetLatestErlangPath = ''); end; |
188 | 192 | function CheckToAddExistingErlangPath: Boolean; begin |
189 | 193 | Result := (not CheckToInstallErlang) and (not ErlangInPath); end; |
190 | | -
|
191 | | -function ConstGetErlangName32(Param: String): String; begin |
192 | | - Result := GlobalErlangData.Name32; end; |
193 | | -function ConstGetErlangName64(Param: String): String; begin |
194 | | - Result := GlobalErlangData.Name64; end; |
195 | | -function ConstGetErlangExe32(Param: String): String; begin |
196 | | - Result := GlobalErlangData.Exe32; end; |
197 | | -function ConstGetErlangExe64(Param: String): String; begin |
198 | | - Result := GlobalErlangData.Exe64; end; |
199 | | -function ConstGetLatestErlangPath(Param: String): String; begin |
200 | | - Result := GetLatestErlangPath; end; |
201 | | -function ConstGetSelectedReleaseVersion(Param: String): String; begin |
202 | | - Result := CacheSelectedRelease.Version; end; |
| 194 | + |
| 195 | +{#StrInspectFuncDef('GlobalErlangData.Name32')} |
| 196 | +{#StrInspectFuncDef('GlobalErlangData.Name64')} |
| 197 | +{#StrInspectFuncDef('GlobalErlangData.Exe32')} |
| 198 | +{#StrInspectFuncDef('GlobalErlangData.Exe64')} |
| 199 | +{#StrInspectFuncDef('GetLatestErlangPath')} |
| 200 | +{#StrInspectFuncDef('CacheSelectedRelease.Version')} |
0 commit comments