spider91
Advanced Member | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору [Setup] AppName=Call of Duty 4 - Modern Warfare (RePack by spider91) AppVerName=Call of Duty 4 - Modern Warfare DefaultDirName={pf}\Activision\Call of Duty 4 - Modern Warfare DefaultGroupName=Call of Duty 4 - Modern Warfare AllowNoIcons=yes OutputBaseFilename=setup Compression=lzma/ultra64 SolidCompression=yes WizardSmallImageFile=C:\Users\Dmitri\Desktop\small.bmp WizardImageFile=C:\Users\Dmitri\Desktop\big.bmp SetupIconFile=C:\Users\Dmitri\Desktop\icon.ico ExtraDiskSpaceRequired=5628202036 UninstallFilesDir={app}\Uninstall [Languages] Name: "russian"; MessagesFile: "compiler:Languages\Russian.isl" [Tasks] Name: "sp"; Description: "Создать ярлык на рабочем столе для одиночной игры (SP)"; GroupDescription: "{cm:AdditionalIcons}"; Name: "mp"; Description: "Создать ярлык на рабочем столе для игры по интернету (MP)"; GroupDescription: "{cm:AdditionalIcons}"; Name: "dx"; Description: "Обновить DirectX"; GroupDescription: "Дополнительное программное обеспечение:"; Name: "vc"; Description: "Установить Microsoft Visual C++ 2005 SP1 Redist"; GroupDescription: "Дополнительное программное обеспечение:"; [Registry] Root: HKLM; Subkey: "SOFTWARE\Activision"; ValueType: String; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueType: String; Flags: uninsdeletekey Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueName: "InstallPath"; ValueType: String; ValueData: "{app}"; Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueName: "InstallDrive"; ValueType: String; ValueData: "{src}"; Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueName: "Language"; ValueType: String; ValueData: "rus"; Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueName: "Version"; ValueType: String; ValueData: "1.0"; Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueName: "UninstallString"; ValueType: String; ValueData: "{pf}\InstallShield Installation Information\{{E48469CC-635E-4FD5-A122-1497C286D217}\uninstall.exe -runfromtemp -l0x0419"; Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueName: "EXEStringS"; ValueType: String; ValueData: "{app}\iw3sp.exe"; Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueName: "EXEStringM"; ValueType: String; ValueData: "{app}\iw3mp.exe"; Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueName: "QA"; ValueType: String; ValueData: "5.1"; Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueName: "Techhelp"; ValueType: String; ValueData: "{app}\Docs\Help\readme.htm"; Root: HKLM; Subkey: "SOFTWARE\Activision\Call of Duty 4"; ValueName: "codkey"; ValueType: String; ValueData: "4MTMMLLUEWQMMGM485F4"; [LangOptions] WelcomeFontName=Tahoma WelcomeFontSize=11 [UninstallDelete] Type: filesandordirs ; Name: "{app}"; [Files] Source: C:\Users\Dmitri\Desktop\splash.bmp; DestDir: {tmp}; Flags: dontcopy Source: C:\Users\Dmitri\Desktop\w\*; DestDir: "{app}"; Flags: ignoreversion overwritereadonly recursesubdirs createallsubdirs Source: {src}\GameData\*; DestDir: "{app}"; Flags: ignoreversion overwritereadonly recursesubdirs createallsubdirs external Source: C:\Program Files (x86)\Inno Setup Scripting v5.1\Scripts\Buttons\button3.bmp; DestDir: {tmp}; Flags: dontcopy [Code] const ButtonWidth = 80; //Указываем размер кнопок ButtonHeight = 23; bidBack = 0; bidNext = 1; bidCancel = 2; bidDirBrowse = 3; bidGroupBrowse = 4; var ProgressBar1: TNewProgressBar; PageNameLabel, PageDescriptionLabel: TLabel; ButtonPanel: array [0..4] of TPanel; ButtonImage: array [0..4] of TBitmapImage; ButtonLabel: array [0..4] of TLabel; SplashImage: TBitmapImage; SplashForm: TForm; SplashFileName: String; I : Integer; procedure CancelButtonClick(CurPage: Integer; var Cancel, Confirm: Boolean); begin Cancel:=False; Confirm:=False; if MsgBox('Вы действительно хотите отменить установку Call of Duty 4 - Modern Warfare ?', mbError, MB_YESNO) = idYes then Cancel:=true; end; procedure ButtonLabelClick(Sender: TObject); var Button: TButton; begin ButtonImage[TLabel(Sender).Tag].Left:=0 case TLabel(Sender).Tag of bidBack: Button:=WizardForm.BackButton bidNext: Button:=WizardForm.NextButton bidCancel: Button:=WizardForm.CancelButton bidDirBrowse: Button:=WizardForm.DirBrowseButton bidGroupBrowse: Button:=WizardForm.GroupBrowseButton else Exit end Button.OnClick(Button) end; procedure ButtonLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin if ButtonLabel[TLabel(Sender).Tag].Enabled then ButtonImage[TLabel(Sender).Tag].Left:=-ButtonWidth end; procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer); begin ButtonImage[TLabel(Sender).Tag].Left:=0 end; procedure LoadButtonImage(AButton: TButton; AButtonIndex: integer); var Image: TBitmapImage; Panel: TPanel; Labl: TLabel; begin Panel:=TPanel.Create(WizardForm) Panel.Left:=AButton.Left Panel.Top:=AButton.Top Panel.Width:=AButton.Width Panel.Height:=AButton.Height Panel.Tag:=AButtonIndex Panel.Parent:=AButton.Parent ButtonPanel[AButtonIndex]:=Panel Image:=TBitmapImage.Create(WizardForm) //Рисунок который ложится на кнопку Image.Width:=160 //Обязательно прописать оригинальный размер рисунка Image.Height:=23 Image.Enabled:=False Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button3.bmp')) Image.Parent:=Panel ButtonImage[AButtonIndex]:=Image with TLabel.Create(WizardForm) do begin Tag:=AButtonIndex Parent:=Panel Width:=Panel.Width Height:=Panel.Height Transparent:=True OnClick:=@ButtonLabelClick OnDblClick:=@ButtonLabelClick OnMouseDown:=@ButtonLabelMouseDown OnMouseUp:=@ButtonLabelMouseUp end Labl:=TLabel.Create(WizardForm) //Текст кнопок Labl.Left:=15 //Указываем положение текста Labl.Top:=5 Labl.Autosize:=True Labl.Alignment:=taCenter Labl.Tag:=AButtonIndex Labl.Transparent:=True Labl.Font.Color:=clWhite //Цвет текста Labl.Caption:=AButton.Caption Labl.OnClick:=@ButtonLabelClick Labl.OnDblClick:=@ButtonLabelClick Labl.OnMouseDown:=@ButtonLabelMouseDown Labl.OnMouseUp:=@ButtonLabelMouseUp Labl.Parent:=Panel ButtonLabel[AButtonIndex]:=Labl end; procedure UpdateButton(AButton: TButton;AButtonIndex: integer); begin ButtonLabel[AButtonIndex].Caption:=AButton.Caption ButtonPanel[AButtonIndex].Visible:=AButton.Visible ButtonLabel[AButtonIndex].Enabled:=Abutton.Enabled end; procedure LicenceAcceptedRadioOnClick(Sender: TObject); begin ButtonLabel[bidNext].Enabled:=True end; procedure LicenceNotAcceptedRadioOnClick(Sender: TObject); begin ButtonLabel[bidNext].Enabled:=False end; procedure CurPageChanged(CurPageID: Integer); begin if CurPageID=wpReady then begin TButton(WizardForm.FindComponent('NextButton')).Caption:='Установка'; end else begin if CurPageID=wpFinished then begin TButton(WizardForm.FindComponent('NextButton')).Caption:='Выход'; end else begin TButton(WizardForm.FindComponent('NextButton')).Caption:='Вперед >'; end; end; TButton(WizardForm.FindComponent('BackButton')).Caption:='< Назад'; TButton(WizardForm.FindComponent('CancelButton')).Caption:='Выход'; UpdateButton(WizardForm.BackButton,bidBack) UpdateButton(WizardForm.NextButton,bidNext) UpdateButton(WizardForm.CancelButton,bidCancel) PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption; end; procedure InitializeWizard(); begin SplashFileName := ExpandConstant('{tmp}\splash.bmp'); ExtractTemporaryFile(ExtractFileName(SplashFileName)); SplashForm := TForm.create(nil); with SplashForm do begin BorderStyle := bsNone; Position := poScreenCenter; ClientWidth := 578; ClientHeight := 210; end; SplashImage := TBitmapImage.Create(SplashForm); with SplashImage do begin Bitmap.LoadFromFile(SplashFileName); Stretch := true; Align := alClient; Parent := SplashForm; end; with SplashForm do begin Show; for I := 1 to 1 do begin Repaint; Sleep(4000); end; Close; Free; end; WizardForm.Position:=poScreenCenter; WizardForm.BackButton.Width:=ButtonWidth WizardForm.BackButton.Height:=ButtonHeight WizardForm.NextButton.Width:=ButtonWidth WizardForm.NextButton.Height:=ButtonHeight WizardForm.CancelButton.Width:=ButtonWidth WizardForm.CancelButton.Height:=ButtonHeight WizardForm.DirBrowseButton.Left:=337 WizardForm.DirBrowseButton.Width:=ButtonWidth WizardForm.DirBrowseButton.Height:=ButtonHeight WizardForm.GroupBrowseButton.Left:=337 WizardForm.GroupBrowseButton.Width:=ButtonWidth WizardForm.GroupBrowseButton.Height:=ButtonHeight WizardForm.LicenseAcceptedRadio.OnClick:=@LicenceAcceptedRadioOnClick WizardForm.LicenseNotAcceptedRadio.OnClick:=@LicenceNotAcceptedRadioOnClick ExtractTemporaryFile('button3.bmp') LoadButtonImage(WizardForm.BackButton,bidBack) LoadButtonImage(WizardForm.NextButton,bidNext) LoadButtonImage(WizardForm.CancelButton,bidCancel) LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse) LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse) WizardForm.PageNameLabel.Hide; WizardForm.PageDescriptionLabel.Hide; PageNameLabel:= TLabel.Create( WizardForm ); PageNameLabel.Left:= WizardForm.PageNameLabel.Left; PageNameLabel.Top:= WizardForm.PageNameLabel.Top; PageNameLabel.Transparent:= True; PageNameLabel.Font.Style:= [fsBold]; PageNameLabel.Font.Color:= clWhite; PageNameLabel.Parent:= WizardForm.MainPanel; PageDescriptionLabel:= TLabel.Create( WizardForm ); PageDescriptionLabel.Left:= WizardForm.PageDescriptionLabel.Left; PageDescriptionLabel.Top:= WizardForm.PageDescriptionLabel.Top; PageDescriptionLabel.Transparent:= True; PageDescriptionLabel.Font.Color:= clWhite; PageDescriptionLabel.Parent:= WizardForm.MainPanel; WizardForm.WizardSmallBitmapImage.Left:= ScaleX(0); WizardForm.WizardSmallBitmapImage.Width:=WizardForm.ClientWidth; WizardForm.StatusLabel.Caption:='Распаковка файлов...'; WizardForm.FileNameLabel.Visible:=False; WizardForm.ProgressGauge.Top:=ScaleY(65); WizardForm.ProgressGauge.Width:=280; WizardForm.ProgressGauge.Left:=120; WizardForm.StatusLabel.Top:=ScaleY(29); WizardForm.WelcomeLabel2.Top:=ScaleY(90); ProgressBar1 := TNewProgressBar.Create(wizardform); with ProgressBar1 do begin Parent := wizardform.installingpage; Top := 65; Width := 110; Height := wizardform.progressgauge.height; Max :=37; end; end; procedure CurStepChanged(CurStep: TSetupStep); var res:Integer; s,s1:string; begin If CurStep=ssInstall then begin s:=ExpandConstant('{src}')+'\data.bin'; s1:=ExpandConstant('{app}'); Exec(s, '-y -o"'+ s1 + '"', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 s:=ExpandConstant('{src}')+'\zone1.bin'; s1:=ExpandConstant('{app}'); Exec(s, '-y -o"'+ s1 + '"', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+2 Exec(ExpandConstant('{app}\precomp.exe'), ' -r zone1.pcf ', '', SW_HIDE, ewWaitUntilTerminated, res); DeleteFile(ExpandConstant('{app}\zone1.pcf')); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+3 Exec(ExpandConstant('{app}\zone1.exe'), ' -y ', '', SW_HIDE, ewWaitUntilTerminated, res); DeleteFile(ExpandConstant('{app}\zone1.exe')); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 s:=ExpandConstant('{src}')+'\zone2.bin'; s1:=ExpandConstant('{app}'); Exec(s, '-y -o"'+ s1 + '"', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+2 Exec(ExpandConstant('{app}\precomp.exe'), ' -r zone2.pcf ', '', SW_HIDE, ewWaitUntilTerminated, res); DeleteFile(ExpandConstant('{app}\zone2.pcf')); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+3 Exec(ExpandConstant('{app}\zone2.exe'), ' -y', '', SW_HIDE, ewWaitUntilTerminated, res); DeleteFile(ExpandConstant('{app}\zone2.exe')); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 s:=ExpandConstant('{src}')+'\main1.bin'; s1:=ExpandConstant('{app}'); Exec(s, '-y -o"'+ s1 + '"', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+2 Exec(ExpandConstant('{app}\main\1.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 Exec(ExpandConstant('{app}\main\2.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 s:=ExpandConstant('{src}')+'\main2.bin'; s1:=ExpandConstant('{app}'); Exec(s, '-y -o"'+ s1 + '"', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+2 Exec(ExpandConstant('{app}\main\3.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); DeleteFile(ExpandConstant('{app}\msvcr80.dll')); DeleteFile(ExpandConstant('{app}\packjpg_dll.dll')); DeleteFile(ExpandConstant('{app}\zlib1.dll')); DeleteFile(ExpandConstant('{app}\precomp.exe')); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+2 s:=ExpandConstant('{src}')+'\main3.bin'; s1:=ExpandConstant('{app}'); Exec(s, '-y -o"'+ s1 + '"', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+2 Exec(ExpandConstant('{app}\main\dec1.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+3 Exec(ExpandConstant('{app}\main\dec2.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+3 Exec(ExpandConstant('{app}\main\4.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 Exec(ExpandConstant('{app}\main\5.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 Exec(ExpandConstant('{app}\main\6.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 Exec(ExpandConstant('{app}\main\7.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 Exec(ExpandConstant('{app}\main\8.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 Exec(ExpandConstant('{app}\main\9.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+1 Exec(ExpandConstant('{app}\main\10.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, res); WizardForm.StatusLabel.Caption:='Распаковка файлов...'; ProgressBar1.Position := ProgressBar1.Position+2 end; end; [Icons] Name: "{group}\Играть Call of Duty 4 - Modern Warfare (SP)"; Filename: "{app}\iw3sp.exe"; IconFileName: "{src}\icon.ico"; Name: "{group}\Играть Call of Duty 4 - Modern Warfare (MP)"; Filename: "{app}\iw3mp.exe"; IconFileName: "{src}\icon.ico"; Name: "{group}\Удалить Call of Duty 4 - Modern Warfare"; Filename: "{uninstallexe}"; Name: "{userdesktop}\Call of Duty 4 - Modern Warfare (SP)"; Filename: "{app}\iw3sp.exe"; IconFileName: "{src}\icon.ico"; Tasks: sp Name: "{userdesktop}\Call of Duty 4 - Modern Warfare (MP)"; Filename: "{app}\iw3mp.exe"; IconFileName: "{src}\icon.ico"; Tasks: mp [Run] Filename: {app}\iw3sp.exe; WorkingDir: {app}; Description: "Начать одиночную игру"; Flags: postinstall nowait Filename: "{src}\Redist\DirectX\DXSETUP.exe"; Parameters: "/silent"; StatusMsg: "Обновление DirectX..."; Tasks: "dx"; Flags: waituntilterminated Filename: "{src}\Redist\vcredist_x86.exe"; Parameters: "/q"; StatusMsg: "Установка Microsoft Visual C++ 2005 SP1 Redist..."; Tasks: "vc"; Flags: runhidden waituntilterminated | Всего записей: 605 | Зарегистр. 02-02-2009 | Отправлено: 23:06 23-04-2009 | Исправлено: spider91, 14:23 24-04-2009 |
|