forked from cadon/ARKStatsExtractor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
setup-debug.iss
231 lines (208 loc) · 11.7 KB
/
setup-debug.iss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
; "Inno Download Plugin" from "Third-Party Files" is required
; http://www.jrsoftware.org/is3rdparty.php
; https://mitrichsoftware.wordpress.com/inno-setup-tools/inno-download-plugin/
#include <idp.iss>
#include <idplang\german.iss>
#define AppName "ARK Smart Breeding"
#define AppPublisher "cadon & friends"
#define AppURL "https://github.com/cadon/ARKStatsExtractor"
#define AppExeName "ARK Smart Breeding.exe"
#define ReleaseDir "ARKBreedingStats\bin\Debug"
#define ReleaseDirUpdater "ASB-Updater\bin\Debug"
#define OutputDir "_publish"
#define AppVersion GetFileVersion(ReleaseDir + "\" + AppExeName)
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{8DDA440C-714D-4BE6-AD7B-F549ABB1BB02}
AppName={#AppName}
AppVersion={#AppVersion}
;AppVerName={#AppName} {#AppVersion}
AppPublisher={#AppPublisher}
AppPublisherURL={#AppURL}
AppSupportURL={#AppURL}
AppUpdatesURL={#AppURL}
DefaultDirName={pf}\{#AppName}
DefaultGroupName={#AppName}
AllowNoIcons=yes
DisableWelcomePage=no
OutputDir={#OutputDir}
OutputBaseFilename=setup-debug-ArkSmartBreeding-{#AppVersion}
Compression=lzma
SolidCompression=yes
CloseApplications=yes
UninstallDisplayIcon={app}\{#AppExeName}
[Messages]
WelcomeLabel2=This will install [name/ver] on your computer.%n%nIf you plan to run [name] as a portable version in a shared location (i.e. not in the system's Program Files folder), we recommend to use the zip file version instead of this installer.
de.WelcomeLabel2=Dieser Assistent wird jetzt [name/ver] auf Ihrem Computer installieren.%n%nWenn Sie planen [name] als portable Version in einem gemeinsam genutzten Verzeichnis (das heißt, außerhalb des Verzeichnisses für Programme) auszuführen, empfehlen wir anstelle dieses Installationsprogramms die Zip-Datei-Version zu nutzen.
[CustomMessages]
DotNetFrameworkNeededCaption=.NET Framework 4.7.2 required
de.DotNetFrameworkNeededCaption=.NET Framework 4.7.2 benötigt
DotNetFrameworkNeededDescription=To run {#AppName} the .NET Framework 4.7.2 is required.
de.DotNetFrameworkNeededDescription=Um {#AppName} auszuführen wird .NET Framework 4.7.2 benötigt.
DotNetFrameworkNeededSubCaption=Check the box below to download and install .NET Framework 4.7.2.
de.DotNetFrameworkNeededSubCaption=Markieren Sie das folgende Kästchen, um .NET Framework 4.7.2 herunterzuladen und zu installieren.
DotNetFrameworkInstall=Download and install .NET Framework 4.7.2
de.DotNetFrameworkInstall=Herunterladen und Installation von .NET Framework 4.7.2
IDP_DownloadFailed=Download of .NET Framework 4.7.2 failed. .NET Framework 4.7.2 is required to run {#AppName}.
de.IDP_DownloadFailed=Herunterladen von .NET Framework 4.7.2 fehlgeschlagen. .NET Framework 4.7.2 wird benötigt um {#AppName} auszuführen.
IDP_RetryCancel=Click 'Retry' to try downloading the files again, or click 'Cancel' to terminate setup.
de.IDP_RetryCancel=Klicken Sie 'Wiederholen', um das Herunterladen der Dateien erneut zu versuchen, oder klicken Sie auf "Abbrechen", um die Installation abzubrechen.
InstallingDotNetFramework=Installing .NET Framework 4.7.2. This might take a few minutes...
de.InstallingDotNetFramework=Installiere .NET Framework 4.7.2. Das wird eine Weile dauern ...
DotNetFrameworkFailedToLaunch=Failed to launch .NET Framework Installer with error "%1". Please fix the error then run this installer again.
de.DotNetFrameworkFailedToLaunch=Starten des .NET Framework Installer fehlgeschlagen mit Fehler "%1". Bitte den Fehler beheben und dieses Installationsprogramm erneut ausführen.
DotNetFrameworkFailed1602=.NET Framework installation was cancelled. This installation can continue, but be aware that this application may not run unless the .NET Framework installation is completed successfully.
de.DotNetFrameworkFailed1602=Die .NET Framework Installation wurde abgebrochen. Diese Installation kann fortgesetzt werden. Beachten Sie jedoch, dass diese Anwendung möglicherweise nicht ausgeführt wird, bis die .NET Framework-Installation erfolgreich abgeschlossen wurde.
DotNetFrameworkFailed1603=A fatal error occurred while installing the .NET Framework. Please fix the error, then run the installer again.
de.DotNetFrameworkFailed1603=Ein schwerwiegender Fehler trat während der Installiion des .NET Frameworks auf. Bitte den Fehler beheben und dieses Installationsprogramm erneut ausführen.
DotNetFrameworkFailed5100=Your computer does not meet the requirements of the .NET Framework.
de.DotNetFrameworkFailed5100=Ihr Computer erfüllt nicht die Voraussetzungen für das .NET Framework.
DotNetFrameworkFailedOther=The .NET Framework installer exited with an unexpected status code "%1". Please review any other messages shown by the installer to determine whether the installation completed successfully, and abort this installation and fix the problem if it did not.
de.DotNetFrameworkFailedOther=Die .NET Framework Installation endete mit dem nicht erwarteten Statuscode "%1". Überprüfen Sie alle anderen vom Installationsprogramm angezeigten Meldungen, um festzustellen, ob die Installation erfolgreich abgeschlossen wurde, und falls nicht, brechen Sie die Installation ab und beheben Sie das Problem.
DownloadImages=Download images for some of the creatures.
de.DownloadImages=Bilder für einige der Dinos herunterladen.
CreatureImages=Additional creature images
de.CreatureImages=Zusätzliche Dino-Bilder
InstallImages=Installing additionally creature images
de.InstallImages=Installiere zusätzliche Dino-Bilder
[Languages]
Name: "en"; MessagesFile: "compiler:Default.isl"
;Name: "fr"; MessagesFile: "compiler:Languages\French.isl"
Name: "de"; MessagesFile: "compiler:Languages\German.isl"
[Tasks]
; images download is configured in function NextButtonClick, unzipping is run as powershell command
Name: "images"; Description: "{cm:DownloadImages}"; GroupDescription: "{cm:CreatureImages}"; Flags: checkedonce
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: checkedonce
[Files]
Source: "{#ReleaseDir}\*"; DestDir: "{app}"; Flags: ignoreversion; Excludes: "*.pdb,*.xml"
Source: "{#ReleaseDir}\de\*"; DestDir: "{app}\de\"; Flags: ignoreversion; Excludes: "*.pdb,*.xml"
Source: "{#ReleaseDir}\es\*"; DestDir: "{app}\es\"; Flags: ignoreversion; Excludes: "*.pdb,*.xml"
Source: "{#ReleaseDir}\fr\*"; DestDir: "{app}\fr\"; Flags: ignoreversion; Excludes: "*.pdb,*.xml"
Source: "{#ReleaseDir}\it\*"; DestDir: "{app}\it\"; Flags: ignoreversion; Excludes: "*.pdb,*.xml"
Source: "{#ReleaseDir}\zh\*"; DestDir: "{app}\zh\"; Flags: ignoreversion; Excludes: "*.pdb,*.xml"
Source: "{#ReleaseDir}\json\*"; DestDir: "{localappdata}\{#AppName}\json\"; Flags: ignoreversion
Source: "{#ReleaseDir}\json\values\values.json"; DestDir: "{localappdata}\{#AppName}\json\values\"; Flags: ignoreversion
Source: "{#ReleaseDir}\json\values\_manifest.json"; DestDir: "{localappdata}\{#AppName}\json\values\"; Flags: ignoreversion
Source: "{#ReleaseDirUpdater}\asb-updater.exe"; DestDir: "{app}"; Flags: ignoreversion
[Icons]
Name: "{group}\{#AppName}"; Filename: "{app}\{#AppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#AppName}}"; Filename: "{#AppURL}"
Name: "{group}\{cm:UninstallProgram,{#AppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#AppName}"; Filename: "{app}\{#AppExeName}"; Tasks: desktopicon
[Run]
Filename: "powershell.exe"; Parameters: "-nologo -noprofile -command ""& {{ Add-Type -A 'System.IO.Compression.FileSystem'; [IO.Compression.ZipFile]::ExtractToDirectory('{tmp}\images.zip', '{localappdata}\{#AppName}\'); }"""; Flags: runminimized; StatusMsg: "{cm:InstallImages}"; Tasks: images
Filename: "{app}\{#AppExeName}"; Flags: nowait postinstall skipifsilent unchecked; Description: "{cm:LaunchProgram,{#StringChange(AppName, '&', '&&')}}"
[UninstallRun]
Filename: "taskkill"; Parameters: "/im ""{#AppExeName}"""; Flags: runhidden
[UninstallDelete]
Type: filesandordirs; Name: "{app}\img"
[Code]
var
requiresRestart: boolean;
DotNetPage: TInputOptionWizardPage;
InstallDotNetFramework: Boolean;
function DotNetFrameworkIsMissing(): Boolean;
var
bSuccess: Boolean;
regVersion: Cardinal;
begin
Result := True;
bSuccess := RegQueryDWordValue(HKLM, 'Software\Microsoft\NET Framework Setup\NDP\v4\Full', 'Release', regVersion);
if (True = bSuccess) and (regVersion >= 461308) then begin
Result := False;
end;
end;
procedure InitializeWizard;
begin
DotNetPage := CreateInputOptionPage(wpSelectTasks, ExpandConstant('{cm:DotNetFrameworkNeededCaption}'),
ExpandConstant('{cm:DotNetFrameworkNeededDescription}'), ExpandConstant('{cm:DotNetFrameworkNeededSubCaption}'), False, False);
DotNetPage.Add(ExpandConstant('{cm:DotNetFrameworkInstall}'));
DotNetPage.Values[0] := True;
//WizardForm.WelcomeLabel2.Font.Style := [fsBold]; //Bold
WizardForm.WelcomeLabel2.Font.Color := clRed; // And red colour
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID = DotNetPage.ID) and not DotNetFrameworkIsMissing() then
Result := True
else
Result := False;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if (CurPageID = DotNetPage.ID) and DotNetFrameworkIsMissing() then begin
if DotNetPage.Values[0] then begin
InstallDotNetFramework := True;
idpAddFile('http://go.microsoft.com/fwlink/?LinkId=863262', ExpandConstant('{tmp}\NetFrameworkInstaller.exe'));
idpDownloadAfter(wpReady);
end;
end;
if (CurPageID = wpSelectTasks) then begin
if IsTaskSelected('images') then
idpAddFile('https://github.com/cadon/ARKStatsExtractor/raw/master/images.zip', ExpandConstant('{tmp}\images.zip'));
idpDownloadAfter(wpReady);
end;
Result := True;
end;
function InstallFramework(): String;
var
StatusText: string;
ResultCode: Integer;
begin
StatusText := WizardForm.StatusLabel.Caption;
WizardForm.StatusLabel.Caption := CustomMessage('InstallingDotNetFramework');
WizardForm.ProgressGauge.Style := npbstMarquee;
try
if not Exec(ExpandConstant('{tmp}\NetFrameworkInstaller.exe'), '/passive /norestart /showrmui /showfinalerror', '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
Result := FmtMessage(CustomMessage('DotNetFrameworkFailedToLaunch'), [SysErrorMessage(resultCode)]);
end
else
begin
// See https://msdn.microsoft.com/en-us/library/ee942965(v=vs.110).aspx#return_codes
case resultCode of
0: begin
// Successful
end;
1602 : begin
MsgBox(CustomMessage('DotNetFrameworkFailed1602'), mbInformation, MB_OK);
end;
1603: begin
Result := CustomMessage('DotNetFrameworkFailed1603');
end;
1641: begin
requiresRestart := True;
end;
3010: begin
requiresRestart := True;
end;
5100: begin
Result := CustomMessage('DotNetFrameworkFailed5100');
end;
else begin
MsgBox(FmtMessage(CustomMessage('DotNetFrameworkFailedOther'), [IntToStr(resultCode)]), mbError, MB_OK);
end;
end;
end;
finally
WizardForm.StatusLabel.Caption := StatusText;
WizardForm.ProgressGauge.Style := npbstNormal;
DeleteFile(ExpandConstant('{tmp}\NetFrameworkInstaller.exe'));
end;
end;
function PrepareToInstall(var NeedsRestart: Boolean): String;
begin
// 'NeedsRestart' only has an effect if we return a non-empty string, thus aborting the installation.
// If the installers indicate that they want a restart, this should be done at the end of installation.
// Therefore we set the global 'restartRequired' if a restart is needed, and return this from NeedRestart()
if InstallDotNetFramework then
begin
Result := InstallFramework();
end;
end;
function NeedRestart(): Boolean;
begin
Result := requiresRestart;
end;