etlegacy-tools/inno_installer/etl_innoinstaller.iss

165 lines
No EOL
6.2 KiB
Text

; Script generated by the Inno Setup Script Wizard.
; TODO
; * fixme: missing file icons (add ader10's new icons)
; * fixme: windows text is scribbled on the Download page
; * (option) import etkey from W:ET 2.60b installation
; * (option) install omnibot files
; Inno Downloader script (had to be updated)
#include <./it_download.iss>
#define MyAppName "Enemy Territory - Legacy"
#define MyAppVersion "2.70"
#define MyAppPublisher "ET:L Team"
#define MyAppURL "http://www.etlegacy.com"
#define MyAppExeName "etl.exe"
[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={{9695CADB-4A88-444C-9A0F-B1D27D15AE5F}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\Enemy Territory - Legacy
DefaultGroupName={#MyAppName}
AllowNoIcons=yes
LicenseFile=files\COPYING.txt
InfoBeforeFile=intro.rtf
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
Name: "czech"; MessagesFile: "compiler:Languages\Czech.isl"
Name: "german"; MessagesFile: "compiler:Languages\German.isl"
Name: "polish"; MessagesFile: "compiler:Languages\Polish.isl"
[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
[Files]
Source: "files\etl.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "files\etlded.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "files\legacy\*"; DestDir: "{app}\legacy\"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "files\libcurl.dll"; DestDir: "{app}"; Flags: ignoreversion
Source: "files\SDL.dll"; DestDir: "{app}"; Flags: ignoreversion
; W:ET 2.60b game data
Source: "{code:GetPakPath|pak0}"; DestDir: "{app}\etmain"; Flags: ignoreversion external
Source: "{code:GetPakPath|pak1}"; DestDir: "{app}\etmain"; Flags: ignoreversion external
Source: "{code:GetPakPath|pak2}"; DestDir: "{app}\etmain"; Flags: ignoreversion external
Source: "{code:GetPakPath|mp_bin}"; DestDir: "{app}\etmain"; Flags: ignoreversion external
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:ProgramOnTheWeb,{#MyAppName}}"; Filename: "{#MyAppURL}"
Name: "{group}\{cm:UninstallProgram,{#MyAppName}}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
[Code]
var
pak0, pak1, pak2, mp_bin: String;
InstallDataPage: TInputOptionWizardPage;
EtmainDirPage: TInputDirWizardPage;
DownloadFiles: Boolean;
procedure InitializeWizard;
begin
InstallDataPage := CreateInputOptionPage(wpSelectDir,
'Required game data', 'You must have W:ET game datafiles in order to play ET:L',
'Do you want to download required data files (pak0.pk3, pak1.pk3, pak2.pk3, mp_bin.pk3)?'#10#10'If Wolfenstein: Enemy Territory 2.60b is already installed, select No, then click Next.',
True, False);
InstallDataPage.Add('Yes, download required files');
InstallDataPage.Add('No, copy files from W:ET installation');
// Set initial values (optional)
InstallDataPage.SelectedValueIndex := 0; // Default: Yes
// Locate W:ET 2.60b etmain directory
EtmainDirPage := CreateInputDirPage(InstallDataPage.ID,
'Select "etmain" directory inside W:ET 2.60b installation', '',
'Select the "etmain" folder inside your Wolfenstein: Enemy Territory 2.60b installation, then click Next.',
False, '');
EtmainDirPage.Add('');
// Download W:ET data files
itd_init;
itd_downloadafter(wpReady);
end;
function ShouldSkipPage(PageID: Integer): Boolean;
begin
{ Skip pages that shouldn't be shown }
if (PageID = EtmainDirPage.ID) and not (InstallDataPage.SelectedValueIndex <> 0) then
Result := True
else
Result := False;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
begin
if CurPageID = EtmainDirPage.ID then begin
pak0 := EtmainDirPage.Values[0] + '\pak0.pk3';
pak1 := EtmainDirPage.Values[0] + '\pak1.pk3';
pak2 := EtmainDirPage.Values[0] + '\pak2.pk3';
mp_bin := EtmainDirPage.Values[0] + '\mp_bin.pk3';
Result := False;
if not FileExists(pak0) then begin
MsgBox('Sorry, pak0.pk3 not found in ' + pak0, mbError, MB_OK)
exit;
end;
if not FileExists(pak1) then begin
MsgBox('Sorry, pak1.pk3 not found in ' + pak1, mbError, MB_OK)
exit;
end;
if not FileExists(pak2) then begin
MsgBox('Sorry, pak2.pk3 not found in ' + pak2, mbError, MB_OK)
exit;
end;
if not FileExists(mp_bin) then begin
MsgBox('Sorry, mp_bin.pk3 not found in ' + mp_bin, mbError, MB_OK)
exit;
end;
Result := True;
end else if (CurPageID = InstallDataPage.ID) and not (InstallDataPage.SelectedValueIndex <> 0) then begin
DownloadFiles := (InstallDataPage.SelectedValueIndex <> 0);
pak0 := expandconstant('{tmp}\pak0.pk3');
pak1 := expandconstant('{tmp}\pak1.pk3');
pak2 := expandconstant('{tmp}\pak2.pk3');
mp_bin := expandconstant('{tmp}\mp_bin.pk3');
itd_setstring(200, 'Downloading additional files');
itd_setstring(201, 'Please wait while setup downloads additional files...');
itd_addfile('http://mirror.etlegacy.com/etmain/pak0.pk3',pak0);
itd_addfile('http://mirror.etlegacy.com/etmain/pak1.pk3',pak1);
itd_addfile('http://mirror.etlegacy.com/etmain/pak2.pk3',pak2);
itd_addfile('http://mirror.etlegacy.com/etmain/mp_bin.pk3',mp_bin);
Result := True;
end else begin
Result := True;
end;
end;
function GetPakPath(pak: String): String;
begin
if pak = 'pak0' then begin
Result := pak0
end;
if pak = 'pak1' then begin
Result := pak1
end;
if pak = 'pak2' then begin
Result := pak2
end;
if pak = 'mp_bin' then begin
Result := mp_bin
end;
end;