Guest User

Script

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