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

Last change on this file since 1149 was 1133, checked in by alloc, 4 years ago

Updated AEI Setup, new updater with a few more log lines, setup always allows chosing the path

File size: 4.9 KB
RevLine 
[818]1#define AppId "{{B67333BB-1CF9-4EFD-A40B-E25B5CB4C8A7}}"
[1133]2#define AppVersion "1.4"
[818]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
[1133]20CreateUninstallRegKey=no
21Uninstallable=no
22UsePreviousAppDir=no
23
24
[818]25ArchitecturesInstallIn64BitMode=x64
26ShowComponentSizes=no
27AppPublisher=
28AppPublisherURL=
29AppSupportURL=
30AppUpdatesURL=
31AllowNoIcons=yes
32OutputDir=.
33Compression=lzma2/max
34SolidCompression=yes
35
36[Languages]
37Name: "en"; MessagesFile: "compiler:Default.isl"
38
39[Messages]
40en.SelectDirBrowseLabel=Please select the installation directory of Oni.
41
42[CustomMessages]
43en.wrongDir=This doesn't seem to be your Oni installation; I don't see a file here named "Oni.exe".
44en.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]
47Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
48
49[Dirs]
50Name: "{app}\AE"; Permissions: users-modify
51
52[Files]
[1015]53Source: "AEInstaller2Updater.jar"; DestDir: "{app}\AE\AEInstaller"
54Source: "JRE\*"; DestDir: "{app}\AE\AEInstaller\JRE"; Excludes: ".svn"; Flags: createallsubdirs recursesubdirs onlyifdoesntexist
55Source: "AElogo.ico"; DestDir: "{app}\AE\AEInstaller"
[818]56
57[Icons]
[1015]58Name: "{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"
59Name: "{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"
60Name: "{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"
61Name: "{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
[818]62
63[Run]
[1015]64Filename: "{app}\AE\AEInstaller\JRE\bin\javaw.exe"; WorkingDir: "{app}\AE\AEInstaller"; Parameters: "-Dsun.java2d.d3d=false -jar AEInstaller2Updater.jar"; Flags: runasoriginaluser; BeforeInstall: WriteProxyData
[818]65
66
67[Code]
68var
[855]69 PageUseProxy: TInputOptionWizardPage;
70 PageProxyData: TInputQueryWizardPage;
[818]71
72
73procedure InitializeWizard();
74begin
[1015]75 PageUseProxy := CreateInputOptionPage(wpSelectTasks, 'Internet connection type', '', 'Do you require a proxy to connect to the internet?', true, false);
[855]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);
[818]83end;
84
85function DirOk(Path: String): boolean;
86begin
87 Result := DirExists(Path+'\GameDataFolder') and FileExists(Path+'\Oni.exe');
88end;
89
90function NextButtonClick(CurPageID: Integer): boolean;
91begin
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;
102end;
103
104
[855]105function EnterProxyData(): Boolean;
106begin
107 Result := PageUseProxy.SelectedValueIndex = 1;
108end;
109
[818]110function ShouldSkipPage(PageID: Integer): Boolean;
111begin
[855]112 Result := false;
113 if (PageID = PageProxyData.ID) then
114 Result := not EnterProxyData();
[818]115end;
116
[855]117
[818]118function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String;
119begin
120 Result := MemoUserInfoInfo + NewLine;
121 Result := Result + MemoDirInfo + NewLine;
122 Result := Result + MemoGroupInfo + NewLine;
123 Result := Result + MemoTasksInfo + NewLine;
[855]124
125 if (EnterProxyData()) then
126 Result := Result + NewLine + 'Set proxy configuration';
[818]127end;
128
[855]129
130procedure WriteProxyData();
131begin
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;
138end;
Note: See TracBrowser for help on using the repository browser.