1 |
#define AppId "{{B67333BB-1CF9-4EFD-A40B-E25B5CB4C8A7}}" |
2 |
#define AppVersion "1.4" |
3 |
#define AppLongName "Anniversary Edition of Oni" |
4 |
#define AppShortName "Anniversary-Edition-Setup" |
5 |
|
6 |
#define MinJavaVersion "1.6" |
7 |
#define JavaDownloadPage "http://www.java.com/en/download/manual.jsp#win" |
8 |
|
9 |
[Setup] |
10 |
AppId={#AppId} |
11 |
AppVersion={#AppVersion} |
12 |
AppName={#AppLongName} |
13 |
DefaultDirName={pf32}\Oni |
14 |
OutputBaseFilename={#AppShortName}-v{#AppVersion} |
15 |
DefaultGroupName=Oni AE |
16 |
|
17 |
DirExistsWarning=no |
18 |
AppendDefaultDirName=no |
19 |
|
20 |
CreateUninstallRegKey=no |
21 |
Uninstallable=no |
22 |
UsePreviousAppDir=no |
23 |
|
24 |
|
25 |
ArchitecturesInstallIn64BitMode=x64 |
26 |
ShowComponentSizes=no |
27 |
AppPublisher= |
28 |
AppPublisherURL= |
29 |
AppSupportURL= |
30 |
AppUpdatesURL= |
31 |
AllowNoIcons=yes |
32 |
OutputDir=. |
33 |
Compression=lzma2/max |
34 |
SolidCompression=yes |
35 |
|
36 |
[Languages] |
37 |
Name: "en"; MessagesFile: "compiler:Default.isl" |
38 |
|
39 |
[Messages] |
40 |
en.SelectDirBrowseLabel=Please select the installation directory of Oni. |
41 |
|
42 |
[CustomMessages] |
43 |
en.wrongDir=This doesn't seem to be your Oni installation; I don't see a file here named "Oni.exe". |
44 |
en.JavaNotFound=This program needs a Java Runtime (JRE) with version being at least %1.%nPlease download and install a suitable JRE.%nDo you want do download a JRE now? |
45 |
|
46 |
[Tasks] |
47 |
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked |
48 |
|
49 |
[Dirs] |
50 |
Name: "{app}\AE"; Permissions: users-modify |
51 |
|
52 |
[Files] |
53 |
Source: "AEInstaller2Updater.jar"; DestDir: "{app}\AE\AEInstaller" |
54 |
Source: "JRE\*"; DestDir: "{app}\AE\AEInstaller\JRE"; Excludes: ".svn"; Flags: createallsubdirs recursesubdirs onlyifdoesntexist |
55 |
Source: "AElogo.ico"; DestDir: "{app}\AE\AEInstaller" |
56 |
|
57 |
[Icons] |
58 |
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" |
59 |
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" |
60 |
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" |
61 |
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 |
62 |
|
63 |
[Run] |
64 |
Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; Parameters: "-Dsun.java2d.d3d=false -jar AEInstaller2Updater.jar"; Flags: runasoriginaluser; BeforeInstall: WriteProxyData |
65 |
|
66 |
|
67 |
[Code] |
68 |
var |
69 |
PageUseProxy: TInputOptionWizardPage; |
70 |
PageProxyData: TInputQueryWizardPage; |
71 |
|
72 |
|
73 |
procedure InitializeWizard(); |
74 |
begin |
75 |
PageUseProxy := CreateInputOptionPage(wpSelectTasks, 'Internet connection type', '', 'Do you require a proxy to connect to the internet?', true, false); |
76 |
PageUseProxy.Add('Direct connection'); |
77 |
PageUseProxy.Add('Use proxy'); |
78 |
PageUseProxy.Values[0] := true; |
79 |
|
80 |
PageProxyData := CreateInputQueryPage(PageUseProxy.ID, 'Proxy data', '', 'Please enter the data required to connect to your proxy.'); |
81 |
PageProxyData.Add('Hostname or IP:', False); |
82 |
PageProxyData.Add('Port:', False); |
83 |
end; |
84 |
|
85 |
function DirOk(Path: String): boolean; |
86 |
begin |
87 |
Result := DirExists(Path+'\GameDataFolder') and FileExists(Path+'\Oni.exe'); |
88 |
end; |
89 |
|
90 |
function NextButtonClick(CurPageID: Integer): boolean; |
91 |
begin |
92 |
Result := True; |
93 |
|
94 |
if CurPageID = wpSelectDir then |
95 |
begin |
96 |
if (not DirOk(WizardDirValue)) then |
97 |
begin |
98 |
MsgBox(CustomMessage('wrongDir'), mbError, MB_OK); |
99 |
Result := False; |
100 |
end; |
101 |
end; |
102 |
end; |
103 |
|
104 |
|
105 |
function EnterProxyData(): Boolean; |
106 |
begin |
107 |
Result := PageUseProxy.SelectedValueIndex = 1; |
108 |
end; |
109 |
|
110 |
function ShouldSkipPage(PageID: Integer): Boolean; |
111 |
begin |
112 |
Result := false; |
113 |
if (PageID = PageProxyData.ID) then |
114 |
Result := not EnterProxyData(); |
115 |
end; |
116 |
|
117 |
|
118 |
function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String; |
119 |
begin |
120 |
Result := MemoUserInfoInfo + NewLine; |
121 |
Result := Result + MemoDirInfo + NewLine; |
122 |
Result := Result + MemoGroupInfo + NewLine; |
123 |
Result := Result + MemoTasksInfo + NewLine; |
124 |
|
125 |
if (EnterProxyData()) then |
126 |
Result := Result + NewLine + 'Set proxy configuration'; |
127 |
end; |
128 |
|
129 |
|
130 |
procedure WriteProxyData(); |
131 |
begin |
132 |
if (EnterProxyData()) then |
133 |
begin |
134 |
SaveStringToFile(ExpandConstant('{app}') + '\AE\AEInstaller\AEI-ProxySettings.xml', |
135 |
'<?xml version="1.0" ?><Proxy><useProxy>true</useProxy><hostOrIp>'+PageProxyData.Values[0]+'</hostOrIp><port>'+PageProxyData.Values[1]+'</port></Proxy>', |
136 |
False); |
137 |
end; |
138 |
end; |