| 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] | 
 
 
 
 
 | 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 | ArchitecturesInstallIn64BitMode=x64 | 
 
 
 
 
 | 21 | ShowComponentSizes=no | 
 
 
 
 
 | 22 | AppPublisher= | 
 
 
 
 
 | 23 | AppPublisherURL= | 
 
 
 
 
 | 24 | AppSupportURL= | 
 
 
 
 
 | 25 | AppUpdatesURL= | 
 
 
 
 
 | 26 | AllowNoIcons=yes | 
 
 
 
 
 | 27 | OutputDir=. | 
 
 
 
 
 | 28 | Compression=lzma2/max | 
 
 
 
 
 | 29 | SolidCompression=yes | 
 
 
 
 
 | 30 |  | 
 
 
 
 
 | 31 | [Languages] | 
 
 
 
 
 | 32 | Name: "en"; MessagesFile: "compiler:Default.isl" | 
 
 
 
 
 | 33 |  | 
 
 
 
 
 | 34 | [Messages] | 
 
 
 
 
 | 35 | en.SelectDirBrowseLabel=Please select the installation directory of Oni. | 
 
 
 
 
 | 36 |  | 
 
 
 
 
 | 37 | [CustomMessages] | 
 
 
 
 
 | 38 | en.wrongDir=This doesn't seem to be your Oni installation; I don't see a file here named "Oni.exe". | 
 
 
 
 
 | 39 | 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? | 
 
 
 
 
 | 40 |  | 
 
 
 
 
 | 41 | [Tasks] | 
 
 
 
 
 | 42 | Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked | 
 
 
 
 
 | 43 |  | 
 
 
 
 
 | 44 | [Dirs] | 
 
 
 
 
 | 45 | Name: "{app}\AE"; Permissions: users-modify | 
 
 
 
 
 | 46 |  | 
 
 
 
 
 | 47 | [Files] | 
 
 
 
 
 | 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" | 
 
 
 
 
 | 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; BeforeInstall: WriteProxyData | 
 
 
 
 
 | 60 |  | 
 
 
 
 
 | 61 |  | 
 
 
 
 
 | 62 | [Code] | 
 
 
 
 
 | 63 | var | 
 
 
 
 
 | 64 | PageUseProxy: TInputOptionWizardPage; | 
 
 
 
 
 | 65 | PageProxyData: TInputQueryWizardPage; | 
 
 
 
 
 | 66 |  | 
 
 
 
 
 | 67 |  | 
 
 
 
 
 | 68 | procedure InitializeWizard(); | 
 
 
 
 
 | 69 | begin | 
 
 
 
 
 | 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); | 
 
 
 
 
 | 78 | end; | 
 
 
 
 
 | 79 |  | 
 
 
 
 
 | 80 | function DirOk(Path: String): boolean; | 
 
 
 
 
 | 81 | begin | 
 
 
 
 
 | 82 | Result := DirExists(Path+'\GameDataFolder') and FileExists(Path+'\Oni.exe'); | 
 
 
 
 
 | 83 | end; | 
 
 
 
 
 | 84 |  | 
 
 
 
 
 | 85 | function NextButtonClick(CurPageID: Integer): boolean; | 
 
 
 
 
 | 86 | begin | 
 
 
 
 
 | 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; | 
 
 
 
 
 | 97 | end; | 
 
 
 
 
 | 98 |  | 
 
 
 
 
 | 99 |  | 
 
 
 
 
 | 100 | function EnterProxyData(): Boolean; | 
 
 
 
 
 | 101 | begin | 
 
 
 
 
 | 102 | Result := PageUseProxy.SelectedValueIndex = 1; | 
 
 
 
 
 | 103 | end; | 
 
 
 
 
 | 104 |  | 
 
 
 
 
 | 105 | function ShouldSkipPage(PageID: Integer): Boolean; | 
 
 
 
 
 | 106 | begin | 
 
 
 
 
 | 107 | Result := false; | 
 
 
 
 
 | 108 | if (PageID = PageProxyData.ID) then | 
 
 
 
 
 | 109 | Result := not EnterProxyData(); | 
 
 
 
 
 | 110 | end; | 
 
 
 
 
 | 111 |  | 
 
 
 
 
 | 112 |  | 
 
 
 
 
 | 113 | function UpdateReadyMemo(Space, NewLine, MemoUserInfoInfo, MemoDirInfo, MemoTypeInfo, MemoComponentsInfo, MemoGroupInfo, MemoTasksInfo: String): String; | 
 
 
 
 
 | 114 | begin | 
 
 
 
 
 | 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'; | 
 
 
 
 
 | 122 | end; | 
 
 
 
 
 | 123 |  | 
 
 
 
 
 | 124 |  | 
 
 
 
 
 | 125 | procedure WriteProxyData(); | 
 
 
 
 
 | 126 | begin | 
 
 
 
 
 | 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; | 
 
 
 
 
 | 133 | end; |