-
Notifications
You must be signed in to change notification settings - Fork 4
/
Tomb Raider Automated Fix.iss
174 lines (155 loc) · 7.34 KB
/
Tomb Raider Automated Fix.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
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!
#define AppName "Tomb Raider Automated Fix"
#define AppVersion "1.2.1"
#define Game "Tomb Raider I"
[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={{D4780545-DC3A-4239-A839-B7B1698506D5}
AppName={#AppName}
AppVersion={#AppVersion}
DefaultDirName={code:GetDefaultDir}
DisableProgramGroupPage=yes
DirExistsWarning=no
DisableDirPage=no
AppendDefaultDirName=no
DisableReadyPage=no
AlwaysShowDirOnReadyPage=yes
CloseApplications=yes
OutputBaseFilename={#AppName} {#AppVersion}
SetupIconFile=TR1.ico
WizardImageFile=TR1_Large.bmp
WizardImageStretch=no
WizardSmallImageFile=TR1_small.bmp
;SetupLogging=yes
Compression=none
SolidCompression=no
Uninstallable=no
PrivilegesRequired=admin
[Types]
Name: standard; Description: Standard
Name: fmv_psx; Description: PSX Cutscenes;
Name: fmv_remastered; Description: Remastered Cutscenes;
Name: custom; Description: Custom Installation; Flags: iscustom
[Components]
Name: base; Description: Tomb Raider Automated Fix; Flags: fixed; Types: standard custom;
Name: fmv; Description: FMV Cutscenes; Flags: fixed; Types: standard custom;
Name: fmv\original; Description: Original; Flags: exclusive; Types: standard;
Name: fmv\enhanced; Description: Enhanced; Flags: exclusive
Name: fmv\enhanced\psx; Description: PSX (Higher quality); Flags: exclusive; Types: fmv_psx;
Name: fmv\enhanced\remastered; Description: Remastered (HD upscaled by LeonDeka); Flags: exclusive; Types: fmv_remastered;
[Tasks]
Name: codec; Description: "Install CCCP Codec (recommended)"; GroupDescription: "A supported H.264/MPEG-4 AVC codec is required to view the enhanced cutscenes."; Components: fmv\enhanced
[Files]
Source: ".\Install\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\TombATI\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: ".\Extras\Codec\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Tasks: codec
Source: ".\Extras\FMV_PSX\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: fmv\enhanced\psx
Source: ".\Extras\FMV_Remastered\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; Components: fmv\enhanced\remastered
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Code]
var ProgressPage: TOutputProgressWizardPage;
function GetDefaultDir(def: string): string;
var InstalledDir : string;
begin
//Check 32bit registry
if RegQueryStringValue(HKLM, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 224960',
'InstallLocation', InstalledDir) then
begin
end
else if RegQueryStringValue(HKLM32, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 224960',
'InstallLocation', InstalledDir) then
begin
end
//Check 64bit registry
else if RegQueryStringValue(HKLM64, 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Steam App 224960',
'InstallLocation', InstalledDir) then
begin
end;
Result:=InstalledDir;
end;
function NextButtonClick(PageId: Integer): Boolean;
begin
Result := True;
if (PageId = wpSelectDir) and (
not FileExists(ExpandConstant('{app}\dosbox.exe'))
and not FileExists(ExpandConstant('{app}\TOMBRAID\tomb.exe'))
) then
begin
MsgBox('The Steam or GOG version of {#Game} could not be found in that folder. If it is the correct folder, please try reinstalling the game.', mbError, MB_OK);
Result := False;
exit;
end
end;
procedure CurStepChanged(CurStep: TSetupStep);
var ErrorCode: Integer;
begin
if CurStep = ssPostInstall then
begin
//Start Post Install
ProgressPage := CreateOutputProgressPage('Installing...','');
ProgressPage.Show;
ProgressPage.SetProgress(10, 100);
Exec(ExpandConstant('{app}\bin2iso.exe'), ExpandConstant('GAME.DAT'), '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Exec(ExpandConstant('{app}\7z.exe'), ExpandConstant('x -y game-01.iso -i!DATA\ -xr!LEVEL10C.PHD'), '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
Exec(ExpandConstant('{app}\7z.exe'), ExpandConstant('x -y game-01.iso -i!FMV\'), '', SW_HIDE, ewWaitUntilTerminated, ErrorCode);
//Remove unneeded folders
ProgressPage.SetText('Removing unneeded folders...', '');
ProgressPage.SetProgress(25, 100);
DelTree(ExpandConstant('{app}\DOCS'), True, True, True);
DelTree(ExpandConstant('{app}\FONTS'), True, True, True);
DelTree(ExpandConstant('{app}\TOMBRAID'), True, True, True);
DelTree(ExpandConstant('{app}\TOOLS'), True, True, True);
//Install Visual C++ Runtimes
ProgressPage.SetText('Installing Visual C++ Redistributables...', '');
ProgressPage.SetProgress(50, 100);
Exec(ExpandConstant('{app}\_CommonRedist\vc_redist.x86.exe'), '/silent', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
Exec(ExpandConstant('{app}\_CommonRedist\vc_redist.x64.exe'), '/silent', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
if IsTaskSelected('codec') then
begin
ProgressPage.SetProgress(70, 100);
ProgressPage.SetText('Installing CCCP codec...', '');
Exec(ExpandConstant('{app}\_CommonRedist\CCCP.exe'), '/verysilent /type=NoPlayers', '', SW_SHOW, ewWaitUntilTerminated, ErrorCode);
DelTree(ExpandConstant('{app}\FMV\ESCAPE.rpl'), False, True, False);
end;
//Delete files - 7z, bin2iso game-01.iso GAME.DAT GAME.GOG
DelTree(ExpandConstant('{app}\7z.dll'), False, True, False);
DelTree(ExpandConstant('{app}\7z.exe'), False, True, False);
DelTree(ExpandConstant('{app}\bin2iso.exe'), False, True, False);
DelTree(ExpandConstant('{app}\game-01.iso'), False, True, False);
DelTree(ExpandConstant('{app}\GAME.dat'), False, True, False);
DelTree(ExpandConstant('{app}\GAME.GOG'), False, True, False);
//End Post Install
ProgressPage.Hide;
end;
end;
[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"
[Messages]
SetupAppTitle={#AppName} {#AppVersion}
SetupWindowTitle={#AppName} {#AppVersion}
WelcomeLabel1={#AppName} {#AppVersion}
WelcomeLabel2=Before continuing, please make sure that you have a clean install of the {#Game} Steam or GOG release.
SelectDirLabel3=Setup will detect where the Steam version of {#Game} has been installed.
SelectDirBrowseLabel=If it has not been detected, click Browse to specify the folder.
FinishedHeadingLabel=Patch Complete
[InstallDelete]
Type: files; Name: "{app}\3dfxSpl2.dll"
Type: files; Name: "{app}\d3dx9.dll"
Type: files; Name: "{app}\dosboxTR.conf"
Type: files; Name: "{app}\glide.log"
Type: files; Name: "{app}\glide.txt"
Type: files; Name: "{app}\glide2x.dll"
Type: files; Name: "{app}\glide2x.ovl"
Type: files; Name: "{app}\glide2x_emu.ovl"
Type: files; Name: "{app}\gogwrap.exe"
Type: files; Name: "{app}\libfluidsynth-1.dll"
Type: files; Name: "{app}\libglib-2.0-0.dll"
Type: files; Name: "{app}\libgthread-2.0-0.dll"
Type: files; Name: "{app}\libphysfs.dll"
Type: files; Name: "{app}\SDL.dll"
Type: files; Name: "{app}\SDL_net.dll"
Type: files; Name: "{app}\TOMBPATH.txt"
Type: files; Name: "{app}\*.mp3"