[Setup]
AppName=Counter-Strike
AppVerName=1.6
AppPublisher=R.G.RI4MOND
AppPublisherURL=http://ri4mond.forumssity.ru
AppSupportURL=http://ri4mond.forumssity.ru
AppUpdatesURL=http://ri4mond.forumssity.ru
DefaultDirName={pf}\Counter-Strike
DefaultGroupName=Counter-Strike
OutputDir=D:\combat
OutputBaseFilename=setup
SetupIconFile=C:\Program Files\REDEMAX\CS System\Counter-Strike 1.6 VP3\cstrike.ico
Compression=lzma/ultra
SolidCompression=true
InternalCompressLevel=ultra
[Code]
function GetSystemMetrics(nIndex:Integer):Integer;
external '
[email protected] stdcall';
function gdipDrawImage(Wnd:HWND; FileName:PChar; Left,Top,Width,Height: Integer; Stretch,IsBkg: Boolean):Longint; external 'gdipDrawImage@files:GDIPlus.dll stdcall';
procedure gdipReleaseImage(img:Longint); external 'gdipReleaseImage@files:GDIPlus.dll stdcall';
procedure gdipShutdown; external 'gdipShutdown@files:GDIPlus.dll stdcall';
var
Welcome, Edit, Tasks, Ready, Setup, Finish: TLabel;
SelectDirLabel, SelectDirLabelBrowse: TLabel; //Надписи на странице выбора места установки
PageNameLabel, PageDescriptionLabel: TLabel; //Заголовок страницы
StatusLabel, FilenameLabel, NeedSpaceLabel,FreeSpaceLabel: TLabel; //Данные на страниые установки
WelcomeLabel1, WelcomeLabel2,FinishedLabel, FinishedHeadingLabel: TLabel; //Надписи на на странице приветствия и на финишной странице
SelectStartMenuFolderLabel, SelectStartMenuFolderBrowseLabel, ReadyLabel, NoIconsLabel: TLabel; //Надписи и чекбоксы на странице выбора места установки ярлыков в Главном Меню
LicenseLabel1, LicenseAcceptedLabel, LicenseNotAcceptedLabel: Tlabel; //Надписи на страниые Лицензионнго соглашения
InfoBeforeClickLabel, InfoAfterClickLabel, ComponentsDiskSpaceLabel, SelectComponentsLabel: TLabel; //Надписи на странице компонентов и страницах показа данных до и после установки
WelcomeInt, DirInt, TasksInt, ReadyInt, InstallInt, FinishInt: Longint;
Procedure NoIconsLabelOnClick (Sender: TObject);
begin
WizardForm.NoIconsCheck.Checked:=Not(WizardForm.NoIconsCheck.Checked)
end;
procedure LicenceAcceptedRadioOnClick(Sender: TObject);
begin
WizardForm.NextButton.Enabled:=True
end;
procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
WizardForm.NextButton.Enabled:=False
end;
Procedure YesRadioOnClick (Sender: TObject);
begin
WizardForm.LicenseAcceptedRadio.Checked:=True
end;
Procedure NoRadioOnClick (Sender: TObject);
begin
WizardForm.LicenseNotAcceptedRadio.Checked:=True
end;
procedure FilenameExt();
begin
FilenameLabel.Caption:= AddBackslash(ExtractFilePath(ExpandConstant(CurrentFilename))) + ExtractFileName(CurrentFilename)
end;
procedure InitializeWizard();
begin
with WizardForm do
begin
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
DiskSpaceLabel.Hide;
SelectDirBitmapImage.Hide;
SelectDirBrowseLabel.Hide;
SelectDirLabel.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
MainPanel.Hide
SelectStartMenuFolderLabel.Hide;
SelectStartMenuFolderBrowseLabel.Hide;
ReadyLabel.Hide;
LicenseLabel1.Hide;
InfoBeforeClickLabel.Hide;
InfoAfterClickLabel.Hide;
ComponentsDiskSpaceLabel.Hide;
SelectComponentsLabel.Hide;
InnerNoteBook.Hide;
OuterNoteBook.Hide;
end;
WizardForm.ClientWidth := ScaleX(680);
WizardForm.ClientHeight := ScaleY(480);
WizardForm.Bevel.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
ExtractTemporaryFile('30.png')
ExtractTemporaryFile('1.png')
ExtractTemporaryFile('40_Slash.png')
ExtractTemporaryFile('6.jpg')
gdipDrawImage(WizardForm.Handle, ExpandConstant('{tmp}\6.jpg'),ScaleX(0),ScaleY(0),ScaleX(680),ScaleY(480),True,True);
gdipDrawImage(WizardForm.Handle, ExpandConstant('{tmp}\30.png'),ScaleX(0),ScaleY(44),ScaleX(680),ScaleY(18),True,True);
gdipDrawImage(WizardForm.Handle, ExpandConstant('{tmp}\1.png'),ScaleX(0),ScaleY(0),ScaleX(680),ScaleY(480),True,True);
Welcome := TLabel.Create(WizardForm);
Welcome.Top := ScaleY(45);
Welcome.Left:= ScaleX(0);
Welcome.Width:= ScaleX(113);
Welcome.AutoSize:= False;
Welcome.Alignment:= taCenter;
Welcome.Transparent := True;
Welcome.Caption := 'Приветствие';
Welcome.Parent := WizardForm;
Edit := TLabel.Create(WizardForm);
Edit.Top := ScaleY(45);
Edit.Left:= ScaleX(114);
Edit.Width:= ScaleX(113);
Edit.AutoSize:= False;
Edit.Alignment:= taCenter;
Edit.Transparent := True;
Edit.Caption:= 'Параметры';
Edit.Parent := WizardForm;
Tasks := TLabel.Create(WizardForm);
Tasks.Top := ScaleY(45);
Tasks.Left:= ScaleX(227);
Tasks.Width:= ScaleX(113);
Tasks.AutoSize:= False;
Tasks.Alignment:= taCenter;
Tasks.Transparent := True;
Tasks.Caption := 'Задачи';
Tasks.Parent := WizardForm;
Ready := TLabel.Create(WizardForm);
Ready.Top := ScaleY(45);
Ready.Left:= ScaleX(340);
Ready.Width:= ScaleX(113);
Ready.AutoSize:= False;
Ready.Alignment:= taCenter;
Ready.Transparent := True;
Ready.Caption := 'Подготовка';
Ready.Parent := WizardForm;
Setup := TLabel.Create(WizardForm);
Setup.Top := ScaleY(45);
Setup.Left:= ScaleX(453);
Setup.Width:= ScaleX(113);
Setup.AutoSize:= False;
Setup.Alignment:= taCenter;
Setup.Transparent := True;
Setup.Caption := 'Установка';
Setup.Parent := WizardForm;
Finish := TLabel.Create(WizardForm);
Finish.Top := ScaleY(45);
Finish.Left:= ScaleX(557);
Finish.Width:= ScaleX(113);
Finish.AutoSize:= False;
Finish.Alignment:= taCenter;
Finish.Transparent := True;
Finish.Caption := 'Готово';
Finish.Parent := WizardForm;
WizardForm.BackButton.Top := WizardForm.BackButton.Top + ScaleY(120);
WizardForm.BackButton.Left:= WizardForm.BackButton.Left + ScaleX(130)
WizardForm.NextButton.Top := WizardForm.NextButton.Top + ScaleY(120);
WizardForm.NextButton.Left:= WizardForm.NextButton.Left + ScaleY(130);
WizardForm.CancelButton.Top := WizardForm.CancelButton.Top + ScaleY(120);
WizardForm.CancelButton.Left:= WizardForm.CancelButton.Left + ScaleY(140);
WizardForm.OuterNotebook.Left := WizardForm.Width / 2 - WizardForm.OuterNotebook.Width / 2;
WizardForm.OuterNotebook.Top := ScaleY(105);
WizardForm.InnerNotebook.Top := ScaleY(10);
WizardForm.Left := GetSystemMetrics(0) / 2 - WizardForm.Width / 2;
WizardForm.Top := GetSystemMetrics(1) / 2 - WizardForm.Height / 2;
PageNameLabel:= TLabel.Create(WizardForm);
with PageNameLabel do
begin
Left:= WizardForm.PageNameLabel.Left + 70;
Top:= WizardForm.PageNameLabel.Top + 70;
Width:= ScaleX(300);
Height:= ScaleY(20);
AutoSize:= False;
Font.Name:= 'Georgia';
Font.Style:= [fsBold];
Font.Size:= 10
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm
end;
PageDescriptionLabel:= TLabel.Create(WizardForm);
with PageDescriptionLabel do
begin
Left:= WizardForm.PageDescriptionLabel.Left + 70;
Top:= WizardForm.PageDescriptionLabel.top + 75;
Width:= ScaleX(400);
Height:= WizardForm.PageDescriptionLabel.Height;
AutoSize:= False;
Wordwrap:= True;
Font.Name:= 'Georgia';
Font.Style:= [fsBold, fsItalic];
Font.Size:= 10
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm
end;
//////////////////////////// WpWelcome ////////////////////////////
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
Top:= WizardForm.WelcomeLabel1.Top + ScaleY(140)
Left:= ScaleX(60)
Width:= ScaleX(560);
Height:= ScaleY(71);
Alignment:= taCenter;
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Size:= 14;
Font.Name:= 'Georgia';
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Parent:= WizardForm
Caption:= WizardForm.WelcomeLabel1.Caption;
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
Top:= WizardForm.WelcomeLabel2.Top + ScaleY(140)
Left:= ScaleX(60)
Width:= ScaleX(560);
Height:= ScaleY(300);
AutoSize:= false;
WordWrap:= true;
Transparent:= true;
Alignment:= taCenter;
Font.Name:= 'Georgia';
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Font.Size:= 10
Parent:= WizardForm
Caption:= WizardForm.WelcomeLabel2.Caption;
end;
//////////////////////////// WpSelectDir ////////////////////////////
SelectDirLabel:= TLabel.Create(WizardForm);
with SelectDirLabel do
begin
Caption:= WizardForm.SelectDirLabel.Caption;
Left:= WizardForm.SelectDirLabel.Left + ScaleX(100);
Top:= WizardForm.SelectDirLabel.Top + ScaleY(160);
Width:= ScaleX(500);
Height:= WizardForm.SelectDirLabel.Height;
Transparent := True;
Font.Name:= 'Georgia';
Font.Style:= [fsBold, fsItalic];
Font.Size:= 10
Font.Color:= ClWhite;
Parent:= WizardForm
end;
SelectDirLabelBrowse:= TLabel.Create(WizardForm);
with SelectDirLabelBrowse do
begin
Caption:= WizardForm.SelectDirBrowseLabel.Caption;
Left:= WizardForm.SelectDirBrowseLabel.Left + ScaleX(100);
Top:= WizardForm.SelectDirBrowseLabel.Top + ScaleY(160);
Width:= ScaleX(500);
Height:= WizardForm.SelectDirBrowseLabel.Height;
WordWrap:= True;
Transparent:= True;
Font.Name:= 'Georgia';
Font.Style:= [fsBold, fsItalic];
Font.Size:= 10
Font.Color:= ClWhite;
Parent:= WizardForm
end;
WizardForm.DirEdit.Left:= WizardForm.DirEdit.Left + ScaleX(100)
WizardForm.DirEdit.Top:= WizardForm.DirEdit.Top + ScaleY(180)
WizardForm.DirEdit.Parent:= WizardForm
WizardForm.DirBrowseButton.Left:= WizardForm.DirBrowseButton.Left + ScaleX(100)
WizardForm.DirBrowseButton.Top:= WizardForm.DirBrowseButton.Top + Scaley(180)
WizardForm.DirBrowseButton.Parent:= WizardForm
////////////////////////////// wpReady ///////////////////////////////
ReadyLabel:= TLabel.Create(WizardForm);
with ReadyLabel do
begin
Left:= ScaleX(90);
Top:= ScaleY(160);
Width:= ScaleX(500);
Height:= ScaleY(60);
AutoSize:= False;
WordWrap:= true;
Transparent:= true;
Font.Name:= 'Georgia';
Font.Style:= [fsBold, fsItalic];
Font.Size:= 10
Font.Color:= ClWhite;
Caption:= 'Нажмите «Установить», чтобы продолжить, или «Назад», если Вы хотите просмотреть или изменить опции установки.'
Parent:= WizardForm
end;
WizardForm.ReadyMemo.Parent:= WizardForm;
WizardForm.ReadyMemo.Left:= ScaleX(90)
WizardForm.ReadyMemo.Width:= ScaleX(500)
WizardForm.ReadyMemo.Top:= ScaleY(210)
WizardForm.ReadyMemo.Height:= ScaleY(200)
////////////////////////////// wpReady ///////////////////////////////
//////////////////////////// WpInstalling ////////////////////////////
StatusLabel:= TLabel.Create(WizardForm);
with StatusLabel do
begin
Left:= WizardForm.StatusLabel.Left + ScaleX(100);
Top:= WizardForm.StatusLabel.Top + ScaleY(160)
Width:= WizardForm.StatusLabel.Width;
Height:= WizardForm.StatusLabel.Height;
AutoSize:= False;
Transparent := True;
Parent:= WizardForm
Font.Name:= 'Georgia';
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Font.Size:= 10
Caption:= 'Распаковка файлов...'
end;
FilenameLabel:= TLabel.Create(WizardForm);
with FilenameLabel do
begin
Left:= WizardForm.FilenameLabel.Left + ScaleX(100);
Top:= WizardForm.FilenameLabel.Top + ScaleY(160);
Width:= ScaleX(480)
Height:= WizardForm.StatusLabel.Height;
AutoSize:= False;
Transparent := True;
Font.Name:= 'Georgia';
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Font.Size:= 10
Parent:= WizardForm
end;
WizardForm.ProgressGauge.Left:= WizardForm.ProgressGauge.Left + ScaleX(100)
WizardForm.ProgressGauge.Top:= WizardForm.ProgressGauge.Top + ScaleY(160)
WizardForm.ProgressGauge.Width:= ScaleX(480)
WizardForm.ProgressGauge.BringToFront;
WizardForm.ProgressGauge.Parent:= WizardForm
//////////////////////////// WpFinished ////////////////////////////
FinishedHeadingLabel:=TLabel.Create(WizardForm);
with FinishedHeadingLabel do
begin
Left:= WelcomeLabel1.Left
Top:= WelcomeLabel1.Top
Width:= ScaleX(520);
Height:= ScaleY(53);
AutoSize:= false;
WordWrap:= true;
Alignment:=taCenter
Font.Size:= 14;
Font.Color:=ClWhite
Font.Name:='Constantia'
Font.Style := [fsBold]
Transparent:= true;
Parent:= WizardForm
Caption:= WizardForm.FinishedHeadingLabel.Caption;
end;
FinishedLabel:= TLabel.Create(WizardForm);
with FinishedLabel do
begin
Left:= WelcomeLabel2.Left;
Top:= WelcomeLabel2.Top;
Width:= ScaleX(520);
Height:= ScaleY(300);
AutoSize:= false;
WordWrap:= true;
Alignment:=taCenter
Font.Name:= 'Georgia';
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Font.Size:= 10
Transparent:= true;
Parent:= WizardForm
end;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;
FinishedLabel.Caption:= WizardForm.FinishedLabel.Caption
PageDescriptionLabel.Show;
PageNameLabel.Show;
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
SelectDirLabel.Hide;
SelectDirLabelBrowse.Hide;
WizardForm.DirEdit.Hide;
WizardForm.DirBrowseButton.Hide;
ReadyLabel.Hide;
WizardForm.ReadyMemo.Hide;
StatusLabel.Hide;
FilenameLabel.Hide;
WizardForm.ProgressGauge.Hide;
WizardForm.StatusLabel.Hide;
WizardForm.FilenameLabel.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
Welcome.Font.Color := clSilver;
Edit.Font.Color := clSilver;
Tasks.Font.Color:= clSilver;
Ready.Font.Color := clSilver;
Setup.Font.Color := clSilver;
Finish.Font.Color := clSilver;
gdipReleaseImage(WelcomeInt)
gdipReleaseImage(DirInt)
gdipReleaseImage(TasksInt)
gdipReleaseImage(ReadyInt)
gdipReleaseImage(InstallInt)
gdipReleaseImage(FinishInt)
if CurPageID = wpWelcome then
begin
WelcomeInt:=gdipDrawImage(WizardForm.Handle, ExpandConstant('{tmp}\40_Slash.png'),ScaleX(0),ScaleY(44),ScaleX(113),ScaleY(18),True,True);
PageDescriptionLabel.Hide;
PageNameLabel.Hide;
WelcomeLabel1.Show;
WelcomeLabel2.Show;
Welcome.Font.Color := clWhite;
end;
if CurPageID = wpSelectDir then
begin
DirInt:=gdipDrawImage(WizardForm.Handle, ExpandConstant('{tmp}\40_Slash.png'),ScaleX(114),ScaleY(44),ScaleX(113),ScaleY(18),True,True);
SelectDirLabel.Show;
SelectDirLabelBrowse.Show;
WizardForm.DirEdit.Show;
WizardForm.DirBrowseButton.Show;
Edit.Font.Color := clWhite;
end;
if CurPageID = wpSelectTasks then
begin
TasksInt:=gdipDrawImage(WizardForm.Handle, ExpandConstant('{tmp}\40_Slash.png'),ScaleX(227),ScaleY(44),ScaleX(113),ScaleY(18),True,True);
Tasks.Font.Color := clWhite;
end;
if CurPageID = wpReady then
begin
ReadyInt:=gdipDrawImage(WizardForm.Handle, ExpandConstant('{tmp}\40_Slash.png'),ScaleX(340),ScaleY(44),ScaleX(113),ScaleY(18),True,True);
Ready.Font.Color := clWhite
ReadyLabel.Show;
WizardForm.ReadyMemo.Show;
end;
if CurPageID = wpInstalling then
begin
InstallInt:=gdipDrawImage(WizardForm.Handle, ExpandConstant('{tmp}\40_Slash.png'),ScaleX(453),ScaleY(44),ScaleX(113),ScaleY(18),True,True);
StatusLabel.Show;
FilenameLabel.Show;
WizardForm.ProgressGauge.Show;
WizardForm.StatusLabel.Show;
WizardForm.FilenameLabel.Show;
Setup.Font.Color := clWhite;
end;
if CurPageID = wpFinished then
begin
FinishInt:=gdipDrawImage(WizardForm.Handle, ExpandConstant('{tmp}\40_Slash.png'),ScaleX(566),ScaleY(44),ScaleX(114),ScaleY(18),True,True);
FinishedHeadingLabel.Show;
FinishedLabel.Show;
PageDescriptionLabel.Hide;
PageNameLabel.Hide;
Finish.Font.Color := clWhite;
end;
end;
procedure DeinitializeSetup();
begin
gdipShutdown;
end;
[Languages]
Name: russian; MessagesFile: compiler:Default.isl
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Files]
Source: C:\Program Files\Inno Setup 5\Examples\MyProg.exe; DestDir: {app}; Flags: ignoreversion
; ОТМЕТЬТЕ: Не используйте "Флажки: Проигнорировать версию" на любых общедоступных системных файлах
; Test
;Source: "{sys}\*.dll"; DestDir: "{app}"; BeforeInstall: FileNameExt(); Flags: ignoreversion external deleteafterinstall;
Source: D:\GDIPlus.dll; DestDir: "{tmp}"; Flags: nocompression
Source: D:\30.png; DestDir: {tmp};
Source: D:\40_Slash.png; DestDir: {tmp};
Source: D:\6.jpg; DestDir: {tmp};
Source: D:\1.png; DestDir: {tmp};
[Icons]
Name: "{group}\Counter-Strike "; Filename: {app}\MyProg.exe
Name: "{commondesktop}\Counter-Strike "; Filename: {app}\MyProg.exe; Tasks: desktopicon
[Run]
Filename: {app}\MyProg.exe; Description: {cm:LaunchProgram,Counter-Strike }; Flags: nowait postinstall skipifsilent