-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMaxPayne_Launcher.au3
304 lines (304 loc) · 16.1 KB
/
MaxPayne_Launcher.au3
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
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
#NoTrayIcon
#Region ;**** Directives created by AutoIt3Wrapper_GUI ****
#AutoIt3Wrapper_Icon=MaxPayne_icon.ico
#AutoIt3Wrapper_Outfile=MaxPayne_Launcher.exe
#AutoIt3Wrapper_Compression=4
#AutoIt3Wrapper_UseUpx=n
#AutoIt3Wrapper_UPX_Parameters=-9 --strip-relocs=0 --compress-exports=0 --compress-icons=0
#AutoIt3Wrapper_Res_Description=Max Payne Launcher
#AutoIt3Wrapper_Res_Fileversion=1.0.0.47
#AutoIt3Wrapper_Res_ProductVersion=1.0.0.47
#AutoIt3Wrapper_Res_LegalCopyright=2014, SalFisher47
#AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
#AutoIt3Wrapper_Res_SaveSource=n
#EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
#Region ;**** Pragma Compile ****
#pragma compile(AutoItExecuteAllowed, true)
#pragma compile(Compression, 9)
#pragma compile(Compatibility, vista, win7, win8, win81, win10)
#pragma compile(InputBoxRes, true)
#pragma compile(CompanyName, 'SalFisher47')
#pragma compile(FileDescription, 'Max Payne Launcher')
#pragma compile(FileVersion, 1.0.0.47)
#pragma compile(InternalName, 'Max Payne Launcher')
#pragma compile(LegalCopyright, '2014, SalFisher47')
#pragma compile(OriginalFilename, MaxPayne_Launcher.exe)
#pragma compile(ProductName, 'Max Payne Launcher')
#pragma compile(ProductVersion, 1.0.0.47)
#EndRegion ;**** Pragma Compile ****
; === UniCrack Installer.au3 =======================================================================================================
; Title .........: Max Payne Launcher
; Version .......: 1.0.0.47
; AutoIt Version : 3.3.14.5
; Language ......: English
; Description ...: Max Payne Widescreen Launcher
; - based on ThirteenAG's widescreen fix
; Author(s) .....: SalFisher47
; Last Modified .: January 02, 2019
; ==================================================================================================================================
$exe32bit = @ScriptDir & "\MaxPayne.exe"
$widescreen_fix_ini = @ScriptDir & "\scripts\MP1_widescreen_fix.ini"
$widescreen_fix_asi = @ScriptDir & "\scripts\MP1_widescreen_fix.asi"
$iniResX = IniRead($widescreen_fix_ini, "MAIN", "X", 0)
$iniResY = IniRead($widescreen_fix_ini, "MAIN", "Y", 0)
If ($iniResX == 0) And ($iniResY == 0) Then
$iniResX = @DesktopWidth
$iniResY = @DesktopHeight
ElseIf ($iniResX == 0) Or ($iniResY == 0) Then
IniWrite($widescreen_fix_ini, "MAIN", "X", " 0")
IniWrite($widescreen_fix_ini, "MAIN", "Y", " 0")
$iniResX = @DesktopWidth
$iniResY = @DesktopHeight
EndIf
$desktopX = $iniResX
$desktopY = $iniResY
$desktopRatio = Round($desktopX/$desktopY, 2)
$RunFirst = IniRead(@ScriptDir & "\MaxPayne_Launcher.ini", "GAME", "RunFirst", 0)
$cracked = IniRead($widescreen_fix_ini, "EXE", "cracked", "0")
DirCreate(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher")
FileInstall("MaxPayne_ProgramData.ini", @AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", 0)
If Not FileExists(@AppDataCommonDir & "\SalFisher47\RunFirst") Then DirCreate(@AppDataCommonDir & "\SalFisher47\RunFirst")
FileInstall("RunFirst\RunFirst.exe", @AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", 0)
FileInstall("RunFirst\RunFirst.txt", @AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.txt", 0)
$cracked_ProgramData = IniRead(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", 0)
$CustomizedGame_Bonus = "Bonus Dead Man Walking Chapters"
If Not FileExists($exe32bit) Then
MsgBox(16, "Max Payne Launcher", "Executable not found:" & @CRLF & "..\MaxPayne.exe")
Exit
EndIf
Switch $desktopRatio
Case 1.33 ; 4:3 aspect ratio, 1024x768
If not FileExists($widescreen_fix_ini) Then
DirCreate(@ScriptDir & "\scripts")
FileInstall("d3d8.dll", @ScriptDir & "\d3d8.dll", 0)
FileInstall("scripts\MP1_widescreen_fix.ini", $widescreen_fix_ini, 0)
FileInstall("scripts\MP1_widescreen_fix.asi", $widescreen_fix_asi, 0)
EndIf
$CustomizedGame_Bonus = ""
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Customized Game", "Customized Game", "REG_SZ", $CustomizedGame_Bonus)
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Bits Per Pixel", "REG_DWORD", Binary(32))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Height", "REG_DWORD", Binary($desktopY))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Width", "REG_DWORD", Binary($desktopX))
If $cracked == 1 Then
If $cracked_ProgramData == 1 Then
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Case 1.25 ; 5:4 aspect ratio, 1280x1024
If not FileExists($widescreen_fix_ini) Then
DirCreate(@ScriptDir & "\scripts")
FileInstall("d3d8.dll", @ScriptDir & "\d3d8.dll", 0)
FileInstall("scripts\MP1_widescreen_fix.ini", $widescreen_fix_ini, 0)
FileInstall("scripts\MP1_widescreen_fix.asi", $widescreen_fix_asi, 0)
EndIf
$CustomizedGame_Bonus = ""
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Customized Game", "Customized Game", "REG_SZ", $CustomizedGame_Bonus)
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Bits Per Pixel", "REG_DWORD", Binary(32))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Height", "REG_DWORD", Binary($desktopY))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Width", "REG_DWORD", Binary($desktopX))
If $cracked == 1 Then
If $cracked_ProgramData == 1 Then
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Case 1.77 ; 16:9 aspect ratio, 1360x768
If not FileExists($widescreen_fix_ini) Then
DirCreate(@ScriptDir & "\scripts")
FileInstall("d3d8.dll", @ScriptDir & "\d3d8.dll", 0)
FileInstall("scripts\MP1_widescreen_fix.ini", $widescreen_fix_ini, 0)
FileInstall("scripts\MP1_widescreen_fix.asi", $widescreen_fix_asi, 0)
EndIf
$CustomizedGame_Bonus = "Widescreen HUD"
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Customized Game", "Customized Game", "REG_SZ", $CustomizedGame_Bonus)
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Bits Per Pixel", "REG_DWORD", Binary(32))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Height", "REG_DWORD", Binary($desktopY))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Width", "REG_DWORD", Binary($desktopX))
If $cracked == 1 Then
If $cracked_ProgramData == 1 Then
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Case 1.78 ; 16:9 aspect ratio, 1366x768
If not FileExists($widescreen_fix_ini) Then
DirCreate(@ScriptDir & "\scripts")
FileInstall("d3d8.dll", @ScriptDir & "\d3d8.dll", 0)
FileInstall("scripts\MP1_widescreen_fix.ini", $widescreen_fix_ini, 0)
FileInstall("scripts\MP1_widescreen_fix.asi", $widescreen_fix_asi, 0)
EndIf
$CustomizedGame_Bonus = "Widescreen HUD"
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Customized Game", "Customized Game", "REG_SZ", $CustomizedGame_Bonus)
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Bits Per Pixel", "REG_DWORD", Binary(32))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Height", "REG_DWORD", Binary($desktopY))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Width", "REG_DWORD", Binary($desktopX))
If $cracked == 1 Then
If $cracked_ProgramData == 1 Then
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Case 1.60 ; 16:10 aspect ratio, 1440x900
If not FileExists($widescreen_fix_ini) Then
DirCreate(@ScriptDir & "\scripts")
FileInstall("d3d8.dll", @ScriptDir & "\d3d8.dll", 0)
FileInstall("scripts\MP1_widescreen_fix.ini", $widescreen_fix_ini, 0)
FileInstall("scripts\MP1_widescreen_fix.asi", $widescreen_fix_asi, 0)
EndIf
$CustomizedGame_Bonus = "Widescreen HUD"
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Customized Game", "Customized Game", "REG_SZ", $CustomizedGame_Bonus)
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Bits Per Pixel", "REG_DWORD", Binary(32))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Height", "REG_DWORD", Binary($desktopY))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Width", "REG_DWORD", Binary($desktopX))
If $cracked == 1 Then
If $cracked_ProgramData == 1 Then
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Case Else ; other aspect ratio
If not FileExists($widescreen_fix_ini) Then
DirCreate(@ScriptDir & "\scripts")
FileInstall("d3d8.dll", @ScriptDir & "\d3d8.dll", 0)
FileInstall("scripts\MP1_widescreen_fix.ini", $widescreen_fix_ini, 0)
FileInstall("scripts\MP1_widescreen_fix.asi", $widescreen_fix_asi, 0)
EndIf
$CustomizedGame_Bonus = ""
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Customized Game", "Customized Game", "REG_SZ", $CustomizedGame_Bonus)
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Bits Per Pixel", "REG_DWORD", Binary(32))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Height", "REG_DWORD", Binary($desktopY))
RegWrite("HKCU\Software\Remedy Entertainment\Max Payne\Video Settings", "Display Width", "REG_DWORD", Binary($desktopX))
If $cracked == 1 Then
If $cracked_ProgramData == 1 Then
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
Else
FileInstall("MaxPayne.exe", @ScriptDir & "\MaxPayne.exe", 1)
IniWrite($widescreen_fix_ini, "EXE", "cracked", " 1")
IniWrite(@AppDataCommonDir & "\SalFisher47\WidescreenLauncher\MaxPayne1.ini", "EXE", "cracked", " 1")
If $RunFirst == 1 Then
ShellExecute(@AppDataCommonDir & "\SalFisher47\RunFirst\RunFirst.exe", '"' & $exe32bit & '"' & " " & $CmdLineRaw, @ScriptDir, "", @SW_HIDE)
Else
ShellExecute($exe32bit, " " & $CmdLineRaw, @ScriptDir)
EndIf
EndIf
EndSwitch