Advertisement
Guest User

Xtreme Black Box by HPMBOT149

a guest
Jun 16th, 2016
398
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 59.97 KB | None | 0 0
  1. //-------------------This Installer Uses Inno Setup Unicode Version-----------------\\
  2. //----------------THIS SCRIPT HAS BEEN CREATED BY HPMBOT149@FILEFORUMS--------------\\
  3. #define AppName "Grand Theft Auto IV"
  4. #define AppPublisher "Rockstar Games"
  5. #define AppVersion "1.0.7.0"
  6. #define AppExec "LaunchGTAIV.exe"
  7. #define AppURL "http://www.rockstargames.com/IV/"
  8. #define AppSize "15872"
  9. #define SetupName "GTA IV Setup"
  10. #define SetupOut "Output"
  11. #define PrecompVer "Inside"
  12.  
  13. [Setup]
  14. AppName={#AppName}
  15. AppPublisher={#AppPublisher}
  16. AppVersion={#AppVersion}
  17. AppComments={#AppName}
  18. DefaultDirName={pf}\{#AppPublisher}\{#AppName}
  19. DefaultGroupName=Rockstar Games
  20. DirExistsWarning=No
  21. OutputBaseFilename={#SetupName}
  22. OutputDir={#SetupOut}
  23. UsePreviousAppDir=No
  24. SetupIconFile=Style\Setup.ico
  25. WizardImageFile=Style\Background.bmp
  26. WizardSmallImageFile=Style\smallbitmap.bmp
  27. Compression=none
  28.  
  29. [Icons]
  30. Name: {group}\Uninstall {#AppName}; Filename: {app}\{uninstallexe}; WorkingDir: {app}; Check: CheckError; IconFileName: {app}\GTAIV.ico
  31. Name: {group}\{#AppName}; Filename: {app}\{#AppExec}; WorkingDir: {app}; Check: CheckError; IconFileName: {app}\GTAIV.ico
  32. Name: {commondesktop}\{#AppName}; Filename: {app}\{#AppExec}; WorkingDir: {app}; Check: CheckError; IconFileName: {app}\GTAIV.ico
  33.  
  34.  
  35. [Files]
  36. Source: Include\*.*; DestDir: {tmp}; Flags: dontcopy
  37. Source: Style\*.*; DestDir: {tmp}; Flags: dontcopy
  38.  
  39.  
  40. #define i 0
  41. #ifexist "Slides\1.jpg"
  42. #sub AddFile
  43. Source: Slides\{#i}.jpg; DestDir: {tmp}; Flags: dontcopy;
  44. #endsub
  45. #for {i = 1; FileExists(StringChange("Slides\FileName.jpg", "FileName", Str(i))) != 0; i++} AddFile
  46. #endif
  47.  
  48. #ifexist "Video.avi"
  49. Source: Style\Video.avi; DestDir: {tmp}; Flags: dontcopy
  50. #endif
  51. #ifexist "Video.mp4"
  52. Source: Style\Video.mp4; DestDir: {tmp}; Flags: dontcopy
  53. #endif
  54. #ifexist "Video.mpeg"
  55. Source: Style\Video.mpeg; DestDir: {tmp}; Flags: dontcopy
  56. #endif
  57. #ifexist "Video.mpg"
  58. Source: Style\Video.mpg; DestDir: {tmp}; Flags: dontcopy
  59. #endif
  60. #ifexist "Video.wmv"
  61. Source: Style\Video.wmv; DestDir: {tmp}; Flags: dontcopy
  62. #endif
  63.  
  64.  
  65. [Messages]
  66. SetupWindowTitle= Welcome to Grand Theft Auto IV Setup Wizard
  67.  
  68. [CustomMessages]
  69. SoundCtrlButtonCaptionSoundOn=Music on
  70. SoundCtrlButtonCaptionSoundOff=Music off
  71.  
  72. [Languages]
  73. Name: eng; MessagesFile: compiler:Default.isl
  74.  
  75. [Components]
  76. Name: "directx"; Description: "Install DirectX"
  77. Name: "visualc"; Description: "Install Visual C++"
  78. Name: "nvidiaphysx"; Description: "Install Nvidia Physx"
  79. Name: "framework"; Description: "Install Framework"
  80.  
  81. [Tasks]
  82. Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
  83.  
  84. [UninstallDelete]
  85. Type: filesandordirs; Name: {app}
  86.  
  87. [Code]
  88. const
  89. BASS_SAMPLE_LOOP = 4;
  90. BASS_ACTIVE_STOPPED = 0;
  91. BASS_ACTIVE_PLAYING = 1;
  92. BASS_ACTIVE_STALLED = 2;
  93. BASS_ACTIVE_PAUSED = 3;
  94. BASS_UNICODE = $80000000;
  95. BASS_CONFIG_GVOL_STREAM = 5;
  96. const
  97. #ifndef UNICODE
  98. EncodingFlag = 0;
  99. #else
  100. EncodingFlag = BASS_UNICODE;
  101. #endif
  102. type
  103. HSTREAM = DWORD;
  104.  
  105. function BASS_Init(device: LongInt; freq, flags: DWORD;
  106. win: HWND; clsid: Cardinal): BOOL;
  107. external 'BASS_Init@files:bass.dll stdcall';
  108. function BASS_StreamCreateFile(mem: BOOL; f: string; offset1: DWORD;
  109. offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
  110. external 'BASS_StreamCreateFile@files:bass.dll stdcall';
  111. function BASS_Start: BOOL;
  112. external 'BASS_Start@files:bass.dll stdcall';
  113. function BASS_Pause: BOOL;
  114. external 'BASS_Pause@files:bass.dll stdcall';
  115. function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL;
  116. external 'BASS_ChannelPlay@files:bass.dll stdcall';
  117. function BASS_SetConfig(option: DWORD; value: DWORD ): BOOL;
  118. external 'BASS_SetConfig@files:bass.dll stdcall';
  119. function BASS_ChannelIsActive(handle: DWORD): DWORD;
  120. external 'BASS_ChannelIsActive@files:bass.dll stdcall';
  121. function BASS_Free: BOOL;
  122. external 'BASS_Free@files:bass.dll stdcall';
  123.  
  124. type
  125. TDirectShowEventProc = procedure(EventCode, Param1, Param2: Integer);
  126.  
  127. function DSGetLastError(var ErrorText: WideString): HRESULT;
  128. external 'DSGetLastError@files:mediaplayer.dll stdcall';
  129. function DSPlayMediaFile: Boolean;
  130. external 'DSPlayMediaFile@files:mediaplayer.dll stdcall';
  131. function DSStopMediaPlay: Boolean;
  132. external 'DSStopMediaPlay@files:mediaplayer.dll stdcall';
  133. function DSSetVolume(Value: LongInt): Boolean;
  134. external 'DSSetVolume@files:mediaplayer.dll stdcall';
  135. function DSSetBalance(Value: LongInt): Boolean;
  136. external 'DSSetBalance@files:mediaplayer.dll stdcall';
  137. function DSInitializeAudioFile(FileName: WideString; CallbackProc: TDirectShowEventProc): Boolean;
  138. external 'DSInitializeAudioFile@files:mediaplayer.dll stdcall';
  139. function DSInitializeVideoFile(FileName: WideString; WindowHandle: HWND; var Width, Height: Integer; CallbackProc: TDirectShowEventProc): Boolean;
  140. external 'DSInitializeVideoFile@files:mediaplayer.dll stdcall';
  141.  
  142. var
  143. SoundStream: HSTREAM;
  144. SoundCtrlButton: TNewButton;
  145. CompactCheckBox: TNewCheckBox;
  146. NoBackgroundCheckBox: TNewCheckBox;
  147.  
  148. procedure SoundCtrlButtonClick(Sender: TObject);
  149. begin
  150. case BASS_ChannelIsActive(SoundStream) of
  151. BASS_ACTIVE_PLAYING:
  152. begin
  153. if BASS_Pause then
  154. SoundCtrlButton.Caption :=
  155. ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOn}');
  156. end;
  157. BASS_ACTIVE_PAUSED:
  158. begin
  159. if BASS_Start then
  160. SoundCtrlButton.Caption :=
  161. ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
  162. end;
  163. end;
  164. end;
  165.  
  166. #ifdef Unicode
  167. #define A "W"
  168. #else
  169. #define A "A"
  170. #endif
  171.  
  172. { RedesignWizardFormBegin } // Don't remove this line!
  173. // Don't modify this section. It is generated automatically.
  174. procedure RedesignWizardForm;
  175. begin
  176. with WizardForm.ProgressGauge do
  177. begin
  178. Height := ScaleY(13);
  179. end;
  180.  
  181. { ReservationBegin }
  182. // This part is for you. Add your specialized code here.
  183.  
  184. { ReservationEnd }
  185. end;
  186. // Don't modify this section. It is generated automatically.
  187. { RedesignWizardFormEnd } // Don't remove this line!
  188.  
  189. #ifdef UNICODE
  190. type
  191.  
  192. PChar = PAnsiChar;
  193. #endif
  194. const
  195. PCFonFLY=true;
  196. notPCFonFLY=false;
  197. var
  198. LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
  199. ISDoneProgressBar1: TNewProgressBar;
  200. MyCancelButton: TButton;
  201. ISDoneCancel:integer;
  202. ISDoneError:boolean;
  203. PCFVer:double;
  204.  
  205. TimerID: LongWord;
  206. CurrentPicture:integer;
  207. PicList: TStringlist;
  208. BackgroundForm: TForm;
  209. VBRadio1,VBRadio2: TNewRadioButton;
  210. FWAdd: Boolean;
  211. BGLabel3,BGLabel2,BGLabel1:TLabel;
  212. BGBevel1,BGBevel2,BGBevel3,BGBevel4:TBevel;
  213. PauseBT,PlayBT,PlayBT1:TBitmapImage;
  214.  
  215. type
  216. TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
  217.  
  218. function WrapCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:ISDone.dll stdcall delayload';
  219.  
  220. function ISArcExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath, ExtractedPath: AnsiString; DeleteInFile:boolean; Password, CfgFile, WorkPath: AnsiString; ExtractPCF: boolean ):boolean; external 'ISArcExtract@files:ISDone.dll stdcall delayload';
  221. function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
  222. function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'ISRarExtract@files:ISDone.dll stdcall delayload';
  223. function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
  224. function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
  225. function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean; external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
  226. function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean; external 'ISPackZIP@files:ISDone.dll stdcall delayload';
  227. function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';
  228.  
  229. function sndPlaySound(lpszSoundName: string; uFlags: cardinal):integer;
  230. external 'sndPlaySound{#A}@winmm.dll stdcall';
  231.  
  232. function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean; external 'Exec2@files:ISDone.dll stdcall delayload';
  233. function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer; external 'ISFindFiles@files:ISDone.dll stdcall delayload';
  234. function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean; external 'ISPickFilename@files:ISDone.dll stdcall delayload';
  235. function ISGetName(TypeStr:integer):PAnsichar; external 'ISGetName@files:ISDone.dll stdcall delayload';
  236. function ISFindFree(FindHandle:integer):boolean; external 'ISFindFree@files:ISDone.dll stdcall delayload';
  237. function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean; external 'ISExec@files:ISDone.dll stdcall delayload';
  238.  
  239. function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean; external 'SrepInit@files:ISDone.dll stdcall delayload';
  240. function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean; external 'PrecompInit@files:ISDone.dll stdcall delayload';
  241. function FileSearchInit(RecursiveSubDir:boolean):boolean; external 'FileSearchInit@files:ISDone.dll stdcall delayload';
  242. function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean; external 'ISDoneInit@files:ISDone.dll stdcall';
  243. function ISDoneStop:boolean; external 'ISDoneStop@files:ISDone.dll stdcall';
  244. function ChangeLanguage(Language:AnsiString):boolean; external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
  245. function SuspendProc:boolean; external 'SuspendProc@files:ISDone.dll stdcall';
  246. function ResumeProc:boolean; external 'ResumeProc@files:ISDone.dll stdcall';
  247.  
  248. type
  249. TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
  250.  
  251.  
  252. function mciSendString(lpstrCommand: string; lpstrReturnString: PChar; uReturnLength:integer; hwndCallback:integer):integer; external 'mciSendStringA@winmm.dll stdcall';
  253. function GetSystemMetrics(nIndex : Integer): Integer; external 'GetSystemMetrics@user32 stdcall';
  254.  
  255. function WrapTimerProc(callback:TProc; paramcount:integer):longword; external 'wrapcallback@files:Innocallback.dll stdcall';
  256. function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
  257. function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';
  258.  
  259. procedure InitializeSlideShow(Hwnd:Thandle; l,t,w,h:integer;Animate:boolean; Stretch:integer); external 'InitializeSlideShow@files:isslideshow.dll stdcall';
  260. procedure DeinitializeSlideShow; external 'DeinitializeSlideShow@files:isslideshow.dll stdcall';
  261. procedure ShowImage(ipath:PAnsiChar; Effect:integer); external 'ShowImage@files:isslideshow.dll stdcall';
  262.  
  263. function GetDC(HWND: DWord): DWord; external 'GetDC@user32.dll stdcall';
  264. function GetDeviceCaps(DC: DWord; Index: Integer): Integer; external 'GetDeviceCaps@gdi32.dll stdcall';
  265. function ReleaseDC(HWND: DWord;DC: DWord): Integer; external 'ReleaseDC@user32.dll stdcall';
  266. //----------------------------------------------------
  267.  
  268. function GetScreenHeight(): integer;
  269. var
  270. dc: DWord;
  271. begin
  272. dc:=GetDC(MainForm.Handle);
  273. Result:=GetDeviceCaps(dc,10);
  274. ReleaseDC(MainForm.Handle,dc);
  275. end;
  276.  
  277. function GetScreenWidth(): integer;
  278. var
  279. dc: DWord;
  280. begin
  281. dc:=GetDC(MainForm.Handle);
  282. Result:=GetDeviceCaps(dc,8);
  283. ReleaseDC(MainForm.Handle,dc);
  284. end;
  285.  
  286. procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
  287. begin
  288. if NoBackgroundCheckBox.Checked = True then begin
  289. with WizardForm do begin
  290. if CurPageID=wpInstalling then begin
  291. PauseBT.hide;
  292. CompactCheckBox.Visible := False;
  293. WizardForm.WizardSmallBitmapImage.Show;
  294. WizardForm.Bevel1.Show;
  295. //WizardForm.Caption := ' Installing Grand Theft Auto IV';
  296. with WizardForm do begin
  297. WizardForm.ProgressGauge.show;
  298. end;
  299. end;
  300. end;
  301. end else begin
  302. CurrentPicture:=CurrentPicture+1;
  303. if CurrentPicture=piclist.count+1 then CurrentPicture:=1;
  304. ShowImage(piclist.strings[CurrentPicture - 1], 1);
  305. end;
  306. end;
  307.  
  308. procedure MakeSlideShow();
  309. var
  310. i :integer;
  311. begin
  312. if NoBackgroundCheckBox.Checked = True then begin
  313. with WizardForm do begin
  314. if CurPageID=wpInstalling then begin
  315. PauseBT.hide;
  316. CompactCheckBox.Visible := False;
  317. WizardForm.WizardSmallBitmapImage.Show;
  318. WizardForm.Bevel1.Show;
  319. //WizardForm.Caption := ' Installing Grand Theft Auto IV';
  320. with WizardForm do begin
  321. WizardForm.ProgressGauge.show;
  322. end;
  323. end;
  324. end;
  325. end else begin
  326. BackgroundForm:= TForm.Create(nil);
  327. BackgroundForm.BorderStyle:= bsNone;
  328. BackgroundForm.Color:=clBlack;
  329. BackgroundForm.SetBounds(0, 0, GetSystemMetrics(0), GetSystemMetrics(1))
  330. BackgroundForm.Visible:=True;
  331. BackgroundForm.enabled:= False;
  332. PicList:=tstringlist.Create;
  333. #ifexist "Slides\1.jpg"
  334. #sub ExtractFile
  335. ExtractTemporaryFile('{#i}.jpg');
  336. #endsub
  337. #for {i = 1; FileExists(StringChange("Slides\FileName.jpg", "FileName", Str(i))) != 0; i++} ExtractFile
  338. #endif
  339. i:=1;
  340. repeat
  341. piclist.add(ExpandConstant('{tmp}\'+IntToStr(i)+'.jpg'));
  342. i:=i+1;
  343. until FileExists(ExpandConstant('{tmp}\'+IntToStr(i)+'.jpg')) = False;
  344. BackgroundForm.Show;
  345. InitializeSlideShow(BackgroundForm.Handle, 0, 0, GetSystemMetrics(0), GetSystemMetrics(1), true, 1);
  346. ShowImage(ExpandConstant('{tmp}') + '\1.jpg', 1);
  347. PlayBT1 := PlayBT;
  348. end;
  349. end;
  350.  
  351. function DirBrowseButtonClick(CurPageID: Integer): Boolean;
  352. begin
  353. sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
  354. Result := False;
  355. end;
  356.  
  357. function GroupBrowseButtonClick(CurPageID: Integer): Boolean;
  358. begin
  359. sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
  360. Result := True;
  361. end;
  362.  
  363. function NextButtonClick(CurPageID: Integer): Boolean;
  364. begin
  365. if (CurPageID = wpFinished) or (CurPageID = wpFinished) and ISDoneError then
  366. begin
  367. end else begin
  368. sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
  369. end;
  370. Result := True;
  371. end;
  372.  
  373. function BackButtonClick(CurPageID: Integer): Boolean;
  374. begin
  375. sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
  376. Result := True;
  377. end;
  378.  
  379. procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
  380. begin
  381. sndPlaySound(ExpandConstant('{tmp}\click.wav'), $0001);
  382. Confirm:=False;
  383. Cancel:=ExitSetupMsgBox;
  384. if CurPageID = wpInstalling then begin;
  385. if Cancel then begin
  386. ISDoneError:=True;
  387. ISDoneCancel:=1;
  388. DelTree(ExpandConstant('{app}'), True, True, True);
  389. WizardForm.CancelButton.Enabled:=False;
  390. end;
  391. end;
  392. end;
  393.  
  394. procedure Background;
  395. begin
  396. if NoBackgroundCheckBox.Checked = True then begin
  397. with WizardForm do begin
  398. if CurPageID=wpInstalling then begin
  399. PauseBT.hide;
  400. CompactCheckBox.Visible := False;
  401. WizardForm.WizardSmallBitmapImage.Show;
  402. WizardForm.Bevel1.Show;
  403. //WizardForm.Caption := ' Installing Grand Theft Auto IV';
  404. with WizardForm do begin
  405. WizardForm.ProgressGauge.show;
  406. end;
  407. end;
  408. end;
  409. end else begin
  410. BackgroundForm := TForm.Create(nil);
  411. with BackgroundForm do
  412. begin
  413. Color := ClBlack
  414. BorderStyle := bsnone;
  415. Left := 0;
  416. Top:= 0;
  417. Enabled := False;
  418. Width := GetSystemMetrics(0);
  419. Height := GetSystemMetrics(1);
  420. Show();
  421. Repaint();
  422. end;
  423. end;
  424. end;
  425.  
  426. const
  427. EC_COMPLETE = $01;
  428.  
  429. procedure BackgroundVideoPlay(EventCode, Param1, Param2: Integer);
  430. begin
  431. if EventCode = EC_COMPLETE then
  432. BackgroundForm.Hide;
  433. end;
  434.  
  435. procedure Pause(Sender: TObject);
  436. begin
  437. if NoBackgroundCheckBox.Checked = False then begin
  438. if FileExists(ExpandConstant('{tmp}\Video.mp4')) then
  439. begin
  440. DSStopMediaPlay;
  441. end;
  442. end else begin
  443. with WizardForm do begin
  444. if CurPageID=wpInstalling then begin
  445. PauseBT.hide;
  446. CompactCheckBox.Visible := False;
  447. WizardForm.WizardSmallBitmapImage.Show;
  448. WizardForm.Bevel1.Show;
  449. //WizardForm.Caption := ' Installing Grand Theft Auto IV';
  450. with WizardForm do begin
  451. WizardForm.ProgressGauge.show;
  452. end;
  453. end;
  454. end;
  455. end;
  456.  
  457. with WizardForm do begin
  458. if CompactCheckBox.Checked = False then begin
  459. Top:=GetScreenHeight-ClientHeight-45
  460. Left:=GetScreenWidth-ClientWidth-20
  461. end else begin
  462. Top:=GetScreenHeight-ClientHeight-75
  463. Left:=GetScreenWidth-ClientWidth-20
  464. end;
  465. end;
  466.  
  467. PauseBT.hide;
  468. PlayBT.hide;
  469. PlayBT1.Show;
  470. BackgroundForm.Hide;
  471. end;
  472.  
  473. procedure Play1(Sender: TObject);
  474. var
  475. Width, Height: Integer;
  476. begin
  477. if NoBackgroundCheckBox.Checked = False then begin
  478. if FileExists(ExpandConstant('{tmp}\Video.mp4')) then
  479. begin
  480. if DSInitializeVideoFile(ExpandConstant('{tmp}\Video.mp4'), BackgroundForm.Handle, Width, Height, @BackgroundVideoPlay) then
  481. begin
  482. BackgroundForm.Width := GetSystemMetrics(0);
  483. BackgroundForm.Height := GetSystemMetrics(1);
  484. DSPlayMediaFile;
  485. BackgroundForm.show;
  486. WizardForm.BringToFront;
  487. PauseBT.Show;
  488. PlayBT1.hide;
  489. PlayBT.hide;
  490. end;
  491. end else begin
  492. with WizardForm do begin
  493. if CurPageID=wpInstalling then begin
  494. PauseBT.hide;
  495. CompactCheckBox.Visible := False;
  496. WizardForm.WizardSmallBitmapImage.Show;
  497. WizardForm.Bevel1.Show;
  498. //WizardForm.Caption := ' Installing Grand Theft Auto IV';
  499. with WizardForm do begin
  500. WizardForm.ProgressGauge.show;
  501. end;
  502. end;
  503. end;
  504. end;
  505. end;
  506. end;
  507.  
  508. procedure PlayMPEGVideo();
  509. var
  510. Width, Height: Integer;
  511. begin
  512. if VBRadio2.Checked then begin
  513. if FileExists(ExpandConstant('{tmp}\Video.mp4')) then
  514. begin
  515. if DSInitializeVideoFile(ExpandConstant('{tmp}\Video.mp4'), BackgroundForm.Handle, Width, Height, @BackgroundVideoPlay) then
  516. begin
  517. BackgroundForm.Width := GetSystemMetrics(0);
  518. BackgroundForm.Height := GetSystemMetrics(1);
  519. DSPlayMediaFile;
  520. WizardForm.BringToFront;
  521. PauseBT.Show;
  522. PlayBT1.hide;
  523. PlayBT.hide;
  524. with WizardForm do begin
  525. WizardForm.NextButton.Caption := 'Install';
  526. end;
  527. end;
  528. end;
  529. end else begin
  530. with WizardForm do begin
  531. if CurPageID=wpInstalling then begin
  532. PauseBT.hide;
  533. CompactCheckBox.Visible := False;
  534. WizardForm.WizardSmallBitmapImage.Show;
  535. WizardForm.Bevel1.Show;
  536. //WizardForm.Caption := ' Installing Grand Theft Auto IV';
  537. with WizardForm do begin
  538. WizardForm.ProgressGauge.show;
  539. end;
  540. end;
  541. end;
  542. end;
  543. end;
  544.  
  545. procedure Play(Sender: TObject);
  546. begin
  547. PlayBT.Hide;
  548. PlayBT1.Hide;
  549. PauseBT.Show;
  550. BackgroundForm.Show;
  551. WizardForm.BringToFront;
  552.  
  553. with WizardForm do begin
  554. if CompactCheckBox.Checked =False then begin
  555. Top:=GetScreenHeight-ClientHeight-45
  556. Left:=GetScreenWidth-ClientWidth-20
  557. end else begin
  558. Top:=GetScreenHeight-ClientHeight-75
  559. Left:=GetScreenWidth-ClientWidth-20
  560. end;
  561. end;
  562. end;
  563.  
  564. function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
  565. begin
  566. if OveralPct<=1000 then ISDoneProgressBar1.Position := OveralPct;
  567. LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
  568. LabelCurrFileName.Caption:=' Extracting File: '+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
  569. LabelTime1.Caption:=' Time Elapsed: '+TimeStr2;
  570. LabelTime2.Caption:='Time Remaining: '+TimeStr1;
  571. // LabelTime3.Caption:='Installing time:'+TimeStr3;
  572. Result := ISDoneCancel;
  573. end;
  574.  
  575. procedure CancelButtonOnClick(Sender: TObject);
  576. begin
  577. SuspendProc;
  578. if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
  579. ResumeProc;
  580. end;
  581.  
  582. procedure HideControls;
  583. begin
  584. WizardForm.FileNamelabel.Hide;
  585. ISDoneProgressBar1.Hide;
  586. LabelPct1.Hide;
  587. LabelCurrFileName.Hide;
  588. LabelTime1.Hide;
  589. LabelTime2.Hide;
  590. MyCancelButton.Hide;
  591. end;
  592.  
  593. procedure SoundControls;
  594. begin
  595. with WizardForm do begin
  596. if (CurPageID = wpFinished) or (CurPageID = wpFinished) and ISDoneError then
  597. begin
  598. BASS_Pause;
  599. sndPlaySound(ExpandConstant('{tmp}\SetupCompleted.wav'), $0001);
  600. end;
  601. end;
  602. end;
  603.  
  604. procedure CreateControls;
  605. var PBTop:integer;
  606. begin
  607. PBTop:=ScaleY(150);
  608. ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  609. with ISDoneProgressBar1 do begin
  610. Parent := WizardForm;
  611. Height := 25;
  612. Left := ScaleX(77);
  613. Top := PBTop;
  614. Width := ScaleX(500);
  615. Max := 1000;
  616. end;
  617. LabelCurrFileName := TLabel.Create(WizardForm);
  618. with LabelCurrFileName do begin
  619. Parent := WizardForm;
  620. AutoSize := False;
  621. Width := ISDoneProgressBar1.Width;
  622. Left := ISDoneProgressBar1.Left;
  623. Top := PBTop-20;
  624. end;
  625.  
  626. LabelTime1 := TLabel.Create(WizardForm);
  627. with LabelTime1 do begin
  628. Parent := WizardForm;
  629. AutoSize := False;
  630. Width := ISDoneProgressBar1.Width div 2;
  631. Left := ISDoneProgressBar1.Left;
  632. Top := PBTop + ScaleY(30);
  633. end;
  634. LabelTime2 := TLabel.Create(WizardForm);
  635. with LabelTime2 do begin
  636. Parent := WizardForm;
  637. AutoSize := False;
  638. Width := LabelTime1.Width+ScaleX(40);
  639. Left := 400;
  640. Top := LabelTime1.Top;
  641. end;
  642. LabelPct1 := TLabel.Create(WizardForm);
  643. with LabelPct1 do begin
  644. Parent := WizardForm;
  645. AutoSize := true;
  646. Font.Height:=-24;
  647. Left := ISDoneProgressBar1.Left -33 + ISDoneProgressBar1.Width div 2;
  648. Top := ISDoneProgressBar1.Top + ScaleY(70);
  649. //Width := ScaleX(80);
  650. end;
  651. // LabelTime3 := TLabel.Create(WizardForm);
  652. // with LabelTime3 do begin
  653. // Parent := WizardForm;
  654. // AutoSize := False;
  655. // Width := 300;
  656. // Left := 180;
  657. // Top := 200;
  658. // end;
  659. MyCancelButton:=TButton.Create(WizardForm);
  660. with MyCancelButton do begin
  661. Parent:=WizardForm;
  662. Width:=ScaleX(150);
  663. Caption:='Cancel';
  664. Left:=ScaleX(347);
  665. Height:=ScaleX(30);
  666. Left:=(480);
  667. Top:=WizardForm.cancelbutton.top;
  668. OnClick:=@CancelButtonOnClick;
  669. end;
  670. end;
  671.  
  672.  
  673. function CheckError:boolean;
  674. begin
  675. result:= not ISDoneError;
  676. end;
  677.  
  678. // Importing LoadSkin API from ISSkin.DLL
  679. procedure LoadSkin(lpszPath: PAnsiChar; lpszIniFileName: PAnsiChar);
  680. external 'LoadSkin@{tmp}\isskin.dll stdcall delayload';
  681.  
  682. // Importing UnloadSkin API from ISSkin.DLL
  683. procedure UnloadSkin;
  684. external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload';
  685.  
  686. // Importing ShowWindow Windows API from User32.DLL
  687. function ShowWindow(hWnd: Integer; uType: Integer): Integer;
  688. external 'ShowWindow@user32.dll stdcall';
  689.  
  690. var
  691. WelcomeLbl,DirLbl,GroupLbl,TasksLbl,FreeSpaceLabel,NeedSpaceLabel,GameSpaceLabel,PartitionSpaceLabel,Status: TLabel;
  692. DirBevel,GroupBevel,TasksBevel,TasksSeparateBevel,Bevel1,Bevel11,Bevel2,Bevel3,Bevel4,Bevel5,Bevel6,Bevel7,Bevel8,Bevel9,Bevel20,Bevel21,Bevel22,Bevel23: TBevel;
  693. FreeMB,TotalMB: cardinal;
  694.  
  695. function InitializeSetup1(): Boolean;
  696. begin
  697. ExtractTemporaryFile('isskin.dll');
  698. ExtractTemporaryFile('skin.cjstyles');
  699. LoadSkin(ExpandConstant('{tmp}\skin.cjstyles'), '');
  700. #ifexist "Video.avi"
  701. ExtractTemporaryFile('Video.avi');
  702. #endif
  703. ExtractTemporaryFile('Video.mp4');
  704. #ifexist "Video.mpeg"
  705. ExtractTemporaryFile('Video.mpeg');
  706. #endif
  707. #ifexist "Video.mpg"
  708. ExtractTemporaryFile('Video.mpg');
  709. #endif
  710. #ifexist "Video.wmv"
  711. ExtractTemporaryFile('Video.wmv');
  712. #endif
  713. Result := True;
  714. end;
  715.  
  716. Function NumToStr(Float: Extended): String;
  717. Begin
  718. Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');
  719. while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
  720. SetLength(Result, Length(Result)-1);
  721. End;
  722.  
  723. Function MbOrTb(Byte: Extended): String;
  724. begin
  725. if Byte < 1024 then Result:= NumToStr(Byte) + ' MB' else
  726. if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' GB' else
  727. Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' TB'
  728. end;
  729.  
  730. procedure GetFreeSpaceCaption(Sender: TObject);
  731. var Path: String;
  732. begin
  733. Path := ExtractFileDrive(WizardForm.DirEdit.Text);
  734. GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
  735. PartitionSpaceLabel.Caption:= ExpandConstant('Partition Space : ') + MbOrTb(TotalMB);
  736. FreeSpaceLabel.Caption := ExpandConstant('Free Space : ') + MbOrTb(FreeMB) + ' (' + IntToStr((FreeMB * 100) div TotalMB) + '%)';
  737. GameSpaceLabel.Caption := ExpandConstant('Game Space : ') + MbOrTb({#AppSize});
  738. NeedSpaceLabel.Caption := ExpandConstant('Total Needed Space : ') + MbOrTb({#AppSize});
  739. if (FreeMB<{#AppSize}) then
  740. FreeSpaceLabel.Font.Color:=clRed
  741. else
  742. FreeSpaceLabel.Font.Color:=clBlue;
  743. PartitionSpaceLabel.Font.Color:=NeedSpaceLabel.Font.Color;
  744. WizardForm.NextButton.Enabled:=FreeMB>{#AppSize};
  745. end;
  746.  
  747. var
  748. DirectXCB,VisualCCB,NvidiaPhysx,Framework,IconCB: TNewCheckBox;
  749. //---COMPONENTS POSITION CONTROL---\\
  750. procedure Tasks;
  751. begin
  752. TasksBevel := TBevel.Create(WizardForm);
  753. with TasksBevel do
  754. begin
  755. Parent := WizardForm;
  756. Left := ScaleX(90);
  757. Top := ScaleY(150);
  758. Width := ScaleX(470);
  759. Height := ScaleY(73);
  760. end;
  761. //------------------------\\
  762.  
  763. //---Top---\\
  764. Bevel20 := TBevel.Create(WizardForm);
  765. with Bevel20 do
  766. begin
  767. Parent := WizardForm;
  768. Left := ScaleX(92);
  769. Top := ScaleY(150);
  770. Width := ScaleX(470);
  771. Height := ScaleY(2);
  772. end;
  773. //---Bottom---\\
  774. Bevel21 := TBevel.Create(WizardForm);
  775. with Bevel21 do
  776. begin
  777. Parent := WizardForm;
  778. Left := ScaleX(92);
  779. Top := ScaleY(308);
  780. Width := ScaleX(470);
  781. Height := ScaleY(2);
  782. end;
  783. //---Left---\\
  784. Bevel22 := TBevel.Create(WizardForm);
  785. with Bevel22 do
  786. begin
  787. Parent := WizardForm;
  788. Left := ScaleX(92);
  789. Top := ScaleY(152);
  790. Width := ScaleX(2);
  791. Height := ScaleY(158);
  792. end;
  793. //---Right---\\
  794. Bevel23 := TBevel.Create(WizardForm);
  795. with Bevel23 do
  796. begin
  797. Parent := WizardForm;
  798. Left := ScaleX(560);
  799. Top := ScaleY(152);
  800. Width := ScaleX(2);
  801. Height := ScaleY(156);
  802. end;
  803. //------------------------\\
  804.  
  805. DirectXCB := TNewCheckBox.Create(WizardForm);
  806. with DirectXCB do
  807. begin
  808. Parent := WizardForm;
  809. Left :=(112);
  810. Top :=(170);
  811. Width := ScaleX(265);
  812. Height := ScaleY(17);
  813. Caption:='Install Microsoft DirectX Runtime Environment';
  814. end;
  815.  
  816. VisualCCB := TNewCheckBox.Create(WizardForm);
  817. with VisualCCB do
  818. begin
  819. Parent := WizardForm;
  820. Left :=(112);
  821. Top :=(190);
  822. Width := ScaleX(265);
  823. Height := ScaleY(17);
  824. Caption := 'Install Visual C++ Redistributable Packages';
  825. end;
  826.  
  827. NvidiaPhysx := TNewCheckBox.Create(WizardForm);
  828. with NvidiaPhysx do
  829. begin
  830. Parent := WizardForm;
  831. Left :=(112);
  832. Top :=(210);
  833. Width := ScaleX(265);
  834. Height := ScaleY(17);
  835. Caption:='Install Nvidia Physx System Software';
  836. end;
  837.  
  838. Framework := TNewCheckBox.Create(WizardForm);
  839. with Framework do
  840. begin
  841. Parent := WizardForm;
  842. Left :=(112);
  843. Top :=(230);
  844. Width := ScaleX(265);
  845. Height := ScaleY(17);
  846. Caption:='Install Microsoft .NET Framework';
  847. end;
  848.  
  849. TasksSeparateBevel := TBevel.Create(WizardForm);
  850. with TasksSeparateBevel do
  851. begin
  852. Parent := WizardForm;
  853. Left :=(10);
  854. Top :=(260);
  855. Width := TasksBevel.Width - 0;
  856. Height := ScaleY(2);
  857. Width := ScaleX(440);
  858. Left := ScaleX(107);
  859. end;
  860.  
  861. IconCB := TNewCheckBox.Create(WizardForm);
  862. with IconCB do
  863. begin
  864. Parent := WizardForm;
  865. Left := (112);
  866. Top :=(275);
  867. Width := ScaleX(255);
  868. Height := ScaleY(17);
  869. Caption := 'Create Desktop Shortcut';
  870. end;
  871. end;
  872. //-----------------------------------\\
  873.  
  874. procedure LogoLabelOnClick(Sender: TObject);
  875. var
  876. ErrorCode: Integer;
  877. begin
  878. ShellExec('open', '{#AppURL}', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
  879. end;
  880.  
  881. procedure CompactCheckBoxClick(Sender: TObject);
  882. begin
  883. if CompactCheckBox.Checked then
  884. begin
  885. with WizardForm do
  886. begin
  887. Status.SetBounds(140,85,00,25);
  888. Status.Caption := 'Installing Components';
  889. WizardSmallBitmapImage.Hide;
  890. WizardForm.ClientWidth:=420;
  891. WizardForm.ClientHeight:=175;
  892. WizardForm.Caption:= ' Installing Grand Theft Auto IV ';
  893. MainPanel.Hide;
  894. Bevel.Hide;
  895. Bevel1.top:=132
  896. PauseBT.Top:=101;
  897. PauseBT.Left:=390;
  898. PlayBT.Top:=101;
  899. PlayBT.Left:=390;
  900. PlayBT1.Top:=101;
  901. PlayBT1.Left:=390;
  902. CompactCheckBox.SetBounds(326,150,90,14);
  903. SoundCtrlButton.SetBounds(16,141,100,30);
  904. CancelButton.SetBounds(151,141,150,30);
  905. CancelButton.Enabled:= False
  906. MyCancelButton.SetBounds(151,141,150,30);
  907. MyCancelButton.Enabled:= True
  908. ISDoneProgressBar1.Width:= ScaleX(388);
  909. ISDoneProgressBar1.height:=20;
  910. ISDoneProgressBar1.Left:= ScaleX(16);
  911. ISDoneProgressBar1.Top:=50;
  912. LabelCurrFileName.Width:=ISDoneProgressBar1.Width;
  913. LabelTime1.Left:=ISDoneProgressBar1.Left;
  914. LabelTime1.Top:=ISDoneProgressBar1.Top +25;;
  915. LabelTime2.Top:= LabelTime1.Top;
  916. LabelTime2.Left:= 227;
  917. LabelCurrFileName.Left:= ISDoneProgressBar1.Left;
  918. LabelCurrFileName.Top:= ISDoneProgressBar1.Top -20;
  919. LabelPct1.Font.Height:=-24;
  920. LabelPct1.Left:= ISDoneProgressBar1.Left -33 + ISDoneProgressBar1.Width div 2;
  921. LabelPct1.Top:= ISDoneProgressBar1.Top + ScaleY(43);
  922. ProgressGauge.Width:= ScaleX(388);
  923. ProgressGauge.height:=20;
  924. ProgressGauge.Left:= ScaleX(16);
  925. ProgressGauge.Top:=50;
  926.  
  927. if Status.Visible then begin
  928. with WizardForm do begin
  929. WizardForm.Caption:= ' Installing Software Prerequisites';
  930. end;
  931. end else begin
  932. with WizardForm do begin
  933. WizardForm.Caption:= ' Installing Grand Theft Auto IV ';
  934. end;
  935. end;
  936.  
  937. if (BackgroundForm.visible=true) then begin
  938.  
  939. Top:=GetScreenHeight-ClientHeight-45
  940. Left:=GetScreenWidth-ClientWidth-20
  941. end else begin
  942. Top:=GetScreenHeight-ClientHeight-75
  943. Left:=GetScreenWidth-ClientWidth-20
  944. end;
  945. end;
  946. end else begin
  947. with WizardForm do
  948. begin
  949. Status.SetBounds(218,200,227,30);
  950. Status.Caption := 'Installing Additional Components';
  951. WizardSmallBitmapImage.show;
  952. WizardForm.ClientWidth:=654;
  953. WizardForm.ClientHeight:=407;
  954. WizardForm.Caption := ' Installing Grand Theft Auto IV';
  955. Bevel.Show;
  956. Bevel1.top:=90
  957. PauseBT.Top:=348;
  958. PauseBT.Left:=320;
  959. PlayBT.Top:=348;
  960. PlayBT.Left:=320;
  961. PlayBT1.Top:=348;
  962. PlayBT1.Left:=320;
  963. CompactCheckBox.SetBounds(560,315,90,14);
  964. SoundCtrlButton.SetBounds(210,347,100,30);
  965. CancelButton.SetBounds(480,347,150,30);
  966. MyCancelButton.SetBounds(480,347,150,30);
  967. ISDoneProgressBar1.Width:= ScaleX(500);
  968. ISDoneProgressBar1.height:=25;
  969. ISDoneProgressBar1.Left:= ScaleX(77);
  970. ISDoneProgressBar1.Top:=150;
  971. LabelTime1.Left:=ISDoneProgressBar1.Left;
  972. LabelTime1.Top:=ISDoneProgressBar1.Top +30;;
  973. LabelTime2.Top:= LabelTime1.Top;
  974. LabelTime2.Left:= 400;
  975. LabelCurrFileName.Left:= ISDoneProgressBar1.Left;
  976. LabelCurrFileName.Top:= ISDoneProgressBar1.Top -20;
  977. LabelPct1.Font.Height:=-24;
  978. LabelPct1.Left:= ISDoneProgressBar1.Left -33 + ISDoneProgressBar1.Width div 2;
  979. LabelPct1.Top:= ISDoneProgressBar1.Top + ScaleY(70);
  980. ProgressGauge.Width:= ScaleX(500);
  981. ProgressGauge.height:=25;
  982. ProgressGauge.Left:= ScaleX(77);
  983. ProgressGauge.Top:=150;
  984. if (BackgroundForm.visible=true) then begin
  985.  
  986. if Status.Visible then begin
  987. with WizardForm do begin
  988. WizardForm.Caption := ' Installing Software Prerequisites';
  989. end;
  990. end else begin
  991. with WizardForm do begin
  992. WizardForm.Caption:= ' Installing Grand Theft Auto IV';
  993. end;
  994. end;
  995.  
  996. Top:=GetScreenHeight-ClientHeight-45
  997. Left:=GetScreenWidth-ClientWidth-20
  998. end else begin
  999. Top:=GetScreenHeight-ClientHeight-75
  1000. Left:=GetScreenWidth-ClientWidth-20
  1001. end;
  1002.  
  1003. end;
  1004. end;
  1005. end;
  1006.  
  1007. procedure NoBackgroundCheckBoxClick(Sender: TObject);
  1008. begin
  1009. if NoBackgroundCheckBox.Checked = True then
  1010. begin
  1011. with WizardForm do
  1012. begin
  1013. VBRadio1.Enabled := False;
  1014. VBRadio2.Enabled := False;
  1015. end;
  1016. end else begin
  1017. VBRadio1.Enabled := True;
  1018. VBRadio2.Enabled := True;
  1019. end;
  1020. end;
  1021.  
  1022. procedure RadioButtonsOnClick(Sender: TObject);
  1023. begin
  1024. Case TNewRadioButton(sender).Tag of
  1025. 1: begin FWAdd:=True;
  1026. TNewRadioButton(sender).Font.Style := [fsBold];
  1027. VBRadio2.Font.Style := [];
  1028.  
  1029. end;
  1030. 2: begin FWAdd:=False;
  1031. TNewRadioButton(sender).Font.Style := [fsBold];
  1032. TNewRadioButton(sender).Visible := True;
  1033. VBRadio1.Font.Style := [];
  1034.  
  1035. end;
  1036. end;
  1037. end;
  1038.  
  1039. procedure InitializeWizard1();
  1040. begin
  1041. ExtractTemporaryFile ('logo.bmp');
  1042. ExtractTemporaryFile ('Play.bmp');
  1043. ExtractTemporaryFile('Video.mp4');
  1044. ExtractTemporaryFile ('Pause.bmp');
  1045.  
  1046. WizardForm.WizardBitmapImage2.Cursor:=crHand;
  1047. WizardForm.WizardBitmapImage2.OnClick:=@LogoLabelOnClick;
  1048. WizardForm.ClientWidth:=654;
  1049. WizardForm.ClientHeight:=402;
  1050. WizardForm.InnerNotebook.Hide;
  1051. WizardForm.OuterNotebook.Hide;
  1052. WizardForm.WizardBitmapImage.Stretch:=True;
  1053. WizardForm.WizardBitmapImage.Parent:=WizardForm;
  1054.  
  1055. WizardForm.WizardBitmapImage2.Width := ScaleX(230);
  1056. WizardForm.WizardBitmapImage2.Height := ScaleX(55);
  1057. WizardForm.WizardBitmapImage2.Top:=340;
  1058. WizardForm.WizardBitmapImage2.Left:=5;
  1059. WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
  1060. WizardForm.WizardBitmapImage2.Parent:=WizardForm;
  1061.  
  1062. WizardForm.WizardSmallBitmapImage.Stretch:=True;
  1063. WizardForm.WizardSmallBitmapImage.Parent:=WizardForm;
  1064. WizardForm.WizardSmallBitmapImage.SetBounds(0,0,WizardForm.ClientWidth,90);
  1065. WizardForm.Bevel1.Parent:=WizardForm;
  1066. WizardForm.Bevel1.Top:=90;
  1067. WizardForm.Bevel1.Width:=WizardForm.ClientWidth;
  1068. WizardForm.Bevel.Parent:=WizardForm;
  1069. WizardForm.Bevel.Top:=330;
  1070. WizardForm.Bevel.Width:=WizardForm.ClientWidth;
  1071. WizardForm.SelectDirBitmapImage.Parent:=WizardForm;
  1072. WizardForm.SelectDirBitmapImage.Top:=125;
  1073. WizardForm.SelectDirBitmapImage.Left:=40;
  1074. WizardForm.DirEdit.Parent:=WizardForm;
  1075. WizardForm.DirEdit.Top:=130;
  1076. WizardForm.DirEdit.Left:=75;
  1077. WizardForm.DirEdit.Width:=430;
  1078. WizardForm.DirEdit.OnChange:=@GetFreeSpaceCaption;
  1079. WizardForm.DirBrowseButton.Parent:=WizardForm;
  1080. WizardForm.DirBrowseButton.Top:=125;
  1081. WizardForm.DirBrowseButton.Left:=515;
  1082. WizardForm.DirBrowseButton.Width:=90;
  1083. WizardForm.DirBrowseButton.Height:=30;
  1084. WizardForm.GroupEdit.Parent:=WizardForm;
  1085. WizardForm.GroupEdit.Top:=255;
  1086. WizardForm.GroupEdit.Left:=75;
  1087. WizardForm.GroupEdit.Width:=430;
  1088. WizardForm.GroupBrowseButton.Parent:=WizardForm;
  1089. WizardForm.GroupBrowseButton.Top:=250;
  1090. WizardForm.GroupBrowseButton.Left:=515;
  1091. WizardForm.GroupBrowseButton.Width:=90;
  1092. WizardForm.GroupBrowseButton.Height:=30;
  1093. WizardForm.NoIconsCheck.Parent:=WizardForm;
  1094. WizardForm.NoIconsCheck.Left:=75;
  1095. WizardForm.NoIconsCheck.Top:=285;
  1096. WizardForm.SelectGroupBitmapImage.Parent:=WizardForm;
  1097. WizardForm.SelectGroupBitmapImage.Top:=250;
  1098. WizardForm.SelectGroupBitmapImage.Left:=40;
  1099. WizardForm.WizardBitmapImage.SetBounds(0,0,WizardForm.ClientWidth,330);
  1100. WizardForm.NextButton.SetBounds(525,347,100,30);
  1101. WizardForm.CancelButton.SetBounds(420,347,100,30);
  1102. WizardForm.BackButton.SetBounds(315,347,100,30);
  1103. CompactCheckBox := TNewCheckBox.Create(WizardForm);
  1104. NoBackgroundCheckBox := TNewCheckBox.Create(WizardForm);
  1105.  
  1106. PauseBT:=TBitmapImage.Create(WizardForm);
  1107. with PauseBT do begin
  1108. Height := 30;
  1109. Width := 31;
  1110. PauseBT.Top:=348;
  1111. PauseBT.Left:=320;
  1112. Bitmap.LoadFromFile(ExpandConstant('{tmp}\Pause.bmp'));
  1113. Parent:=WizardForm;
  1114. PauseBT.Hide;
  1115. OnClick:=@Pause;
  1116. End;
  1117.  
  1118. PlayBT:=TBitmapImage.Create(WizardForm);
  1119. with PlayBT do begin
  1120. Height := 30;
  1121. Width := 31;
  1122. Top:=348;
  1123. Left:=320;
  1124. Bitmap.LoadFromFile(ExpandConstant('{tmp}\Play.bmp'));
  1125. Parent:=WizardForm;
  1126. OnClick:=@Play;
  1127. End;
  1128.  
  1129. PlayBT1:=TBitmapImage.Create(WizardForm);
  1130. with PlayBT1 do begin
  1131. Height := 30;
  1132. Width := 31;
  1133. Top:=348;
  1134. Left:=320;
  1135. Bitmap.LoadFromFile(ExpandConstant('{tmp}\Play.bmp'));
  1136. Parent:=WizardForm;
  1137. OnClick:=@Play1;
  1138. End;
  1139.  
  1140. BGLabel2:=TLabel.Create(WizardForm);
  1141. With BGLabel2 do begin
  1142. Transparent:=true;
  1143. Parent:=WizardForm;
  1144. Alignment:=taCenter;
  1145. Caption := ExpandConstant('Select the Background Option');
  1146. Font.Color:= clWhite
  1147. SetBounds(203,153,240,25);
  1148. end;
  1149.  
  1150. BGLabel3:=TLabel.Create(WizardForm);
  1151. With BGLabel3 do begin
  1152. Transparent:=true;
  1153. Parent:=WizardForm;
  1154. Caption := ExpandConstant('Select a background option to be displayed during the installation process.Otherwise skip'+#13#10+'the selection and click "Install" to begin installation.')
  1155. Font.Color:= clWhite
  1156. SetBounds(111,105,450,40);
  1157. end;
  1158.  
  1159. BGBevel1 := TBevel.Create(WizardForm);
  1160. with BGBevel1 do
  1161. begin
  1162. Style:=bsRaised;
  1163. // bsLowered, bsRaised);
  1164. Parent := WizardForm;
  1165. Top := ScaleY(144);
  1166. Left := ScaleX(203);
  1167. Width := ScaleX(250);
  1168. Height := ScaleY(169);
  1169. end;
  1170.  
  1171. BGBevel2 := TBevel.Create(WizardForm);
  1172. with BGBevel2 do
  1173. begin
  1174. Style:=bsRaised;
  1175. // bsLowered, bsRaised);
  1176. Parent := WizardForm;
  1177. Top := ScaleY(169);
  1178. Left := ScaleX(208);
  1179. Width := ScaleX(240);
  1180. Height := ScaleY(5);
  1181. end;
  1182.  
  1183. BGBevel3 := TBevel.Create(WizardForm);
  1184. with BGBevel3 do
  1185. begin
  1186. Style:=bsLowered;
  1187. // bsLowered, bsRaised);
  1188. Parent := WizardForm;
  1189. Top := ScaleY(149);
  1190. Left := ScaleX(208);
  1191. Width := ScaleX(240);
  1192. Height := ScaleY(159);
  1193. end;
  1194.  
  1195. BGBevel4 := TBevel.Create(WizardForm);
  1196. with BGBevel4 do
  1197. begin
  1198. Style:=bsLowered;
  1199. // bsLowered, bsRaised);
  1200. Parent := WizardForm;
  1201. Top := ScaleY(149);
  1202. Left := ScaleX(208);
  1203. Width := ScaleX(240);
  1204. Height := ScaleY(159);
  1205. end;
  1206.  
  1207. VBRadio1 := TNewRadioButton.Create(WizardForm);
  1208. with VBRadio1 do
  1209. begin
  1210. Parent := WizardForm;
  1211. Tag := 1;
  1212. Left := 260;
  1213. Top := ScaleY(210);
  1214. Width := ScaleX(125);
  1215. Height := ScaleY(23);
  1216. Caption := 'Picture Slideshow';
  1217. Checked := True;
  1218. Font.Style := [fsBold];
  1219. OnClick := @RadioButtonsOnClick;
  1220. end;
  1221.  
  1222. VBRadio2 := TNewRadioButton.Create(WizardForm);
  1223. with VBRadio2 do
  1224. begin
  1225. Parent := WizardForm;
  1226. Tag := 2;
  1227. Left := VBRadio1.Left;
  1228. Top := VBRadio1.Top + 30;
  1229. Width := VBRadio1.Width;
  1230. Height := VBRadio1.Height;
  1231. Caption := 'Video Background';
  1232. Checked := False;
  1233. Font.Style := [fsBold];
  1234. OnClick := @RadioButtonsOnClick;
  1235. end;
  1236.  
  1237. FWAdd := True
  1238.  
  1239. with NoBackgroundCheckBox do
  1240. begin
  1241. Caption := 'No Background Option';
  1242. Name := 'NoBackgroundCheckBox';
  1243. Parent := WizardForm;
  1244. Left := (62);
  1245. Top :=(312);
  1246. Width := ScaleX(125);
  1247. Height := ScaleY(17);
  1248. OnClick := @NoBackgroundCheckBoxClick
  1249. end;
  1250. NoBackgroundCheckBox.Taborder := 3;
  1251.  
  1252. with CompactCheckBox do
  1253. begin
  1254. Name := 'CompactCheckBox';
  1255. Parent := WizardForm;
  1256. Left := ScaleX(560);
  1257. Top := ScaleY(315);
  1258. Width := ScaleX(90);
  1259. Height := ScaleY(14);
  1260. Alignment := taLeftJustify;
  1261. Caption := 'Compact Mode';
  1262. OnClick := @CompactCheckBoxClick;
  1263. end;
  1264. CompactCheckBox.TabOrder := 3;
  1265.  
  1266. WelcomeLbl:=TLabel.Create(WizardForm);
  1267. With WelcomeLbl do begin
  1268. Transparent:=true;
  1269. Parent:=WizardForm;
  1270. Alignment:=taCenter;
  1271. Caption:='Welcome to {#AppName} Setup Wizard.' + #13#10#13#10 + 'It is recommended that you close all other applications before proceeding.' + #13#10#13#10 + 'Click "Next" to continue.';
  1272. Font.Color:=clWhite;
  1273. Font.Size:=9;
  1274. SetBounds(127,205,407,90);
  1275. end;
  1276. //
  1277. Tasks;
  1278. DirBevel := TBevel.Create(WizardForm);
  1279. with DirBevel do
  1280. begin
  1281. Parent := WizardForm;
  1282. Left := ScaleX(28);
  1283. Top := ScaleY(110);
  1284. Width := ScaleX(594);
  1285. Height := ScaleY(110);
  1286. end;
  1287.  
  1288. //-----Bevel Line Page 2 Bottom-----\\
  1289.  
  1290. //---Top---\\
  1291. Bevel3 := TBevel.Create(WizardForm);
  1292. with Bevel3 do
  1293. begin
  1294. Parent := WizardForm;
  1295. Left := ScaleX(27);
  1296. Top := ScaleY(235);
  1297. Width := ScaleX(594);
  1298. Height := ScaleY(2);
  1299. end;
  1300. //---Bottom---\\
  1301. Bevel4 := TBevel.Create(WizardForm);
  1302. with Bevel4 do
  1303. begin
  1304. Parent := WizardForm;
  1305. Left := ScaleX(27);
  1306. Top := ScaleY(313);
  1307. Width := ScaleX(595);
  1308. Height := ScaleY(2);
  1309. end;
  1310. //---Left---\\
  1311. Bevel5 := TBevel.Create(WizardForm);
  1312. with Bevel5 do
  1313. begin
  1314. Parent := WizardForm;
  1315. Left := ScaleX(27);
  1316. Top := ScaleY(236);
  1317. Width := ScaleX(2);
  1318. Height := ScaleY(78);
  1319. end;
  1320. //---Right---\\
  1321. Bevel6 := TBevel.Create(WizardForm);
  1322. with Bevel6 do
  1323. begin
  1324. Parent := WizardForm;
  1325. Left := ScaleX(620);
  1326. Top := ScaleY(235);
  1327. Width := ScaleX(2);
  1328. Height := ScaleY(79);
  1329. end;
  1330. //------------------------\\
  1331.  
  1332. //-----Bevel Line Page 2 Top-----\\
  1333.  
  1334. //---Top---\\
  1335. Bevel7 := TBevel.Create(WizardForm);
  1336. with Bevel7 do
  1337. begin
  1338. Parent := WizardForm;
  1339. Left := ScaleX(27);
  1340. Top := ScaleY(110);
  1341. Width := ScaleX(595);
  1342. Height := ScaleY(2);
  1343. end;
  1344. //---Bottom---\\
  1345. Bevel8 := TBevel.Create(WizardForm);
  1346. with Bevel8 do
  1347. begin
  1348. Parent := WizardForm;
  1349. Left := ScaleX(27);
  1350. Top := ScaleY(218);
  1351. Width := ScaleX(595);
  1352. Height := ScaleY(2);
  1353. end;
  1354. //---Right---\\
  1355. Bevel9 := TBevel.Create(WizardForm);
  1356. with Bevel9 do
  1357. begin
  1358. Parent := WizardForm;
  1359. Left := ScaleX(620);
  1360. Top := ScaleY(110);
  1361. Width := ScaleX(2);
  1362. Height := ScaleY(108);
  1363. end;
  1364. //---Left---\\
  1365. Bevel11 := TBevel.Create(WizardForm);
  1366. with Bevel11 do
  1367. begin
  1368. Parent := WizardForm;
  1369. Left := ScaleX(27);
  1370. Top := ScaleY(111);
  1371. Width := ScaleX(2);
  1372. Height := ScaleY(109);
  1373. end;
  1374.  
  1375. //------------------------\\
  1376. Status:=TLabel.Create(WizardForm);
  1377. With Status do begin
  1378. //Transparent:=true;
  1379. Parent:=WizardForm;
  1380. Alignment:=taCenter;
  1381. //Font.Color:=clWhite;
  1382. Font.Height:=-15;
  1383. SetBounds(0,250,650,30);
  1384. end;
  1385.  
  1386. DirLbl:=TLabel.Create(WizardForm);
  1387. With DirLbl do begin
  1388. //Transparent:=true;
  1389. Parent:=WizardForm;
  1390. //Alignment:=taCenter;
  1391. Caption:=' Grand Theft Auto IV will be installed to the following folder ';
  1392. Font.Color:=clWhite;
  1393. SetBounds(52,105,300,15);
  1394. end;
  1395. GroupLbl:=TLabel.Create(WizardForm);
  1396. With GroupLbl do begin
  1397. //Transparent:=true;
  1398. Parent:=WizardForm;
  1399. //Alignment:=taCenter;
  1400. Caption:=' Startmenu shortcuts will be created here ';
  1401. Font.Color:=clWhite;
  1402. SetBounds(52,230,235,15);
  1403. end;
  1404. TasksLbl:=TLabel.Create(WizardForm);
  1405. With TasksLbl do begin
  1406. //Transparent:=true;
  1407. Parent:=WizardForm;
  1408. //Alignment:=taCenter;
  1409. Caption:='Select the components you want to install; Clear the components you do not want to install.' + #13#10 + 'Click Next when you are ready to continue.';
  1410. Font.Color:=clWhite;
  1411. SetBounds(111,105,450,40);
  1412. end;
  1413. //---PARTITION SPACE---\\
  1414. PartitionSpaceLabel:=TLabel.Create(WizardForm);
  1415. With PartitionSpaceLabel do begin
  1416. //Transparent:=true;
  1417. Parent:=WizardForm;
  1418. //Alignment:=taCenter;
  1419. //Font.Color:=clWhite;
  1420. Font.Height:=-13;
  1421. SetBounds(75,160,200,30);
  1422. end;
  1423. //---FREE SPACE---\\
  1424. FreeSpaceLabel:=TLabel.Create(WizardForm);
  1425. With FreeSpaceLabel do begin
  1426. //Transparent:=true;
  1427. Parent:=WizardForm;
  1428. //Alignment:=taCenter;
  1429. //Font.Color:=clWhite;
  1430. Font.Height:=-13;
  1431. SetBounds(335,160,200,30);
  1432. end;
  1433. //---GAME SPACE---\\
  1434. GameSpaceLabel:=TLabel.Create(WizardForm);
  1435. With GameSpaceLabel do begin
  1436. //Transparent:=true;
  1437. Parent:=WizardForm;
  1438. //Alignment:=taCenter;
  1439. //Font.Color:=clWhite;
  1440. Font.Height:=-13;
  1441. SetBounds(75,190,200,30);
  1442. end;
  1443. //---Total Needed Space---\\
  1444. NeedSpaceLabel:=TLabel.Create(WizardForm);
  1445. With NeedSpaceLabel do begin
  1446. //Transparent:=true;
  1447. Parent:=WizardForm;
  1448. //Alignment:=taCenter;
  1449. //Font.Color:=clWhite;
  1450. Font.Height:=-13;
  1451. SetBounds(335,190,200,30);
  1452. end;
  1453. end;
  1454.  
  1455. Procedure HideComponents();
  1456. begin
  1457. //TasksSeparateBevel.Hide;
  1458. CompactCheckBox.hide;
  1459. NoBackgroundCheckBox.hide;
  1460. WizardForm.WizardSmallBitmapImage.Hide;
  1461. WizardForm.Bevel1.Hide;
  1462. DirBevel.Hide;
  1463. Bevel3.Hide;
  1464. Bevel4.Hide;
  1465. Bevel5.Hide;
  1466. Bevel6.Hide;
  1467. Bevel7.Hide;
  1468. Bevel8.Hide;
  1469. BGLabel2.hide;
  1470. BGLabel3.Hide;
  1471. BGBevel1.hide;
  1472. BGBevel2.hide;
  1473. BGBevel3.hide;
  1474. BGBevel4.hide;
  1475. VBRadio1.hide;
  1476. VBRadio2.hide;
  1477. PauseBT.hide;
  1478. PlayBT.hide;
  1479. PlayBT1.hide;
  1480. Bevel9.Hide;
  1481. Bevel11.Hide;
  1482. Bevel20.Hide;
  1483. Bevel21.Hide;
  1484. Bevel22.Hide;
  1485. Bevel23.Hide;
  1486. TasksBevel.Hide;
  1487. DirLbl.Hide;
  1488. GroupLbl.Hide;
  1489. TasksLbl.Hide;
  1490. DirectXCB.Hide;
  1491. VisualCCB.Hide;
  1492. NvidiaPhysx.Hide;
  1493. Framework.Hide;
  1494. IconCB.Hide;
  1495. WizardForm.SelectDirBitmapImage.Hide;
  1496. WizardForm.SelectGroupBitmapImage.Hide;
  1497. WizardForm.DirEdit.Hide;
  1498. WizardForm.GroupEdit.Hide;
  1499. WizardForm.DirBrowseButton.Hide;
  1500. WizardForm.GroupBrowseButton.Hide;
  1501. WizardForm.NoIconsCheck.Hide;
  1502. WizardForm.WizardBitmapImage.Hide;
  1503. WelcomeLbl.Hide;
  1504. // WizardForm.ComponentsList.Hide;
  1505. // WizardForm.TasksList.Hide;
  1506. TasksSeparateBevel.Hide;
  1507. PartitionSpaceLabel.Hide;
  1508. FreeSpaceLabel.Hide;
  1509. GameSpaceLabel.Hide;
  1510. NeedSpaceLabel.Hide;
  1511. Status.Hide;
  1512. end;
  1513.  
  1514. procedure CurStepChanged1(CurStep: TSetupStep);
  1515. var Comps1,Comps2,Comps3, TmpValue:cardinal;
  1516. FindHandle1,ColFiles1,CurIndex1,tmp:integer;
  1517. ExecError:boolean;
  1518. InFilePath,OutFilePath,OutFileName:PAnsiChar;
  1519. begin
  1520. if CurStep = ssInstall then begin //If necessary, you can change to ssPostInstall
  1521. WizardForm.ProgressGauge.Hide;
  1522. WizardForm.CancelButton.Hide;
  1523. CreateControls;
  1524. WizardForm.StatusLabel.Caption:='Installing Components';
  1525. ISDoneCancel:=0;
  1526.  
  1527. #ifdef PrecompVer
  1528. #if PrecompVer == "0.38"
  1529. ExtractTemporaryFile('precomp038.exe');
  1530. #endif
  1531. #if PrecompVer == "0.40"
  1532. ExtractTemporaryFile('precomp040.exe');
  1533. #endif
  1534. #if PrecompVer == "0.41"
  1535. ExtractTemporaryFile('precomp041.exe');
  1536. #endif
  1537. #if PrecompVer == "0.42"
  1538. ExtractTemporaryFile('precomp042.exe');
  1539. #endif
  1540. #if PrecompVer == "0.43"
  1541. ExtractTemporaryFile('precomp043.exe');
  1542. #endif
  1543. #if PrecompVer == "Inside"
  1544. ExtractTemporaryFile('CLS-precomp.dll');
  1545. ExtractTemporaryFile('CLS-MSC.dll');
  1546. ExtractTemporaryFile('CLS-srep.dll');
  1547. ExtractTemporaryFile('precomp.exe');
  1548. #endif
  1549. #endif
  1550. ExtractTemporaryFile('arc.ini');
  1551. ExtractTemporaryFile('facompress.dll');
  1552. ExtractTemporaryFile('facompress_mt.dll');
  1553. ExtractTemporaryFile('XDelta3.dll');
  1554. ExtractTemporaryFile('7z.dll');
  1555. ExtractTemporaryFile('PackZIP.exe');
  1556. ExtractTemporaryFile('english.ini');
  1557. ExtractTemporaryFile('FreeArc-LZMA-x64.exe');
  1558. ExtractTemporaryFile('srep.exe');
  1559. ExtractTemporaryFile('srep64.exe');
  1560. ExtractTemporaryFile('unarc.dll');
  1561. ExtractTemporaryFile('packjpg_dll.dll');
  1562. ExtractTemporaryFile('packjpg_dll1.dll');
  1563. ExtractTemporaryFile('zlib1.dll');
  1564.  
  1565. Comps1:=0; Comps2:=0; Comps3:=0;
  1566. #ifdef Components
  1567. TmpValue:=1;
  1568. if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue; //component 1
  1569. TmpValue:=TmpValue*2;
  1570. if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue; //component 2
  1571. TmpValue:=TmpValue*2;
  1572. if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue; //component 3
  1573. TmpValue:=TmpValue*2;
  1574. if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue; //component 4
  1575. #endif
  1576.  
  1577. #ifdef precomp
  1578. PCFVer:={#precomp};
  1579. #else
  1580. PCFVer:=0;
  1581. #endif
  1582. ISDoneError:=true;
  1583. if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, 512, @ProgressCallback) then begin
  1584. repeat
  1585. ChangeLanguage('english');
  1586. if not SrepInit('',512,0) then break;
  1587. if not PrecompInit('',128,PCFVer) then break;
  1588. if not FileSearchInit(true) then break;
  1589. #include 'Archives.ini'
  1590. ISDoneError:=false;
  1591. until true;
  1592. ISDoneStop;
  1593. end;
  1594. HideControls;
  1595. WizardForm.CancelButton.Visible:=true;
  1596. WizardForm.CancelButton.Enabled:=false;
  1597. Status.Show;
  1598. end;
  1599.  
  1600. if CurStep = ssPostInstall then begin
  1601. if NoBackgroundCheckBox.Checked then begin
  1602. WizardForm.Caption := ' Installing Software Prerequisites';
  1603. if DirectXCB.Checked then begin
  1604. Status.Caption:='Installing DirectX...';
  1605. Status.Left := 218;
  1606. Status.Top := 200;
  1607. Status.Width := 227;
  1608. Status.Height := 20;
  1609. Exec2(ExpandConstant('{src}\Redist\DirectX\DXSETUP.exe'),'/silent',false);
  1610. end;
  1611. if NvidiaPhysx.Checked then begin
  1612. Status.Caption:='Installing Nvidia Physx...';
  1613. Status.Left := 218;
  1614. Status.Top := 200;
  1615. Status.Width := 227;
  1616. Status.Height := 20;
  1617. Exec2(ExpandConstant('{src}\Redist\PhysX-9.13.1220-SystemSoftware.msi'),'/q',false);
  1618. end;
  1619. if VisualCCB.Checked then begin
  1620. Status.Caption:='Installing Visual C++...';
  1621. Status.Left := 218;
  1622. Status.Top := 200;
  1623. Status.Width := 227;
  1624. Status.Height := 20;
  1625. Exec2(ExpandConstant('{src}\Redist\vcredist_x86.exe'),'/q',false);
  1626. end;
  1627. if Framework.Checked then begin
  1628. Status.Caption:='Installing .NET Framework...';
  1629. Status.Left := 218;
  1630. Status.Top := 200;
  1631. Status.Width := 227;
  1632. Status.Height := 20;
  1633. Exec2(ExpandConstant('{src}\Redist\dotnetfx.exe'),'/q',false);
  1634. end;
  1635. end;
  1636. end;
  1637.  
  1638. if not NoBackgroundCheckBox.Checked then begin
  1639. WizardForm.Caption := ' Installing Software Prerequisites';
  1640. if CurStep = ssPostInstall then begin
  1641. if not CompactCheckBox.Checked then begin
  1642. Status.Caption := 'Installing Additional Components';
  1643. Status.Left := 218;
  1644. Status.Top := 200;
  1645. Status.Width := 227;
  1646. Status.Height := 30;
  1647. if DirectXCB.Checked then begin
  1648. Exec2(ExpandConstant('{src}\Redist\DirectX\DXSETUP.exe'),'/silent',false);
  1649. end;
  1650. if NvidiaPhysx.Checked then begin
  1651. Exec2(ExpandConstant('{src}\Redist\PhysX-9.13.1220-SystemSoftware.msi'),'/q',false);
  1652. end;
  1653. if VisualCCB.Checked then begin
  1654. Exec2(ExpandConstant('{src}\Redist\vcredist_x86.exe'),'/q',false);
  1655. end;
  1656. if Framework.Checked then begin
  1657. Exec2(ExpandConstant('{src}\Redist\dotnetfx.exe'),'/q',false);
  1658. end;
  1659. end;
  1660. end;
  1661. end;
  1662. end;
  1663.  
  1664. //-------- First Page --------\\
  1665. procedure CurPageChanged1(CurPageID: integer);
  1666. begin
  1667. if CurPageID=wpWelcome then begin
  1668. HideComponents;
  1669. Bevel3.Hide;
  1670. Bevel4.Hide;
  1671. BGLabel3.Hide;
  1672. Bevel5.Hide;
  1673. Bevel6.Hide;
  1674. WizardForm.WizardBitmapImage.Show;
  1675. WelcomeLbl.Show;
  1676. WizardForm.Caption:=' Welcome to Grand Theft Auto IV Setup Wizard'
  1677. WizardForm.CancelButton.show;
  1678. end;
  1679. //-------- Second Page --------\\
  1680. if CurPageID=wpSelectDir then begin
  1681. HideComponents;
  1682. WizardForm.WizardSmallBitmapImage.Show;
  1683. WizardForm.Bevel1.Show;
  1684. DirBevel.Show;
  1685. BGLabel3.Hide;
  1686. Bevel3.Show;
  1687. Bevel4.Show;
  1688. Bevel5.Show;
  1689. Bevel6.Show;
  1690. Bevel7.Show;
  1691. Bevel8.Hide;
  1692. Bevel9.Show;
  1693. Bevel11.Show;
  1694. WizardForm.Caption:= ' Select the Destination Directory';
  1695. WizardForm.SelectDirBitmapImage.Show;
  1696. WizardForm.SelectGroupBitmapImage.Show;
  1697. WizardForm.DirEdit.Show;
  1698. WizardForm.GroupEdit.Show;
  1699. WizardForm.DirBrowseButton.Show;
  1700. WizardForm.GroupBrowseButton.Show;
  1701. WizardForm.NoIconsCheck.Show;
  1702. DirLbl.Show;
  1703. GroupLbl.Show;
  1704. PartitionSpaceLabel.Show;
  1705. FreeSpaceLabel.Show;
  1706. GameSpaceLabel.Show;
  1707. NeedSpaceLabel.Show;
  1708. GetFreeSpaceCaption(nil);
  1709. end;
  1710. //-------- Third page --------\\
  1711. if CurPageID=wpSelectTasks then begin
  1712. HideComponents;
  1713. WizardForm.Caption:= ' Select Additional Components';
  1714. WizardForm.WizardSmallBitmapImage.Show;
  1715. WizardForm.Bevel1.Show;
  1716. BGLabel3.Hide;
  1717. Bevel3.Hide;
  1718. Bevel4.Hide;
  1719. Bevel5.Hide;
  1720. Bevel6.Hide;
  1721. Bevel20.Show;
  1722. Bevel21.Show;
  1723. Bevel22.Show;
  1724. Bevel23.Show;
  1725. WizardForm.ComponentsList.Show;
  1726. WizardForm.TasksList.Show;
  1727. DirectXCB.Show;
  1728. DirectXCB.Checked:= False;
  1729. VisualCCB.Show;
  1730. VisualCCB.Checked:= True;
  1731. NvidiaPhysx.Checked:= False;
  1732. NvidiaPhysx.Enabled:= True;
  1733. NvidiaPhysx.Show;
  1734. Framework.Show;
  1735. Framework.Enabled:= True;
  1736. Framework.Checked:= False;
  1737. IconCB.Show;
  1738. IconCB.Checked:= True;
  1739. TasksBevel.Hide;
  1740. TasksLbl.Show;
  1741. WizardForm.NextButton.Caption:='Next >';
  1742. TasksSeparateBevel.Show;
  1743. end;
  1744. //-------- Forth page --------\\
  1745. if CurPageID=wpReady then begin
  1746. HideComponents;
  1747. NoBackgroundCheckBox.Visible := True;
  1748. NoBackgroundCheckBox.Checked := True;
  1749. BGLabel2.Show;
  1750. BGLabel3.Show;
  1751. BGBevel1.Show;
  1752. BGBevel2.Show;
  1753. BGBevel3.Show;
  1754. BGBevel4.Show;
  1755. // BGBevel5.Show;
  1756. VBRadio1.Show;
  1757. VBRadio2.Show;
  1758. //if VBRadio2.Checked then PlayMPEGVideo;
  1759. DirBevel.hide;
  1760. WizardForm.NextButton.Caption:='Install';
  1761. WizardForm.Caption:=' Select the Background Option'
  1762. WizardForm.WizardSmallBitmapImage.Show;
  1763. if not (FileExists(ExpandConstant('{tmp}\Video.avi')) or FileExists(ExpandConstant('{tmp}\Video.mp4')) or FileExists(ExpandConstant('{tmp}\Video.mpeg')) or FileExists(ExpandConstant('{tmp}\Video.mpg')) or FileExists(ExpandConstant('{tmp}\Video.wmv'))) and NoBackgroundCheckBox.Checked =True then
  1764. VBRadio2.Enabled := False;
  1765. end;
  1766.  
  1767. //--------Installation Page--------\\
  1768. if CurPageID=wpInstalling then begin
  1769. HideComponents;
  1770. PauseBT.Show;
  1771. CompactCheckBox.Visible := True;
  1772. CompactCheckBox.Checked := False;
  1773. WizardForm.WizardSmallBitmapImage.Show;
  1774. WizardForm.Bevel1.Show;
  1775. WizardForm.Caption := ' Installing Grand Theft Auto IV';
  1776. WizardForm.TasksList.CheckItem(0,IconCB.Checked);
  1777.  
  1778. with WizardForm do begin
  1779. WizardForm.ProgressGauge.show;
  1780.  
  1781. if NoBackgroundCheckBox.Checked = False then begin
  1782. Top:=GetScreenHeight-ClientHeight-45;
  1783. Left:=GetScreenWidth-ClientWidth-20;
  1784. end;
  1785.  
  1786. if FWAdd then begin
  1787. with WizardForm do begin
  1788. if VBRadio1.Checked then begin
  1789. hide;
  1790. MakeSlideShow;
  1791. show;
  1792. PlayBT1 := PlayBT;
  1793. TimerID := SetTimer(0, 0, 2000, WrapTimerProc(@OnTimer, 4));
  1794. end;
  1795. end;
  1796. end else
  1797. with wizardForm do begin
  1798. FWAdd := False;
  1799. Background;
  1800. end;
  1801. end;
  1802. end;
  1803.  
  1804. if VBRadio2.Checked then begin
  1805. PlayMPEGVideo;
  1806. end;
  1807.  
  1808. if CompactCheckBox.Checked and (CurPageID = wpFinished) then begin
  1809. BackgroundForm.Visible := False;
  1810. end;
  1811.  
  1812. //--------Game was successfully installed PAGE--------\\
  1813.  
  1814. if (CurPageID = wpFinished) and ISDoneError then begin
  1815. Exec2(ExpandConstant('{app}\unins000.exe'),'/VERYSILENT',false);
  1816. end;
  1817.  
  1818. if CurPageID = wpFinished then begin
  1819. with WizardForm do begin
  1820. HideComponents;
  1821. WizardForm.ClientWidth:=654;
  1822. WizardForm.ClientHeight:=402;
  1823. SoundCtrlButton.Hide;
  1824. WizardForm.WizardBitmapImage.Show;
  1825. WelcomeLbl.Show;
  1826. if NoBackgroundCheckBox.Checked = False and (CurPageID = wpFinished) then BackgroundForm.Visible := False;
  1827. WizardForm.Position:=poScreenCenter;
  1828. WelcomeLbl.Left:=145;
  1829. WelcomeLbl.Caption:='Grand Theft Auto IV was successfully installed on your computer.';
  1830. WizardForm.Caption:= ' Finish Grand Theft Auto IV Setup Wizard';
  1831. DeinitializeSlideShow;
  1832. KillTimer(0, TimerID);
  1833. WizardForm.BringToFront;
  1834. DsStopMediaPlay;
  1835. SoundControls;
  1836. end;
  1837. end;
  1838.  
  1839. //--------Game Fail To Install PAGE--------\\
  1840. if (CurPageID = wpFinished) and ISDoneError then begin
  1841. //LabelTime3.Hide;
  1842. WizardForm.Caption:=' Grand Theft Auto IV Setup';
  1843. WelcomeLbl.Font.Color:= clRed;
  1844. if NoBackgroundCheckBox.Checked = False and (CurPageID = wpFinished) and ISDoneError then BackgroundForm.Visible := False;
  1845. WelcomeLbl.Caption:= 'Setup encountered an error while installing Grand Theft Auto IV.' + #13#10#13#10 + 'Changes were not saved , please try installing again.';
  1846. WelcomeLbl.Left:=163;
  1847. WizardForm.ProgressGauge.Hide;
  1848. WizardForm.Position:=poScreenCenter;
  1849. end;
  1850. end;
  1851.  
  1852. procedure DeinitializeSetup1();
  1853. begin
  1854. ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  1855. UnloadSkin();
  1856. end;
  1857.  
  1858. procedure ShowSplashScreen(p1:HWND;p2:AnsiString;p3,p4,p5,p6,p7:integer;p8:boolean;p9:Cardinal;p10 :integer); external 'ShowSplashScreen@files:isgsg.dll stdcall delayload';
  1859. procedure InitializeWizard2();
  1860. begin
  1861. ExtractTemporaryFile('Splash.png');
  1862. ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}\Splash.png'),1000,3000,1000,0,255,True,$FFFFFF,10);
  1863. end;
  1864.  
  1865. function InitializeSetup(): Boolean;
  1866. begin
  1867. Result := InitializeSetup1(); if not Result then exit;
  1868. end;
  1869.  
  1870. procedure InitializeWizard();
  1871. begin
  1872. ExtractTemporaryFile('music.mp3');
  1873. ExtractTemporaryFile('SetupCompleted.wav');
  1874. ExtractTemporaryFile('click.wav');
  1875. if BASS_Init(-1, 44100, 0, 0, 0) then
  1876. begin
  1877. SoundStream := BASS_StreamCreateFile(False,
  1878. ExpandConstant('{tmp}\music.mp3'), 0, 0, 0, 0,
  1879. EncodingFlag or BASS_SAMPLE_LOOP);
  1880. BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);
  1881. BASS_ChannelPlay(SoundStream, False);
  1882.  
  1883. SoundCtrlButton := TNewButton.Create(WizardForm);
  1884. SoundCtrlButton.Parent := WizardForm;
  1885. SoundCtrlButton.SetBounds(210,347,100,30);
  1886. SoundCtrlButton.Caption :=
  1887. ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
  1888. SoundCtrlButton.OnClick := @SoundCtrlButtonClick;
  1889. RedesignWizardForm;
  1890. InitializeWizard1();
  1891. InitializeWizard2();
  1892. end;
  1893. end;
  1894.  
  1895. procedure CurStepChanged(CurStep: TSetupStep);
  1896. begin
  1897. CurStepChanged1(CurStep);
  1898. end;
  1899.  
  1900. procedure CurPageChanged(CurPageID: Integer);
  1901. begin
  1902. CurPageChanged1(CurPageID);
  1903. end;
  1904.  
  1905. function ShouldSkipPage(PageID: Integer):Boolean;
  1906. begin
  1907. if (PageID=wpSelectProgramGroup) or (PageID=wpSelectComponents) then Result:=true;
  1908.  
  1909. //if NoBackgroundCheckBox.Checked = False then begin
  1910. //with WizardForm do begin
  1911. //if (CurPageID=wpFinisheded) and BackgroundForm.Visible then begin
  1912. //BackgroundForm.hide;
  1913. //end;
  1914. //end;
  1915. //end;
  1916. end;
  1917.  
  1918. procedure DeinitializeSetup();
  1919. begin
  1920. mciSendString('Close AVIFile','',0,0);
  1921. mciSendString('Close MPEGVideo','',0,0);
  1922. DeinitializeSlideShow;
  1923. DsStopMediaPlay;
  1924. KillTimer(0, TimerID);
  1925. BASS_Free();
  1926. DeinitializeSetup1();
  1927. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement