Помогите исправить ошибку в скрипте Юры с арком вылазиет в блоке музыка вот такое мне предлагали поставить две палочки но далее идет еще ошибка такого типа и потом аркине разархивируются
Вот скрипт может кто и поможет
[more]#define MyAppName "Need For Speed Undercover"
#define NeedSize "5000"
#define PB_ImageFile "progress1.bmp"
#ifdef UNICODE
#define PStr "AnsiString"
#else
#define PStr "String"
#endif
[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{85F49BE2-30C3-437B-A1B8-42453054A480}
AppName=Need For Speed Undercover
AppVerName=Need For Speed Undercover 1.0
AppPublisher=R.G RePackers
AppPublisherURL=http://posrednik.dkm.dp.ua
AppSupportURL=http://posrednik.dkm.dp.ua
AppUpdatesURL=http://posrednik.dkm.dp.ua
DefaultDirName={pf}\Need For Speed Undercover
DefaultGroupName=Need For Speed Undercover
OutputDir=C:\Program Files\R.G.RePackers
OutputBaseFilename=setup
Compression=lzma/ultra64
SolidCompression=true
InternalCompressLevel=ultra64
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[CustomMessages]
russian.Welcome1=Вас приветствует Мастер установки игры
russian.Welcome2=Программа установит игру {#MyAppName} на Ваш компьютер.%n%nРекомендуется закрыть антивирусные пакеты, а также все прочие приложения перед тем, как продолжить.%n%nНажмите «Далее», чтобы продолжить, или «Отмена», чтобы выйти из программы установки.
russian.Space=Доступно места на диске:
russian.Space1=Требуется места на диске:
russian.Status=Пожалуйста, подождите, пока игра установится на Ваш компьютер.
russian.DescrLbl1=В какую папку Вы хотите установить {#MyAppName}?
russian.Language=Выберите язык игры
russian.StartMenuLbl=Нажмите «Установить», чтобы продолжить. Если Вы хотите выбрать другую папку, нажмите «Обзор».
russian.Finished1=Установка игры {#MyAppName} успешно завершена.
russian.Finished2=Игра {#MyAppName} была успешно установлена на Ваш компьютер. Для ее запуска выберите соответствующий ярлык в меню «Пуск» или ярлык на Рабочем столе.
russian.Finished3=Нажмите «Завершить», чтобы выйти из программы установки.
russian.DirectX=Обновить DirectX
russian.DirectXInstall=Идет обновление DirectX...
russian.Icons=Добавить ярлык на Рабочий стол
russian.Uninstall=Удалить {#MyAppName}
russian.ArcBreak=Установка прервана!
russian.Finished4=Установка игры {#MyAppName} не завершена.
russian.ExtractedInfo=Распаковка игровых архивов. Выполнено: %1 Мб из %2 Мб
russian.ArcInfo=Архив: %1 из %2
russian.ArcTitle=Распаковка архивов FreeArc
russian.ArcError=Распаковщик FreeArc вернул код ошибки: %1
russian.ArcFail=Распаковка не завершена!
russian.AllProgress=Общий прогресс распаковки: %1%%
russian.ArcBroken=Возможно, архив %1 повреждён%nили недостаточно места на диске назначения.
russian.Extracting=Распаковывается: %1
russian.taskbar=%1%%, ждите %2
russian.remains=Осталось ждать %1
russian.LongTime=вечно
russian.ending=завершение
russian.hour=часов
russian.min=мин
russian.sec=сек
[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked
[Files]
Source: C:\RePack\Image\*.bmp; Flags: dontcopy
Source: C:\RePack\InstallFiles\*; Flags: dontcopy
Source: C:\RePack\InstallFiles\\ISSkin.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
Source: C:\RePack\InstallFiles\\Tiger.cjstyles; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system
Source: "C:\Program Files\EA Games\Need For Speed Undercover\nfs_icon.ico"; DestDir: {app}; Flags: ignoreversion
;Source: "C:\Program Files\EA Games\Need for Speed Undercover\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs; BeforeInstall: ProgressExt();
[UninstallDelete]
Type: filesandordirs; Name: {app}
Type: files; Name: {commondesktop}\{#MyAppName}.lnk
[Icons]
Name: {group}\Need For Speed Undercover; Filename: {app}\nfs.exe
Name: {commondesktop}\Need For Speed Undercover; Filename: {app}\nfs.exe; Tasks: desktopicon
[Run]
Filename: {app}\nfs.exe; Description: {cm:LaunchProgram,Need For Speed Undercover}; Flags: nowait postinstall skipifsilent
[Registry]
Root: HKLM; SubKey: SOFTWARE\Electronic Arts\EA GAMES\Need for Speed Undercover\ergc; ValueType: string; ValueName: ; ValueData: C9BKNJQ33DSS53DEURLD
[Code]
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);
const
ButtonWidth = 80;
ButtonHeight = 23;
bidBack = 0;
bidNext = 1;
bidCancel = 2;
bidDirBrowse = 3;
bidGroupBrowse = 4;
bidbtnCancelUnpacking = 5;
BASS_ACTIVE_PLAYING = 1;
BASS_ACTIVE_STALLED = 2;
BASS_ACTIVE_PAUSED = 3;
BASS_SAMPLE_LOOP = 4;
Archives = '{src}\Bin\*.arc'; // укажите расположение архивов FreeArc т.е в папке где лешит сам инсталлер должна быть папка BIN и в ней должен быть архив Setup.arc
// либо если их много у тебя то просто укажи Bin\*.arc -так будут распаковываться все архивы в папке BIN.
PM_REMOVE = 1;
CP_ACP = 0; CP_UTF8 = 65001;
oneMb = 1048576;
var
btnCancelUnpacking: TButton;
ButtonPanel: array [0..5] of TPanel;
ButtonImage: array [0..5] of TBitmapImage;
ButtonLabel: array [0..5] of TLabel;
TimerID: LongWord;
intOldCurrWidth : Integer;
ProgressBar_BitmapImage: TBitmapImage;
ProgressBar_Edit : TEdit;
ProgressBar_ImageHeight : integer;
LanguageLabel1: TLabel;
LanguageLabel2: TLabel;
rus: Boolean;
pnl_ru, pnl_us: TPanel;
mp3Handle: HWND;
mp3Name: String;
PlayButton, PauseButton, StopButton: TPanel;
PlayImage, PauseImage: TBitmapImage;
PlayLabel, PauseLabel: TLabel;
MouseLabel: Tlabel;
Welcome, Parameters, StartMenu, Installing, Finish,
IconsLabel, NoIconsLabel, DirectXLabel, GroupLabel,
SelectDirLabel, SelectDirBrowseLabel,
PageNameLabel1, PageNameLabel2, PageNameLabel3,
PageDescriptionLabel1, PageDescriptionLabel2, PageDescriptionLabel3,
StatusLabel, FilenameLabel, NeedSpaceLabel,FreeSpaceLabel,
WelcomeLabel1, WelcomeLabel2,FinishedLabel, FinishedHeadingLabel,
SelectStartMenuFolderLabel, SelectStartMenuFolderBrowseLabel, ReadyLabel, NoIconsLabel1: TLabel;
DirectX, Icons, NoIconsCheck, Group: TCheckBox;
NeedSize:Integer;
FreeMB, TotalMB: Cardinal;
BmpFile: TBitmapImage;
function DetectPage(CurPageID: Integer): TNewNotebookPage;
begin
case CurPageID of
wpWelcome: Result:= WizardForm.WelcomePage;
wpSelectDir: Result:= WizardForm.SelectDirPage;
wpSelectProgramGroup: Result:= WizardForm.SelectProgramGroupPage;
wpSelectTasks: Result:= WizardForm.SelectTasksPage;
wpInstalling: Result:= WizardForm.InstallingPage;
wpFinished: Result:= WizardForm.FinishedPage;
end;
end;
Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.2n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;
function InstallDirectX: Boolean;
begin
Result:= DirectX.Checked;
end;
function CreateIcons: Boolean;
begin
Result:=Icons.Checked;
end;
function GroupIcons: Boolean;
begin
Result:=Group.Checked;
end;
function BackButtonClick(CurPageID: Integer): Boolean;
begin
Result := True;
if CurPageID = wpSelectDir then
ButtonPanel[bidNext].Enabled := True;
end;
procedure DirectXLabelOnClick(Sender: TObject);
begin
if DirectX.Checked = False then
DirectX.Checked:= True else
DirectX.Checked:= False;
end;
procedure IconsOnClick(Sender: TObject);
begin
if Icons.Checked = False then
Icons.Checked:= True else
Icons.Checked:= False;
end;
procedure CheckStartMenuOnClick(Sender: TObject);
begin
if WizardForm.NoIconsCheck.Checked then
begin
WizardForm.GroupEdit.Enabled := not (WizardForm.GroupEdit.Enabled);
WizardForm.GroupBrowseButton.Enabled := False;
ButtonLabel[bidGroupBrowse].Enabled := False;
ButtonPanel[bidGroupBrowse].Enabled := False;
end else
begin
WizardForm.GroupEdit.Enabled := True;
WizardForm.GroupEdit.Enabled := WizardForm.GroupEdit.Enabled;
WizardForm.GroupBrowseButton.Enabled := True;
ButtonLabel[bidGroupBrowse].Enabled := True;
ButtonPanel[bidGroupBrowse].Enabled := True;
end;
end;
procedure CheckNoIconsCheck(Sender: TObject);
begin
if (WizardForm.NoIconsCheck.Checked = False) then
WizardForm.NoIconsCheck.Checked := True
else
WizardForm.NoIconsCheck.Checked := False;
end;
procedure CurStepChanged1(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
if Icons.Checked then
CreateShellLink(ExpandConstant('{commondesktop}\{#MyAppName}.lnk'), '',
ExpandConstant('{app}\DMC4.exe'), '', ExpandConstant('{app}'), '', 0, SW_SHOWNORMAL);
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: String;
begin
Path := ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB > 1024 then
FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ NumToStr(round(FreeMB/1024*100)/100) + ' GB' else
FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ NumToStr(FreeMB)+ ' MB';
end;
procedure GetNeedSpaceCaption;
begin
if NeedSize > 1024 then
NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ NumToStr(round(NeedSize/1024*100)/100) + ' GB' else
NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ NumToStr(NeedSize)+ ' MB';
end;
procedure ProgressExt();
begin
FilenameLabel.Caption:= ExpandConstant(ExtractFileDir(CurrentFilename)) + '\' + ExtractFilename(CurrentFilename);
end;
procedure ProgressExt2();
begin
FilenameLabel.Caption:= ExpandConstant('{cm:DirectXInstall}')
end;
procedure InitializeWizard1();
begin
ExtractTemporaryFile('1.bmp');
ExtractTemporaryFile('2.bmp');
ExtractTemporaryFile('3.bmp');
ExtractTemporaryFile('4.bmp');
ExtractTemporaryFile('5.bmp');
NeedSize:= {#NeedSize};
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\1.bmp'));
BmpFile.Top:= ScaleY(0);
BmpFile.Left:= ScaleX(0);
BmpFile.Width:= ScaleX(790);
BmpFile.Height:= ScaleY(533);
BmpFile.Stretch:= true;
BmpFile.Parent:= WizardForm.WelcomePage;
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\2.bmp'));
BmpFile.Top:= ScaleY(0);
BmpFile.Left:= ScaleX(0);
BmpFile.Width:= ScaleX(790);
BmpFile.Height:= ScaleY(533);
BmpFile.Stretch:= true;
BmpFile.Parent:= WizardForm.SelectDirPage;
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\3.bmp'));
BmpFile.Top:= ScaleY(0);
BmpFile.Left:= ScaleX(0);
BmpFile.Width:= ScaleX(790);
BmpFile.Height:= ScaleY(533);
BmpFile.Stretch:= true;
BmpFile.Parent:= WizardForm.SelectProgramGroupPage;
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\4.bmp'));
BmpFile.Top:= ScaleY(0);
BmpFile.Left:= ScaleX(0);
BmpFile.Width:= ScaleX(790);
BmpFile.Height:= ScaleY(533);
BmpFile.Stretch:= true;
BmpFile.Parent:= WizardForm.InstallingPage;
BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\5.bmp'));
BmpFile.Top:= ScaleY(0);
BmpFile.Left:= ScaleX(0);
BmpFile.Width:= ScaleX(790);
BmpFile.Height:= ScaleY(533);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.FinishedPage;
WizardForm.ClientWidth:=ScaleX(790);
WizardForm.ClientHeight:=ScaleY(533);
WizardForm.Font.Color:=$ffffff;
WizardForm.Center;
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;
FilenameLabel.Hide;
StatusLabel.Hide;
SelectStartMenuFolderLabel.Hide;
SelectStartMenuFolderBrowseLabel.Hide;
ReadyLabel.Hide;
end;
with WizardForm do
begin
InnerNotebook.Left := ScaleX(0);
InnerNotebook.Top := ScaleY(0);
InnerNotebook.Width := ScaleX(790);
InnerNotebook.Height := ScaleY(533);
OuterNotebook.Left := ScaleX(0);
OuterNotebook.Top := ScaleY(0);
OuterNotebook.Width := ScaleX(790);
OuterNotebook.Height := ScaleY(533);
end;
////////////////////// WelcomePage //////////////////////
WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
Left:= ScaleX(70);
Top:= ScaleY(180);
Width:= ScaleX(650);
Height:= ScaleY(65);
AutoSize:= false;
Alignment := taCenter;
Transparent:= true;
WordWrap:= true;
Font.Name:='Georgia';
Font.Size:= 16;
Font.Color:=ClWhite;
Font.Style := [fsBold];
Parent:= WizardForm.WelcomePage;
Caption:= ExpandConstant('{cm:Welcome1}')+#13+('{#MyAppName}');
end;
WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
Top:= ScaleY(270);
Left:= ScaleX(70);
Width:= ScaleX(650);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Georgia';
Font.Size:= 11
Font.Style := [fsBold, fsItalic];
Font.Color:=ClWhite;
Transparent:= true;
Parent:= WizardForm.WelcomePage;
Caption:= ExpandConstant('{cm:Welcome2}');
end;
////////////////////// WelcomePage //////////////////////
////////////////////// SelectDirPage //////////////////////
PageNameLabel1:= TLabel.Create(WizardForm);
with PageNameLabel1 do
begin
Left:= ScaleX(65);
Top:= ScaleY(185);
Width:= ScaleX(300);
Height:= ScaleY(30);
AutoSize:= False;
Font.Name:= 'Georgia'
Font.Size:= 13;
Font.Style:= [fsBold];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
end;
PageDescriptionLabel1:= TLabel.Create(WizardForm);
with PageDescriptionLabel1 do
begin
Left:=ScaleX(95);
Top:= ScaleY(215);
Width:= ScaleX(600);
Height:= ScaleY(50);
AutoSize:= False;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Wordwrap:= True;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
end;
SelectDirBrowseLabel:= TLabel.Create(WizardForm);
with SelectDirBrowseLabel do
begin
Caption:= WizardForm.SelectDirBrowseLabel.Caption;
Left:= ScaleX(120);
Top:= ScaleY(250);
Width:= ScaleX(600);
Height:= ScaleY(50);
AutoSize:= False;
WordWrap:= True;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent:= True;
Parent:= WizardForm.SelectDirPage;
end;
with WizardForm do
begin
DirBrowseButton.Top:= ScaleY(305);
DirEdit.Left:= ScaleX(120);
DirEdit.Top:= ScaleY(305);
DirEdit.Width:= ScaleX(460);
DirEdit.Font.Size:= 9;
end;
DirectX:= TCheckBox.Create(WizardForm);
with DirectX do
begin
Parent:= WizardForm.SelectDirPage;
Left:= ScaleX(65);
Top:= ScaleY(340);
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 0;
Checked:= False;
end;
DirectXLabel:= TLabel.Create(WizardForm);
with DirectXLabel do
begin
Caption:= ExpandConstant('{cm:DirectX}');
Left:= ScaleX(90);
Top:= ScaleY(340);
Width:= ScaleX(150);
Height:= ScaleY(13);
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @DirectXLabelOnClick;
end;
Icons:= TCheckBox.Create(WizardForm);
with Icons do
begin
Parent:= WizardForm.SelectDirPage;
Left:= ScaleX(65);
Top:= ScaleY(360);
Width:= ScaleX(14);
Height:= ScaleY(14);
TabOrder:= 2;
Checked:= False;
end;
IconsLabel:= TLabel.Create(WizardForm);
with IconsLabel do
begin
Caption:=ExpandConstant('{cm:Icons}');
Left:= ScaleX(90);
Top:= ScaleY(360);
Width:= ScaleX(150);
Height:= ScaleY(13);
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.SelectDirPage;
OnClick:= @IconsOnClick;
end;
NeedSpaceLabel:= TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent:= WizardForm.SelectDirPage;
Left:= ScaleX(65);
Top:= ScaleY(420);
Width:= ScaleX(209);
Height:= ScaleY(13);
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent:= True;
end;
FreeSpaceLabel:= TLabel.Create(WizardForm);
with FreeSpaceLabel do
begin
Parent:= WizardForm.SelectDirPage;
Left:= ScaleX(65);
Top:= ScaleY(440);
Width:= ScaleX(209);
Height:= ScaleY(13);
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent:= True;
end;
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
////////////////////// SelectDirPage //////////////////////
////////////////////// ProgrammGroupPage //////////////////////
PageNameLabel2:= TLabel.Create(WizardForm);
with PageNameLabel2 do
begin
Left:= ScaleX(65);
Top:= ScaleY(185);
Width:= ScaleX(350);
Height:= ScaleY(30);
AutoSize:= False;
Font.Name:= 'Georgia';
Font.Size:= 13;
Font.Style:= [fsBold];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.SelectProgramGroupPage;
end;
PageDescriptionLabel2:= TLabel.Create(WizardForm);
with PageDescriptionLabel2 do
begin
Left:=ScaleX(95);
Top:= ScaleY(215);
Width:= ScaleX(600);
Height:= ScaleY(50);
AutoSize:= False;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Wordwrap:= True;
Transparent := True;
Parent:= WizardForm.SelectProgramGroupPage;
end;
SelectStartMenuFolderBrowseLabel:=TLabel.Create(WizardForm)
with SelectStartMenuFolderBrowseLabel do
begin
Left:= ScaleX(120);
Top:= ScaleY(250);
Width:= ScaleX(600);
Height:= ScaleY(50);
AutoSize:= False;
WordWrap:= True;
Font.Name:= 'Georgia';
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
WordWrap:=True
Transparent:=True
Caption:=ExpandConstant('{cm:StartMenuLbl}')
Parent:=WizardForm.SelectProgramGroupPage
end;
WizardForm.NoIconsCheck.Show;
WizardForm.NoIconsCheck.Left := ScaleX(65);
WizardForm.NoIconsCheck.Top := ScaleY(440);
WizardForm.NoIconsCheck.Width := ScaleX(13);
WizardForm.NoIconsCheck.Height := ScaleY(13);
WizardForm.NoIconsCheck.OnClick := @CheckStartMenuOnClick;
WizardForm.NoIconsCheck.Parent := WizardForm.SelectProgramGroupPage;
NoIconsLabel:= TLabel.Create(WizardForm);
with NoIconsLabel do
begin
Caption:=WizardForm.NoIconsCheck.Caption
Left:= ScaleX(90);
Top:= ScaleY(440);
Width:= ScaleX(150);
Height:= ScaleY(13);
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.SelectProgramGroupPage
OnClick := @CheckNoIconsCheck;
end;
with WizardForm do
begin
GroupEdit.Left:= ScaleX(120);
GroupEdit.Top:= ScaleY(305);
GroupEdit.Width:= ScaleX(460);
GroupEdit.Font.Size:=9
GroupBrowseButton.Top:= ScaleY(305);
end;
////////////////////// ProgrammGroupPage //////////////////////
////////////////////// InstallingPage //////////////////////
PageNameLabel3:= TLabel.Create(WizardForm);
with PageNameLabel3 do
begin
Left:= ScaleX(65);
Top:= ScaleY(185);
Width:= ScaleX(150);
Height:= ScaleY(20);
AutoSize:= False;
Font.Name:= 'Georgia';
Font.Size:= 13;
Font.Style:= [fsBold];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.InstallingPage;
end;
StatusLabel:= TLabel.Create(WizardForm);
with StatusLabel do
begin
Left:=ScaleX(95);
Top:= ScaleY(215);
Width:= ScaleX(600);
Height:= ScaleY(50);
AutoSize:= False;
Font.Name:= 'Georgia';
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.InstallingPage;
Caption:= ExpandConstant('{cm:Status}')
end;
FilenameLabel:= TLabel.Create(WizardForm);
with FilenameLabel do
begin
Left:= ScaleX(65);
Top:= ScaleY(275);
Width:= ScaleX(625);
Height:= ScaleY(20);
AutoSize:= False;
Font.Name:= 'Georgia'
Font.Size:= 10;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClWhite;
Transparent := True;
Parent:= WizardForm.InstallingPage;
end;
with WizardForm do
begin
ProgressGauge.Top:=ScaleY(310);
ProgressGauge.Left:=ScaleX(100);
ProgressGauge.Width:=ScaleX(590);
end;
////////////////////// InstallingPage //////////////////////
////////////////////// FinishedPage //////////////////////
FinishedHeadingLabel:=TLabel.Create(WizardForm);
with FinishedHeadingLabel do
begin
Left:= ScaleX(70);
Top:= ScaleY(180);
Width:= ScaleX(650);
Height:= ScaleY(65)
AutoSize:= false;
Alignment := taCenter;
WordWrap:= true;
Font.Name:='Georgia';
Font.Size:= 16;
Font.Color:=ClWhite;
Font.Style := [fsBold];
Transparent:= true;
Parent:= WizardForm.FinishedPage;
Caption:= ExpandConstant('{cm:Finished1}');
end;
FinishedLabel:= TLabel.Create(WizardForm);
with FinishedLabel do
begin
Top:= ScaleY(270);
Left:= ScaleX(70);
Width:= ScaleX(650);
Height:= ScaleY(200);
AutoSize:= false;
WordWrap:= true;
Font.Name:= 'Georgia'
Font.Size:= 11;
Font.Style := [fsBold, fsItalic];
Font.Color:=ClWhite;
Transparent:= true;
Parent:= WizardForm.FinishedPage;
Caption:= ExpandConstant('{cm:Finished2}')+#13#13+ExpandConstant('{cm:Finished3}');
end;
end;
////////////////////// FinishedPage //////////////////////
procedure CurPageChanged1(CurPageID: Integer);
begin
PageNameLabel1.Caption:= WizardForm.PageNameLabel.Caption;
PageDescriptionLabel1.Caption:= WizardForm.PageDescriptionLabel.Caption;
PageNameLabel2.Caption:= WizardForm.PageNameLabel.Caption;
PageDescriptionLabel2.Caption:= WizardForm.PageDescriptionLabel.Caption;
PageNameLabel3.Caption:= WizardForm.PageNameLabel.Caption;
if CurPageID=wpSelectProgramGroup then
begin
If WizardForm.FindComponent('NextButton') is TButton
then
TButton(WizardForm.FindComponent('NextButton')).Caption:='Установить';
end;
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;
bidbtnCancelUnpacking: Button := btnCancelUnpacking;
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 := -ScaleX(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 := ScaleX(160);
Image.Height := ScaleY(23);
Image.Enabled := False;
Image.Bitmap.LoadFromFile(ExpandConstant('{tmp}\button.bmp'));
Image.Stretch := True;
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.Autosize := True;
Labl.Alignment := taCenter;
Labl.Tag := AButtonIndex;
Labl.Transparent := True;
Labl.Font.Color := clWhite;
Labl.Font.Style := [fsBold];
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 InitializeWizard2();
begin
WizardForm.BackButton.SetBounds(WizardForm.ClientWidth - ScaleX(8) * 37,
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight));
WizardForm.NextButton.SetBounds(WizardForm.ClientWidth - ScaleX(8) * 26,
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight));
WizardForm.CancelButton.SetBounds(WizardForm.ClientWidth - ScaleX(8)* 15,
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 2, ScaleX(ButtonWidth), ScaleY(ButtonHeight));
WizardForm.DirBrowseButton.SetBounds(WizardForm.ClientWidth - ScaleX(5) * 30,
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 10, ScaleX(ButtonWidth), ScaleY(ButtonHeight));
WizardForm.GroupBrowseButton.SetBounds(WizardForm.ClientWidth - ScaleX(5) * 30,
WizardForm.ClientHeight - ScaleY(ButtonHeight) * 10, ScaleX(ButtonWidth), ScaleY(ButtonHeight));
ExtractTemporaryFile('button.bmp')
LoadButtonImage(WizardForm.BackButton,bidBack)
LoadButtonImage(WizardForm.NextButton,bidNext)
LoadButtonImage(WizardForm.CancelButton,bidCancel)
LoadButtonImage(WizardForm.DirBrowseButton,bidDirBrowse)
LoadButtonImage(WizardForm.GroupBrowseButton,bidGroupBrowse)
end;
procedure CurPageChanged2(CurPageID: Integer);
begin
UpdateButton(WizardForm.BackButton,bidBack)
UpdateButton(WizardForm.NextButton,bidNext)
UpdateButton(WizardForm.CancelButton,bidCancel)
ButtonLabel[bidBack].Left := ButtonPanel[bidBack].Width div 2 - ButtonLabel[bidBack].Width div 2;
ButtonLabel[bidBack].Top := ButtonPanel[bidBack].Height div 2 - ButtonLabel[bidBack].Height div 2;
ButtonLabel[bidNext].Left := ButtonPanel[bidNext].Width div 2 - ButtonLabel[bidNext].Width div 2;
ButtonLabel[bidNext].Top := ButtonPanel[bidNext].Height div 2 - ButtonLabel[bidNext].Height div 2;
ButtonLabel[bidCancel].Left := ButtonPanel[bidCancel].Width div 2 - ButtonLabel[bidCancel].Width div 2;
ButtonLabel[bidCancel].Top := ButtonPanel[bidCancel].Height div 2 - ButtonLabel[bidCancel].Height div 2;
ButtonLabel[bidDirBrowse].Left := ButtonPanel[bidDirBrowse].Width div 2 - ButtonLabel[bidDirBrowse].Width div 2;
ButtonLabel[bidDirBrowse].Top := ButtonPanel[bidDirBrowse].Height div 2 - ButtonLabel[bidDirBrowse].Height div 2;
ButtonLabel[bidGroupBrowse].Left := ButtonPanel[bidGroupBrowse].Width div 2 - ButtonLabel[bidGroupBrowse].Width div 2;
ButtonLabel[bidGroupBrowse].Top := ButtonPanel[bidGroupBrowse].Height div 2 - ButtonLabel[bidGroupBrowse].Height div 2;
if CurPageID = wpSelectDir then
begin
GetNeedSpaceCaption;
if FreeMB < NeedSize then
begin
WizardForm.NextButton.Enabled := False;
ButtonLabel[bidNext].Enabled := False;
ButtonPanel[bidNext].Enabled := False;
end;
end;
end;
//************************************************ [Конец - Текстуры кнопок] ***************************************************//
//************************************************ [Начало - Панель] ***************************************************//
Procedure InitializeWizard3();
Var
CurPageID: Integer;
begin
Welcome := TLabel.Create(WizardForm);
Welcome.Top := ScaleY(94);
Welcome.Left := ScaleX(35);
Welcome.Caption := 'Приветствие';
Welcome.Transparent := True;
Welcome.Font.Size := 10;
Welcome.Font.Name := 'Arial';
Welcome.Font.Style:= [fsBold];
Parameters := TLabel.Create(WizardForm);
Parameters.Top := ScaleY(94);
Parameters.Left := ScaleX(201);
Parameters.Caption:= 'Параметры';
Parameters.Transparent := True;
Parameters.Font.Size := 10;
Parameters.Font.Name := 'Arial';
Parameters.Font.Style:= [fsBold];
StartMenu := TLabel.Create(WizardForm);
StartMenu.Top := ScaleY(94);
StartMenu.Left := ScaleX(355);
StartMenu.Caption := 'Меню "Пуск"';
StartMenu.Transparent := True;
StartMenu.Font.Size := 10;
StartMenu.Font.Name := 'Arial';
StartMenu.Font.Style:= [fsBold];
Installing := TLabel.Create(WizardForm);
Installing.Top := ScaleY(94);
Installing.Left := ScaleX(520);
Installing.Caption := 'Установка';
Installing.Transparent := True;
Installing.Font.Size := 10;
Installing.Font.Name := 'Arial';
Installing.Font.Style:= [fsBold];
Finish := TLabel.Create(WizardForm);
Finish.Left := 400;
Finish.Top := ScaleY(94);
Finish.Left := ScaleX(670);
Finish.Caption := 'Завершение';
Finish.Transparent := True;
Finish.Font.Size := 10;
Finish.Font.Name := 'Arial';
Finish.Font.Style:= [fsBold];
end;
procedure CurPageChanged3(CurPageID: Integer);
begin
Welcome.Font.Color := -16777199;
Parameters.Font.Color := -16777199;
StartMenu.Font.Color := -16777199;
Installing.Font.Color := -16777199;
Finish.Font.Color := -16777199;
if (CurPageID= wpWelcome)or(CurPageID= wpSelectDir)or (CurPageID= wpSelectProgramGroup)or(CurPageID= wpInstalling)or(CurPageID= wpFinished) then
Welcome.Parent := DetectPage(CurPageID);
Parameters.Parent := DetectPage(CurPageID);
StartMenu.Parent := DetectPage(CurPageID);
Installing.Parent := DetectPage(CurPageID);
Finish.Parent := DetectPage(CurPageID);
if CurPageID = wpWelcome then
begin
Welcome.Font.Color := clWhite;
end;
if CurPageID = wpSelectDir then
begin
Parameters.Font.Color := clWhite;
end;
if CurPageID = wpSelectProgramGroup then
begin
StartMenu.Font.Color := clWhite;
end;
if CurPageID = wpInstalling then
begin
Installing.Font.Color := clWhite;
end;
if CurPageID = wpFinished then
begin
Finish.Font.Color := clWhite;
end;
end;
//************************************************ [Конец - Панель] ***************************************************//
//************************************************ [Начало - Музыка] ***************************************************//
function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean;
external 'BASS_Init@files:BASS.dll stdcall delayload';
function BASS_StreamCreateFile(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): DWORD;
external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';
function BASS_Start(): Boolean;
external 'BASS_Start@files:BASS.dll stdcall delayload';
function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean;
external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload';
function BASS_ChannelIsActive(handle: DWORD): Integer;
external 'BASS_ChannelIsActive@files:BASS.dll stdcall delayload';
function BASS_ChannelPause(handle: DWORD): Boolean;
external 'BASS_ChannelPause@files:BASS.dll stdcall delayload';
function BASS_Pause(): Boolean;
external 'BASS_Pause@files:BASS.dll stdcall delayload';
function BASS_Free(): Boolean;
external 'BASS_Free@files:BASS.dll stdcall delayload';
procedure PlayMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := -100
end;
procedure PlayMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := 4
end;
procedure PlayMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if PlayImage.Left <> 100 then PlayImage.Left := -196
end;
procedure PauseMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PauseImage.Left := -132
end;
procedure PauseMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
PauseImage.Left := -36
end;
procedure PauseMouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
if PauseImage.Left <> -132 then PauseImage.Left := -228
end;
procedure MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
PlayImage.Left := -4
PauseImage.Left := 36
end;
procedure PlayButtonOnClick(Sender: TObject);
begin
case BASS_ChannelIsActive(mp3Handle) of
BASS_ACTIVE_PAUSED:
begin
BASS_ChannelPlay(mp3Handle, False);
PlayButton.Hide
PauseButton.Show
end;
end;
end;
procedure PauseButtonOnClick(Sender: TObject);
begin
BASS_ChannelPause(mp3Handle);
PauseButton.Hide
PlayButton.Show
end;
procedure InitializeWizard4();
begin
ExtractTemporaryFile('MusicButton.bmp')
MouseLabel := TLabel.Create(WizardForm)
MouseLabel.Width := WizardForm.Width
MouseLabel.Height := WizardForm.Height
MouseLabel.Autosize := False
MouseLabel.Transparent := True
MouseLabel.OnMouseMove := @MouseMove
MouseLabel.Parent := WizardForm
PlayButton := TPanel.Create(WizardForm)
PlayButton.Left := ScaleX(762)
PlayButton.Top := ScaleY(3)
PlayButton.Width := 25
PlayButton.Height := 23
PlayButton.Cursor := crHand
PlayButton.ShowHint := True
PlayButton.Hint := 'Воспроизведение музыки'
PlayButton.OnClick := @PlayButtonOnClick
PlayButton.Parent := WizardForm
PlayImage := TBitmapImage.Create(WizardForm)
PlayImage.Left := 0
PlayImage.Top := 0
PlayImage.Width := 288
PlayImage.Height := 23
PlayImage.Enabled := False
PlayImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp'))
PlayImage.Parent := PlayButton
PlayImage.ReplaceColor:=$E2E2E2
PlayImage.ReplaceWithColor:=clBtnFace
PlayLabel := TLabel.Create(WizardForm)
PlayLabel.Width := PlayButton.Width
PlayLabel.Height := PlayButton.Height
PlayLabel.Autosize := False
PlayLabel.Transparent := True
PlayLabel.OnClick := @PlayButtonOnClick
PlayLabel.OnMouseDown := @PlayMouseDown
PlayLabel.OnMouseUp := @PlayMouseUp
PlayLabel.OnMouseMove := @PlayMouseMove
PlayLabel.Parent := PlayButton
PauseButton := TPanel.Create(WizardForm)
PauseButton.Left := ScaleX(762)
PauseButton.Top := ScaleY(3)
PauseButton.Width := 25
PauseButton.Height := 23
PauseButton.Cursor := crHand
PauseButton.ShowHint := True
PauseButton.Hint := 'Приостановить музыку'
PauseButton.OnClick := @PauseButtonOnClick
PauseButton.Parent := WizardForm
PauseImage := TBitmapImage.Create(WizardForm)
PauseImage.Left := -36
PauseImage.Top := 0
PauseImage.Width := 288
PauseImage.Height := 23
PauseImage.Enabled := False
PauseImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\MusicButton.bmp'))
PauseImage.Parent := PauseButton
PauseImage.ReplaceColor:=$E2E2E2
PauseImage.ReplaceWithColor:=clBtnFace
PauseLabel := TLabel.Create(WizardForm)
PauseLabel.Width := PauseButton.Width
PauseLabel.Height := PauseButton.Height
PauseLabel.Autosize := False
PauseLabel.Transparent := True
PauseLabel.OnClick := @PauseButtonOnClick
PauseLabel.OnMouseDown := @PauseMouseDown
PauseLabel.OnMouseUp := @PauseMouseUp
PauseLabel.OnMouseMove := @PauseMouseMove
PauseLabel.Parent := PauseButton
end;
//************************************************ [Конец - Музыка] ***************************************************//
//************************************************ [Начало - Скин] ***************************************************//
procedure LoadSkin(lpszPath: {#PStr}; lpszIniFileName: {#PStr});
external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
procedure LoadSkinUninst(lpszPath: {#PStr}; lpszIniFileName: {#PStr});
external 'LoadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
procedure UnloadSkin();
external 'UnloadSkin@files:isskin.dll stdcall delayload setuponly';
procedure UnloadSkinUninst();
external 'UnloadSkin@{tmp}\isskin.dll stdcall delayload uninstallonly';
function ShowWindow(hWnd: Integer; uType: Integer): Integer;
external 'ShowWindow@user32.dll stdcall';
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('BASS.dll');
ExtractTemporaryFile('Music.mp3');
mp3Name := ExpandConstant('{tmp}\Music.mp3');
BASS_Init(-1, 44100, 0, 0, 0);
mp3Handle := BASS_StreamCreateFile(FALSE, PChar(mp3Name), 0, 0, BASS_SAMPLE_LOOP);
BASS_Start();
BASS_ChannelPlay(mp3Handle, False);
Result := True;
ExtractTemporaryFile('Tiger.cjstyles');
LoadSkin(ExpandConstant('{tmp}\Tiger.cjstyles'), '');
Result := True;
end;
function InitializeUninstall(): Boolean; //////////////////// Обратить внимание
begin
FileCopy(ExpandConstant('{app}\isskin.dll'), ExpandConstant('{tmp}\isskin.dll'), True);
FileCopy(ExpandConstant('{app}\Tiger.cjstyles'), ExpandConstant('{tmp}\Tiger.cjstyles'), True);
LoadSkinUninst(ExpandConstant('{tmp}\Tiger.cjstyles'), '');
Result := True;
end;
procedure DeinitializeUninstall();
begin
UnloadSkinUninst();
end;
//************************************************ [Конец - Скин] ***************************************************//
//************************************************ [Начало - Язык игры] ***************************************************//
function Lang: Boolean;
begin
Result:= rus;
end;
procedure ImageClick(Sender: TObject);
begin
case TLabel(Sender).Tag of
0: begin
pnl_ru.BevelInner:= bvLowered;
pnl_ru.Top:= ScaleY(381);
pnl_ru.Left:= ScaleX(320);
pnl_ru.Width:= ScaleX(42);
pnl_ru.Height:= ScaleY(30);
pnl_us.BevelInner:= bvSpace;
pnl_us.Top:= ScaleY(381);
pnl_us.Left:= ScaleX(380);
pnl_us.Width:= ScaleX(46);
pnl_us.Height:= ScaleY(33);
LanguageLabel2.Caption:= 'Русский';
rus:= True;
end;
1: begin
pnl_ru.BevelInner:= bvSpace;
pnl_ru.Top:= ScaleY(381);
pnl_ru.Left:= ScaleX(319);
pnl_ru.Width:= ScaleX(46);
pnl_ru.Height:= ScaleY(33);
pnl_us.BevelInner:= bvLowered;
pnl_us.Top:= ScaleY(381);
pnl_us.Left:= ScaleX(381);
pnl_us.Width:= ScaleX(42);
pnl_us.Height:= ScaleY(30);
LanguageLabel2.Caption:= 'English';
rus:= False;
end;
end;
end;
procedure InitializeWizard5();
begin
ExtractTemporaryFile('ru.bmp');
ExtractTemporaryFile('us.bmp');
LanguageLabel1 := TLabel.Create(WizardForm);
with LanguageLabel1 do
begin
Parent := WizardForm.SelectDirPage;
Top:= ScaleY(390);
Left:= ScaleX(90);
Width:= ScaleX(50);
Height:= ScaleY(15);
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Transparent:= True;
Caption:= ExpandConstant('{cm:Language}');
end;
LanguageLabel2 := TLabel.Create(WizardForm);
with LanguageLabel2 do
begin
Parent := WizardForm.SelectDirPage;
Top:= ScaleY(390);
Left:= ScaleX(250);
Width:= ScaleX(50);
Height:= ScaleY(15);
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Style:= [fsBold, fsItalic];
Font.Color:= ClYellow;
Transparent:= True;
Caption:= 'Русский';
end;
pnl_ru:= TPanel.Create(WizardForm);
with pnl_ru do
begin
BevelInner:= bvLowered;
Top:= ScaleY(381);
Left:= ScaleX(320);
Width:= ScaleX(42);
Height:= ScaleY(30);
Parent:= WizardForm.SelectDirPage;
with TBitmapImage.Create(pnl_ru) do
begin
Align:= alClient;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\ru.bmp'));
Stretch:= True;
Parent:= pnl_ru;
end;
with TLabel.Create(pnl_ru) do
begin
Align:= alClient;
Transparent:= True;
OnClick:= @ImageClick;
Parent:= pnl_ru;
Cursor:= crHand;
Tag:= 0;
end;
end;
pnl_us:= TPanel.Create(WizardForm);
with pnl_us do
begin
BevelInner:= bvSpace;
Top:= ScaleY(381);
Left:= ScaleX(380);
Width:= ScaleX(46);
Height:= ScaleY(33);
Parent:= WizardForm.SelectDirPage;
with TBitmapImage.Create(pnl_us) do
begin
Align:= alClient;
Bitmap.LoadFromFile(ExpandConstant('{tmp}\us.bmp'));
Stretch:= True;
Parent:= pnl_us;
end;
with TLabel.Create(pnl_us) do
begin
Align:= alClient;
Transparent:= True;
OnClick:= @ImageClick;
Parent:= pnl_us;
Cursor:= crHand;
Tag:= 1;
end;
end;
rus:= True;
end;
//************************************************ [Конец - Язык игры] ***************************************************//
//************************************************ [Начало - Прогресс бар] ***************************************************//
function WrapTimerProc(callback:TProc; paramcount:integer):longword; external 'wrapcallback@files:innocallback.dll stdcall';
function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord; external 'SetTimer@user32.dll stdcall';
function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord; external 'KillTimer@user32.dll stdcall';
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
if CurPageID = wpInstalling then
ProgressBar_Edit.Show;
end;
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
var
CurrWidth : single;
begin
with WizardForm.ProgressGauge do
begin
CurrWidth := ( Position * Width ) / Max;
if intOldCurrWidth <> Round( CurrWidth ) then
begin
intOldCurrWidth := Round( CurrWidth );
ProgressBar_BitmapImage.SetBounds( 0, 0, intOldCurrWidth, ProgressBar_ImageHeight );
ProgressBar_BitmapImage.Show();
end;
end;
end;
procedure CurPageChanged4(CurPageID: Integer);
var
pfunc: LongWord;
begin
if CurPageID = wpInstalling then
begin
pfunc := WrapTimerProc( @OnTimer, 4 );
TimerID := SetTimer( 0, 0, 100, pfunc );
intOldCurrWidth := 0;
end;
if CurPageID = wpFinished then
KillTimer( 0, TimerID );
end;
Procedure InitializeWizard6();
begin
ProgressBar_Edit := TEdit.Create( WizardForm );
with ProgressBar_Edit do
begin
Left := WizardForm.ProgressGauge.Left;
Top := WizardForm.ProgressGauge.Top;
Width := WizardForm.ProgressGauge.Width;
Height := WizardForm.ProgressGauge.Height;
Enabled := False;
ReadOnly := True;
Color := 10789024;
Parent := WizardForm.InstallingPage;
end;
ExtractTemporaryFile( '{#PB_ImageFile}' );
ProgressBar_BitmapImage := TBitmapImage.Create( WizardForm );
with ProgressBar_BitmapImage do
begin
Bitmap.LoadFromFile( ExpandConstant( '{tmp}\' ) + '{#PB_ImageFile}' );
Parent := ProgressBar_Edit;
Stretch := True;
Hide;
end;
ProgressBar_ImageHeight := ProgressBar_Edit.Height - 2;
WizardForm.ProgressGauge.Hide;
end;
procedure DeinitializeSetup();
begin
KillTimer( 0, TimerID );
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin();
BASS_Free();
end;
//************************************************ [Конец - Прогресс бар] ***************************************************//
//************************************************ [Начало - FreeArc] ***************************************************//
type
#ifdef UNICODE ; если у вас ошибка на этой строке, то установите препроцессор или исправьте скрипт для вашей версии Inno Setup
#define A "W"
#else
#define A "A" ; точка входа в SetWindowText, {#A} меняется на A или W в зависимости от версии
// Required for Inno Setup 5.3.0 and higher. (требуется для Inno Setup версии 5.3.0 и ниже)
#endif
#if Ver < 84018176
AnsiString = String; // There is no need for this line in Inno Setup 5.2.4 and above (для Inno Setup версий 5.2.4 и выше эта строка не нужна)
#endif
TMyMsg = record
hwnd: HWND;
message: UINT;
wParam: Longint;
lParam: Longint;
time: DWORD;
pt: TPoint;
end;
TFreeArcCallback = function (what: PAnsiChar; int1, int2: Integer; str: PAnsiChar): Integer;
TArc = record Path: string; OrigSize: Integer; Size: Extended; end;
var
FileNamelbl, ExtractFile: TLabel;
lblExtractFileName: TLabel;
CancelCode, n, UnPackError, StartInstall: Integer;
Arcs: array of TArc;
msgError: string;
lastMb: Integer;
baseMb: Integer;
totalUncompressedSize: Integer; // total uncompressed size of archive data in mb
LastTimerEvent: DWORD;
Function MultiByteToWideChar(CodePage: UINT; dwFlags: DWORD; lpMultiByteStr: string; cbMultiByte: integer; lpWideCharStr: string; cchWideChar: integer): longint; external 'MultiByteToWideChar@kernel32.dll stdcall';
Function WideCharToMultiByte(CodePage: UINT; dwFlags: DWORD; lpWideCharStr: string; cchWideChar: integer; lpMultiByteStr: string; cbMultiByte: integer; lpDefaultChar: integer; lpUsedDefaultChar: integer): longint; external 'WideCharToMultiByte@kernel32.dll stdcall';
function PeekMessage(var lpMsg: TMyMsg; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMyMsg): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMyMsg): Longint; external 'DispatchMessageA@user32.dll stdcall';
Function OemToChar(lpszSrc, lpszDst: AnsiString): longint; external 'OemToCharA@user32.dll stdcall';
function GetWindowLong(hWnd, nIndex: Integer): Longint; external 'GetWindowLongA@user32 stdcall delayload';
function SetWindowText(hWnd: Longint; lpString: String): Longint; external 'SetWindowText{#A}@user32 stdcall delayload';
function GetTickCount: DWord; external 'GetTickCount@kernel32';
function WrapFreeArcCallback (callback: TFreeArcCallback; paramcount: integer):longword; external 'wrapcallback@files:innocallback.dll stdcall';
function FreeArcExtract (callback: longword; cmd1,cmd2,cmd3,cmd4,cmd5,cmd6,cmd7,cmd8,cmd9,cmd10: PAnsiChar): integer; external 'FreeArcExtract@files:unarc.dll cdecl';
procedure AppProcessMessage;
var
Msg: TMyMsg;
begin
while PeekMessage(Msg, 0, 0, 0, PM_REMOVE) do begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;
function cm(Message: String): String; Begin Result:= ExpandConstant('{cm:'+ Message +'}') End;
Function Size64(Hi, Lo: Integer): Extended;
Begin
Result:= Lo;
if Lo<0 then Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
for Hi:= Hi-1 Downto 0 do
Result:= Result + $7FFFFFFF + $7FFFFFFF + 2;
End;
// Converts OEM encoded string into ANSI
// Преобразует OEM строку в ANSI кодировку
function OemToAnsiStr( strSource: AnsiString): AnsiString;
var
nRet : longint;
begin
SetLength( Result, Length( strSource ) );
nRet:= OemToChar( strSource, Result );
end;
// Converts ANSI encoded string into UTF-8
// Преобразует строку из ANSI в UTF-8 кодировку
function AnsiToUtf8( strSource: string ): string;
var
nRet : integer;
WideCharBuf: string;
MultiByteBuf: string;
begin
strSource:= strSource + chr(0);
SetLength( WideCharBuf, Length( strSource ) * 2 );
SetLength( MultiByteBuf, Length( strSource ) * 2 );
nRet:= MultiByteToWideChar( CP_ACP, 0, strSource, -1, WideCharBuf, Length(WideCharBuf) );
nRet:= WideCharToMultiByte( CP_UTF8, 0, WideCharBuf, -1, MultiByteBuf, Length(MultiByteBuf), 0, 0);
Result:= MultiByteBuf;
end;
// OnClick event function for btnCancel
procedure btnCancelUnpackingOnClick(Sender: TObject);
begin
if MsgBox( SetupMessage( msgExitSetupMessage ), mbInformation, MB_YESNO ) = IDYES then
CancelCode:= -127;
end;
var origsize: Integer;
// The callback function for getting info about FreeArc archive
function FreeArcInfoCallback (what: PAnsiChar; Mb, sizeArc: Integer; str: PAnsiChar): Integer;
begin
if string(what)='origsize' then origsize := Mb else
if string(what)='compsize' then else
if string(what)='total_files' then else
Result:= CancelCode;
end;
// Returns decompressed size of files in archive
function ArchiveOrigSize(arcname: string): Integer;
var
callback: longword;
Begin
callback:= WrapFreeArcCallback(@FreeArcInfoCallback,4); //FreeArcInfoCallback has 4 arguments
CancelCode:= 0;
AppProcessMessage;
try
// Pass the specified arguments to 'unarc.dll'
Result:= FreeArcExtract (callback, 'l', '--', AnsiToUtf8(arcname), '', '', '', '', '', '', '');
if CancelCode < 0 then Result:= CancelCode;
if Result >= 0 then Result:= origsize;
except
Result:= -63; // ArcFail
end;
end;
// Scans the specified folders for archives and add them to list
function FindArcs(dir: string): Extended;
var
FSR: TFindRec;
Begin
Result:= 0;
if FindFirst(ExpandConstant(dir), FSR) then begin
try
repeat
// Skip everything but the folders
if FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY > 0 then CONTINUE;
n:= GetArrayLength(Arcs);
// Expand the folder list
SetArrayLength(Arcs, n +1);
Arcs[n].Path:= ExtractFilePath(ExpandConstant(dir)) + FSR.Name;
Arcs[n].Size:= Size64(FSR.SizeHigh, FSR.SizeLow);
Result:= Result + Arcs[n].Size;
Arcs[n].OrigSize := ArchiveOrigSize(Arcs[n].Path)
totalUncompressedSize := totalUncompressedSize + Arcs[n].OrigSize
until not FindNext(FSR);
finally
FindClose(FSR);
end;
end;
End;
// Sets the TaskBar title
Procedure SetTaskBarTitle(Title: String); var h: Integer;
Begin
h:= GetWindowLong(MainForm.Handle, -8); if h <> 0 then SetWindowText(h, Title);
End;
// Converts milliseconds to human-readable time
// Конвертирует милисекунды в человеко-читаемое изображение времени
Function TicksToTime(Ticks: DWord; h,m,s: String; detail: Boolean): String;
Begin
if detail {hh:mm:ss format} then
Result:= PADZ(IntToStr(Ticks/3600000), 2) +':'+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +':'+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2)
else if Ticks/3600 >= 1000 {more than hour} then
Result:= IntToStr(Ticks/3600000) +h+' '+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +m
else if Ticks/60 >= 1000 {1..60 minutes} then
Result:= IntToStr(Ticks/60000) +m+' '+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2) +s
else Result:= IntToStr(Ticks/1000) +s {less than one minute}
End;
// The main callback function for unpacking FreeArc archives
function FreeArcCallback (what: PAnsiChar; Mb, sizeArc: Integer; str: PAnsiChar): Integer;
var
percents, Remaining: Integer;
s: String;
begin
if GetTickCount - LastTimerEvent > 1000 then begin
// This code will be executed once each 1000 ms (этот код будет выполняться раз в 1000 миллисекунд)
// ....
// End of code executed by timer
LastTimerEvent := LastTimerEvent+1000;
end;
if string(what)='filename' then begin
// Update FileName label
lblExtractFileName.Caption:= FmtMessage( cm( 'Extracting' ), [OemToAnsiStr( str )] )
end else if (string(what)='write') and (totalUncompressedSize>0) and (Mb>lastMb) then begin
// Assign to Mb *total* amount of data extracted to the moment from all archives
lastMb := Mb;
Mb := baseMb+Mb;
// Update progress bar
WizardForm.ProgressGauge.Position:= Mb;
// Show how much megabytes/archives were processed up to the moment
percents:= (Mb*1000) div totalUncompressedSize;
s := FmtMessage(cm('ExtractedInfo'), [IntToStr(Mb), IntToStr(totalUncompressedSize)]);
if GetArrayLength(Arcs)>1 then
s := s + '. '+FmtMessage(cm('ArcInfo'), [IntToStr(n+1), IntToStr(GetArrayLength(Arcs))])
ExtractFile.Caption := s
// Calculate and show current percents
percents:= (Mb*1000) div totalUncompressedSize;
s:= FmtMessage(cm('AllProgress'), [Format('%.1n', [Abs(percents/10)])]);
if Mb > 0 then Remaining:= trunc((GetTickCount - StartInstall) * Abs((totalUncompressedSize - Mb)/Mb)) else Remaining:= 0;
if Remaining = 0 then SetTaskBarTitle(cm('ending')) else begin
s:= s + '. '+FmtMessage(cm('remains'), [TicksToTime(Remaining, cm('hour'), cm('min'), cm('sec'), false)])
SetTaskBarTitle(FmtMessage(cm('taskbar'), [IntToStr(percents/10), TicksToTime(Remaining, 'h', 'm', 's', false)]))
end;
FileNameLbl.Caption := s
end;
AppProcessMessage;
Result:= CancelCode;
end;
// Extracts all found archives
function UnPack(Archives: string): Integer;
var
totalCompressedSize: Extended;
callback: longword;
FreeMB, TotalMB: Cardinal;
begin
// Display 'Extracting FreeArc archive'
lblExtractFileName.Caption:= '';
lblExtractFileName.Show;
ExtractFile.caption:= cm('ArcTitle');
ExtractFile.Show;
FileNamelbl.Caption:= '';
FileNamelbl.Show;
// Show the 'Cancel unpacking' button and set it as default button
btnCancelUnpacking.Caption:= WizardForm.CancelButton.Caption;
btnCancelUnpacking.Show;
LoadButtonImage(btnCancelUnpacking,bidbtnCancelUnpacking);
ButtonLabel[bidbtnCancelUnpacking].Left := ButtonPanel[bidbtnCancelUnpacking].Width div 2 - ButtonLabel[bidbtnCancelUnpacking].Width div 2;
ButtonLabel[bidbtnCancelUnpacking].Top := ButtonPanel[bidbtnCancelUnpacking].Height div 2 - ButtonLabel[bidbtnCancelUnpacking].Height div 2;
WizardForm.ActiveControl:= btnCancelUnpacking;
WizardForm.ProgressGauge.Position:= 0;
// Get the size of all archives
totalUncompressedSize := 0;
totalCompressedSize := FindArcs(Archives);
WizardForm.ProgressGauge.Max:= totalUncompressedSize;
// Other initializations
callback:= WrapFreeArcCallback(@FreeArcCallback,4); //FreeArcCallback has 4 arguments
StartInstall:= GetTickCount; {время начала распаковки}
LastTimerEvent:= GetTickCount;
baseMb:= 0
for n:= 0 to GetArrayLength(Arcs) -1 do
begin
lastMb := 0
CancelCode:= 0;
AppProcessMessage;
try
// Pass the specified arguments to 'unarc.dll'
Result:= FreeArcExtract (callback, 'x', '-o+', '-dp' + AnsiToUtf8( ExpandConstant('{app}') ), '--', AnsiToUtf8(Arcs[n].Path), '', '', '', '', '');
if CancelCode < 0 then Result:= CancelCode;
except
Result:= -63; // ArcFail
end;
baseMb:= baseMb+lastMb
// Error occured
if Result <> 0 then
begin
msgError:= FmtMessage(cm('ArcError'), [IntToStr(Result)]);
GetSpaceOnDisk(ExtractFileDrive(ExpandConstant('{app}')), True, FreeMB, TotalMB);
case Result of
-1: if FreeMB < 32 {Мб на диске} then msgError:= SetupMessage(msgDiskSpaceWarningTitle)
else msgError:= msgError + #13#10 + FmtMessage(cm('ArcBroken'), [ExtractFileName(Arcs[n].Path)]);
-127: msgError:= cm('ArcBreak'); //Cancel button
-63: msgError:= cm('ArcFail');
end;
// MsgBox(msgError, mbInformation, MB_OK); //сообщение показывается на странице завершения
Log(msgError);
Break; //прервать цикл распаковки
end;
end;
// Hide labels and button
FileNamelbl.Hide;
lblExtractFileName.Hide;
ExtractFile.Hide;
btnCancelUnpacking.Hide;
ButtonPanel[bidbtnCancelUnpacking].Hide;
ButtonImage[bidbtnCancelUnpacking].Hide;
ButtonLabel[bidbtnCancelUnpacking].Hide;
end;
procedure CurStepChanged2(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
begin
FileNameLabel.Hide
UnPackError:= UnPack(Archives) /// вернуть на мэсто
if UnPackError = 0 then
SetTaskBarTitle(SetupMessage(msgSetupAppTitle))
else
begin
// Error occured, uninstall it then
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n); //откат установки из-за ошибки unarc.dll
SetTaskBarTitle(SetupMessage(msgErrorTitle))
WizardForm.Caption:= SetupMessage(msgErrorTitle) +' - '+ cm('ArcBreak')
end;
end;
end;
// стандартный способ отката (не нужна CurPageChanged), но архивы распаковываются до извлечения файлов инсталлятора
// if CurStep = ssInstall then
// if UnPack(Archives) <> 0 then Abort;
Procedure CurPageChanged5(CurPageID: Integer);
Begin
if (CurPageID = wpFinished) and (UnPackError <> 0) then
begin // Extraction was unsuccessful (распаковщик вернул ошибку)
// Show error message
FinishedHeadingLabel.Caption:= ExpandConstant('{cm:Finished4}');
FinishedLabel.Caption:= SetupMessage(msgSetupAborted)+#13#13+ExpandConstant('{cm:Finished3}');
end;
End;
procedure InitializeWizard7();
begin
with WizardForm.ProgressGauge do
begin
// Create a label to show current FileName being extracted
lblExtractFileName:= TLabel.Create(WizardForm);
lblExtractFileName.parent:=WizardForm.InstallingPage;
lblExtractFileName.autosize:=false;
lblExtractFileName.Left:= ScaleX(65);
lblExtractFileName.Top:= ScaleY(275);
lblExtractFileName.Width:= ScaleX(625);
lblExtractFileName.Height:= ScaleY(20);
lblExtractFileName.Caption:= '';
lblExtractFileName.Transparent := True;
lblExtractFileName.Font.Name:= 'Georgia'
lblExtractFileName.Font.Size:= 10;
lblExtractFileName.Font.Style:= [fsBold, fsItalic];
lblExtractFileName.Hide;
// Create a label to show percentage
ExtractFile:= TLabel.Create(WizardForm);
ExtractFile.parent:=WizardForm.InstallingPage;
ExtractFile.autosize:=false;
ExtractFile.Left:= ScaleX(82);
ExtractFile.Top:= ScaleY(350);
ExtractFile.Width:= ScaleX(625);
ExtractFile.Height:= ScaleY(20);
ExtractFile.Alignment := taCenter;
ExtractFile.caption:= '';
ExtractFile.Transparent := True;
ExtractFile.Font.Name:= 'Georgia'
ExtractFile.Font.Size:= 10;
ExtractFile.Font.Style:= [fsBold, fsItalic];
ExtractFile.Hide;
FileNamelbl:= TLabel.Create(WizardForm);
FileNamelbl.parent:=WizardForm.InstallingPage;
FileNamelbl.autosize:=false;
FileNamelbl.Left:= ScaleX(82);
FileNamelbl.Top:= ScaleY(380);
FileNamelbl.Width:= ScaleX(625);
FileNamelbl.Height:= ScaleY(20);
FileNamelbl.Alignment := taCenter;
FileNamelbl.caption:= '';
FileNamelbl.Transparent := True;
FileNamelbl.Font.Name:= 'Georgia'
FileNamelbl.Font.Size:= 10;
FileNamelbl.Font.Style:= [fsBold, fsItalic];
FileNamelbl.Hide;
end;
// Create a 'Cancel unpacking' button and hide it for now.
btnCancelUnpacking:=TButton.create(WizardForm);
btnCancelUnpacking.Parent:= WizardForm;
btnCancelUnpacking.SetBounds(WizardForm.CancelButton.Left, WizardForm.CancelButton.top, WizardForm.CancelButton.Width, WizardForm.CancelButton.Height);
btnCancelUnpacking.OnClick:= @btnCancelUnpackingOnClick;
btnCancelUnpacking.Hide;
end;
//************************************************ [Конец - FreeArc] ***************************************************//
procedure CurPageChanged(CurPageID: Integer);
begin
CurPageChanged1(CurPageID);
CurPageChanged2(CurPageID);
CurPageChanged3(CurPageID);
CurPageChanged4(CurPageID);
CurPageChanged5(CurPageID);
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
//CurStepChanged1(CurStep);
CurStepChanged2(CurStep);
end;
Procedure InitializeWizard();
begin
InitializeWizard1();
InitializeWizard2();
InitializeWizard3();
InitializeWizard4();
InitializeWizard5();
InitializeWizard6();
InitializeWizard7();
end;
[/more]