Advertisement
Guest User

Untitled

a guest
Jun 28th, 2015
268
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.41 KB | None | 0 0
  1. //===== [название игры] =====\\:
  2. #define GameName "GRID Autosport"
  3. //===== [название компании] =====\\:
  4. #define CompanyName "Codemasters"
  5. //===== [версия игры] =====\\:
  6. #define GameVersion "1.0.103.1840"
  7. ; Папка установки для Steam версии
  8. #define DirSteam "GRID Autosport"
  9. //===== [название группы / имя репаккера] =====\\:
  10. #define Company "formatCeft"
  11.  
  12. //===== [Если нужен скин, если нет - закомментировать ";"] =====\\
  13. #define skin
  14. ; Url адрес для Steam игры
  15. #define UrlSteam "steam://rungameid/255220"
  16. #define IconFile "ba09a138c4f334c1d256524562df35bb60e456ba.ico"
  17.  
  18. [Setup]
  19. AppName={#GameName}
  20. DefaultDirName={code:RightDirName}
  21. DefaultGroupName={code:RightGroupName}
  22. AppVerName={#GameName} v{#GameVersion}
  23. VersionInfoDescription={#GameName}
  24. VersionInfoCompany={#Company}
  25. VersionInfoVersion=6.6.6.6
  26. AppCopyright=© {#Company}
  27. AppVersion={#GameVersion}
  28. AppPublisher={#CompanyName}
  29. OutputDir=Output
  30. OutputBaseFilename=setup
  31. RestartIfNeededByRun=no
  32. ShowComponentSizes=no
  33. PrivilegesRequired=none
  34. Compression=none
  35. ChangesEnvironment=true
  36. DirExistsWarning=no
  37. ChangesAssociations=true
  38. WizardImageFile=Files\WizardImage.bmp
  39. WizardSmallImageFile=Files\WizardSmallImage.bmp
  40. SetupIconFile=Files\Icon.ico
  41. InternalCompressLevel=none
  42. DiskSpanning=true
  43. SlicesPerDisk=4
  44. DiskSliceSize=1073741824
  45.  
  46. [Languages]
  47. Name: BrazilianPortuguese; MessagesFile: compiler:Languages\BrazilianPortuguese.isl
  48. Name: English; MessagesFile: compiler:Languages\English.isl
  49. Name: French; MessagesFile: compiler:Languages\French.isl
  50. Name: German; MessagesFile: compiler:Languages\German.isl
  51. Name: Italian; MessagesFile: compiler:Languages\Italian.isl
  52. Name: Japanese; MessagesFile: compiler:Languages\Japanese.isl
  53. Name: Polish; MessagesFile: compiler:Languages\Polish.isl
  54. Name: Russian; MessagesFile: compiler:Languages\Russian.isl
  55. Name: Spanish; MessagesFile: compiler:Languages\Spanish.isl
  56.  
  57. [Tasks]
  58. Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons};
  59.  
  60. [Files]
  61. // Steam
  62. Source: Steam\games\{#IconFile}; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\steam\games\; Check: Steam; Flags: ignoreversion
  63. Source: Steam\SteamApps\appmanifest_255220.acf; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\SteamApps\; Check: Steam; Flags: ignoreversion
  64. Source: Steam\depotcache\228983_8124929965194586177.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  65. Source: Steam\depotcache\228990_1829726630299308803.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  66. Source: Steam\depotcache\255221_5177371478748266110.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  67. Source: Steam\depotcache\255222_2041972190344702092.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  68. Source: Steam\depotcache\282090_7840909317643248662.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  69. Source: Steam\depotcache\282091_1603432670393381554.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  70. Source: Steam\depotcache\282092_2655086809045768959.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  71. Source: Steam\depotcache\289020_4820209721630431123.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  72. Source: Steam\depotcache\289021_123269673088706407.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  73. Source: Steam\depotcache\289022_807762041476896465.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  74. Source: Steam\depotcache\289023_3517044908277566029.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  75. Source: Steam\depotcache\289024_3774472518664351455.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  76. Source: Steam\depotcache\289025_7872787737617852106.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  77. Source: Steam\depotcache\295100_6777079304490454537.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  78. Source: Steam\depotcache\324130_3436002864892354670.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
  79. #ifdef skin
  80. #ifdef UNICODE
  81. Source: Skin\ISSkinU.dll; DestDir: {app}\Uninstall; Attribs: hidden system
  82. #else
  83. Source: Skin\ISSkin.dll; DestDir: {app}\Uninstall; Attribs: hidden system
  84. #endif
  85. Source: Skin\Skin.cjstyles; DestDir: {app}\Uninstall; Attribs: hidden system
  86. #endif
  87. Source: Files\WizardSmallImage.bmp; Flags: dontcopy
  88. Source: "GRID Autosport\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
  89.  
  90. [Icons]
  91. Name: {group}\{#GameName}; Filename: {app}\GRIDAutosport.exe; WorkingDir: "{app}\"
  92. Name: {group}\{cm:UninstallProgram,{#GameName}}; Filename: {uninstallexe}; WorkingDir: "{app}"
  93. Name: {commondesktop}\{#GameName}; Filename: {app}\GRIDAutosport.exe; Tasks: desktopicon; WorkingDir: "{app}\"
  94.  
  95. [Run]
  96. Filename: {app}\GRIDAutosport.exe; Description: {cm:LaunchProgram,{#StringChange(GameName, '&', '&&')}}; Flags: nowait postinstall skipifsilent
  97.  
  98. ;[Messages]
  99. ;BeveledLabel=formatCeft
  100.  
  101. [UninstallDelete]
  102. // Удалять папку с файлами
  103. Type: FilesAndOrDirs; Name: {app};
  104.  
  105. [Code]
  106. var
  107. MyExit: TSetupForm;
  108.  
  109. function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
  110.  
  111. procedure LabelOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
  112. begin
  113. ReleaseCapture;
  114. SendMessage(SelectLanguageForm.Handle,$0112,$F012,0)
  115. end;
  116.  
  117. function RightDirName(s: string): string;
  118. begin
  119. Result := ExpandConstant('{pf}\Codemasters\{#GameName}');
  120. end;
  121.  
  122. function RightGroupName(s: string): string;
  123. begin
  124. Result := ExpandConstant('{#CompanyName}\{#GameName}');
  125. end;
  126.  
  127. #ifdef skin
  128. #ifdef UNICODE
  129. procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskinu.dll stdcall delayload setuponly';
  130. procedure UnloadSkin(); external 'UnloadSkin@files:isskinu.dll stdcall delayload setuponly';
  131. #else
  132. procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
  133. procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall delayload setuponly';
  134. #endif
  135. #endif
  136.  
  137. //procedure LangChange(Sender : TObject);
  138. //var
  139. // i : integer;
  140. // begin
  141. // i := SelectLanguageForm.LangCombo.ItemIndex;
  142. // case TNewComboBox(Sender).ItemIndex of
  143. // 0: begin
  144. // with SelectLanguageForm do begin
  145. // SelectLabel.Caption := 'Select language, which will use at installing process:';
  146. // CancelButton.Caption := 'Cancel';
  147. // Caption := 'Select setup language';
  148. // end;
  149. // end;
  150. // 1: begin
  151. // with SelectLanguageForm do begin
  152. // SelectLabel.Caption := 'Выберите язык, который будет использован в процессе установки:';
  153. // CancelButton.Caption := 'Отмена';
  154. // Caption := 'Выберите язык установки';
  155. // end;
  156. // end;
  157. // end;
  158. //end;
  159. //
  160. //function InitializeLanguageDialog(): Boolean;
  161. //begin
  162. // with SelectLanguageForm do begin
  163. // BorderStyle := bsNone;
  164. // OnMouseDown:=@LabelOnMouseDown;
  165. // ClientHeight := ScaleY(100);
  166. // ClientWidth := SelectLabel.Width + ScaleX(20);
  167. // SelectLabel.Left := ScaleX(10);
  168. // SelectLabel.OnMouseDown:=@LabelOnMouseDown;
  169. // LangCombo.SetBounds(SelectLabel.Left, SelectLabel.Top + SelectLabel.Height, SelectLabel.Width, LangCombo.Height);
  170. // LangCombo.OnChange := @LangChange;
  171. // OKButton.SetBounds(SelectLabel.Left, LangCombo.Top + LangCombo.Height + ScaleY(5), ScaleX(100), OKButton.Height);
  172. // CancelButton.SetBounds(LangCombo.Width - OKButton.Width + ScaleX(10), OKButton.Top, ScaleX(100), CancelButton.Height);
  173. // IconBitmapImage.Hide;
  174. // end;
  175. // #ifdef skin
  176. // ExtractTemporaryFile('Skin.cjstyles');
  177. // LoadSkin(ExpandConstant('{tmp}\Skin.cjstyles'), '');
  178. // #endif
  179. // Result := True;
  180. //end;
  181.  
  182. procedure MyExitMessage();
  183. var
  184. MyIcon: String;
  185. YesBtn, NoBtn: TButton;
  186. begin
  187. MyExit := CreateCustomForm();
  188. with MyExit do
  189. begin
  190. Position := poScreenCenter;
  191. ClientWidth := WizardForm.Width-ScaleX(100);
  192. ClientHeight := WizardForm.Height div 3+ScaleY(45);
  193. Caption := ExpandConstant(SetupMessage(msgExitSetupTitle));
  194.  
  195. MyIcon := ExpandConstant(AddBackSlash('{tmp}') + 'WizardSmallImage.bmp');
  196. if not FileExists(MyIcon) then
  197. ExtractTemporaryFile(ExtractFileName(MyIcon));
  198.  
  199. with TBitmapImage.Create(MyExit) do
  200. begin
  201. Stretch := True;
  202. Left := ScaleX(25);
  203. Top := ScaleY(20);
  204. Width := 55;
  205. Height := 55;
  206. Bitmap.LoadFromFile(MyIcon);
  207. Parent := MyExit;
  208. end;
  209.  
  210. with TNewStaticText.Create(MyExit) do
  211. begin
  212. Left := ScaleX(110);
  213. Top := ScaleY(20);
  214. Width := MyExit.Width - ScaleX(120);
  215. Height := MyExit.Height div 2;
  216. AutoSize := False;
  217. WordWrap := True;
  218. Caption := ExpandConstant(SetupMessage(msgExitSetupMessage));
  219. Parent := MyExit;
  220. Font.Color := clWhite;
  221. end;
  222. end;
  223.  
  224. NoBtn:= TButton.Create(MyExit);
  225. NoBtn.SetBounds(MyExit.Width - 100, MyExit.Height - 35 - ScaleY(25), 80, 23);
  226. NoBtn.Caption:= SetupMessage(msgButtonCancel);
  227. NoBtn.ModalResult:= mrNo;
  228. NoBtn.Parent:= MyExit;
  229.  
  230. YesBtn:= TButton.Create(MyExit);
  231. YesBtn.SetBounds(MyExit.Width - 190, MyExit.Height - 35 - ScaleY(25), 80, 23);
  232. YesBtn.Caption:= SetupMessage(msgButtonYes);
  233. YesBtn.ModalResult:= mrYes;
  234. YesBtn.Parent:= MyExit;
  235. end;
  236.  
  237. procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
  238. begin
  239. Confirm := False;
  240. MyExitMessage();
  241. Cancel := False;
  242. if MyExit.ShowModal() = mrYes then
  243. Cancel := True;
  244. MyExit.Free;
  245. end;
  246.  
  247. function InitializeSetup: Boolean;
  248. begin
  249. #ifdef skin
  250. ExtractTemporaryFile('Skin.cjstyles');
  251. LoadSkin(ExpandConstant('{tmp}\Skin.cjstyles'), '');
  252. #endif
  253. Result:=True;
  254. end;
  255.  
  256. procedure DeinitializeSetup();
  257. begin
  258. #ifdef skin
  259. UnloadSkin();
  260. #endif
  261. end;
  262.  
  263. //========================================================\\
  264. //===== [Steam Module] =====\\
  265. var
  266. NewRadioButton1: TNewRadioButton;
  267. NewRadioButton2: TNewRadioButton;
  268. DirS: string;
  269.  
  270. function Steam: boolean;
  271. begin
  272. Result:= NewRadioButton1.Checked;
  273. end;
  274.  
  275. procedure Select1(Sender:TObject);
  276. begin
  277. if (DirS<> WizardForm.DirEdit.Text) then
  278. DirS:= WizardForm.DirEdit.Text;
  279. WizardForm.DirEdit.Text:= ExpandConstant('{reg:HKLM\SOFTWARE\Valve\Steam,InstallPath|{pf}\Steam}')+ '\steamapps\common\{#DirSteam}';
  280. WizardForm.DirEdit.Enabled:=False;
  281. WizardForm.DirBrowseButton.Enabled:= False;
  282. end;
  283.  
  284. procedure Select2(Sender:TObject);
  285. begin
  286. if WizardForm.DirEdit.Text<>DirS then
  287. WizardForm.DirEdit.Text:= DirS;
  288. WizardForm.DirEdit.Enabled:=True;
  289. WizardForm.DirBrowseButton.Enabled:= True;
  290. end;
  291.  
  292. procedure RedesignWizardForm;
  293. begin
  294. DirS:= WizardForm.DirEdit.Text;
  295. { NewRadioButton1 }
  296. NewRadioButton1 := TNewRadioButton.Create(WizardForm);
  297. with NewRadioButton1 do
  298. begin
  299. Parent := WizardForm.SelectDirPage;
  300. Left := ScaleX(9);
  301. Top := ScaleY(141);
  302. Width := ScaleX(173);
  303. Height := ScaleY(17);
  304. if ActiveLanguage='Russian' then
  305. Caption := 'Установка в Steam клиент';
  306. if ActiveLanguage='German' then
  307. Caption := 'Installieren Sie den Steam-Client';
  308. if ActiveLanguage='French' then
  309. Caption := 'Installez le client Steam';
  310. if ActiveLanguage='Japanese' then
  311. Caption := #$0053#$0074#$0065#$0061#$006D#$30AF#$30E9#$30A4#$30A2#$30F3#$30C8#$3092#$30A4#$30F3#$30B9#$30C8#$30FC#$30EB#$3057#$307E#$3059#$3002;
  312. if ActiveLanguage='BrazilianPortuguese' then
  313. Caption := 'Instale o cliente do Steam';
  314. if ActiveLanguage='English' then
  315. Caption := 'Install the Steam client';
  316. if ActiveLanguage='Italian' then
  317. Caption := 'Installare il client Steam';
  318. if ActiveLanguage='Polish' then
  319. Caption := 'Położony w samym klient Steam';
  320. if ActiveLanguage='Spanish' then
  321. Caption := 'Instale el cliente de Steam';
  322. OnClick:= @Select1;
  323. end;
  324.  
  325. { NewRadioButton2 }
  326. NewRadioButton2 := TNewRadioButton.Create(WizardForm);
  327. with NewRadioButton2 do
  328. begin
  329. Parent := WizardForm.SelectDirPage;
  330. Left := ScaleX(9);
  331. Top := ScaleY(165);
  332. Width := ScaleX(145);
  333. Height := ScaleY(17);
  334. if ActiveLanguage='Russian' then
  335. Caption := 'Обычная установка';
  336. if ActiveLanguage='German' then
  337. Caption := 'Standardinstallation';
  338. if ActiveLanguage='French' then
  339. Caption := 'Installation typique';
  340. if ActiveLanguage='Japanese' then
  341. Caption := #$6A19#$6E96#$30A4#$30F3#$30B9#$30C8#$30FC#$30EB;
  342. if ActiveLanguage='BrazilianPortuguese' then
  343. Caption := 'instalação típica';
  344. if ActiveLanguage='English' then
  345. Caption := 'Typical installation';
  346. if ActiveLanguage='Italian' then
  347. Caption := 'Installazione tipica';
  348. if ActiveLanguage='Polish' then
  349. Caption := 'Typowa instalacja';
  350. if ActiveLanguage='Spanish' then
  351. Caption := 'Instalación típica';
  352. OnClick:= @Select2;
  353. Checked:= True;
  354. end;
  355.  
  356. NewRadioButton1.TabOrder := 5;
  357. NewRadioButton2.TabOrder := 6;
  358. end;
  359.  
  360. procedure InitializeWizard();
  361. begin
  362. RedesignWizardForm;
  363. end;
  364.  
  365. procedure Checked(CurStep: TSetupStep);
  366. begin
  367. if CurStep = ssPostInstall then
  368. begin
  369. if NewRadioButton1.Checked then
  370. begin
  371. SaveStringToFile(ExpandConstant('{userdesktop}\{#GameName}.url'), '', True);
  372. SetIniString('InternetShortcut','URL','{#UrlSteam}',ExpandConstant('{userdesktop}\{#GameName}.url'));
  373. SetIniString('InternetShortcut','IconFile',ExpandConstant('{reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\steam\games\{#IconFile}'),ExpandConstant('{userdesktop}\{#GameName}.url'));
  374. SetIniString('InternetShortcut','IconIndex','0',ExpandConstant('{userdesktop}\{#GameName}.url'));
  375. end else begin
  376. //
  377. //
  378. end;
  379. end;
  380. end;
  381.  
  382. procedure CurStepChanged(CurStep: TSetupStep);
  383. begin
  384. // IsDoneUnpack(CurStep);
  385. //if not ISDoneError then
  386. Checked(CurStep);
  387. end;
  388.  
  389. procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
  390. begin
  391. if CurUninstallStep=usUninstall then
  392. begin
  393. DeleteFile(ExpandConstant('{userdesktop}\{#GameName}.url'));
  394. DeleteFile(ExpandConstant('{userdesktop}\{#GameName}.lnk'));
  395. DelTree(ExpandConstant('{commonprograms}\{#GameName}'), True, True, True);
  396. end;
  397. end;
  398. //===== [Steam Module] =====\\
  399. //========================================================\\
  400.  
  401. Var
  402. Text: TNewStaticText;
  403.  
  404. Procedure InitializeWizard();
  405. begin
  406. Text:=TNewStaticText.Create(WizardForm)
  407. Text.Left:=10
  408. Text.Top:=468
  409. Text.Color:=$dbcdcc
  410. Text.Font.Color:=$ab663d
  411. Text.Caption:='formatCeft'
  412. Text.Parent:=WizardForm
  413. end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement