Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //===== [название игры] =====\\:
- #define GameName "GRID Autosport"
- //===== [название компании] =====\\:
- #define CompanyName "Codemasters"
- //===== [версия игры] =====\\:
- #define GameVersion "1.0.103.1840"
- ; Папка установки для Steam версии
- #define DirSteam "GRID Autosport"
- //===== [название группы / имя репаккера] =====\\:
- #define Company "formatCeft"
- //===== [Если нужен скин, если нет - закомментировать ";"] =====\\
- #define skin
- ; Url адрес для Steam игры
- #define UrlSteam "steam://rungameid/255220"
- #define IconFile "ba09a138c4f334c1d256524562df35bb60e456ba.ico"
- [Setup]
- AppName={#GameName}
- DefaultDirName={code:RightDirName}
- DefaultGroupName={code:RightGroupName}
- AppVerName={#GameName} v{#GameVersion}
- VersionInfoDescription={#GameName}
- VersionInfoCompany={#Company}
- VersionInfoVersion=6.6.6.6
- AppCopyright=© {#Company}
- AppVersion={#GameVersion}
- AppPublisher={#CompanyName}
- OutputDir=Output
- OutputBaseFilename=setup
- RestartIfNeededByRun=no
- ShowComponentSizes=no
- PrivilegesRequired=none
- Compression=none
- ChangesEnvironment=true
- DirExistsWarning=no
- ChangesAssociations=true
- WizardImageFile=Files\WizardImage.bmp
- WizardSmallImageFile=Files\WizardSmallImage.bmp
- SetupIconFile=Files\Icon.ico
- InternalCompressLevel=none
- DiskSpanning=true
- SlicesPerDisk=4
- DiskSliceSize=1073741824
- [Languages]
- Name: BrazilianPortuguese; MessagesFile: compiler:Languages\BrazilianPortuguese.isl
- Name: English; MessagesFile: compiler:Languages\English.isl
- Name: French; MessagesFile: compiler:Languages\French.isl
- Name: German; MessagesFile: compiler:Languages\German.isl
- Name: Italian; MessagesFile: compiler:Languages\Italian.isl
- Name: Japanese; MessagesFile: compiler:Languages\Japanese.isl
- Name: Polish; MessagesFile: compiler:Languages\Polish.isl
- Name: Russian; MessagesFile: compiler:Languages\Russian.isl
- Name: Spanish; MessagesFile: compiler:Languages\Spanish.isl
- [Tasks]
- Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons};
- [Files]
- // Steam
- Source: Steam\games\{#IconFile}; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\steam\games\; Check: Steam; Flags: ignoreversion
- Source: Steam\SteamApps\appmanifest_255220.acf; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\SteamApps\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\228983_8124929965194586177.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\228990_1829726630299308803.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\255221_5177371478748266110.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\255222_2041972190344702092.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\282090_7840909317643248662.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\282091_1603432670393381554.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\282092_2655086809045768959.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\289020_4820209721630431123.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\289021_123269673088706407.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\289022_807762041476896465.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\289023_3517044908277566029.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\289024_3774472518664351455.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\289025_7872787737617852106.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\295100_6777079304490454537.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- Source: Steam\depotcache\324130_3436002864892354670.manifest; DestDir: {reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\depotcache\; Check: Steam; Flags: ignoreversion
- #ifdef skin
- #ifdef UNICODE
- Source: Skin\ISSkinU.dll; DestDir: {app}\Uninstall; Attribs: hidden system
- #else
- Source: Skin\ISSkin.dll; DestDir: {app}\Uninstall; Attribs: hidden system
- #endif
- Source: Skin\Skin.cjstyles; DestDir: {app}\Uninstall; Attribs: hidden system
- #endif
- Source: Files\WizardSmallImage.bmp; Flags: dontcopy
- Source: "GRID Autosport\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
- [Icons]
- Name: {group}\{#GameName}; Filename: {app}\GRIDAutosport.exe; WorkingDir: "{app}\"
- Name: {group}\{cm:UninstallProgram,{#GameName}}; Filename: {uninstallexe}; WorkingDir: "{app}"
- Name: {commondesktop}\{#GameName}; Filename: {app}\GRIDAutosport.exe; Tasks: desktopicon; WorkingDir: "{app}\"
- [Run]
- Filename: {app}\GRIDAutosport.exe; Description: {cm:LaunchProgram,{#StringChange(GameName, '&', '&&')}}; Flags: nowait postinstall skipifsilent
- ;[Messages]
- ;BeveledLabel=formatCeft
- [UninstallDelete]
- // Удалять папку с файлами
- Type: FilesAndOrDirs; Name: {app};
- [Code]
- var
- MyExit: TSetupForm;
- function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
- procedure LabelOnMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
- begin
- ReleaseCapture;
- SendMessage(SelectLanguageForm.Handle,$0112,$F012,0)
- end;
- function RightDirName(s: string): string;
- begin
- Result := ExpandConstant('{pf}\Codemasters\{#GameName}');
- end;
- function RightGroupName(s: string): string;
- begin
- Result := ExpandConstant('{#CompanyName}\{#GameName}');
- end;
- #ifdef skin
- #ifdef UNICODE
- procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskinu.dll stdcall delayload setuponly';
- procedure UnloadSkin(); external 'UnloadSkin@files:isskinu.dll stdcall delayload setuponly';
- #else
- procedure LoadSkin(lpszPath: String; lpszIniFileName: String); external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
- procedure UnloadSkin(); external 'UnloadSkin@files:isskin.dll stdcall delayload setuponly';
- #endif
- #endif
- //procedure LangChange(Sender : TObject);
- //var
- // i : integer;
- // begin
- // i := SelectLanguageForm.LangCombo.ItemIndex;
- // case TNewComboBox(Sender).ItemIndex of
- // 0: begin
- // with SelectLanguageForm do begin
- // SelectLabel.Caption := 'Select language, which will use at installing process:';
- // CancelButton.Caption := 'Cancel';
- // Caption := 'Select setup language';
- // end;
- // end;
- // 1: begin
- // with SelectLanguageForm do begin
- // SelectLabel.Caption := 'Выберите язык, который будет использован в процессе установки:';
- // CancelButton.Caption := 'Отмена';
- // Caption := 'Выберите язык установки';
- // end;
- // end;
- // end;
- //end;
- //
- //function InitializeLanguageDialog(): Boolean;
- //begin
- // with SelectLanguageForm do begin
- // BorderStyle := bsNone;
- // OnMouseDown:=@LabelOnMouseDown;
- // ClientHeight := ScaleY(100);
- // ClientWidth := SelectLabel.Width + ScaleX(20);
- // SelectLabel.Left := ScaleX(10);
- // SelectLabel.OnMouseDown:=@LabelOnMouseDown;
- // LangCombo.SetBounds(SelectLabel.Left, SelectLabel.Top + SelectLabel.Height, SelectLabel.Width, LangCombo.Height);
- // LangCombo.OnChange := @LangChange;
- // OKButton.SetBounds(SelectLabel.Left, LangCombo.Top + LangCombo.Height + ScaleY(5), ScaleX(100), OKButton.Height);
- // CancelButton.SetBounds(LangCombo.Width - OKButton.Width + ScaleX(10), OKButton.Top, ScaleX(100), CancelButton.Height);
- // IconBitmapImage.Hide;
- // end;
- // #ifdef skin
- // ExtractTemporaryFile('Skin.cjstyles');
- // LoadSkin(ExpandConstant('{tmp}\Skin.cjstyles'), '');
- // #endif
- // Result := True;
- //end;
- procedure MyExitMessage();
- var
- MyIcon: String;
- YesBtn, NoBtn: TButton;
- begin
- MyExit := CreateCustomForm();
- with MyExit do
- begin
- Position := poScreenCenter;
- ClientWidth := WizardForm.Width-ScaleX(100);
- ClientHeight := WizardForm.Height div 3+ScaleY(45);
- Caption := ExpandConstant(SetupMessage(msgExitSetupTitle));
- MyIcon := ExpandConstant(AddBackSlash('{tmp}') + 'WizardSmallImage.bmp');
- if not FileExists(MyIcon) then
- ExtractTemporaryFile(ExtractFileName(MyIcon));
- with TBitmapImage.Create(MyExit) do
- begin
- Stretch := True;
- Left := ScaleX(25);
- Top := ScaleY(20);
- Width := 55;
- Height := 55;
- Bitmap.LoadFromFile(MyIcon);
- Parent := MyExit;
- end;
- with TNewStaticText.Create(MyExit) do
- begin
- Left := ScaleX(110);
- Top := ScaleY(20);
- Width := MyExit.Width - ScaleX(120);
- Height := MyExit.Height div 2;
- AutoSize := False;
- WordWrap := True;
- Caption := ExpandConstant(SetupMessage(msgExitSetupMessage));
- Parent := MyExit;
- Font.Color := clWhite;
- end;
- end;
- NoBtn:= TButton.Create(MyExit);
- NoBtn.SetBounds(MyExit.Width - 100, MyExit.Height - 35 - ScaleY(25), 80, 23);
- NoBtn.Caption:= SetupMessage(msgButtonCancel);
- NoBtn.ModalResult:= mrNo;
- NoBtn.Parent:= MyExit;
- YesBtn:= TButton.Create(MyExit);
- YesBtn.SetBounds(MyExit.Width - 190, MyExit.Height - 35 - ScaleY(25), 80, 23);
- YesBtn.Caption:= SetupMessage(msgButtonYes);
- YesBtn.ModalResult:= mrYes;
- YesBtn.Parent:= MyExit;
- end;
- procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
- begin
- Confirm := False;
- MyExitMessage();
- Cancel := False;
- if MyExit.ShowModal() = mrYes then
- Cancel := True;
- MyExit.Free;
- end;
- function InitializeSetup: Boolean;
- begin
- #ifdef skin
- ExtractTemporaryFile('Skin.cjstyles');
- LoadSkin(ExpandConstant('{tmp}\Skin.cjstyles'), '');
- #endif
- Result:=True;
- end;
- procedure DeinitializeSetup();
- begin
- #ifdef skin
- UnloadSkin();
- #endif
- end;
- //========================================================\\
- //===== [Steam Module] =====\\
- var
- NewRadioButton1: TNewRadioButton;
- NewRadioButton2: TNewRadioButton;
- DirS: string;
- function Steam: boolean;
- begin
- Result:= NewRadioButton1.Checked;
- end;
- procedure Select1(Sender:TObject);
- begin
- if (DirS<> WizardForm.DirEdit.Text) then
- DirS:= WizardForm.DirEdit.Text;
- WizardForm.DirEdit.Text:= ExpandConstant('{reg:HKLM\SOFTWARE\Valve\Steam,InstallPath|{pf}\Steam}')+ '\steamapps\common\{#DirSteam}';
- WizardForm.DirEdit.Enabled:=False;
- WizardForm.DirBrowseButton.Enabled:= False;
- end;
- procedure Select2(Sender:TObject);
- begin
- if WizardForm.DirEdit.Text<>DirS then
- WizardForm.DirEdit.Text:= DirS;
- WizardForm.DirEdit.Enabled:=True;
- WizardForm.DirBrowseButton.Enabled:= True;
- end;
- procedure RedesignWizardForm;
- begin
- DirS:= WizardForm.DirEdit.Text;
- { NewRadioButton1 }
- NewRadioButton1 := TNewRadioButton.Create(WizardForm);
- with NewRadioButton1 do
- begin
- Parent := WizardForm.SelectDirPage;
- Left := ScaleX(9);
- Top := ScaleY(141);
- Width := ScaleX(173);
- Height := ScaleY(17);
- if ActiveLanguage='Russian' then
- Caption := 'Установка в Steam клиент';
- if ActiveLanguage='German' then
- Caption := 'Installieren Sie den Steam-Client';
- if ActiveLanguage='French' then
- Caption := 'Installez le client Steam';
- if ActiveLanguage='Japanese' then
- Caption := #$0053#$0074#$0065#$0061#$006D#$30AF#$30E9#$30A4#$30A2#$30F3#$30C8#$3092#$30A4#$30F3#$30B9#$30C8#$30FC#$30EB#$3057#$307E#$3059#$3002;
- if ActiveLanguage='BrazilianPortuguese' then
- Caption := 'Instale o cliente do Steam';
- if ActiveLanguage='English' then
- Caption := 'Install the Steam client';
- if ActiveLanguage='Italian' then
- Caption := 'Installare il client Steam';
- if ActiveLanguage='Polish' then
- Caption := 'Położony w samym klient Steam';
- if ActiveLanguage='Spanish' then
- Caption := 'Instale el cliente de Steam';
- OnClick:= @Select1;
- end;
- { NewRadioButton2 }
- NewRadioButton2 := TNewRadioButton.Create(WizardForm);
- with NewRadioButton2 do
- begin
- Parent := WizardForm.SelectDirPage;
- Left := ScaleX(9);
- Top := ScaleY(165);
- Width := ScaleX(145);
- Height := ScaleY(17);
- if ActiveLanguage='Russian' then
- Caption := 'Обычная установка';
- if ActiveLanguage='German' then
- Caption := 'Standardinstallation';
- if ActiveLanguage='French' then
- Caption := 'Installation typique';
- if ActiveLanguage='Japanese' then
- Caption := #$6A19#$6E96#$30A4#$30F3#$30B9#$30C8#$30FC#$30EB;
- if ActiveLanguage='BrazilianPortuguese' then
- Caption := 'instalação típica';
- if ActiveLanguage='English' then
- Caption := 'Typical installation';
- if ActiveLanguage='Italian' then
- Caption := 'Installazione tipica';
- if ActiveLanguage='Polish' then
- Caption := 'Typowa instalacja';
- if ActiveLanguage='Spanish' then
- Caption := 'Instalación típica';
- OnClick:= @Select2;
- Checked:= True;
- end;
- NewRadioButton1.TabOrder := 5;
- NewRadioButton2.TabOrder := 6;
- end;
- procedure InitializeWizard();
- begin
- RedesignWizardForm;
- end;
- procedure Checked(CurStep: TSetupStep);
- begin
- if CurStep = ssPostInstall then
- begin
- if NewRadioButton1.Checked then
- begin
- SaveStringToFile(ExpandConstant('{userdesktop}\{#GameName}.url'), '', True);
- SetIniString('InternetShortcut','URL','{#UrlSteam}',ExpandConstant('{userdesktop}\{#GameName}.url'));
- SetIniString('InternetShortcut','IconFile',ExpandConstant('{reg:HKLM\SOFTWARE\Valve\Steam,InstallPath}\steam\games\{#IconFile}'),ExpandConstant('{userdesktop}\{#GameName}.url'));
- SetIniString('InternetShortcut','IconIndex','0',ExpandConstant('{userdesktop}\{#GameName}.url'));
- end else begin
- //
- //
- end;
- end;
- end;
- procedure CurStepChanged(CurStep: TSetupStep);
- begin
- // IsDoneUnpack(CurStep);
- //if not ISDoneError then
- Checked(CurStep);
- end;
- procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
- begin
- if CurUninstallStep=usUninstall then
- begin
- DeleteFile(ExpandConstant('{userdesktop}\{#GameName}.url'));
- DeleteFile(ExpandConstant('{userdesktop}\{#GameName}.lnk'));
- DelTree(ExpandConstant('{commonprograms}\{#GameName}'), True, True, True);
- end;
- end;
- //===== [Steam Module] =====\\
- //========================================================\\
- Var
- Text: TNewStaticText;
- Procedure InitializeWizard();
- begin
- Text:=TNewStaticText.Create(WizardForm)
- Text.Left:=10
- Text.Top:=468
- Text.Color:=$dbcdcc
- Text.Font.Color:=$ab663d
- Text.Caption:='formatCeft'
- Text.Parent:=WizardForm
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement