source: AE/Setup/Windows/AEI.iss@ 1027

Last change on this file since 1027 was 1015, checked in by alloc, 10 years ago

AEI2-Setup Win 1.2

File size: 4.8 KB
Line 
1#define AppId "{{B67333BB-1CF9-4EFD-A40B-E25B5CB4C8A7}}"
2#define AppVersion "1.2"
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]
10AppId={#AppId}
11AppVersion={#AppVersion}
12AppName={#AppLongName}
13DefaultDirName={pf32}\Oni
14OutputBaseFilename={#AppShortName}-v{#AppVersion}
15DefaultGroupName=Oni AE
16
17DirExistsWarning=no
18AppendDefaultDirName=no
19
20ArchitecturesInstallIn64BitMode=x64
21ShowComponentSizes=no
22AppPublisher=
23AppPublisherURL=
24AppSupportURL=
25AppUpdatesURL=
26AllowNoIcons=yes
27OutputDir=.
28Compression=lzma2/max
29SolidCompression=yes
30
31[Languages]
32Name: "en"; MessagesFile: "compiler:Default.isl"
33
34[Messages]
35en.SelectDirBrowseLabel=Please select the installation directory of Oni.
36
37[CustomMessages]
38en.wrongDir=This doesn't seem to be your Oni installation; I don't see a file here named "Oni.exe".
39en.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?
40
41[Tasks]
42Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
43
44[Dirs]
45Name: "{app}\AE"; Permissions: users-modify
46
47[Files]
48Source: "AEInstaller2Updater.jar"; DestDir: "{app}\AE\AEInstaller"
49Source: "JRE\*"; DestDir: "{app}\AE\AEInstaller\JRE"; Excludes: ".svn"; Flags: createallsubdirs recursesubdirs onlyifdoesntexist
50Source: "AElogo.ico"; DestDir: "{app}\AE\AEInstaller"
51
52[Icons]
53Name: "{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"
54Name: "{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"
55Name: "{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"
56Name: "{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]
59Filename: "{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]
63var
64 PageUseProxy: TInputOptionWizardPage;
65 PageProxyData: TInputQueryWizardPage;
66
67
68procedure InitializeWizard();
69begin
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;
74
75 PageProxyData := CreateInputQueryPage(PageUseProxy.ID, 'Proxy data', '', 'Please enter the data required to connect to your proxy.');
76 PageProxyData.Add('Hostname or IP:', False);
77 PageProxyData.Add('Port:', False);
78end;
79
80function DirOk(Path: String): boolean;
81begin
82 Result := DirExists(Path+'\GameDataFolder') and FileExists(Path+'\Oni.exe');
83end;
84
85function NextButtonClick(CurPageID: Integer): boolean;
86begin
87 Result := True;
88
89 if CurPageID = wpSelectDir then
90 begin
91 if (not DirOk(WizardDirValue)) then
92 begin
93 MsgBox(CustomMessage('wrongDir'), mbError, MB_OK);
94 Result := False;
95 end;
96 end;
97end;
98
99
100function EnterProxyData(): Boolean;
101begin
102 Result := PageUseProxy.SelectedValueIndex = 1;
103end;
104
105function ShouldSkipPage(PageID: Integer): Boolean;
106begin
107 Result := false;
108 if (PageID = PageProxyData.ID) then
109 Result := not EnterProxyData();
110end;
111
112
113function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
114begin
115 Result := MemoUserInfoInfo + NewLine;
116 Result := Result + MemoDirInfo + NewLine;
117 Result := Result + MemoGroupInfo + NewLine;
118 Result := Result + MemoTasksInfo + NewLine;
119
120 if (EnterProxyData()) then
121 Result := Result + NewLine + 'Set proxy configuration';
122end;
123
124
125procedure WriteProxyData();
126begin
127 if (EnterProxyData()) then
128 begin
129 SaveStringToFile(ExpandConstant('{app}') + '\AE\AEInstaller\AEI-ProxySettings.xml',
130 '<?xml version="1.0" ?><Proxy><useProxy>true</useProxy><hostOrIp>'+PageProxyData.Values[0]+'</hostOrIp><port>'+PageProxyData.Values[1]+'</port></Proxy>',
131 False);
132 end;
133end;
Note: See TracBrowser for help on using the repository browser.