| 1 |
|
#define AppId "{{B67333BB-1CF9-4EFD-A40B-E25B5CB4C8A7}}" |
| 2 |
< |
#define AppVersion "1.1" |
| 2 |
> |
#define AppVersion "1.2" |
| 3 |
|
#define AppLongName "Anniversary Edition of Oni" |
| 4 |
|
#define AppShortName "Anniversary-Edition-Setup" |
| 5 |
|
|
| 41 |
|
[Tasks] |
| 42 |
|
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked |
| 43 |
|
|
| 44 |
– |
[Components] |
| 45 |
– |
Name: "JRE"; Description: "JRE" |
| 46 |
– |
Name: "AEI"; Description: "AEI" |
| 47 |
– |
|
| 44 |
|
[Dirs] |
| 45 |
|
Name: "{app}\AE"; Permissions: users-modify |
| 46 |
|
|
| 47 |
|
[Files] |
| 48 |
< |
Source: "AEInstaller2Updater.jar"; DestDir: "{app}\AE\AEInstaller"; Components: AEI |
| 49 |
< |
Source: "JRE\*"; DestDir: "{app}\AE\AEInstaller\JRE"; Excludes: ".svn"; Flags: createallsubdirs recursesubdirs onlyifdoesntexist; Components: JRE |
| 50 |
< |
Source: "AElogo.ico"; DestDir: "{app}\AE\AEInstaller"; Components: AEI |
| 48 |
> |
Source: "AEInstaller2Updater.jar"; DestDir: "{app}\AE\AEInstaller" |
| 49 |
> |
Source: "JRE\*"; DestDir: "{app}\AE\AEInstaller\JRE"; Excludes: ".svn"; Flags: createallsubdirs recursesubdirs onlyifdoesntexist |
| 50 |
> |
Source: "AElogo.ico"; DestDir: "{app}\AE\AEInstaller" |
| 51 |
|
|
| 52 |
|
[Icons] |
| 53 |
< |
Name: "{app}\AE\AEInstaller2"; Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar bin\AEInstaller2.jar"; Check: not IsJavaInstalled |
| 54 |
< |
Name: "{app}\AE\AEInstaller2Updater"; Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar AEInstaller2Updater.jar"; Check: not IsJavaInstalled |
| 55 |
< |
Name: "{group}\AEInstaller 2"; Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar bin\AEInstaller2.jar"; Check: not IsJavaInstalled |
| 56 |
< |
Name: "{commondesktop}\AEInstaller 2"; Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar bin\AEInstaller2.jar"; Tasks: desktopicon; Check: not IsJavaInstalled |
| 61 |
< |
Name: "{app}\AE\AEInstaller2"; Filename: "{code:GetJavaPath}\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar bin\AEInstaller2.jar"; Check: IsJavaInstalled |
| 62 |
< |
Name: "{app}\AE\AEInstaller2Updater"; Filename: "{code:GetJavaPath}\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar AEInstaller2Updater.jar"; Check: IsJavaInstalled |
| 63 |
< |
Name: "{group}\AEInstaller 2"; Filename: "{code:GetJavaPath}\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar bin\AEInstaller2.jar"; Check: IsJavaInstalled |
| 64 |
< |
Name: "{commondesktop}\AEInstaller 2"; Filename: "{code:GetJavaPath}\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar bin\AEInstaller2.jar"; Tasks: desktopicon; Check: IsJavaInstalled |
| 53 |
> |
Name: "{app}\AE\AEInstaller2"; Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar bin\AEInstaller2.jar" |
| 54 |
> |
Name: "{app}\AE\AEInstaller2Updater"; Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar AEInstaller2Updater.jar" |
| 55 |
> |
Name: "{group}\AEInstaller 2"; Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar bin\AEInstaller2.jar" |
| 56 |
> |
Name: "{commondesktop}\AEInstaller 2"; Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; IconFilename: "{app}\AE\AEInstaller\AElogo.ico"; Parameters: "-Dsun.java2d.d3d=false -jar bin\AEInstaller2.jar"; Tasks: desktopicon |
| 57 |
|
|
| 58 |
|
[Run] |
| 59 |
< |
Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; Parameters: "-Dsun.java2d.d3d=false -jar AEInstaller2Updater.jar"; Flags: runasoriginaluser; Check: not IsJavaInstalled; BeforeInstall: WriteProxyData |
| 68 |
< |
Filename: "{code:GetJavaPath}\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; Parameters: "-Dsun.java2d.d3d=false -jar AEInstaller2Updater.jar"; Flags: runasoriginaluser; Check: IsJavaInstalled; BeforeInstall: WriteProxyData |
| 59 |
> |
Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; Parameters: "-Dsun.java2d.d3d=false -jar AEInstaller2Updater.jar"; Flags: runasoriginaluser; BeforeInstall: WriteProxyData |
| 60 |
|
|
| 61 |
|
|
| 62 |
|
[Code] |
| 63 |
|
var |
| 64 |
|
PageUseProxy: TInputOptionWizardPage; |
| 65 |
|
PageProxyData: TInputQueryWizardPage; |
| 75 |
– |
javaPath: String; |
| 66 |
|
|
| 77 |
– |
procedure DecodeVersion (verstr: String; var verint: array of Integer); |
| 78 |
– |
var |
| 79 |
– |
i,p: Integer; s: string; |
| 80 |
– |
begin |
| 81 |
– |
// initialize array |
| 82 |
– |
verint := [0,0,0,0]; |
| 83 |
– |
i := 0; |
| 84 |
– |
while ((Length(verstr) > 0) and (i < 4)) do |
| 85 |
– |
begin |
| 86 |
– |
p := pos ('.', verstr); |
| 87 |
– |
if p > 0 then |
| 88 |
– |
begin |
| 89 |
– |
if p = 1 then s:= '0' else s:= Copy (verstr, 1, p - 1); |
| 90 |
– |
verint[i] := StrToInt(s); |
| 91 |
– |
i := i + 1; |
| 92 |
– |
verstr := Copy (verstr, p+1, Length(verstr)); |
| 93 |
– |
end |
| 94 |
– |
else |
| 95 |
– |
begin |
| 96 |
– |
verint[i] := StrToInt (verstr); |
| 97 |
– |
verstr := ''; |
| 98 |
– |
end; |
| 99 |
– |
end; |
| 100 |
– |
|
| 101 |
– |
end; |
| 102 |
– |
|
| 103 |
– |
function CompareVersion (ver1, ver2: String) : Integer; |
| 104 |
– |
var |
| 105 |
– |
verint1, verint2: array of Integer; |
| 106 |
– |
i: integer; |
| 107 |
– |
begin |
| 108 |
– |
SetArrayLength (verint1, 4); |
| 109 |
– |
DecodeVersion (ver1, verint1); |
| 110 |
– |
|
| 111 |
– |
SetArrayLength (verint2, 4); |
| 112 |
– |
DecodeVersion (ver2, verint2); |
| 113 |
– |
|
| 114 |
– |
Result := 0; i := 0; |
| 115 |
– |
while ((Result = 0) and ( i < 4 )) do |
| 116 |
– |
begin |
| 117 |
– |
if verint1[i] > verint2[i] then |
| 118 |
– |
Result := 1 |
| 119 |
– |
else |
| 120 |
– |
if verint1[i] < verint2[i] then |
| 121 |
– |
Result := -1; |
| 122 |
– |
i := i + 1; |
| 123 |
– |
end; |
| 124 |
– |
|
| 125 |
– |
end; |
| 126 |
– |
|
| 127 |
– |
procedure CheckJavaRuntime(); |
| 128 |
– |
var |
| 129 |
– |
W6432: Boolean; |
| 130 |
– |
Res: Boolean; |
| 131 |
– |
JavaVer: String; |
| 132 |
– |
begin |
| 133 |
– |
W6432 := False; |
| 134 |
– |
Res := RegQueryStringValue(HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment', 'CurrentVersion', JavaVer); |
| 135 |
– |
if (Res = False) and IsWin64() then |
| 136 |
– |
begin |
| 137 |
– |
Res := RegQueryStringValue(HKLM32, 'SOFTWARE\JavaSoft\Java Runtime Environment', 'CurrentVersion', JavaVer); |
| 138 |
– |
W6432 := Res; |
| 139 |
– |
end; |
| 140 |
– |
if Res = True then |
| 141 |
– |
begin |
| 142 |
– |
if Length( JavaVer ) > 0 then |
| 143 |
– |
begin |
| 144 |
– |
if CompareVersion(JavaVer, '{#MinJavaVersion}') >= 0 then |
| 145 |
– |
begin |
| 146 |
– |
if W6432 then |
| 147 |
– |
Res := RegQueryStringValue(HKLM32, 'SOFTWARE\JavaSoft\Java Runtime Environment\'+JavaVer, 'JavaHome', javaPath) |
| 148 |
– |
else |
| 149 |
– |
Res := RegQueryStringValue(HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment\'+JavaVer, 'JavaHome', javaPath); |
| 150 |
– |
end; |
| 151 |
– |
end; |
| 152 |
– |
end; |
| 153 |
– |
end; |
| 154 |
– |
|
| 155 |
– |
function IsJavaInstalled(): Boolean; |
| 156 |
– |
begin |
| 157 |
– |
Result := Length(javaPath) > 0; |
| 158 |
– |
end; |
| 159 |
– |
|
| 160 |
– |
function GetJavaPath(Param: String): String; |
| 161 |
– |
begin |
| 162 |
– |
Result := javaPath; |
| 163 |
– |
end; |
| 164 |
– |
|
| 165 |
– |
function InitializeSetup(): Boolean; |
| 166 |
– |
begin |
| 167 |
– |
CheckJavaRuntime(); |
| 168 |
– |
Result := True; |
| 169 |
– |
end; |
| 67 |
|
|
| 68 |
|
procedure InitializeWizard(); |
| 172 |
– |
var |
| 173 |
– |
Components : TNewCheckListbox; |
| 174 |
– |
i : integer; |
| 69 |
|
begin |
| 70 |
< |
Components := WizardForm.ComponentsList; |
| 177 |
< |
i := Components.Items.IndexOf('JRE'); |
| 178 |
< |
if i <> -1 then |
| 179 |
< |
begin |
| 180 |
< |
Components.ItemEnabled[i] := false; |
| 181 |
< |
Components.Checked[i] := not IsJavaInstalled(); |
| 182 |
< |
end; |
| 183 |
< |
i := Components.Items.IndexOf('AEI'); |
| 184 |
< |
if i <> -1 then |
| 185 |
< |
begin |
| 186 |
< |
Components.ItemEnabled[i] := false; |
| 187 |
< |
Components.Checked[i] := true; |
| 188 |
< |
end; |
| 189 |
< |
|
| 190 |
< |
PageUseProxy := CreateInputOptionPage(wpSelectTasks, 'Internet connection type', '', 'Do you require to use a proxy to connect to the internet?', true, false); |
| 70 |
> |
PageUseProxy := CreateInputOptionPage(wpSelectTasks, 'Internet connection type', '', 'Do you require a proxy to connect to the internet?', true, false); |
| 71 |
|
PageUseProxy.Add('Direct connection'); |
| 72 |
|
PageUseProxy.Add('Use proxy'); |
| 73 |
|
PageUseProxy.Values[0] := true; |
| 105 |
|
function ShouldSkipPage(PageID: Integer): Boolean; |
| 106 |
|
begin |
| 107 |
|
Result := false; |
| 228 |
– |
if (PageID = wpSelectComponents) then |
| 229 |
– |
Result := true; |
| 108 |
|
if (PageID = PageProxyData.ID) then |
| 109 |
|
Result := not EnterProxyData(); |
| 110 |
|
end; |