Advertisement
Guest User

Untitled

a guest
Apr 7th, 2016
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 37.86 KB | None | 0 0
  1. //----------This Installer Uses Inno Setup Unicode Version----------\\
  2. #define AppName "Fallout 4"
  3. ;#define AppName64 "Bear Simulator x64"
  4. #define AppPublisher "Asaya"
  5. #define AppVersion "v 1.4.132"
  6. #define AppExec "Fallout4Launcher.exe"
  7. ;#define AppExec64 "Bear Simulator (Windows 64 bit).exe"
  8. #define AppURL "https://kat.cr/user/Asaya/uploads/"
  9. #define AppSize "1000"
  10. #define SetupName "Setup"
  11. #define SetupOut "Output"
  12.  
  13. #define PrecompVer "Inside"
  14.  
  15. ;{pf}\{#AppPublisher}\{#AppName}
  16.  
  17. [Setup]
  18. AppName={#AppName}
  19. AppPublisher={#AppPublisher}
  20. AppVersion={#AppVersion}
  21. AppComments={#AppName}
  22. DefaultDirName={pf}\{#AppName}
  23. DefaultGroupName={#AppName}
  24. OutputBaseFilename={#SetupName}
  25. OutputDir={#SetupOut}
  26. SetupIconFile=Style\Setup.ico
  27. WizardImageFile=Style\Background.bmp
  28. WizardSmallImageFile=Style\smallbitmap.bmp
  29.  
  30. [Icons]
  31. ;Name: {group}\Uninstall {#AppName}; Filename: {app}\unins000.exe; WorkingDir: {app}; Check: CheckError
  32. Name: {group}\{#AppName}; Filename: {app}\{#AppExec}
  33. ;Name: {group}\{#AppName64}; Filename: {app}\Win64\{#AppExec64}
  34. Name: {commondesktop}\{#AppName}; Filename: {app}\{#AppExec}; Tasks: desktopicon
  35. ;Name: {commondesktop}\{#AppName64}; Filename: {app}\Win64\{#AppExec64}; Tasks: desktopicon
  36. Name: {userstartmenu}\{#AppName}; Filename: {app}\{#AppExec}
  37. ;Name: {userstartmenu}\{#AppName64}; Filename: {app}\Win64\{#AppExec64}
  38.  
  39. [Files]
  40. Source: "Include\*.*"; DestDir: "{tmp}"; Flags: dontcopy
  41. Source: "Style\*.*"; DestDir: "{tmp}"; Flags: dontcopy
  42. Source: "..\..\..\..\Games\Fallout 4\Fallout4_Default.ini"; DestDir: "{tmp}"; Flags: dontcopy
  43. Source: "..\..\..\..\Games\Fallout 4\steam_api.ini"; DestDir: "{tmp}"; Flags: dontcopy
  44. Source: "..\Fallout english\Data\Strings\Fallout4_en.DLSTRINGS"; DestDir: "{tmp}"; Flags: dontcopy
  45. Source: "..\Fallout english\Data\Strings\Fallout4_en.ILSTRINGS"; DestDir: "{tmp}"; Flags: dontcopy
  46. Source: "..\Fallout english\Data\Strings\Fallout4_en.STRINGS"; DestDir: "{tmp}"; Flags: dontcopy
  47. Source: "..\Fallout english\Data\Interface\Translate_en.txt"; DestDir: "{tmp}"; Flags: dontcopy
  48.  
  49. [Messages]
  50. SetupWindowTitle=Welcome to The Setup Wizard «{#AppName}»
  51.  
  52. [CustomMessages]
  53. SoundCtrlButtonCaptionSoundOn=Music on
  54. SoundCtrlButtonCaptionSoundOff=Music off
  55.  
  56. [Languages]
  57. Name: eng; MessagesFile: compiler:Default.isl
  58.  
  59. [Components]
  60. Name: directx; Description: Install DirectX
  61. Name: visualc; Description: Install Visual C++
  62. Name: framework; Description: Install Framework
  63. Name: winupdate; Description: Install Windows Updates
  64.  
  65. [Tasks]
  66. Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
  67.  
  68. [UninstallDelete]
  69. Type: filesandordirs; Name: {app}
  70.  
  71. [Code]
  72.  
  73. const
  74. BASS_SAMPLE_LOOP = 4;
  75. BASS_ACTIVE_STOPPED = 0;
  76. BASS_ACTIVE_PLAYING = 1;
  77. BASS_ACTIVE_STALLED = 2;
  78. BASS_ACTIVE_PAUSED = 3;
  79. BASS_UNICODE = $80000000;
  80. BASS_CONFIG_GVOL_STREAM = 5;
  81. const
  82. #ifndef UNICODE
  83. EncodingFlag = 0;
  84. #else
  85. EncodingFlag = BASS_UNICODE;
  86. #endif
  87. type
  88. HSTREAM = DWORD;
  89.  
  90. function BASS_Init(device: LongInt; freq, flags: DWORD;
  91. win: HWND; clsid: Cardinal): BOOL;
  92. external 'BASS_Init@files:bass.dll stdcall';
  93. function BASS_StreamCreateFile(mem: BOOL; f: string; offset1: DWORD;
  94. offset2: DWORD; length1: DWORD; length2: DWORD; flags: DWORD): HSTREAM;
  95. external 'BASS_StreamCreateFile@files:bass.dll stdcall';
  96. function BASS_Start: BOOL;
  97. external 'BASS_Start@files:bass.dll stdcall';
  98. function BASS_Pause: BOOL;
  99. external 'BASS_Pause@files:bass.dll stdcall';
  100. function BASS_ChannelPlay(handle: DWORD; restart: BOOL): BOOL;
  101. external 'BASS_ChannelPlay@files:bass.dll stdcall';
  102. function BASS_SetConfig(option: DWORD; value: DWORD ): BOOL;
  103. external 'BASS_SetConfig@files:bass.dll stdcall';
  104. function BASS_ChannelIsActive(handle: DWORD): DWORD;
  105. external 'BASS_ChannelIsActive@files:bass.dll stdcall';
  106. function BASS_Free: BOOL;
  107. external 'BASS_Free@files:bass.dll stdcall';
  108.  
  109. var
  110. SoundStream: HSTREAM;
  111. SoundCtrlButton: TNewButton;
  112.  
  113. procedure SoundCtrlButtonClick(Sender: TObject);
  114. begin
  115. case BASS_ChannelIsActive(SoundStream) of
  116. BASS_ACTIVE_PLAYING:
  117. begin
  118. if BASS_Pause then
  119. SoundCtrlButton.Caption :=
  120. ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOn}');
  121. end;
  122. BASS_ACTIVE_PAUSED:
  123. begin
  124. if BASS_Start then
  125. SoundCtrlButton.Caption :=
  126. ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
  127. end;
  128. end;
  129. end;
  130.  
  131. { RedesignWizardFormBegin } // Don't remove this line!
  132. // Don't modify this section. It is generated automatically.
  133. procedure RedesignWizardForm;
  134. begin
  135. with WizardForm.ProgressGauge do
  136. begin
  137. Height := ScaleY(13);
  138. end;
  139.  
  140. { ReservationBegin }
  141. // This part is for you. Add your specialized code here.
  142.  
  143. { ReservationEnd }
  144. end;
  145. // Don't modify this section. It is generated automatically.
  146. { RedesignWizardFormEnd } // Don't remove this line!
  147.  
  148.  
  149. type
  150. #ifdef UNICODE
  151. PChar = PAnsiChar;
  152. #endif
  153. const
  154. PCFonFLY=true;
  155. notPCFonFLY=false;
  156. var
  157. LabelPct1,LabelCurrFileName,LabelTime1,LabelTime2,LabelTime3: TLabel;
  158. ISDoneProgressBar1: TNewProgressBar;
  159. MyCancelButton: TButton;
  160. ISDoneCancel:integer;
  161. ISDoneError:boolean;
  162. PCFVer:double;
  163.  
  164. type
  165. TCallback = function (OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
  166.  
  167. function WrapCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:ISDone.dll stdcall delayload';
  168.  
  169. 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';
  170. function IS7ZipExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'IS7zipExtract@files:ISDone.dll stdcall delayload';
  171. function ISRarExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; Password: AnsiString):boolean; external 'ISRarExtract@files:ISDone.dll stdcall delayload';
  172. function ISPrecompExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISPrecompExtract@files:ISDone.dll stdcall delayload';
  173. function ISSRepExtract(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean):boolean; external 'ISSrepExtract@files:ISDone.dll stdcall delayload';
  174. function ISxDeltaExtract(CurComponent:Cardinal; PctOfTotal:double; minRAM,maxRAM:integer; InName, DiffFile, OutFile: AnsiString; DeleteInFile, DeleteDiffFile:boolean):boolean; external 'ISxDeltaExtract@files:ISDone.dll stdcall delayload';
  175. function ISPackZIP(CurComponent:Cardinal; PctOfTotal:double; InName, OutFile: AnsiString;ComprLvl:integer; DeleteInFile:boolean):boolean; external 'ISPackZIP@files:ISDone.dll stdcall delayload';
  176. function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):boolean; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall delayload';
  177.  
  178. function Exec2 (FileName, Param: PAnsiChar;Show:boolean):boolean; external 'Exec2@files:ISDone.dll stdcall delayload';
  179. function ISFindFiles(CurComponent:Cardinal; FileMask:AnsiString; var ColFiles:integer):integer; external 'ISFindFiles@files:ISDone.dll stdcall delayload';
  180. function ISPickFilename(FindHandle:integer; OutPath:AnsiString; var CurIndex:integer; DeleteInFile:boolean):boolean; external 'ISPickFilename@files:ISDone.dll stdcall delayload';
  181. function ISGetName(TypeStr:integer):PAnsichar; external 'ISGetName@files:ISDone.dll stdcall delayload';
  182. function ISFindFree(FindHandle:integer):boolean; external 'ISFindFree@files:ISDone.dll stdcall delayload';
  183. function ISExec(CurComponent:Cardinal; PctOfTotal,SpecifiedProcessTime:double; ExeName,Parameters,TargetDir,OutputStr:AnsiString;Show:boolean):boolean; external 'ISExec@files:ISDone.dll stdcall delayload';
  184.  
  185. function SrepInit(TmpPath:PAnsiChar;VirtMem,MaxSave:Cardinal):boolean; external 'SrepInit@files:ISDone.dll stdcall delayload';
  186. function PrecompInit(TmpPath:PAnsiChar;VirtMem:cardinal;PrecompVers:single):boolean; external 'PrecompInit@files:ISDone.dll stdcall delayload';
  187. function FileSearchInit(RecursiveSubDir:boolean):boolean; external 'FileSearchInit@files:ISDone.dll stdcall delayload';
  188. function ISDoneInit(RecordFileName:AnsiString; TimeType,Comp1,Comp2,Comp3:Cardinal; WinHandle, NeededMem:longint; callback:TCallback):boolean; external 'ISDoneInit@files:ISDone.dll stdcall';
  189. function ISDoneStop:boolean; external 'ISDoneStop@files:ISDone.dll stdcall';
  190. function ChangeLanguage(Language:AnsiString):boolean; external 'ChangeLanguage@files:ISDone.dll stdcall delayload';
  191. function SuspendProc:boolean; external 'SuspendProc@files:ISDone.dll stdcall';
  192. function ResumeProc:boolean; external 'ResumeProc@files:ISDone.dll stdcall';
  193.  
  194. function ProgressCallback(OveralPct,CurrentPct: integer;CurrentFile,TimeStr1,TimeStr2,TimeStr3:PAnsiChar): longword;
  195. begin
  196. if OveralPct<=1000 then ISDoneProgressBar1.Position := OveralPct;
  197. LabelPct1.Caption := IntToStr(OveralPct div 10)+'.'+chr(48 + OveralPct mod 10)+'%';
  198. LabelCurrFileName.Caption:=' Extracting File: '+MinimizePathName(CurrentFile, LabelCurrFileName.Font, LabelCurrFileName.Width-ScaleX(100));
  199. LabelTime1.Caption:=' Time Elapsed: '+TimeStr2;
  200. LabelTime2.Caption:='Time Remaining: '+TimeStr1;
  201. // LabelTime3.Caption:='Installing time:'+TimeStr3;
  202. Result := ISDoneCancel;
  203. end;
  204.  
  205. procedure CancelButtonOnClick(Sender: TObject);
  206. begin
  207. SuspendProc;
  208. if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then ISDoneCancel:=1;
  209. ResumeProc;
  210. end;
  211.  
  212. procedure HideControls;
  213. begin
  214. WizardForm.FileNamelabel.Hide;
  215. ISDoneProgressBar1.Hide;
  216. LabelPct1.Hide;
  217. LabelCurrFileName.Hide;
  218. LabelTime1.Hide;
  219. LabelTime2.Hide;
  220. MyCancelButton.Hide;
  221. end;
  222.  
  223. procedure CreateControls;
  224. var PBTop:integer;
  225. begin
  226. PBTop:=ScaleY(150);
  227. ISDoneProgressBar1 := TNewProgressBar.Create(WizardForm);
  228. with ISDoneProgressBar1 do begin
  229. Parent := WizardForm;
  230. Height := 25;
  231. Left := ScaleX(77);
  232. Top := PBTop;
  233. Width := ScaleX(500);
  234. Max := 1000;
  235. end;
  236. LabelCurrFileName := TLabel.Create(WizardForm);
  237. with LabelCurrFileName do begin
  238. Parent := WizardForm;
  239. AutoSize := False;
  240. Width := ISDoneProgressBar1.Width+ScaleX(30);
  241. Left := ISDoneProgressBar1.Left;
  242. Top := PBTop-20;
  243. end;
  244.  
  245. LabelTime1 := TLabel.Create(WizardForm);
  246. with LabelTime1 do begin
  247. Parent := WizardForm;
  248. AutoSize := False;
  249. Width := ISDoneProgressBar1.Width div 2;
  250. Left := ISDoneProgressBar1.Left;
  251. Top := PBTop + ScaleY(30);
  252. end;
  253. LabelTime2 := TLabel.Create(WizardForm);
  254. with LabelTime2 do begin
  255. Parent := WizardForm;
  256. AutoSize := False;
  257. Width := LabelTime1.Width+ScaleX(40);
  258. Left := 400;
  259. Top := LabelTime1.Top;
  260. end;
  261. LabelPct1 := TLabel.Create(WizardForm);
  262. with LabelPct1 do begin
  263. Parent := WizardForm;
  264. AutoSize := true;
  265. Font.Height:=-24;
  266. Left := ISDoneProgressBar1.Left -33 + ISDoneProgressBar1.Width div 2;
  267. Top := ISDoneProgressBar1.Top + ScaleY(70);
  268. //Width := ScaleX(80);
  269. end;
  270. // LabelTime3 := TLabel.Create(WizardForm);
  271. // with LabelTime3 do begin
  272. // Parent := WizardForm;
  273. // AutoSize := False;
  274. // Width := 300;
  275. // Left := 180;
  276. // Top := 200;
  277. // end;
  278. MyCancelButton:=TButton.Create(WizardForm);
  279. with MyCancelButton do begin
  280. Parent:=WizardForm;
  281. Width:=ScaleX(150);
  282. Caption:='Cancel';
  283. Left:=ScaleX(347);
  284. Height:=ScaleX(30);
  285. Left:=(480);
  286. Top:=WizardForm.cancelbutton.top;
  287. OnClick:=@CancelButtonOnClick;
  288. end;
  289. end;
  290.  
  291.  
  292. function CheckError:boolean;
  293. begin
  294. result:= not ISDoneError;
  295. end;
  296.  
  297. // Importing LoadSkin API from ISSkin.DLL
  298. procedure LoadSkin(lpszPath: PAnsiChar; lpszIniFileName: PAnsiChar);
  299. external 'LoadSkin@{tmp}\isskin.dll stdcall delayload';
  300.  
  301. // Importing UnloadSkin API from ISSkin.DLL
  302. procedure UnloadSkin;
  303. external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload';
  304.  
  305. // Importing ShowWindow Windows API from User32.DLL
  306. function ShowWindow(hWnd: Integer; uType: Integer): Integer;
  307. external 'ShowWindow@user32.dll stdcall';
  308.  
  309. var
  310. WelcomeLbl,DirLbl,GroupLbl,TasksLbl,FreeSpaceLabel,NeedSpaceLabel,GameSpaceLabel,PartitionSpaceLabel,Status: TLabel;
  311. DirBevel,GroupBevel,TasksBevel,TasksSeparateBevel,Bevel1,Bevel11,Bevel2,Bevel3,Bevel4,Bevel5,Bevel6,Bevel7,Bevel8,Bevel9,Bevel20,Bevel21,Bevel22,Bevel23: TBevel;
  312. FreeMB,TotalMB: cardinal;
  313.  
  314. function InitializeSetup1(): Boolean;
  315. begin
  316. ExtractTemporaryFile('Fallout4_Default.ini');
  317. ExtractTemporaryFile('steam_api.ini');
  318. ExtractTemporaryFile('Fallout4_en.DLSTRINGS');
  319. ExtractTemporaryFile('Fallout4_en.ILSTRINGS');
  320. ExtractTemporaryFile('Fallout4_en.STRINGS');
  321. ExtractTemporaryFile('Translate_en.txt');
  322.  
  323.  
  324. ExtractTemporaryFile('isskin.dll');
  325. ExtractTemporaryFile('skin.cjstyles');
  326. LoadSkin(ExpandConstant('{tmp}\skin.cjstyles'), '');
  327. Result := True;
  328. end;
  329.  
  330. Function NumToStr(Float: Extended): String;
  331. Begin
  332. Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');
  333. while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
  334. SetLength(Result, Length(Result)-1);
  335. End;
  336.  
  337. Function MbOrTb(Byte: Extended): String;
  338. begin
  339. if Byte < 1024 then Result:= NumToStr(Byte) + ' MB' else
  340. if Byte/1024 < 1024 then Result:= NumToStr(round(Byte/1024*100)/100) + ' GB' else
  341. Result:= NumToStr(round((Byte/(1024*1024))*100)/100) + ' TB'
  342. end;
  343.  
  344. procedure GetFreeSpaceCaption(Sender: TObject);
  345. var Path: String;
  346. begin
  347. Path := ExtractFileDrive(WizardForm.DirEdit.Text);
  348. GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
  349. PartitionSpaceLabel.Caption:= ExpandConstant('Partition Space : ') + MbOrTb(TotalMB);
  350. FreeSpaceLabel.Caption := ExpandConstant('Free Space : ') + MbOrTb(FreeMB) + ' (' + IntToStr((FreeMB * 100) div TotalMB) + '%)';
  351. // GameSpaceLabel.Caption := ExpandConstant('Game Space : ') + MbOrTb({#AppSize});
  352. // NeedSpaceLabel.Caption := ExpandConstant('Total Needed Space : ') + MbOrTb({#AppSize});
  353. if (FreeMB<{#AppSize}) then
  354. FreeSpaceLabel.Font.Color:=clRed
  355. else
  356. PartitionSpaceLabel.Font.Color:=NeedSpaceLabel.Font.Color;
  357. WizardForm.NextButton.Enabled:=FreeMB>{#AppSize};
  358. end;
  359.  
  360. var
  361. DirectXCB,VisualCCB,Framework,winupdate,IconCB: TNewCheckBox;
  362. //---COMPONENTS POSITION CONTROL---\\
  363. procedure Tasks;
  364. begin
  365. TasksBevel := TBevel.Create(WizardForm);
  366. with TasksBevel do
  367. begin
  368. Parent := WizardForm;
  369. Left := ScaleX(90);
  370. Top := ScaleY(150);
  371. Width := ScaleX(470);
  372. Height := ScaleY(73);
  373. end;
  374. //------------------------\\
  375.  
  376. //---Top---\\
  377. Bevel20 := TBevel.Create(WizardForm);
  378. with Bevel20 do
  379. begin
  380. Parent := WizardForm;
  381. Left := ScaleX(92);
  382. Top := ScaleY(150);
  383. Width := ScaleX(470);
  384. Height := ScaleY(2);
  385. end;
  386. //---Bottom---\\
  387. Bevel21 := TBevel.Create(WizardForm);
  388. with Bevel21 do
  389. begin
  390. Parent := WizardForm;
  391. Left := ScaleX(92);
  392. Top := ScaleY(308);
  393. Width := ScaleX(470);
  394. Height := ScaleY(2);
  395. end;
  396. //---Left---\\
  397. Bevel22 := TBevel.Create(WizardForm);
  398. with Bevel22 do
  399. begin
  400. Parent := WizardForm;
  401. Left := ScaleX(92);
  402. Top := ScaleY(152);
  403. Width := ScaleX(2);
  404. Height := ScaleY(158);
  405. end;
  406. //---Right---\\
  407. Bevel23 := TBevel.Create(WizardForm);
  408. with Bevel23 do
  409. begin
  410. Parent := WizardForm;
  411. Left := ScaleX(560);
  412. Top := ScaleY(152);
  413. Width := ScaleX(2);
  414. Height := ScaleY(156);
  415. end;
  416. //------------------------\\
  417.  
  418. DirectXCB := TNewCheckBox.Create(WizardForm);
  419. with DirectXCB do
  420. begin
  421. Parent := WizardForm;
  422. Left :=(112);
  423. Top :=(170);
  424. Width := ScaleX(265);
  425. Height := ScaleY(17);
  426. Caption:='Install DirectX';
  427. end;
  428.  
  429. VisualCCB := TNewCheckBox.Create(WizardForm);
  430. with VisualCCB do
  431. begin
  432. Parent := WizardForm;
  433. Left :=(112);
  434. Top :=(190);
  435. Width := ScaleX(265);
  436. Height := ScaleY(17);
  437. Caption := 'Install Visual C ++';
  438. end;
  439.  
  440. Framework := TNewCheckBox.Create(WizardForm);
  441. with Framework do
  442. begin
  443. Parent := WizardForm;
  444. Left :=(112);
  445. Top :=(210);
  446. Width := ScaleX(265);
  447. Height := ScaleY(17);
  448. Caption:='Install Framework';
  449. end;
  450.  
  451. winupdate := TNewCheckBox.Create(WizardForm);
  452. with winupdate do
  453. begin
  454. Parent := WizardForm;
  455. Left :=(112);
  456. Top :=(230);
  457. Width := ScaleX(265);
  458. Height := ScaleY(17);
  459. Caption:='Install Windows Updates';
  460. end;
  461.  
  462.  
  463. TasksSeparateBevel := TBevel.Create(WizardForm);
  464. with TasksSeparateBevel do
  465. begin
  466. Parent := WizardForm;
  467. Left :=(10);
  468. Top :=(260);
  469. Width := TasksBevel.Width - 0;
  470. Height := ScaleY(2);
  471. Width := ScaleX(440);
  472. Left := ScaleX(107);
  473. end;
  474.  
  475. IconCB := TNewCheckBox.Create(WizardForm);
  476. with IconCB do
  477. begin
  478. Parent := WizardForm;
  479. Left := (112);
  480. Top :=(275);
  481. Width := ScaleX(255);
  482. Height := ScaleY(17);
  483. Caption := 'Create Desktop Shortcut';
  484. end;
  485. end;
  486.  
  487. //-----------------------------------\\
  488.  
  489. procedure LogoLabelOnClick(Sender: TObject);
  490. var
  491. ErrorCode: Integer;
  492. begin
  493. ShellExec('open', '{#AppURL}', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
  494. end;
  495.  
  496. procedure InitializeWizard1();
  497. begin
  498. WizardForm.WizardBitmapImage2.Cursor:=crHand;
  499. WizardForm.WizardBitmapImage2.OnClick:=@LogoLabelOnClick;
  500. WizardForm.ClientWidth:=654;
  501. WizardForm.ClientHeight:=402;
  502. WizardForm.InnerNotebook.Hide;
  503. WizardForm.OuterNotebook.Hide;
  504. WizardForm.WizardBitmapImage.Stretch:=True;
  505. WizardForm.WizardBitmapImage.Parent:=WizardForm;
  506. ExtractTemporaryFile ('logo.bmp');
  507. WizardForm.WizardBitmapImage2.Width := ScaleX(230);
  508. WizardForm.WizardBitmapImage2.Height := ScaleX(55);
  509. WizardForm.WizardBitmapImage2.Top:=340;
  510. WizardForm.WizardBitmapImage2.Left:=5;
  511. WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));
  512. WizardForm.WizardBitmapImage2.Parent:=WizardForm;
  513. WizardForm.WizardSmallBitmapImage.Stretch:=True;
  514. WizardForm.WizardSmallBitmapImage.Parent:=WizardForm;
  515. WizardForm.WizardSmallBitmapImage.SetBounds(0,0,WizardForm.ClientWidth,90);
  516. WizardForm.Bevel1.Parent:=WizardForm;
  517. WizardForm.Bevel1.Top:=90;
  518. WizardForm.Bevel1.Width:=WizardForm.ClientWidth;
  519. WizardForm.Bevel.Parent:=WizardForm;
  520. WizardForm.Bevel.Top:=330;
  521. WizardForm.Bevel.Width:=WizardForm.ClientWidth;
  522. WizardForm.SelectDirBitmapImage.Parent:=WizardForm;
  523. WizardForm.SelectDirBitmapImage.Top:=125;
  524. WizardForm.SelectDirBitmapImage.Left:=40;
  525. WizardForm.DirEdit.Parent:=WizardForm;
  526. WizardForm.DirEdit.Top:=130;
  527. WizardForm.DirEdit.Left:=75;
  528. WizardForm.DirEdit.Width:=430;
  529. WizardForm.DirEdit.OnChange:=@GetFreeSpaceCaption;
  530. WizardForm.DirBrowseButton.Parent:=WizardForm;
  531. WizardForm.DirBrowseButton.Top:=125;
  532. WizardForm.DirBrowseButton.Left:=515;
  533. WizardForm.DirBrowseButton.Width:=90;
  534. WizardForm.DirBrowseButton.Height:=30;
  535. WizardForm.GroupEdit.Parent:=WizardForm;
  536. WizardForm.GroupEdit.Top:=255;
  537. WizardForm.GroupEdit.Left:=75;
  538. WizardForm.GroupEdit.Width:=430;
  539. WizardForm.GroupBrowseButton.Parent:=WizardForm;
  540. WizardForm.GroupBrowseButton.Top:=250;
  541. WizardForm.GroupBrowseButton.Left:=515;
  542. WizardForm.GroupBrowseButton.Width:=90;
  543. WizardForm.GroupBrowseButton.Height:=30;
  544. WizardForm.NoIconsCheck.Parent:=WizardForm;
  545. WizardForm.NoIconsCheck.Left:=75;
  546. WizardForm.NoIconsCheck.Top:=285;
  547. WizardForm.SelectGroupBitmapImage.Parent:=WizardForm;
  548. WizardForm.SelectGroupBitmapImage.Top:=250;
  549. WizardForm.SelectGroupBitmapImage.Left:=40;
  550. WizardForm.WizardBitmapImage.SetBounds(0,0,WizardForm.ClientWidth,330);
  551. WizardForm.NextButton.SetBounds(525,347,100,30);
  552. WizardForm.CancelButton.SetBounds(420,347,100,30);
  553. WizardForm.BackButton.SetBounds(315,347,100,30);
  554.  
  555. WelcomeLbl:=TLabel.Create(WizardForm);
  556. With WelcomeLbl do begin
  557. Transparent:=true;
  558. Parent:=WizardForm;
  559. Alignment:=taCenter;
  560. 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';
  561. Font.Color:=clWhite;
  562. Font.Size:=9;
  563. SetBounds(126,205,400,90);
  564. end;
  565. //
  566. Tasks;
  567. DirBevel := TBevel.Create(WizardForm);
  568. with DirBevel do
  569. begin
  570. Parent := WizardForm;
  571. Left := ScaleX(28);
  572. Top := ScaleY(110);
  573. Width := ScaleX(594);
  574. Height := ScaleY(110);
  575. end;
  576.  
  577. //-----Bevel Line Page 2 Bottom-----\\
  578.  
  579. //---Top---\\
  580. Bevel3 := TBevel.Create(WizardForm);
  581. with Bevel3 do
  582. begin
  583. Parent := WizardForm;
  584. Left := ScaleX(27);
  585. Top := ScaleY(235);
  586. Width := ScaleX(594);
  587. Height := ScaleY(2);
  588. end;
  589. //---Bottom---\\
  590. Bevel4 := TBevel.Create(WizardForm);
  591. with Bevel4 do
  592. begin
  593. Parent := WizardForm;
  594. Left := ScaleX(27);
  595. Top := ScaleY(313);
  596. Width := ScaleX(595);
  597. Height := ScaleY(2);
  598. end;
  599. //---Left---\\
  600. Bevel5 := TBevel.Create(WizardForm);
  601. with Bevel5 do
  602. begin
  603. Parent := WizardForm;
  604. Left := ScaleX(27);
  605. Top := ScaleY(236);
  606. Width := ScaleX(2);
  607. Height := ScaleY(78);
  608. end;
  609. //---Right---\\
  610. Bevel6 := TBevel.Create(WizardForm);
  611. with Bevel6 do
  612. begin
  613. Parent := WizardForm;
  614. Left := ScaleX(620);
  615. Top := ScaleY(235);
  616. Width := ScaleX(2);
  617. Height := ScaleY(79);
  618. end;
  619. //------------------------\\
  620.  
  621. //-----Bevel Line Page 2 Top-----\\
  622.  
  623. //---Top---\\
  624. Bevel7 := TBevel.Create(WizardForm);
  625. with Bevel7 do
  626. begin
  627. Parent := WizardForm;
  628. Left := ScaleX(27);
  629. Top := ScaleY(110);
  630. Width := ScaleX(595);
  631. Height := ScaleY(2);
  632. end;
  633. //---Bottom---\\
  634. Bevel8 := TBevel.Create(WizardForm);
  635. with Bevel8 do
  636. begin
  637. Parent := WizardForm;
  638. Left := ScaleX(27);
  639. Top := ScaleY(218);
  640. Width := ScaleX(595);
  641. Height := ScaleY(2);
  642. end;
  643. //---Right---\\
  644. Bevel9 := TBevel.Create(WizardForm);
  645. with Bevel9 do
  646. begin
  647. Parent := WizardForm;
  648. Left := ScaleX(620);
  649. Top := ScaleY(110);
  650. Width := ScaleX(2);
  651. Height := ScaleY(108);
  652. end;
  653. //---Left---\\
  654. Bevel11 := TBevel.Create(WizardForm);
  655. with Bevel11 do
  656. begin
  657. Parent := WizardForm;
  658. Left := ScaleX(27);
  659. Top := ScaleY(111);
  660. Width := ScaleX(2);
  661. Height := ScaleY(109);
  662. end;
  663.  
  664. //------------------------\\
  665. Status:=TLabel.Create(WizardForm);
  666. With Status do begin
  667. //Transparent:=true;
  668. Parent:=WizardForm;
  669. Alignment:=taCenter;
  670. //Font.Color:=clWhite;
  671. Font.Height:=-15;
  672. SetBounds(0,250,650,30);
  673. end;
  674.  
  675. DirLbl:=TLabel.Create(WizardForm);
  676. With DirLbl do begin
  677. //Transparent:=true;
  678. Parent:=WizardForm;
  679. //Alignment:=taCenter;
  680. Caption:=' Setup will install The game into the following folder ';
  681. Font.Color:=clWhite;
  682. SetBounds(52,105,251,15);
  683. end;
  684. GroupLbl:=TLabel.Create(WizardForm);
  685. With GroupLbl do begin
  686. //Transparent:=true;
  687. Parent:=WizardForm;
  688. //Alignment:=taCenter;
  689. Caption:=' Setup will create shortcuts in the following Start ';
  690. Font.Color:=clWhite;
  691. SetBounds(52,230,235,15);
  692. end;
  693. TasksLbl:=TLabel.Create(WizardForm);
  694. With TasksLbl do begin
  695. //Transparent:=true;
  696. Parent:=WizardForm;
  697. //Alignment:=taCenter;
  698. 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.';
  699. //Font.Color:=clWhite;
  700. SetBounds(125,105,407,30);
  701. end;
  702. //---PARTITION SPACE---\\
  703. PartitionSpaceLabel:=TLabel.Create(WizardForm);
  704. With PartitionSpaceLabel do begin
  705. //Transparent:=true;
  706. Parent:=WizardForm;
  707. //Alignment:=taCenter;
  708. //Font.Color:=clWhite;
  709. Font.Height:=-13;
  710. SetBounds(75,160,200,30);
  711. end;
  712. //---FREE SPACE---\\
  713. FreeSpaceLabel:=TLabel.Create(WizardForm);
  714. With FreeSpaceLabel do begin
  715. //Transparent:=true;
  716. Parent:=WizardForm;
  717. //Alignment:=taCenter;
  718. //Font.Color:=clWhite;
  719. Font.Height:=-13;
  720. SetBounds(335,160,200,30);
  721. end;
  722. //---GAME SPACE---\\
  723. GameSpaceLabel:=TLabel.Create(WizardForm);
  724. With GameSpaceLabel do begin
  725. //Transparent:=true;
  726. Parent:=WizardForm;
  727. //Alignment:=taCenter;
  728. //Font.Color:=clWhite;
  729. Font.Height:=-13;
  730. SetBounds(75,190,200,30);
  731. end;
  732. //---Total Needed Space---\\
  733. NeedSpaceLabel:=TLabel.Create(WizardForm);
  734. With NeedSpaceLabel do begin
  735. //Transparent:=true;
  736. Parent:=WizardForm;
  737. //Alignment:=taCenter;
  738. //Font.Color:=clWhite;
  739. Font.Height:=-13;
  740. SetBounds(335,190,200,30);
  741. end;
  742. end;
  743.  
  744. Procedure HideComponents();
  745. begin
  746. WizardForm.WizardSmallBitmapImage.Hide;
  747. WizardForm.Bevel1.Hide;
  748. DirBevel.Hide;
  749. Bevel3.Hide;
  750. Bevel4.Hide;
  751. Bevel5.Hide;
  752. Bevel6.Hide;
  753. Bevel7.Hide;
  754. Bevel8.Hide;
  755. Bevel9.Hide;
  756. Bevel11.Hide;
  757. Bevel20.Hide;
  758. Bevel21.Hide;
  759. Bevel22.Hide;
  760. Bevel23.Hide;
  761. TasksBevel.Hide;
  762. DirLbl.Hide;
  763. GroupLbl.Hide;
  764. TasksLbl.Hide;
  765. DirectXCB.Hide;
  766. VisualCCB.Hide;
  767. Framework.Hide;
  768. winupdate.Hide;
  769. IconCB.Hide;
  770. WizardForm.SelectDirBitmapImage.Hide;
  771. WizardForm.SelectGroupBitmapImage.Hide;
  772. WizardForm.DirEdit.Hide;
  773. WizardForm.GroupEdit.Hide;
  774. WizardForm.DirBrowseButton.Hide;
  775. WizardForm.GroupBrowseButton.Hide;
  776. WizardForm.NoIconsCheck.Hide;
  777. WizardForm.WizardBitmapImage.Hide;
  778. WelcomeLbl.Hide;
  779. // WizardForm.ComponentsList.Hide;
  780. // WizardForm.TasksList.Hide;
  781. TasksSeparateBevel.Hide;
  782. PartitionSpaceLabel.Hide;
  783. FreeSpaceLabel.Hide;
  784. GameSpaceLabel.Hide;
  785. NeedSpaceLabel.Hide;
  786. Status.Hide;
  787. end;
  788.  
  789. procedure CurStepChanged1(CurStep: TSetupStep);
  790. var Comps1,Comps2,Comps3, TmpValue:cardinal;
  791. FindHandle1,ColFiles1,CurIndex1,tmp:integer;
  792. ExecError:boolean;
  793. InFilePath,OutFilePath,OutFileName:PAnsiChar;
  794. begin
  795. if CurStep = ssInstall then begin //If necessary, you can change to ssPostInstall
  796. WizardForm.ProgressGauge.Hide;
  797. WizardForm.CancelButton.Hide;
  798. CreateControls;
  799. WizardForm.StatusLabel.Caption:='Extracting Files...';
  800. ISDoneCancel:=0;
  801.  
  802. #ifdef PrecompVer
  803. #if PrecompVer == "0.38"
  804. ExtractTemporaryFile('precomp038.exe');
  805. #endif
  806. #if PrecompVer == "0.40"
  807. ExtractTemporaryFile('precomp040.exe');
  808. #endif
  809. #if PrecompVer == "0.41"
  810. ExtractTemporaryFile('precomp041.exe');
  811. #endif
  812. #if PrecompVer == "0.42"
  813. ExtractTemporaryFile('precomp042.exe');
  814. #endif
  815. #if PrecompVer == "0.43"
  816. ExtractTemporaryFile('precomp043.exe');
  817. #endif
  818. #if PrecompVer == "Inside"
  819. ExtractTemporaryFile('CLS-precomp.dll');
  820. ExtractTemporaryFile('CLS-MSC.dll');
  821. ExtractTemporaryFile('CLS-srep.dll');
  822. ExtractTemporaryFile('precomp.exe');
  823. #endif
  824. #endif
  825. ExtractTemporaryFile('arc.ini');
  826. ExtractTemporaryFile('facompress.dll');
  827. ExtractTemporaryFile('facompress_mt.dll');
  828. ExtractTemporaryFile('XDelta3.dll');
  829. ExtractTemporaryFile('7z.dll');
  830. ExtractTemporaryFile('PackZIP.exe');
  831. ExtractTemporaryFile('english.ini');
  832. ExtractTemporaryFile('FreeArc-LZMA-x64.exe');
  833. ExtractTemporaryFile('srep.exe');
  834. ExtractTemporaryFile('srep64.exe');
  835. ExtractTemporaryFile('unarc.dll');
  836. ExtractTemporaryFile('packjpg_dll.dll');
  837. ExtractTemporaryFile('packjpg_dll1.dll');
  838. ExtractTemporaryFile('zlib1.dll');
  839.  
  840. Comps1:=0; Comps2:=0; Comps3:=0;
  841. #ifdef Components
  842. TmpValue:=1;
  843. if IsComponentSelected('text\rus') then Comps1:=Comps1+TmpValue; //component 1
  844. TmpValue:=TmpValue*2;
  845. if IsComponentSelected('text\eng') then Comps1:=Comps1+TmpValue; //component 2
  846. TmpValue:=TmpValue*2;
  847. if IsComponentSelected('voice\rus') then Comps1:=Comps1+TmpValue; //component 3
  848. TmpValue:=TmpValue*2;
  849. if IsComponentSelected('voice\eng') then Comps1:=Comps1+TmpValue; //component 4
  850. #endif
  851.  
  852. #ifdef precomp
  853. PCFVer:={#precomp};
  854. #else
  855. PCFVer:=0;
  856. #endif
  857. ISDoneError:=true;
  858. if ISDoneInit(ExpandConstant('{src}\records.inf'), $F777, Comps1,Comps2,Comps3, MainForm.Handle, 512, @ProgressCallback) then begin
  859. repeat
  860. ChangeLanguage('english');
  861. if not SrepInit('',512,0) then break;
  862. if not PrecompInit('',128,PCFVer) then break;
  863. if not FileSearchInit(true) then break;
  864. #include 'Archives.ini'
  865. ISDoneError:=false;
  866. until true;
  867. ISDoneStop;
  868. end;
  869. HideControls;
  870. WizardForm.CancelButton.Visible:=true;
  871. WizardForm.CancelButton.Enabled:=false;
  872. Status.Show;
  873. end;
  874.  
  875. if CurStep=ssPostInstall then begin
  876.  
  877. if DirectXCB.Checked then begin
  878. Status.Caption:='Installing DirectX...';
  879. Status.Left := 200;
  880. Status.Top := 200;
  881. Status.Width := 223;
  882. Status.Height := 20;
  883. Exec2(ExpandConstant('{src}\_CommonRedist\DirectX\DXSETUP.exe'),'/silent',false);
  884. end;
  885. if VisualCCB.Checked then begin
  886. Status.Caption:='Installing Visual C++...';
  887. Status.Left := 200;
  888. Status.Top := 200;
  889. Status.Width := 227;
  890. Status.Height := 20;
  891. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2005\vcredist_x86.exe'),'/q',false);
  892. if IsWin64() then begin
  893. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2005\vcredist_x64.exe'),'/q',false);
  894. end;
  895. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2008\vcredist_x86.exe'),'/q',false);
  896. if IsWin64() then begin
  897. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2008\vcredist_x64.exe'),'/q',false);
  898. end;
  899. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2010\vcredist_x86.exe'),'/q',false);
  900. if IsWin64() then begin
  901. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2010\vcredist_x64.exe'),'/q',false);
  902. end;
  903. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2012\vcredist_x86.exe'),'/q',false);
  904. if IsWin64() then begin
  905. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2012\vcredist_x64.exe'),'/q',false);
  906. end;
  907. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2013\vcredist_x86.exe'),'/q',false);
  908. if IsWin64() then begin
  909. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2013\vcredist_x64.exe'),'/q',false);
  910. end;
  911. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2015\vcredist_x86.exe'),'/q',false);
  912. if IsWin64() then begin
  913. Exec2(ExpandConstant('{src}\_CommonRedist\vc\2015\vcredist_x64.exe'),'/q',false);
  914. end;
  915.  
  916. end;
  917. if Framework.Checked then begin
  918. Status.Caption:='Installing Framework...';
  919. Status.Left := 200;
  920. Status.Top := 200;
  921. Status.Width := 227;
  922. Status.Height := 20;
  923. Exec2(ExpandConstant('{src}\_CommonRedist\dotNetFx45_Full_setup.exe'),'/q',false);
  924. end;
  925. if winupdate.Checked then begin
  926. Status.Caption:='Installing Windows Updates...';
  927. Status.Left := 200;
  928. Status.Top := 200;
  929. Status.Width := 227;
  930. Status.Height := 20;
  931. Exec2(ExpandConstant('{src}\_CommonRedist\Windows6.1-KB2670838-x86.msu'),'/quiet /promptrestart',false);
  932. if IsWin64() then begin
  933. Exec2(ExpandConstant('{src}\_CommonRedist\Windows6.1-KB2670838-x64.msu'),'/quiet /promptrestart',false);
  934. end;
  935. end;
  936. end;
  937. if (CurStep=ssInstall) and ISDoneError then begin
  938. Exec2(ExpandConstant('{uninstallexe}'), '/VERYSILENT', false);
  939. end;
  940. end;
  941. //-------- First Page --------\\
  942. procedure CurPageChanged1(CurPageID: integer);
  943. begin
  944. if CurPageID=wpWelcome then begin
  945. HideComponents;
  946. WizardForm.Position:=poScreenCenter;
  947. Bevel3.Hide;
  948. Bevel4.Hide;
  949. Bevel5.Hide;
  950. Bevel6.Hide;
  951. WizardForm.WizardBitmapImage.Show;
  952. WelcomeLbl.Show;
  953. WizardForm.CancelButton.show;
  954. end;
  955. //-------- Second Page --------\\
  956. if CurPageID=wpSelectDir then begin
  957. HideComponents;
  958. WizardForm.Position:=poScreenCenter;
  959. WizardForm.WizardSmallBitmapImage.Show;
  960. WizardForm.Bevel1.Show;
  961. DirBevel.Show;
  962. Bevel3.Show;
  963. Bevel4.Show;
  964. Bevel5.Show;
  965. Bevel6.Show;
  966. Bevel7.Show;
  967. Bevel8.Hide;
  968. Bevel9.Show;
  969. Bevel11.Show;
  970. WizardForm.Caption:= 'Select Dir «{#AppName}»';
  971. WizardForm.SelectDirBitmapImage.Show;
  972. WizardForm.SelectGroupBitmapImage.Show;
  973. WizardForm.DirEdit.Show;
  974. WizardForm.GroupEdit.Show;
  975. WizardForm.DirBrowseButton.Show;
  976. WizardForm.GroupBrowseButton.Show;
  977. WizardForm.NoIconsCheck.Show;
  978. DirLbl.Show;
  979. GroupLbl.Show;
  980. PartitionSpaceLabel.Show;
  981. FreeSpaceLabel.Show;
  982. GameSpaceLabel.Show;
  983. NeedSpaceLabel.Show;
  984. GetFreeSpaceCaption(nil);
  985. end;
  986. //--------Installation Page--------\\
  987. if CurPageID=wpInstalling then begin
  988. TasksSeparateBevel.Hide;
  989. HideComponents;
  990. WizardForm.Position:=poScreenCenter;
  991. WizardForm.WizardSmallBitmapImage.Show;
  992. WizardForm.Caption:= 'Installing «{#AppName}»';
  993. WizardForm.Bevel1.Show;
  994. WizardForm.TasksList.CheckItem(0,IconCB.Checked);
  995. end;
  996. //--------Game was successfully installed PAGE--------\\
  997. if CurPageID=wpFinished then begin
  998. HideComponents;
  999. WizardForm.Position:=poScreenCenter;
  1000. WizardForm.WizardBitmapImage.Show;
  1001. WelcomeLbl.Show;
  1002. WelcomeLbl.Left:=145;
  1003. WizardForm.Caption:= 'Finish «{#AppName}» Setup Wizard';
  1004. 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.';
  1005. end;
  1006. //--------Game Fail To Install PAGE--------\\
  1007. if (CurPageID = wpFinished) and ISDoneError then
  1008. begin
  1009. //LabelTime3.Hide;
  1010. WizardForm.Caption:= 'Error! «{#AppName}»';
  1011. WelcomeLbl.Font.Color:= clRed;
  1012. WelcomeLbl.Caption:= 'Setup encountered an error while installing «{#AppName}»' + #13#10#13#10 + 'Changes were not saved , please re-run the setup again.';
  1013. WelcomeLbl.Left:=163;
  1014. end;
  1015. end;
  1016.  
  1017. function ShouldSkipPage1(PageID: Integer): Boolean;
  1018. begin
  1019. if (PageID=wpSelectProgramGroup) or (PageID=wpReady) or (PageID=wpSelectComponents) then Result:=true;
  1020. end;
  1021.  
  1022. procedure DeinitializeSetup1();
  1023. begin
  1024.  
  1025. Exec2(ExpandConstant('{sys}\cmd.exe'),' /c timeout /T 3 /NOBREAK & taskkill /f /im precomp*',false);
  1026.  
  1027. FileCopy(ExpandConstant('{tmp}\Fallout4_Default.ini'), ExpandConstant('{app}\Fallout4_Default.ini'), False);
  1028. FileCopy(ExpandConstant('{tmp}\steam_api.ini'), ExpandConstant('{app}\steam_api.ini'), False);
  1029. DeleteFile(ExpandConstant('{app}\Data\Strings\Fallout4_ru.DLSTRINGS'));
  1030. DeleteFile(ExpandConstant('{app}\Data\Strings\Fallout4_ru.ILSTRINGS'));
  1031. DeleteFile(ExpandConstant('{app}\Data\Strings\Fallout4_ru.STRINGS'));
  1032. CreateDir(ExpandConstant('{app}\Data\Interface'));
  1033. FileCopy(ExpandConstant('{tmp}\Translate_en.txt'), ExpandConstant('{app}\Data\Interface\Translate_en.txt'), False);
  1034. FileCopy(ExpandConstant('{tmp}\Fallout4_en.DLSTRINGS'), ExpandConstant('{app}\Data\Strings\Fallout4_en.DLSTRINGS'), False);
  1035. FileCopy(ExpandConstant('{tmp}\Fallout4_en.ILSTRINGS'), ExpandConstant('{app}\Data\Strings\Fallout4_en.ILSTRINGS'), False);
  1036. FileCopy(ExpandConstant('{tmp}\Fallout4_en.STRINGS'), ExpandConstant('{app}\Data\Strings\Fallout4_en.STRINGS'), False);
  1037.  
  1038. RenameFile(ExpandConstant('{app}\Data\Video\Intro_ru.bk2'), ExpandConstant('{app}\Data\Video\Intro_en.bk2'));
  1039. RenameFile(ExpandConstant('{app}\Data\Video\Endgame_FEMALE_A_RU.bk2'), ExpandConstant('{app}\Data\Video\Endgame_FEMALE_A_EN.bk2'));
  1040. RenameFile(ExpandConstant('{app}\Data\Video\Endgame_FEMALE_B_RU.bk2'), ExpandConstant('{app}\Data\Video\Endgame_FEMALE_B_EN.bk2'));
  1041. RenameFile(ExpandConstant('{app}\Data\Video\Endgame_MALE_A_RU.bk2'), ExpandConstant('{app}\Data\Video\Endgame_MALE_A_EN.bk2'));
  1042. RenameFile(ExpandConstant('{app}\Data\Video\Endgame_MALE_B_RU.bk2'), ExpandConstant('{app}\Data\Video\Endgame_MALE_B_EN.bk2'));
  1043.  
  1044. FileCopy(ExpandConstant('{app}\Data\Video\Intro_en.bk2'), ExpandConstant('{app}\Data\Video\Intro.bk2'), False);
  1045. FileCopy(ExpandConstant('{app}\Data\Video\Endgame_FEMALE_A_EN.bk2'), ExpandConstant('{app}\Data\Video\Endgame_FEMALE_A.bk2'), False);
  1046. FileCopy(ExpandConstant('{app}\Data\Video\Endgame_FEMALE_B_EN.bk2'), ExpandConstant('{app}\Data\Video\Endgame_FEMALE_B.bk2'), False);
  1047. FileCopy(ExpandConstant('{app}\Data\Video\Endgame_MALE_A_EN.bk2'), ExpandConstant('{app}\Data\Video\Endgame_MALE_A.bk2'), False);
  1048. FileCopy(ExpandConstant('{app}\Data\Video\Endgame_MALE_B_EN.bk2'), ExpandConstant('{app}\Data\Video\Endgame_MALE_B.bk2'), False);
  1049.  
  1050.  
  1051. ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
  1052. UnloadSkin();
  1053. end;
  1054.  
  1055. 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';
  1056. procedure InitializeWizard2();
  1057. begin
  1058. ExtractTemporaryFile('Splash.png');
  1059. ShowSplashScreen(WizardForm.Handle,ExpandConstant('{tmp}\Splash.png'),1000,3000,1000,0,255,True,$FFFFFF,10);
  1060. end;
  1061.  
  1062. function InitializeSetup(): Boolean;
  1063. begin
  1064. Result := InitializeSetup1(); if not Result then exit;
  1065. end;
  1066.  
  1067. procedure InitializeWizard();
  1068. begin
  1069. ExtractTemporaryFile('music.mp3');
  1070. if BASS_Init(-1, 44100, 0, 0, 0) then
  1071. begin
  1072. SoundStream := BASS_StreamCreateFile(False,
  1073. ExpandConstant('{tmp}\music.mp3'), 0, 0, 0, 0,
  1074. EncodingFlag or BASS_SAMPLE_LOOP);
  1075. BASS_SetConfig(BASS_CONFIG_GVOL_STREAM, 2500);
  1076. BASS_ChannelPlay(SoundStream, False);
  1077.  
  1078. SoundCtrlButton := TNewButton.Create(WizardForm);
  1079. SoundCtrlButton.Parent := WizardForm;
  1080. SoundCtrlButton.SetBounds(210,347,100,30);
  1081. SoundCtrlButton.Caption :=
  1082. ExpandConstant('{cm:SoundCtrlButtonCaptionSoundOff}');
  1083. SoundCtrlButton.OnClick := @SoundCtrlButtonClick;
  1084. RedesignWizardForm;
  1085. InitializeWizard1();
  1086. InitializeWizard2();
  1087. end;
  1088. end;
  1089.  
  1090. procedure CurStepChanged(CurStep: TSetupStep);
  1091. begin
  1092. CurStepChanged1(CurStep);
  1093. end;
  1094.  
  1095. procedure CurPageChanged(CurPageID: Integer);
  1096. begin
  1097. CurPageChanged1(CurPageID);
  1098. end;
  1099.  
  1100. function ShouldSkipPage(PageID: Integer): Boolean;
  1101. begin
  1102. Result := ShouldSkipPage1(PageID); if not Result then exit;
  1103. end;
  1104.  
  1105. procedure DeinitializeSetup();
  1106. begin
  1107.  
  1108. BASS_Free();
  1109. DeinitializeSetup1();
  1110. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement