Ru-Board.club
← Вернуться в раздел «Программы»

» Inno Setup (создание инсталяционных пакетов)

Автор: Kindly
Дата сообщения: 30.06.2011 14:03
All - Cancer_to_Shanghai - известный флудер, которого необходимо забанить за набивание постов. Раньше он был известен под другими никами Sancho_s_Rancho и другие. Не ведитесь на него или сообщите модератору.
Автор: Cancer_to_Shanghai
Дата сообщения: 30.06.2011 14:11
Kindly

Ну и гад же ты! Омерзительный.
Автор: troyan90
Дата сообщения: 30.06.2011 14:17
Alex 17
edit.font.color:=clblack;

vadimsva

Цитата:
Вообще кто-то пользуется этой dll?

еще как пользуются. просто тут одни сплошные репакеры, которым она нафиг не нужна..
п.с. чтото я не нашел на оф сайте 0.3.6. неофициальная чтоли?
Автор: Y4enik32
Дата сообщения: 30.06.2011 14:30
Доброго времени суток.
Помогите прикрутить к этому скрипту (как у Fenix'a) какой нибудь ISDone.
Автор: Alex 17
Дата сообщения: 30.06.2011 14:38
troyan90, можно подробнее?
Автор: troyan90
Дата сообщения: 30.06.2011 15:02
Alex 17
куда еще подробнее? скрипт чтоли тебе написать?

Добавлено:
edit.font.color:=clblack;
вместо edit вставь свое "поле". и радуйся
Автор: Alex 17
Дата сообщения: 30.06.2011 15:59
Не получается, помогите!

Мой основной скрипт - [more=тут]#define MyAppName "F.E.A.R. 3"
#define NeedSize "4219"
#include "Module\Components.iss"
#include "Module\PlayWith.Texture.iss"


[Setup]
Diskspanning=yes
SetupIconFile=10.ico
AppName=F.E.A.R. 3
AppVerName=F.E.A.R. 3
DefaultDirName={pf}\TMTGamer\F.E.A.R. 3
DefaultGroupName=F.E.A.R. 3
DirExistsWarning=no
AppVersion=16.00.20.0275
OutputBaseFilename=setup
OutputDir=E:\Gamer\F3 TMT
VersionInfoCopyright=TMTGamer
AppPublisher=Interactive Entertainment
WizardImageFile=Files\WizardImage.bmp
WizardSmallImageFile=Files\WizardSmallImage.bmp
UninstallDisplayIcon=10.ico
ShowTasksTreeLines=true

[UninstallDelete]
Type: filesandordirs; Name: {app}


[Languages]
Name: rus; MessagesFile: compiler:Languages\Russian.isl

[Tasks]
Name: desktopicon; Description: Создать значок на Рабочем столе; GroupDescription: Дополнительные значки:
Name: Redist; Description: Дополнительное программное обеспечение:
Name: Redist\DirectXCheck; Description: Обновить Microsoft DirectX; Flags: unchecked
Name: Redist\VCCheck; Description: Установить Microsoft Visual C++ Redist; Flags: unchecked

[CustomMessages]
rus.Welcome2=Программа установит игру {#MyAppName} на Ваш компьютер.%n%nРекомендуется закрыть антивирусные пакеты, а также все прочие приложения перед тем, как продолжить.
rus.Finished=Игра {#MyAppName} установлена на Ваш компьютер.%n%nПриложение можно запустить с помощью соответствующего значка.%n%nНажмите «Завершить», чтобы выйти из программы установки.

[Files]
Source: Files\bass.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\sound.mp3; DestDir: {tmp}; Flags: dontcopy
Source: Files\unarc.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\facompress.dll; DestDir: {tmp}; Flags: dontcopy
Source: Files\Logo.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\papka.bmp; DestDir: {tmp}; Flags: dontcopy
Source: Files\Finishe.bmp; DestDir: {tmp}; Flags: dontcopy
Source: "Files\sound.mp3"; DestDir: "{tmp}"; Flags: dontcopy noencryption nocompression
Source: "Files\MusicButton.bmp"; DestDir: "{tmp}"; Flags: dontcopy
Source: "Files\bass.dll"; DestDir: "{tmp}"; Flags: dontcopy
;Source: "C:\Program Files\EA Games\Need for Speed Undercover\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs;

[Run]

Filename: {src}\Redist\DirectX\DXSETUP.exe; StatusMsg: Обновление компонентов DirectX...; Tasks: Redist\DirectXCheck; Flags: waituntilterminated;
Filename: "{src}\Redist\vcredist_x86_ru.exe"; StatusMsg: Установка Microsoft Visual C++ Redist...; Tasks: Redist\VCCheck; Flags: waituntilterminated;

[Icons]
Name: "{group}\F.E.A.R. 3"; Filename: "{app}\F.E.A.R. 3.exe"; WorkingDir: "{app}";
Name: "{group}\Удалить игру"; Filename: "{uninstallexe}";
Name: "{userdesktop}\F.E.A.R. 3"; Filename: "{app}\F.E.A.R. 3.exe"; WorkingDir: "{app}"; Tasks: "desktopicon";

[UninstallDelete]
Type: files; Name: "{app}\Skidrow.ini";

[Code]
var
WelcomeLabel1, WelcomeLabel2, FinishedLabel, FinishedHeadingLabel: TLabel;
PageNameLabel, PageDescriptionLabel: TLabel; Page: TInputQueryWizardPage;


procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
Confirm:=False;
end;

procedure Labels();
begin
WelcomeLabel1:= TLabel.Create(WizardForm);
WelcomeLabel1.AutoSize:= False;
with WizardForm.WelcomeLabel1 do
//координаты WelcomeLabel1
WelcomeLabel1.SetBounds(ScaleX(230), ScaleY(20), ScaleX(300), ScaleY(220));
WelcomeLabel1.Font:= WizardForm.WelcomeLabel1.Font
WelcomeLabel1.Font.Color:= clWhite;
WelcomeLabel1.Transparent:= True;
WelcomeLabel1.WordWrap:= true;
WelcomeLabel1.Caption:= WizardForm.WelcomeLabel1.Caption;
WelcomeLabel1.Parent:= WizardForm.WelcomePage

WelcomeLabel2:= TLabel.Create(WizardForm);
WelcomeLabel2.AutoSize:= False;
with WizardForm.WelcomeLabel2 do
//координаты WelcomeLabel2
WelcomeLabel2.SetBounds(ScaleX(230), ScaleY(100), ScaleX(257), ScaleY(220));
WelcomeLabel2.Font:= WizardForm.WelcomeLabel2.Font
WelcomeLabel2.Font.Color:= clWhite;
WelcomeLabel2.Transparent:= True;
WelcomeLabel2.WordWrap:= true;
WelcomeLabel2.Caption:= ExpandConstant('{cm:Welcome2}');
WelcomeLabel2.Caption:= WizardForm.WelcomeLabel2.Caption;
WelcomeLabel2.Parent:= WizardForm.WelcomePage

WizardForm.WizardSmallBitmapImage.SetBounds(ScaleX(0), ScaleY(0), WizardForm.MainPanel.Width, WizardForm.MainPanel.Height);

PageNameLabel:= TLabel.Create(WizardForm)
with WizardForm.PageNameLabel do
PageNameLabel.SetBounds(Left, Top, Width, Height);
PageNameLabel.Transparent:= True;
PageNameLabel.Font:= WizardForm.PageNameLabel.Font;
PageNameLabel.Font.Color:= clWhite; //цвет надписи
PageNameLabel.Parent:= WizardForm.MainPanel;

PageDescriptionLabel:= TLabel.Create(WizardForm)
with WizardForm.PageDescriptionLabel do
PageDescriptionLabel.SetBounds(Left, Top, Width, Height);
PageDescriptionLabel.Transparent:= True;
PageDescriptionLabel.Font:= WizardForm.PageDescriptionLabel.Font;
PageDescriptionLabel.Font.Color:= clWhite; //цвет надписи
PageDescriptionLabel.Parent:= WizardForm.MainPanel;

FinishedHeadingLabel:= TLabel.Create(WizardForm);
FinishedHeadingLabel.AutoSize:= False;
with WizardForm.FinishedHeadingLabel do
//координаты FinishedHeadingLabel
FinishedHeadingLabel.SetBounds(ScaleX(230), ScaleY(20), ScaleX(292), ScaleY(220));
FinishedHeadingLabel.Font:= WizardForm.FinishedHeadingLabel.Font
FinishedHeadingLabel.Font.Color:= clWhite;
FinishedHeadingLabel.Transparent:= True;
FinishedHeadingLabel.WordWrap:= true;
FinishedHeadingLabel.Parent:= WizardForm.FinishedPage

FinishedLabel:= TLabel.Create(WizardForm);
FinishedLabel.AutoSize:= False;
with WizardForm.FinishedLabel do
//координаты FinishedLabel
FinishedLabel.SetBounds(ScaleX(230), ScaleY(100), ScaleX(257), ScaleY(220));
FinishedLabel.Font:= WizardForm.FinishedLabel.Font
FinishedLabel.Font.Color:= clWhite;
FinishedLabel.Transparent:= True;
FinishedLabel.WordWrap:= true;
FinishedLabel.Parent:= WizardForm.FinishedPage

WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;

WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.FinishedLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
end;


procedure InitializeWizard();
Begin
Page := CreateInputQueryPage(wpWelcome, 'Создание учетной записи','', ' Введите свой ник');
Page.Add(' ', False);
LabelSize();
ButtonTextures();
Labels();
music();
ExtractTemporaryFile('Finishe.bmp');
WizardForm.WizardBitmapImage.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Width:= ScaleX(497);
WizardForm.WizardBitmapImage2.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Finishe.bmp'));
ExtractTemporaryFile('papka.bmp');
WizardForm.SelectDirBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectDirBitmapImage.AutoSize:=true;
WizardForm.SelectGroupBitmapImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\papka.bmp'));
WizardForm.SelectGroupBitmapImage.AutoSize:=true;
End;

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssPostInstall then
SaveStringToFile(ExpandConstant('{app}\Skidrow.ini'), 'PlayerName =' + Page.Values[0] + #13#10, True);
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
UpdateButtons();
FinishedLabel.Caption:= ExpandConstant('{cm:Finished}');
PageNameLabel.Caption:= WizardForm.PageNameLabel.Caption;
//PageDescriptionLabel.Caption:= WizardForm.PageDescriptionLabel.Caption;

FinishedHeadingLabel.Caption:= WizardForm.FinishedHeadingLabel.Caption;

if BASS_ChannelIsActive(mp3Handle) = BASS_ACTIVE_PAUSED then
PlayButton.Show else
PauseButton.Show;

Case CurPageID of
wpWelcome:
begin
PlayButton.Hide;
PauseButton.Hide;
end;

wpSelectDir:
begin
GetNeedSpaceCaption;
if FreeMB < NeedSize then
begin
WizardForm.NextButton.Enabled := False;
ButtonLabel[bidNext].Enabled := False;
ButtonPanel[bidNext].Enabled := False;
end;
end;

wpFinished:
begin
PlayButton.Hide;
PauseButton.Hide;
end;
End;
end;[/more]
А вот дополнительный скрипт с цветами - [more=тут][CustomMessages]
rus.Space=Доступно места на диске:
rus.Space1=Требуется места на диске:

[Files]
Source: Files\button2.bmp; DestDir: {tmp}; Flags: dontcopy

[Code]
const
ButtonWidth = 80;
ButtonHeight = 23;
Color = clblack;

bidBack = 0;
bidNext = 1;
bidCancel = 2;
bidDirBrowse = 3;
bidGroupBrowse = 4;
bidbtnCancelUnpacking = 5;

var
WizardLabel: TLabel;
ButtonPanel: array of TPanel;
ButtonImage: array of TBitmapImage;
ButtonLabel: array of TLabel;
UsedButtons: array of TButton;
ButtonsCount: Integer;
NeedSpaceLabel,FreeSpaceLabel: TLabel;
NeedSize:Integer;
FreeMB, TotalMB: Cardinal;

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;

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) + ' Гб' else
FreeSpaceLabel.Caption := ExpandConstant('{cm:SPACE} ')+ IntToStr(FreeMB)+ ' Мб';
if WizardForm.CurPageID = wpSelectDir then begin //Чтоб не было глюков на других страницах
if FreeMB < NeedSize then begin
WizardForm.NextButton.Enabled := False;
ButtonPanel[bidNext].Enabled:= False;
ButtonLabel[bidNext].Enabled:= False;
end else begin
WizardForm.NextButton.Enabled := True;
ButtonPanel[bidNext].Enabled:= True;
ButtonLabel[bidNext].Enabled:= True; end;
end;
end;

procedure GetNeedSpaceCaption;
begin
if NeedSize > 1024 then
NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ NumToStr(round(NeedSize/1024*100)/100) + ' Гб' else
NeedSpaceLabel.Caption := ExpandConstant('{cm:SPACE1} ')+ NumToStr(NeedSize)+ ' Мб';
end;

procedure LabelSize();
begin
NeedSize:= {#NeedSize};
with WizardForm do
begin
DiskSpaceLabel.Hide;end;
////////////////////// SelectDirPage //////////////////////
NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(202);
Width := ScaleX(209);
Height := ScaleY(13);
end;

FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do
begin
Parent := WizardForm.SelectDirPage;
Left := ScaleX(0);
Top := ScaleY(220);
Width := ScaleX(209);
Height := ScaleY(13);
end;
end;

procedure ButtonLabelClick(Sender: TObject);
var Button: TButton; n, i: Integer;
begin
i:= TLabel(Sender).Tag; ButtonImage[i].Left:= 0
for n:=0 to (ButtonsCount-1) do begin
if i = n then Button:= UsedButtons[n];
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*2
end;

procedure ButtonLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
if ButtonLabel[TLabel(Sender).Tag].Enabled then ButtonImage[TLabel(Sender).Tag].Left:=0
end;

procedure ButtonLabelMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var n, I: Integer;
begin
I:=TLabel(Sender).Tag;
//Сначала восстанавливаем картинку у всех кнопок, так надо иначе могут быть глюки
for n:=0 to (ButtonsCount-1) do begin if (ButtonLabel[n].Enabled)and(ButtonImage[n].Left <> -ButtonWidth*2)and(I<>N) then ButtonImage[n].Left:= 0; end;
//Теперь собственно ставим нужную картинку
if (ButtonLabel[I].Enabled)and(ButtonImage[I].Left <> -ButtonWidth*2) then begin ButtonImage[I].Left:= -ButtonWidth; end;
end;

procedure WizardLabelMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
var n: Integer;
begin
//Т.к Sender'ом выступает WizardLabel то не получится испльзовать индекс кнопки
for n:=0 to (ButtonsCount-1) do if (ButtonLabel[n].Enabled)and(ButtonImage[n].Left <> -ButtonWidth*2) then begin ButtonImage[n].Left:= 0; end;
end;

procedure LoadButtonImage(AButton: TButton);
var n: Integer;
begin
n:=ButtonsCount; SetArrayLength(ButtonPanel, n+1);
SetArrayLength(ButtonImage, n+1); SetArrayLength(ButtonLabel, n+1);
SetArrayLength(UsedButtons, n+1); UsedButtons[n]:= AButton;

ButtonPanel[n]:=TPanel.Create(WizardForm)
ButtonPanel[n].SetBounds(AButton.Left, AButton.Top, AButton.Width, AButton.Height)
ButtonPanel[n].Tag:= n
ButtonPanel[n].Enabled:= AButton.Enabled
ButtonPanel[n].Parent:=AButton.Parent

ButtonImage[n]:=TBitmapImage.Create(WizardForm)
ButtonImage[n].SetBounds(ScaleX(0), ScaleY(0), ScaleX(320), ScaleY(23))
ButtonImage[n].Enabled:=False
ButtonImage[n].Bitmap.LoadFromFile(ExpandConstant('{tmp}\Button2.bmp'))
ButtonImage[n].Parent:=ButtonPanel[n]

with TLabel.Create(WizardForm) do begin
Tag:=n
Parent:=ButtonPanel[n]
Width:=AButton.Width
Height:=AButton.Height
Transparent:=True
OnClick:=@ButtonLabelClick
OnDblClick:=@ButtonLabelClick
OnMouseMove:=@ButtonLabelMove
OnMouseDown:=@ButtonLabelMouseDown
OnMouseUp:=@ButtonLabelMouseUp
end;

ButtonLabel[n]:=TLabel.Create(WizardForm)
ButtonLabel[n].Autosize:=True
ButtonLabel[n].Alignment:=taCenter
ButtonLabel[n].Tag:=n
ButtonLabel[n].Enabled:= AButton.Enabled
ButtonLabel[n].Transparent:=True
ButtonLabel[n].Font.Color:=clWhite
ButtonLabel[n].Caption:=AButton.Caption
ButtonLabel[n].OnClick:=@ButtonLabelClick
ButtonLabel[n].OnDblClick:=@ButtonLabelClick
ButtonLabel[n].OnMouseMove:=@ButtonLabelMove
ButtonLabel[n].OnMouseDown:=@ButtonLabelMouseDown
ButtonLabel[n].OnMouseUp:=@ButtonLabelMouseUp
ButtonLabel[n].Parent:=ButtonPanel[n]

ButtonsCount:= ButtonsCount+1
end;

procedure UpdateButtons();
var n: Integer;
begin
for n:=0 to ButtonsCount-1 do begin
ButtonLabel[n].Caption:=UsedButtons[n].Caption
ButtonPanel[n].Visible:=UsedButtons[n].Visible
if (UsedButtons[n].Enabled = False) then ButtonImage[n].Left:= -ButtonWidth*3 else ButtonImage[n].Left:= 0;
ButtonLabel[n].Enabled:= UsedButtons[n].Enabled;
ButtonPanel[n].Enabled:= UsedButtons[n].Enabled;
//Ставим Left и Top лейбла соразмерно размеру лейбла
ButtonLabel[n].Left:= ButtonPanel[n].Width div 2 - ButtonLabel[n].Width div 2;
ButtonLabel[n].Top:= ButtonPanel[n].Height div 2 - ButtonLabel[n].Height div 2;
end;
end;

procedure LicenceAcceptedRadioOnClick(Sender: TObject);
begin
//Делаем кнопку активной
WizardForm.NextButton.Enabled:= True;
//Обновляем текстурированную кнопку (обновляем активность и текстуру)
UpdateButtons();
end;

procedure LicenceNotAcceptedRadioOnClick(Sender: TObject);
begin
//Делаем кнопку неактивной
WizardForm.NextButton.Enabled:= False;
//Обновляем текстурированную кнопку (обновляем активность и текстуру)
UpdateButtons()
end;

procedure ButtonTextures();
begin
WizardForm.Font.Color:=clWhite;
WizardForm.Color:=Color;
WizardForm.WelcomePage.Color:=Color;
WizardForm.InnerPage.Color:=Color;
WizardForm.FinishedPage.Color:=Color;
WizardForm.LicensePage.Color:=Color;
WizardForm.PasswordPage.Color:=Color;
WizardForm.InfoBeforePage.Color:=Color;
WizardForm.UserInfoPage.Color:=Color;
WizardForm.SelectDirPage.Color:=Color;
WizardForm.SelectComponentsPage.Color:=Color;
WizardForm.SelectProgramGroupPage.Color:=Color;
WizardForm.SelectTasksPage.Color:=Color;
WizardForm.ReadyPage.Color:=Color;
WizardForm.PreparingPage.Color:=Color;
WizardForm.InstallingPage.Color:=Color;
WizardForm.InfoAfterPage.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.DiskSpaceLabel.Color:=Color;
WizardForm.DirEdit.Color:=Color;
WizardForm.GroupEdit.Color:=Color;
WizardForm.PasswordLabel.Color:=Color;
WizardForm.PasswordEdit.Color:=Color;
WizardForm.PasswordEditLabel.Color:=Color;
WizardForm.ReadyMemo.Color:=Color;
WizardForm.TypesCombo.Color:=Color;
WizardForm.WelcomeLabel1.Color:=Color;
WizardForm.InfoBeforeClickLabel.Color:=Color;
WizardForm.MainPanel.Color:=Color;
WizardForm.PageDescriptionLabel.Color:=Color;
WizardForm.ReadyLabel.Color:=Color;
WizardForm.YesRadio.Color:=Color;
WizardForm.NoRadio.Color:=Color;
WizardForm.WelcomeLabel2.Color:=Color;
WizardForm.LicenseLabel1.Color:=Color;
WizardForm.InfoAfterClickLabel.Color:=Color;
WizardForm.ComponentsList.Color:=Color;
WizardForm.ComponentsDiskSpaceLabel.Color:=Color;
WizardForm.BeveledLabel.Color:=Color;
WizardForm.StatusLabel.Color:=Color;
WizardForm.FilenameLabel.Color:=Color;
WizardForm.SelectDirLabel.Color:=Color;
WizardForm.SelectStartMenuFolderLabel.Color:=Color;
WizardForm.SelectComponentsLabel.Color:=Color;
WizardForm.SelectTasksLabel.Color:=Color;
WizardForm.LicenseAcceptedRadio.Color:=Color;
WizardForm.LicenseNotAcceptedRadio.Color:=Color;
WizardForm.UserInfoNameLabel.Color:=Color;
WizardForm.UserInfoNameEdit.Color:=Color;
WizardForm.UserInfoOrgLabel.Color:=Color;
WizardForm.UserInfoOrgEdit.Color:=Color;
WizardForm.PreparingLabel.Color:=Color;
WizardForm.UserInfoSerialLabel.Color:=Color;
WizardForm.UserInfoSerialEdit.Color:=Color;
WizardForm.TasksList.Color:=Color;
WizardForm.RunList.Color:=Color;
WizardForm.SelectDirBrowseLabel.Color:=Color;
WizardForm.SelectStartMenuFolderBrowseLabel.Color:=Color;

WizardLabel:= TLabel.Create(WizardForm)
WizardLabel.SetBounds(ScaleX(0), ScaleY(0), ScaleX(WizardForm.Width), ScaleY(WizardForm.Height))
WizardLabel.Transparent:= True;
WizardLabel.AutoSize:=false;
WizardLabel.OnMouseMove:=@WizardLabelMove
WizardLabel.Parent:= WizardForm;

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:=ScaleX(337)
WizardForm.DirBrowseButton.Width:= ButtonWidth
WizardForm.DirBrowseButton.Height:=ButtonHeight

WizardForm.GroupBrowseButton.Left:=ScaleX(337)
WizardForm.GroupBrowseButton.Width:= ButtonWidth
WizardForm.GroupBrowseButton.Height:=ButtonHeight

WizardForm.LicenseAcceptedRadio.OnClick:=@LicenceAcceptedRadioOnClick

WizardForm.LicenseNotAcceptedRadio.OnClick:=@LicenceNotAcceptedRadioOnClick

ExtractTemporaryFile('button2.bmp')
LoadButtonImage(WizardForm.BackButton)
LoadButtonImage(WizardForm.NextButton)
LoadButtonImage(WizardForm.CancelButton)
LoadButtonImage(WizardForm.DirBrowseButton)
LoadButtonImage(WizardForm.GroupBrowseButton)
//Сначала текстурируются кнопки, затем выполняется процедура которую мы перенесли
WizardForm.DirEdit.OnChange:= @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text + #0;
end;


[/more]
Последний вопрос
Автор: tabak96
Дата сообщения: 30.06.2011 18:51
Привет всем.
Вот мой [more=скрипт.][Setup]
AppId={{F77E21C2-3EB8-4AB3-82FE-28EAB7A7757B}
AppName=Dungeon Siege 3
AppVersion=1.0
AppVerName=Dungeon Siege 3 1.0
AppPublisher=Obsidian
DefaultDirName={pf}\Dungeon Siege 3
DefaultGroupName=Dungeon Siege 3
OutputDir=C:\Install
OutputBaseFilename=setup
Compression=lzma/fast
SolidCompression=true
WizardImageFile=1.bmp
InternalCompressLevel=none
DiskSpanning=true
DiskSliceSize=1457664000

[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl

[Tasks]
Name: desktopicon; Description: {cm:CreateDesktopIcon}; GroupDescription: {cm:AdditionalIcons}; Flags: unchecked

[CustomMessages]
russian.ExtractedFile=Распаковывается файл:
russian.CancelButton=Отменить распаковку
russian.Error=Ошибка распаковки!

[Files]
Source: C:\Games\Dungeon Siege 3\Dungeon Siege III.exe; DestDir: {app}; Flags: ignoreversion
Source: ISDone.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
Source: Include\facompress.dll; DestDir: {tmp}; Flags: dontcopy

[Icons]
Name: {group}\Dungeon Siege 3; Filename: {app}\Dungeon Siege III.exe
Name: {commondesktop}\Dungeon Siege 3; Filename: {app}\Dungeon Siege III.exe; Tasks: desktopicon

[Run]
Filename: {app}\Dungeon Siege III.exe; Description: {cm:LaunchProgram,Dungeon Siege 3}; Flags: nowait postinstall skipifsilent

[Code]
var
LabelPct: TLabel;
LabelCurrFileName: TLabel;
ISDoneProgressBar: TNewProgressBar;
MyCancelButton: TButton;
OveralPct,Cancel:integer;
CallBack:longword;
MyError:boolean;

type
TCallback = function (Pct: integer;CurrentFile:string): longword;

TMessage = record hWnd: HWND; msg, wParam: Word; lParam: LongWord; Time: TFileTime; pt: TPoint; end;

function PeekMessage(var lpMsg: TMessage; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMessage): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMessage): Longint; external 'DispatchMessageA@user32.dll stdcall';

function WrapMyCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:innocallback.dll stdcall';

function ISArcExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: string; DeleteInFile:boolean; callback: longword; Password, CfgFile, WorkPath: String):BOOL; external 'ISArcExtract@files:ISDone.dll stdcall';
function IS7ZipExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: string; DeleteInFile:boolean; callback: longword; Password: String):BOOL; external 'IS7zipExtract@files:ISDone.dll stdcall';
function ISRarExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: string; DeleteInFile:boolean; callback: longword; Password: String):BOOL; external 'ISRarExtract@files:ISDone.dll stdcall';
function ISPrecompExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile: string; DeleteInFile:boolean; callback: longword):BOOL; external 'ISPrecompExtract@files:ISDone.dll stdcall';
function ISSRepExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile, IdxFile: string; DeleteInFile:boolean; callback: longword):BOOL; external 'ISSrepExtract@files:ISDone.dll stdcall';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:string):BOOL; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall';
function StartRecord(RecordFileName:string; AllComponents:longword):BOOL; external 'StartRecord@files:ISDone.dll stdcall';
function CheckPoint(CurComponent:Integer):BOOL; external 'CheckPoint@files:ISDone.dll stdcall';
function StopRecord:BOOL; external 'StopRecord@files:ISDone.dll stdcall';

procedure AppProcessMessage;
var
Msg: TMessage;
begin
while PeekMessage(Msg, 0, 0, 0, 1) do begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
end;

function ProgressCallback(Pct: integer; CurrentFile:string): longword;
begin
if Pct<=ISDoneProgressBar.Max then
ISDoneProgressBar.Position := Pct;
LabelPct.Caption := IntToStr(Pct div 10)+'.'+IntToStr(Pct mod 10)+'%';
LabelCurrFileName.Caption :=ExpandConstant('{cm:ExtractedFile} ')+CurrentFile;

AppProcessMessage;

Result := Cancel;
end;

procedure CancelButtonOnClick(Sender: TObject);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;

procedure InitializeWizard();
begin
ISDoneProgressBar := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar do begin
Left := ScaleX(0);
Top := ScaleY(40);
Width := ScaleX(417);
Max := 1000;
Height := WizardForm.ProgressGauge.Height;
Parent := WizardForm.InstallingPage;
end;
LabelPct := TLabel.Create(WizardForm);
with LabelPct do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Top := WizardForm.ProgressGauge.Top + ScaleY(40);
Alignment := taCenter;
Caption := '';
end;
LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Left := ScaleX(0);
Top := WizardForm.ProgressGauge.Top + ScaleY(25);
Caption := '';
end;
end;

procedure Error;
var n:integer;
begin
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n);
WizardForm.Caption:= ExpandConstant('{cm:Error}');
end;

procedure CurStepChanged(CurStep: TSetupStep);
var ChComp, TmpValue:longword;
begin
if CurStep = ssPostInstall then
if MyError then Error;
if CurStep = ssInstall then begin
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Visible:=false;
MyCancelButton:=TButton.Create(WizardForm);
with MyCancelButton do begin
Parent:=WizardForm;
Width:=ScaleX(135);
Caption:=ExpandConstant('{cm:CancelButton}');
Left:=ScaleX(360);
Top:=WizardForm.cancelbutton.top;
OnClick:=@CancelButtonOnClick;
end;
CallBack:=WrapMyCallback(@ProgressCallback,2);
Cancel:=0;
OveralPct:=0;

// Распаковка всех необходимых файлов в папку {tmp}. Это необходимо для того, чтобы
//выполнять установку в момент ssInstall, и секция [Run] выполнялась после установки.
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp04
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp04.exe');
#endif
#ifdef precomp038
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp038.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef unrar
ExtractTemporaryFile('Unrar.dll');
#endif

// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
ChComp:=0;
#ifdef Components
TmpValue:=1;
if IsComponentSelected('text\rus') then ChComp:=ChComp+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('text\eng') then ChComp:=ChComp+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\rus') then ChComp:=ChComp+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then ChComp:=ChComp+TmpValue; //компонент 4
#endif

StartRecord(ExpandConstant('{src}\records.inf'),ChComp);
repeat
MyError:=true;

if not ISArcExtract ( 0, OveralPct, 0, ExpandConstant('{src}\data1.bin'), ExpandConstant('{app}\data_archive.oaf.srep'), false,CallBack, '', '', '') then break;
if not ISSRepExtract ( 0, OveralPct, 0, ExpandConstant('{app}\data_archive.oaf.srep'), ExpandConstant('{app}\data_archive.oaf'), '', true, CallBack ) then break;
MyError:=false;
until true;
StopRecord;

MyCancelButton.Visible:=false;
WizardForm.CancelButton.Visible:=true;
end;
end;
[/more]
При установке пишет "ISSrepExtract не верно задан входной файл".Подскажите в чем проблема
Автор: Seraph1
Дата сообщения: 30.06.2011 19:51
tabak96
Не верно указал название среп файла в скрипте..
Автор: tabak96
Дата сообщения: 30.06.2011 20:40
Кто нибудь может подкорректировать,что бы нормально было?
Автор: vadimsva
Дата сообщения: 01.07.2011 04:21
troyan90
скорее автор забыл обновить сайт

Так если кто пользуется it download, пусть подскажут как правильно ее юзать
Автор: troyan90
Дата сообщения: 01.07.2011 12:47
vadimsva
там же вроде примеры есть. или они тоже не работают?
нужно библиотеку просто добавить в files и скрипт с функциями включить

Код: [Files]
Source: itdownload.dll; Flags: dontcopy;
#include "it_download.iss"
Автор: Fire Lizard
Дата сообщения: 01.07.2011 12:58
Добрый день

Есть следующий вопрос:

Есть необходимость инсталлировать/деинсталлировать плагин для Adobe Acrobat для программы:

Не подскажете ли как это сделать в Inno Setup?

Или как перевести это со скриптов NSIS в скрипты Inno Setup?

Function InstallWordPickAcrobatPlugin
ReadRegStr $R9 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Acrobat.exe" "Path"
StrCmp $R9 "" next2 copyfile2
copyfile2:
SetOutPath "$R9\plug_ins"
File .\win32-install-dir\StarDict.api
next2:

SetOutPath "$INSTDIR"
FunctionEnd

Function un.DeleteWordPickAcrobatPlugin
ReadRegStr $R9 HKLM "SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Acrobat.exe" "Path"
StrCmp $R9 "" next2 deletefile2
deletefile2:
Delete "$R9\plug_ins\StarDict.api"
next2:

FunctionEnd
Автор: vadimsva
Дата сообщения: 01.07.2011 13:00
troyan90
я знаю что есть примеры, и всяко пробовал, весь косяк в библиотеке, при старте инсталера пишет Cannot import dll.
Автор: Kutsenko
Дата сообщения: 01.07.2011 13:13
Добрый день! Подскажите пожалуйста как можно скрыть меню которое появляется при нажатии пкм на вкладку инсталятора на меню "Пуск". Скрипт уже даным-давно выкладывали на форуме, но к сожалению на семёрке он неработает(.
[more]
[Setup]
AppName=My Program1234
AppVerName=My Program v.1.2
DefaultDirName={pf}\My Program

[Code]
const
GWL_STYLE = (-16);
WS_MINIMIZEBOX = $20000;
WS_SYSMENU = $80000;

function GetWindowLong(Wnd: HWnd; Index: Integer): Longint; external 'GetWindowLongA@user32.dll stdcall';
function SetWindowLong(Wnd: HWnd; Index: Integer; NewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function FindWindowEx(hWndM, hWndC: LongWord; lpszClass, lpszWindow: PChar): LongWord; external 'FindWindowExA@user32.dll stdcall';

Procedure InitializeWizard;
var
TAppHandle: HWND;
begin
TAppHandle:= GetWindowLong(MainForm.Handle,-8);
if TAppHandle <> 0 then
SetWindowLong(TAppHandle,GWL_STYLE,GetWindowLong(TAppHandle,GWL_STYLE) and not (WS_SYSMENU or WS_MINIMIZEBOX));
end;
[/more]
Спасибо!
Автор: Nukloud
Дата сообщения: 01.07.2011 13:18
Пожалуйста помагите!
Почему у меня не отображается прогресс бар при инсталляции вот [more=скрипт]#define MyAppVerName "Duke Nukem Forever(Ukr)"
#define MyAppName "Duke Nukem Forever(Ukr)"
#define DefaultDirName "{pf}\Duke Nukem Forever"
#define DefaultGroupName "Duke Nukem Forever"
#define MyAppExeName "RUN_DNF.exe"
#define NeedSize = 6754;
#define TNeedSize = 6754;
#define Processor = 4000;
#define RAM = 1024;
#define VideoCard = 256;
#define WinVerMajor = 5;
#define WinVerMinor = 1;
#define ServicePack = 2;
;#define ISDone
;#ifdef ISDone
;#define NeedMem 512
#define records

;#define Components
;#ifdef Components
;[Components]
;Name: Localization; Description: {cm:Localization}; Types: full custom; Flags: fixed;
;Name: Localization\English; Description: {cm:English}; Types: full; Flags: exclusive;
;Name: Localization\Russian; Description: {cm:Russian}; Types: custom; Flags: exclusive;
;#endif
;[Files]
;Source: "Localization\English\-"; DestDir: "{app}\"; Components: Localization\English;
;Source: "Localization\Russian\-"; DestDir: "{app}\"; Components: Localization\Russian;

#ifdef records
[Files]
Source: Other\records.inf; DestDir: {tmp}; Flags: dontcopy
#endif

[Setup]
AppId={{2CA04E92-B824-4A1B-87F8-5F6B8BECAA01}
AppName={#MyAppName}
AppVerName={#MyAppVerName}
DefaultDirName={#DefaultDirName}
DefaultGroupName={#DefaultGroupName}
DirExistsWarning=No
OutputBaseFilename=Setup
SetupIconFile=Image\Icon.ico
VersionInfoCopyright=Localized Team
DisableReadyPage=True
AllowNoIcons=yes

#include "Modules\Messages.iss"

[Files]
Source: Image\*.*; Flags: dontcopy;
Source: Other\*.*; Flags: dontcopy;
Source: Image\Icon.ico; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
Source: Other\ISSkin.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
Source: Other\InnoCallback.dll; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;
Source: Other\Grey&Black.cjstyles; DestDir: {app}; Flags: ignoreversion; Attribs: hidden system;

[Run]
;Filename: {src}\Soft\DirectX.exe; WorkingDir: {src}\Soft\; Flags: waituntilterminated; Check: DirectX and not Install; BeforeInstall: DirectXProgress;
;Filename: {src}\Soft\PhysX.exe; WorkingDir: {src}\Soft\; Flags: waituntilterminated; Check: PhysX and not Install; BeforeInstall: PhysXProgress;
;Filename: {src}\Soft\Visual C++ Redist.exe; WorkingDir: {src}\Soft\; Parameters: /Q; Flags: waituntilterminated; Check: visualc and not IsWin64 and not Install; BeforeInstall: visualcProgress;
;Filename: {src}\Soft\Visual C++ Redist.exe; WorkingDir: {src}\Soft\; Parameters: /Q; Flags: waituntilterminated; Check: visualc and IsWin64 and not Install; BeforeInstall: visualcProgress;
[Icons]
Name: {userdesktop}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Check: Desktop and not Install;
Name: {group}\{cm:UninstallProgram,{#MyAppName}}; Filename: {uninstallexe}; Check: NoIcons and not Install;
Name: {group}\{#MyAppName}; Filename: {app}\{#MyAppExeName}; Check: NoIcons and not Install;

[Registry]
Root: HKCU; Subkey: Software\Duke Nukem Forever(Ukr); ValueName: path; ValueType: string; ValueData: {app}; Flags: uninsdeletekey; Check: not Install;

[UninstallDelete]
Type: filesandordirs; Name: {app};

[Code]
const
WFDiskTimerID = 1;
WFSysReqTimerID = 2;
ARTitleTimerID = 2;
BASS_ACTIVE_PAUSED = 3;
BASS_SAMPLE_LOOP = 4;

type
TTimerProc = procedure (h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
TPBProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint;
TALabel = array of TLabel;

var
SystemPage, SelectTasksPage, SelectComponentsPage: TWizardPage;
WizardImg, Workspace, WizardSmallImage, WizardFinishImage, RedistCheck, logo,
Line, Edit, DirFolder, GroupFolder, HardDrivePanel, HDD, RequirementsPanel: Longint;
AppDir, unins, mp3Name, OldDisk: string;
ResultCode, ErrorCode: integer;
MusicButton,mp3Handle, hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn, hCancelUninstBtn,
DesktopCheck, QuickLaunchCheck, DirectXCheck, PhysXCheck, NoIconsCheck, visualcCheck: HWND;
WelcomeLabel1, WelcomeLabel2, RequirementsLbl, ProcessorLbl, VideoCardLbl, SoundCardLbl, RAMLbl, SystemLbl, FinishedLabel,
ProcessorNameLbl, VideoCardNameLbl, SoundCardNameLbl, RAMTotalLbl, SystemNameLbl, NextLbl, FinishedHeadingLabel, PhysXLabel,
PageNameLabel,PageDescriptionLabel, WelcomeLabel1, WelcomeLabel2, SelectDirBrowseLabel, DirEditLabel, TotalSpaceLabel,
NeedSpaceLabel, FreeSpaceLabel, SelectTasksLabel, SelectStartMenuFolderBrowseLabel, GroupEditLabel, NoIconsLabel, SelectDirLabel,
NeedSpaceTLabel, SelectStartMenuFolderLabel, DesktopLabel, DirectXLabel, visualcLabel, RedistLabel, LogoLabel, SelectComponentsLabel: TLabel;
WFButtonFont, UPFButtonFont: TFont;
LogoPanel: TPanel;
LogoImage: TBitmapImage;
FreeMB, TotalMB: Cardinal;
ASysReq, ADisk: TALabel;
Keys: TArrayOfString;
Components, ComponentsList, ProgressInfoLabel2: TLabel;
#ifndef ISDone
MyError: boolean;
PB2Img, PBBkg1Img: Longint;
#endif
#ifndef FreeArc
UnPackError: Integer;
#endif

function sndPlaySound(lpszSoundName: AnsiString; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall';
function WrapTimerProc(callback:TTimerProc; 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';
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function CallBackProc(P:TPBProc;ParamCount:integer):LongWord; external 'wrapcallback@{tmp}\innocallback.dll stdcall delayload';
procedure InitProgressBar(hwnd:thandle; l,t,w,h,speed:integer; clFore, clBack: integer); external 'InitProgressBar@files:IsProgressBar.dll stdcall';
procedure DeinitProgressBar; external 'DeinitProgressBar@files:IsProgressBar.dll stdcall';

procedure FinishFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
begin
if FinishedLabel.Font.Color=$FFFFFF then FinishedLabel.Font.Color:=$0030ff else FinishedLabel.Font.Color:=$FFFFFF;
if FinishedHeadingLabel.Font.Color=$FFFFFF then FinishedHeadingLabel.Font.Color:=$0030ff else FinishedHeadingLabel.Font.Color:=$FFFFFF;
end;

procedure LoadSkin(lpszPath: string; lpszIniFileName: string ); external 'LoadSkin@files:isskin.dll stdcall delayload setuponly';
procedure LoadSkinUninst(lpszPath: string; lpszIniFileName: string ); 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';

procedure ReadEntries();
begin
    RegQueryStringValue(HKCU, 'Software\Duke Nukem Forever(Ukr)', 'path', AppDir);
end;

function InitializeSetup: Boolean;
begin
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
if not FileExists(ExpandConstant('{tmp}\innocallback.dll')) then ExtractTemporaryFile('innocallback.dll');
if not FileExists(ExpandConstant('{tmp}\BASS.dll')) then ExtractTemporaryFile('BASS.dll');
if not FileExists(ExpandConstant('{tmp}\MusicButton.png')) then ExtractTemporaryFile('MusicButton.png');
if not FileExists(ExpandConstant('{tmp}\Music.mp3')) then ExtractTemporaryFile('Music.mp3');
if not FileExists(ExpandConstant('{tmp}\Grey&Black.cjstyles')) then ExtractTemporaryFile('Grey&Black.cjstyles');

LoadSkin(ExpandConstant('{tmp}\Grey&Black.cjstyles'), '');

begin
unins:='unins000.exe';
ReadEntries;
if not (RegValueExists(HKCU, 'Software\Duke Nukem Forever', 'path')) then
Result:=True else
case MsgBox(ExpandConstant('{cm:Game} ') + ExpandConstant('{#MyAppName} ') + ExpandConstant('{cm:MsgBox1}'), mbInformation, MB_YESNOCANCEL or MB_DEFBUTTON3) of
idYes:
Result:=True;
idNo:
if (FileExists(AddBackslash(AppDir) + unins)) then begin
Exec(AddBackslash(AppDir) + unins, '', ExtractFilePath(AddBackslash(AppDir) + unins), SW_SHOW, ewNoWait, ResultCode);
end else begin
MsgBox(ExpandConstant('{cm:MsgBox2} ') + ExpandConstant('{#MyAppName}, ') +#13#10+ ExpandConstant('{cm:MsgBox3}'), mbCriticalError, MB_OK or MB_DEFBUTTON1);
Result:=False;
end;
end;
end;
end;

#include "Modules\botva2.iss"
#include "Modules\Progress Bar.iss"

#ifdef FreeArc
#include "Modules\FreeArc.iss"
#endif

#ifdef ISDone
#include "Modules\ISDone.iss"
#endif

procedure CreateWizardImage;
var
i: integer;
begin
with WizardForm do begin
InnerNotebook.Hide;
OuterNotebook.Hide;
Center;
Color:= $282828;
end;

ExtractTemporaryFile('Workspace.png');
ExtractTemporaryFile('StartImage.png');
ExtractTemporaryFile('EndImage.png');
ExtractTemporaryFile('SmallImage.png');
ExtractTemporaryFile('Line.png');
ExtractTemporaryFile('Edit.png');
ExtractTemporaryFile('button.png');
ExtractTemporaryFile('WFEnter.wav');
ExtractTemporaryFile('Check.wav');
ExtractTemporaryFile('Click.wav');
ExtractTemporaryFile('DirFolder.png');
ExtractTemporaryFile('GroupFolder.png');
ExtractTemporaryFile('CheckBox.png');
ExtractTemporaryFile('HardDrivePanel.png');
ExtractTemporaryFile('HDD.png');
ExtractTemporaryFile('RequirementsPanel.png');
ExtractTemporaryFile('OneProgressImage.png');
ExtractTemporaryFile('TwoProgressImage.png');
ExtractTemporaryFile('ProgressImage.png');

WizardImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\StartImage.png'),ScaleX(0), ScaleY(0),ScaleX(497),ScaleY(313),True,True);
WizardFinishImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\EndImage.png'),ScaleX(0), ScaleY(0),ScaleX(497),ScaleY(313),True,True);
Workspace:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Workspace.png'),ScaleX(30), ScaleY(30),ScaleX(437),ScaleY(253),True,True);
WizardSmallImage:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\SmallImage.png'),ScaleX(0), ScaleY(0),ScaleX(73),ScaleY(55),False,True);
Line:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Line.png'),ScaleX(0), ScaleY(58),ScaleX(497),ScaleY(5),True,True);
Edit:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\Edit.png'),ScaleX(40), ScaleY(157),ScaleX(330),ScaleY(20),True,True);
DirFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\DirFolder.png'),ScaleX(30), ScaleY(70),ScaleX(50),ScaleY(50),True,True);
GroupFolder:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\GroupFolder.png'),ScaleX(30), ScaleY(70),ScaleX(50),ScaleY(50),True,True);
HardDrivePanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\HardDrivePanel.png'),ScaleX(90), ScaleY(203),ScaleX(280),ScaleY(90),True,True);
HDD:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\HDD.png'),ScaleX(30), ScaleY(223),ScaleX(50),ScaleY(50),True,True);
RequirementsPanel:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\RequirementsPanel.png'),ScaleX(10), ScaleY(110),ScaleX(477),ScaleY(146),True,True);

ImgApplyChanges(WizardForm.Handle);
end;

procedure SetStateNewButtons;
begin
with WizardForm.BackButton do begin
BtnSetText(hBackBtn,PAnsiChar(Caption));
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
end;
with WizardForm.NextButton do begin
BtnSetText(hNextBtn,PAnsiChar(Caption));
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
end;
with WizardForm.CancelButton do begin
BtnSetText(hCancelBtn,PAnsiChar(Caption));
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
end;
BtnSetText(hDirBrowseBtn,PAnsiChar(WizardForm.DirBrowseButton.Caption));
BtnSetText(hGroupBrowseBtn,PAnsiChar(WizardForm.GroupBrowseButton.Caption));
end;

procedure WizardFormBtnClick(hBtn:HWND);
var
Btn:TButton;
begin
sndPlaySound(ExpandConstant('{tmp}\Click.wav'),$0001);
case hBtn of
hCancelBtn: Btn:=WizardForm.CancelButton;
hNextBtn: Btn:=WizardForm.NextButton;
hBackBtn: Btn:=WizardForm.BackButton;
hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
end;
Btn.OnClick(Btn);
SetStateNewButtons;
BtnRefresh(hBtn);
end;

procedure WFBtnEnter(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\WFEnter.wav'),$0001);
end;

procedure ButtonsTextures;
begin
WFButtonFont:=TFont.Create;
WFButtonFont.Style:=[fsBold];

with WizardForm.BackButton do begin
hBackBtn:=BtnCreate(WizardForm.Handle,237,297,80,80,ExpandConstant('{tmp}\button.png'),10,False);
BtnSetEvent(hBackBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hBackBtn,WFButtonFont.Handle);
BtnSetFontColor(hBackBtn,$ffffff,$000000,$ffffff,$B6B6B6);
BtnSetCursor(hBackBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle,317,297,80,80,ExpandConstant('{tmp}\button.png'),3,False);
BtnSetEvent(hNextBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hNextBtn,WFButtonFont.Handle);
BtnSetFontColor(hNextBtn,$ffffff,$000000,$ffffff,$B6B6B6);
BtnSetCursor(hNextBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle,408,297,80,80,ExpandConstant('{tmp}\button.png'),10,False);
BtnSetEvent(hCancelBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hCancelBtn,WFButtonFont.Handle);
BtnSetFontColor(hCancelBtn,$ffffff,$000000,$ffffff,$B6B6B6);
BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle,380,126,76,80,ExpandConstant('{tmp}\button.png'),10,False);
BtnSetEvent(hDirBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hDirBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hDirBrowseBtn,$ffffff,$000000,$ffffff,$B6B6B6);
BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
end;

with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,380,126,76,80,ExpandConstant('{tmp}\button.png'),10,False);
BtnSetEvent(hGroupBrowseBtn,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetFont(hGroupBrowseBtn,WFButtonFont.Handle);
BtnSetFontColor(hGroupBrowseBtn,$ffffff,$000000,$ffffff,$B6B6B6);
BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32649));
Width:=0;
Height:=0;
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: PAnsiChar; 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_Stop: Boolean; external 'BASS_Stop@files:BASS.dll stdcall delayload';
function BASS_Free: Boolean; external 'BASS_Free@files:BASS.dll stdcall delayload';

procedure MusicButtonClick(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Click.wav'), $0001);
if BtnGetChecked(MusicButton) then BASS_ChannelPause(mp3Handle)
else if BASS_ChannelIsActive(mp3Handle)=BASS_ACTIVE_PAUSED then BASS_ChannelPlay(mp3Handle, False);
end;

procedure InsertMusic;
begin
MusicButton:=BtnCreate(WizardForm.Handle,ScaleX(470),ScaleY(70),ScaleX(20),ScaleY(20),ExpandConstant('{tmp}\MusicButton.png'),0,True);
BtnSetEvent(MusicButton,BtnClickEventID,WrapBtnCallback(@MusicButtonClick,1));
BtnSetEvent(MusicButton,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(MusicButton,GetSysCursorHandle(32649));

mp3Name:=ExpandConstant('{tmp}\Music.mp3');
BASS_Init(-1,44100,0,0,0);
mp3Handle:=BASS_StreamCreateFile(FALSE,PAnsiChar(mp3Name),0,0,BASS_SAMPLE_LOOP);
BASS_Start;
BASS_ChannelPlay(mp3Handle,False);
end;

function DetectHardware: Integer; external 'hwc_DetectHardware@files:get_hw_caps.dll stdcall';
function GetProcessorName: PAnsiChar; external 'hwc_GetProcessorName@files:get_hw_caps.dll stdcall';
function GetProcessorFreq: Integer; external 'hwc_GetProcessorFreq@files:get_hw_caps.dll stdcall';
function GetVideoCardName: PAnsiChar; external 'hwc_GetVideoCardName@files:get_hw_caps.dll stdcall';
function GetVidMemLocal: Integer; external 'hwc_GetVidMemLocal@files:get_hw_caps.dll stdcall';
function GetPdmWidth: Integer; external 'hwc_GetPdmWidth@files:get_hw_caps.dll stdcall';
function GetPdmHeight: Integer; external 'hwc_GetPdmHeight@files:get_hw_caps.dll stdcall';
function GetSoundCards: Integer; external 'hwc_GetSoundCards@files:get_hw_caps.dll stdcall';
function GetSoundCardName: PAnsiChar; external 'hwc_GetSoundCardName@files:get_hw_caps.dll stdcall';
function GetSystemPhys: Integer; external 'hwc_GetSystemPhys@files:get_hw_caps.dll stdcall';
function GetWindowsName: PAnsiChar; external 'hwc_GetWindowsName@files:get_hw_caps.dll stdcall';

function DelSp(s: string): string;
begin
while Pos(' ',s)>0 do StringChange(s,' ',' ');
Result:=Trim(s);
end;

procedure GroupChange(Sender: TObject);
begin
GroupEditLabel.Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
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 MbOrTB(Float: Extended): string;
begin
if Float<1024 then Result:=NumToStr(Float)+' MB'
else if (Float/1024)<1024 then Result:=NumToStr(Float/1024)+' GB'
else if (Float/(1024*1024))<1024 then Result:=NumToStr(Float/(1024*1024))+' TB';
end;

procedure SysReqFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
var
i:integer;
begin
for i:= 0 to GetArrayLength(ASysReq)-1 do
if ASysReq[i].Font.Color=clLime then ASysReq[i].Font.Color:=$0000FF else ASysReq[i].Font.Color:=clLime;
end;

procedure DiskFlashing(h: Longword; msg: Longword; idevent: Longword; dwTime: Longword);
var
i:integer;
begin
for i:= 0 to GetArrayLength(ADisk)-1 do
if ADisk[i].Font.Color=$FFFFFF then ADisk[i].Font.Color:=$0000FF else ADisk[i].Font.Color:=$FFFFFF;
end;

function GetElementIndex(a:TALabel; lbl:TLabel):integer;
var
i:integer;
f:boolean;
begin
Result:=-1;
f:=False;
for i:=0 to GetArrayLength(a)-1 do
if a[i]=lbl then begin
f:=True;
Break;
end;
if f then Result:=i;
end;

procedure AddLabelToArray(var a:TALabel; lbl:TLabel);
begin
if GetElementIndex(a,lbl)=-1 then begin
SetArrayLength(a,GetArrayLength(a)+1);
a[GetArrayLength(a)-1]:=lbl;
end;
end;

procedure DeleteLabelFromArray(var a:TALabel; lbl:integer);
var
Last,i:integer;
begin
if lbl<>-1 then begin
Last:=GetArrayLength(a)-1;
if lbl<Last then
for i:=lbl to Last-1 do a[i]:=a[i+1];
SetArrayLength(a,Last);
end;
end;

procedure GetFreeSpaceCaption(Sender: TObject);
var
CurrentDisk: String;
i:integer;
begin
CurrentDisk:=ExtractFileDrive(WizardForm.DirEdit.Text);
DirEditLabel.Caption:=MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
if not GetSpaceOnDisk(CurrentDisk,True,FreeMB,TotalMB) then begin
KillTimer(WizardForm.Handle,WFDiskTimerID);
SetArrayLength(ADisk,0);
TotalSpaceLabel.Visible:=False;
FreeSpaceLabel.Visible:=False;
BtnSetEnabled(hNextBtn,False);
WizardForm.NextButton.Enabled:=False;
OldDisk:=CurrentDisk;
Exit;
end;

TotalSpaceLabel.Visible:=True;
FreeSpaceLabel.Visible:=True;

if CurrentDisk<>OldDisk then begin
OldDisk:=CurrentDisk;
TotalSpaceLabel.Caption := ExpandConstant('{cm:TotalSpace} ') + MbOrTB(TotalMb);
FreeSpaceLabel.Caption := ExpandConstant('{cm:FreeSpace} ') + MbOrTB(FreeMb) + ' (' + IntToStr((FreeMb*100) div TotalMB) + ' %)';

if WizardForm.CurPageID = wpSelectDir then begin
if FreeMB>={#TNeedSize} then begin
i:=GetElementIndex(ADisk,FreeSpaceLabel);
if i<>-1 then begin
DeleteLabelFromArray(ADisk,i);
FreeSpaceLabel.Font.Color:=$FFFFFF;
if GetArrayLength(ADisk)=0 then KillTimer(WizardForm.Handle,WFDiskTimerID);
end;
end
else AddLabelToArray(ADisk,FreeSpaceLabel);

if TotalMb>={#TNeedSize} then begin
i:=GetElementIndex(ADisk,TotalSpaceLabel);
if i<>-1 then begin
DeleteLabelFromArray(ADisk,i);
TotalSpaceLabel.Font.Color:=$FFFFFF;
if GetArrayLength(ADisk)=0 then KillTimer(WizardForm.Handle,WFDiskTimerID);
end;
end
else AddLabelToArray(ADisk,TotalSpaceLabel);

if GetArrayLength(ADisk)>0 then SetTimer(WizardForm.Handle,WFDiskTimerID,1000,WrapTimerProc(@DiskFlashing,4));
BtnSetEnabled(hNextBtn,not (GetArrayLength(ADisk)>0));
WizardForm.NextButton.Enabled:=not (GetArrayLength(ADisk)>0);
end;
end;
end;

function Install: Boolean;
begin
if MyError or (UnPackError <> 0) then
Result:= True;
end;

function NoIcons: Boolean;
begin
Result:= BtnGetEnabled(hGroupBrowseBtn);
end;

function Desktop: Boolean;
begin
Result:= BtnGetChecked(DesktopCheck);
end;

function Redist: Boolean;
begin
Result:= BtnGetChecked(RedistCheck);
end;

function DirectX: Boolean;
begin
ProgressInfoLabel.Visible:=False;
Result:= BtnGetChecked(DirectXCheck);
end;

function visualc: Boolean;
begin
ProgressInfoLabel.Visible:=False;
Result:= BtnGetChecked(visualcCheck);
end;

function PhysX: Boolean;
begin
ProgressInfoLabel.Visible:=False;
Result:= BtnGetChecked(PhysXCheck);
end;

procedure NoIconsClick(hBtn:HWND);
var
Check:boolean;
begin
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
Check:=BtnGetChecked(hBtn);
BtnSetEnabled(hGroupBrowseBtn, not Check);
GroupEditLabel.Enabled:=not Check;
if Check then NoIconsLabel.Font.Color:=$00FFFF else NoIconsLabel.Font.Color:=$FFFFFF;
end;

procedure NoIconsLabelClick(Sender:TObject);
begin
BtnSetChecked(NoIconsCheck, not BtnGetChecked(NoIconsCheck));
NoIconsClick(NoIconsCheck);
end;

procedure DesktopClick(hBtn:HWND);
begin
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
if BtnGetChecked(hBtn) then DesktopLabel.Font.Color:=$00FFFF else DesktopLabel.Font.Color:=$FFFFFF;
end;

procedure DesktopLabelClick(Sender:TObject);
begin
BtnSetChecked(DesktopCheck, not BtnGetChecked(DesktopCheck));
DesktopClick(DesktopCheck);
end;

procedure RedistClick(hBtn:HWND);
begin
if BtnGetChecked(RedistCheck) then BtnSetChecked(DirectXCheck, True) else BtnSetChecked(DirectXCheck, False);
if BtnGetChecked(RedistCheck) then BtnSetChecked(visualcCheck, True) else BtnSetChecked(visualcCheck, False);
if BtnGetChecked(RedistCheck) then BtnSetChecked(PhysXCheck, True) else BtnSetChecked(PhysXCheck, False);
if BtnGetChecked(RedistCheck) then DirectXLabel.Font.Color:=$00FFFF else DirectXLabel.Font.Color:=$FFFFFF;
if BtnGetChecked(RedistCheck) then visualcLabel.Font.Color:=$00FFFF else visualcLabel.Font.Color:=$FFFFFF;
if BtnGetChecked(RedistCheck) then PhysXLabel.Font.Color:=$00FFFF else PhysXLabel.Font.Color:=$FFFFFF;
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
if BtnGetChecked(hBtn) then RedistLabel.Font.Color:=$00FFFF else RedistLabel.Font.Color:=$FFFFFF;
end;

procedure RedistLabelClick(Sender:TObject);
begin
BtnSetChecked(RedistCheck, not BtnGetChecked(RedistCheck));
RedistClick(RedistCheck);
end;

procedure DirectXClick(hBtn:HWND);
begin
if BtnGetChecked(DirectXCheck) or BtnGetChecked(visualcCheck) or BtnGetChecked(PhysXCheck) then BtnSetChecked(RedistCheck, True) else BtnSetChecked(RedistCheck, False);
if BtnGetChecked(DirectXCheck) or BtnGetChecked(visualcCheck) or BtnGetChecked(PhysXCheck) then RedistLabel.Font.Color:=$00FFFF else RedistLabel.Font.Color:=$FFFFFF;
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
if BtnGetChecked(hBtn) then DirectXLabel.Font.Color:=$00FFFF else DirectXLabel.Font.Color:=$FFFFFF;
end;

procedure DirectXLabelClick(Sender:TObject);
begin
BtnSetChecked(DirectXCheck, not BtnGetChecked(DirectXCheck));
DirectXClick(DirectXCheck);
end;

procedure DirectXProgress;
begin
StatusLabel.Caption:=ExpandConstant('{cm:DirectX}');
FilenameLabel.Caption:=ExpandConstant('{cm:DirectXInstall}');
ImgSetVisibility(PBImg,False);
ImgSetVisibility(PBBkgImg,False);
ImgSetVisibility(PB2Img,False);
ImgSetVisibility(PBBkg1Img,False);
ImgApplyChanges(WizardForm.Handle);
ProgressInfoLabel2.Hide;
InitProgressBar(WizardForm.Handle, 41, 130, 413, 20, 210, $82FE7A, $282828);
end;

procedure visualcClick(hBtn:HWND);
begin
if BtnGetChecked(visualcCheck) or BtnGetChecked(DirectXCheck) or BtnGetChecked(PhysXCheck) then BtnSetChecked(RedistCheck, True) else BtnSetChecked(RedistCheck, False);
if BtnGetChecked(visualcCheck) or BtnGetChecked(DirectXCheck) or BtnGetChecked(PhysXCheck) then RedistLabel.Font.Color:=$00FFFF else RedistLabel.Font.Color:=$FFFFFF;
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
if BtnGetChecked(hBtn) then visualcLabel.Font.Color:=$00FFFF else visualcLabel.Font.Color:=$FFFFFF;
end;

procedure visualcLabelClick(Sender:TObject);
begin
BtnSetChecked(visualcCheck, not BtnGetChecked(visualcCheck));
visualcClick(visualcCheck);
end;

procedure visualcProgress;
begin
StatusLabel.Caption:=ExpandConstant('{cm:visualc}');
FilenameLabel.Caption:=ExpandConstant('{cm:visualcInstall}');
ImgSetVisibility(PBImg,False);
ImgSetVisibility(PBBkgImg,False);
ImgSetVisibility(PB2Img,False);
ImgSetVisibility(PBBkg1Img,False);
ProgressInfoLabel2.Hide;
ImgApplyChanges(WizardForm.Handle);
DeinitProgressBar;
InitProgressBar(WizardForm.Handle, 41, 130, 413, 20, 70, $82FE7A, $282828);
end;

procedure PhysXClick(hBtn:HWND);
begin
if BtnGetChecked(PhysXCheck) or BtnGetChecked(DirectXCheck) or BtnGetChecked(visualcCheck) then BtnSetChecked(RedistCheck, True) else BtnSetChecked(RedistCheck, False);
if BtnGetChecked(PhysXCheck) or BtnGetChecked(DirectXCheck) or BtnGetChecked(visualcCheck) then RedistLabel.Font.Color:=$00FFFF else RedistLabel.Font.Color:=$FFFFFF;
sndPlaySound(ExpandConstant('{tmp}\Check.wav'), $0001);
if BtnGetChecked(hBtn) then PhysXLabel.Font.Color:=$00FFFF else PhysXLabel.Font.Color:=$FFFFFF;
end;

procedure PhysXLabelClick(Sender:TObject);
begin
BtnSetChecked(PhysXCheck, not BtnGetChecked(PhysXCheck));
PhysXClick(PhysXCheck);
end;

procedure PhysXProgress;
begin
StatusLabel.Caption:=ExpandConstant('{cm:PhysX}');
FilenameLabel.Caption:=ExpandConstant('{cm:PhysXInstall}');
ImgSetVisibility(PBImg,False);
ImgSetVisibility(PBBkgImg,False);
ImgSetVisibility(PB2Img,False);
ImgSetVisibility(PBBkg1Img,False);
ImgApplyChanges(WizardForm.Handle);
ProgressInfoLabel2.Hide;
DeinitProgressBar;
InitProgressBar(WizardForm.Handle, 41, 130, 413, 20, 30, $82FE7A, $282828);
end;


procedure CreatePageComponents;
var
Pdm : string;
vr,VidRam : Longint;
Version : TWindowsVersion;
begin
PageNameLabel:=TLabel.Create(WizardForm);
with PageNameLabel do begin
AutoSize:= False;
WordWrap:= True;
SetBounds(ScaleX(110), ScaleY(10), ScaleX(370), ScaleY(14));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold, fsItalic];
Parent:=WizardForm;
end;
PageDescriptionLabel:=TLabel.Create(WizardForm);
with PageDescriptionLabel do begin
AutoSize:= False;
SetBounds(ScaleX(130), ScaleY(25), ScaleX(330), ScaleY(30));
Wordwrap:= True;
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Parent:=WizardForm;
end;


WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do begin
AutoSize:=False
SetBounds(ScaleX(75), ScaleY(50), ScaleX(350), ScaleY(65));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 13;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold]
Caption:= ExpandConstant('{cm:Welcome1}')+#13#10+('{#MyAppName}');
Parent:=WizardForm;
end;

WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do begin
AutoSize:=False
SetBounds(ScaleX(25), ScaleY(130), ScaleX(450), ScaleY(200));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:Welcome2}');
Parent:=WizardForm;
end;



SystemPage:=CreateCustomPage(wpLicense, ExpandConstant('{cm:Requirements1}'), ExpandConstant('{cm:Requirements2}'));

RequirementsLbl := TLabel.Create(WizardForm);
with RequirementsLbl do begin
AutoSize:=False;
SetBounds(ScaleX(-50), ScaleY(75), ScaleX(605), ScaleY(50));
Alignment:= taCenter;
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Color:=clLime;
Font.Style:=[fsBold, fsItalic];
Caption := ExpandConstant('{cm:Requirements3}');
Parent:=WizardForm;
end;

NextLbl := TLabel.Create(WizardForm);
with NextLbl do begin
AutoSize:=False;
SetBounds(ScaleX(-50), ScaleY(280), ScaleX(605), ScaleY(50));
Alignment:= taCenter;
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Color:=$ffffff;
Font.Style:=[fsBold, fsItalic];
Caption := ExpandConstant('{cm:NextLbl}');
Parent:=WizardForm;
end;



ProcessorLbl := TLabel.Create(WizardForm);
with ProcessorLbl do begin
AutoSize:=False;
SetBounds(ScaleX(15), ScaleY(113), ScaleX(150), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:=$ffffff;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:Processor}');
Parent := WizardForm;
end;

ProcessorNameLbl := TLabel.Create(WizardForm);
with ProcessorNameLbl do begin
AutoSize:=False;
SetBounds(ScaleX(150), ScaleY(113), ScaleX(350), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:=clLime;
Font.Style:=[fsBold];
Caption := DelSP(GetProcessorName) + ' @' + IntToStr(GetProcessorFreq) + ' MHz';
Parent := WizardForm;
end;

RegGetSubkeyNames(HKLM, 'Hardware\Description\System\CentralProcessor', Keys)

if (GetProcessorFreq*GetArrayLength(Keys)) < {#Processor} then
begin
RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}');
RequirementsLbl.Font.Color := clRed;
AddLabelToArray(AsysReq,ProcessorNameLbl);
end;


VideoCardLbl := TLabel.Create(WizardForm);
with VideoCardLbl do begin
AutoSize:=False;
SetBounds(ScaleX(15), ScaleY(144), ScaleX(150), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:VideoCard}');
Parent := WizardForm;
end;

VideoCardNameLbl := TLabel.Create(WizardForm);
with VideoCardNameLbl do begin
AutoSize:=False;
SetBounds(ScaleX(150), ScaleY(144), ScaleX(350), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:=clLime;
Font.Style:=[fsBold];
Caption := GetVideoCardName;
Parent := WizardForm;
end;

Pdm:=' ['+IntToStr(GetPdmWidth)+'x'+IntToStr(GetPdmHeight)+']';

VidRam:=GetVidMemLocal/1000000;
if (VidRam<63) or (VidRam>1100) then vr:=VidRam
else if VidRam<100 then vr:=64
else if VidRam<200 then vr:=128
else if VidRam<300 then vr:=256
else if VidRam<400 then vr:=384
else if VidRam<600 then vr:=512
else if VidRam<800 then vr:=792
else if VidRam>800 then vr:=1024;

if VidRam=0 then VideoCardNameLbl.Caption:=ExpandConstant('{cm:DeviceDriver}')
else VideoCardNameLbl.Caption:=DelSp(VideoCardNameLbl.Caption)+' ~'+IntToStr(vr)+' MB'+Pdm;
if vr<{#VideoCard} then begin
RequirementsLbl.Caption:=ExpandConstant('{cm:Requirements4}');
RequirementsLbl.Font.Color := clRed;
AddLabelToArray(ASysReq,VideoCardNameLbl);
end;


SoundCardLbl := TLabel.Create(WizardForm);
with SoundCardLbl do begin
AutoSize:=False;
SetBounds(ScaleX(15), ScaleY(175), ScaleX(150), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:SoundCard}');
Parent := WizardForm;
end;

SoundCardNameLbl := TLabel.Create(WizardForm);
with SoundCardNameLbl do begin
AutoSize:=False;
SetBounds(ScaleX(150), ScaleY(175), ScaleX(350), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:=clLime;
Font.Style:=[fsBold];
Caption := GetSoundCardName;
Parent := WizardForm;
end;

if GetSoundCards = 0 then begin
RequirementsLbl.Caption:= ExpandConstant('{cm:Requirements4}');
RequirementsLbl.Font.Color := clRed;
SoundCardNameLbl.Caption:= ExpandConstant('{cm:DeviceDriver}');
AddLabelToArray(ASysReq,SoundCardNameLbl);
end;



RAMLbl := TLabel.Create(WizardForm);
with RAMLbl do begin
AutoSize:=False;
SetBounds(ScaleX(15), ScaleY(206), ScaleX(150), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:RAM}');
Parent := WizardForm;
end;

RAMTotalLbl := TLabel.Create(WizardForm);
with RAMTotalLbl do begin
AutoSize:=False;
SetBounds(ScaleX(150), ScaleY(206), ScaleX(350), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:=clLime;
Font.Style:=[fsBold];
Caption := IntToStr(GetSystemPhys + 1) + ' MB';
Parent := WizardForm;
end;

if (GetSystemPhys+1)<{#RAM} then begin
RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}');
RequirementsLbl.Font.Color := clRed;
AddLabelToArray(ASysReq,RAMTotalLbl);
end;



SystemLbl := TLabel.Create(WizardForm);
with SystemLbl do begin
AutoSize:=False;
SetBounds(ScaleX(15), ScaleY(237), ScaleX(150), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := ExpandConstant('{cm:OperationSystem}');
Parent := WizardForm;
end;

SystemNameLbl := TLabel.Create(WizardForm);
with SystemNameLbl do begin
AutoSize:=False;
SetBounds(ScaleX(150), ScaleY(237), ScaleX(350), ScaleY(22));
Transparent:=True;
Font.Name:= 'Arial';
Font.Size:= 8;
Font.Color:=clLime;
Font.Style:=[fsBold];
Caption := GetWindowsName;
Parent := WizardForm;
end;

GetWindowsVersionEx(Version);

if not Version.NTPlatform or
(Version.NTPlatform and (Version.Major<{#WinVerMajor})) or
(Version.NTPlatform and (Version.Major={#WinVerMajor}) and (Version.Minor<{#WinVerMinor})) or
(Version.NTPlatform and (Version.Major={#WinVerMajor}) and (Version.Minor={#WinVerMinor}) and (Version.ServicePackMajor<{#ServicePack})) then begin
RequirementsLbl.Caption := ExpandConstant('{cm:Requirements4}');
RequirementsLbl.Font.Color := clRed;
AddLabelToArray(ASysReq,SystemNameLbl);
end;



SelectDirLabel := TLabel.Create(WizardForm);
with SelectDirLabel do begin
AutoSize:=False;
SetBounds(ScaleX(85), ScaleY(85), ScaleX(400), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption:= WizardForm.SelectDirLabel.Caption;
Parent := WizardForm;
end;

SelectDirBrowseLabel := TLabel.Create(WizardForm);
with SelectDirBrowseLabel do begin
AutoSize:=False;
SetBounds(ScaleX(40), ScaleY(120), ScaleX(400), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption:= WizardForm.SelectDirBrowseLabel.Caption;
Parent := WizardForm;
end;

DirEditLabel := TLabel.Create(WizardForm);
with DirEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(50), ScaleY(160), ScaleX(446), ScaleY(15));
WordWrap:= True;
ShowAccelChar := False;
Transparent:=True;
Font.Name:= 'Arial'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := MinimizePathName(WizardForm.DirEdit.Text, DirEditLabel.Font, DirEditLabel.Width);
Parent := WizardForm;
end;

TotalSpaceLabel := TLabel.Create(WizardForm);
with TotalSpaceLabel do begin
AutoSize:=False;
SetBounds(ScaleX(100), ScaleY(210), ScaleX(446), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Parent := WizardForm;
end;

FreeSpaceLabel := TLabel.Create(WizardForm);
with FreeSpaceLabel do begin
AutoSize:=False;
SetBounds(ScaleX(100), ScaleY(230), ScaleX(500), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Parent := WizardForm;
end;

NeedSpaceLabel := TLabel.Create(WizardForm);
with NeedSpaceLabel do begin
AutoSize:=False;
SetBounds(ScaleX(100), ScaleY(250), ScaleX(500), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption := ExpandConstant('{cm:NeedSpace} ') + MbOrTB({#NeedSize});
Parent := WizardForm;
end;

NeedSpaceTLabel := TLabel.Create(WizardForm);
with NeedSpaceTLabel do begin
AutoSize:=False;
SetBounds(ScaleX(100), ScaleY(270), ScaleX(500), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia';
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption := ExpandConstant('{cm:TNeedSpace} ') + MbOrTB({#TNeedSize});
Parent := WizardForm;
end;



SelectStartMenuFolderLabel := TLabel.Create(WizardForm);
with SelectStartMenuFolderLabel do begin
AutoSize:=False;
SetBounds(ScaleX(85), ScaleY(85), ScaleX(400), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption:= WizardForm.SelectStartMenuFolderLabel.Caption;
Parent := WizardForm;
end;

SelectStartMenuFolderBrowseLabel := TLabel.Create(WizardForm);
with SelectStartMenuFolderBrowseLabel do begin
AutoSize:=False;
SetBounds(ScaleX(40), ScaleY(120), ScaleX(400), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption:= WizardForm.SelectStartMenuFolderBrowseLabel.Caption;
Parent := WizardForm;
end;

GroupEditLabel := TLabel.Create(WizardForm);
with GroupEditLabel do begin
AutoSize:=False;
SetBounds(ScaleX(50), ScaleY(160), ScaleX(446), ScaleY(15));
WordWrap:= True;
ShowAccelChar := False;
Transparent:=True;
Font.Name:= 'Arial'
Font.Size:= 9;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold];
Caption := MinimizePathName(WizardForm.GroupEdit.Text, GroupEditLabel.Font, GroupEditLabel.Width);
Parent := WizardForm;
end;

NoIconsCheck:=BtnCreate(WizardForm.Handle,ScaleX(40),ScaleY(280),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(NoIconsCheck,BtnClickEventID,WrapBtnCallback(@NoIconsClick,1));
BtnSetEvent(NoIconsCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(NoIconsCheck,GetSysCursorHandle(32649));

NoIconsLabel := TLabel.Create(WizardForm);
with NoIconsLabel do begin
AutoSize:=False;
SetBounds(ScaleX(75), ScaleY(285), ScaleX(275), ScaleY(17));
OnClick:= @NoIconsLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption := WizardForm.NoIconsCheck.Caption;
Parent := WizardForm;
end;

WizardForm.DirEdit.OnChange := @GetFreeSpaceCaption;
WizardForm.DirEdit.Text:= WizardForm.DirEdit.Text;
WizardForm.GroupEdit.OnChange := @GroupChange;



#ifdef Components
ComponentsList := TLabel.Create(WizardForm);
with ComponentsList do begin
WizardForm.ComponentsList.Left:= ScaleX(50)
WizardForm.ComponentsList.Top:= ScaleY(150);
WizardForm.ComponentsList.Width:= ScaleX(400)
WizardForm.ComponentsList.Height:= ScaleY(120)
WizardForm.ComponentsList.Color:= $272727;
WizardForm.ComponentsList.Font.Color:= ClWhite;
WizardForm.ComponentsList.Font.Style:= [fsBold];
WizardForm.ComponentsList.Font.Size:= 8;
WizardForm.ComponentsList.Font.Name:= 'Arial'
WizardForm.ComponentsList.Parent:= WizardForm;
WizardForm.SelectComponentsPage;
end;
SelectComponentsLabel := TLabel.Create(WizardForm);
with SelectComponentsLabel do begin
AutoSize:=False;
SetBounds(ScaleX(50), ScaleY(75), ScaleX(400), ScaleY(70));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption:= ExpandConstant('{cm:SelectComponentsLabel}');
Parent := WizardForm;
end;
#endif


SelectTasksPage := CreateCustomPage(wpSelectProgramGroup, ExpandConstant('{cm:TasksName}'), ExpandConstant('{cm:TasksDescription}'));
SelectTasksLabel := TLabel.Create(WizardForm);
with SelectTasksLabel do begin
AutoSize:=False;
SetBounds(ScaleX(40), ScaleY(75), ScaleX(440), ScaleY(50));
WordWrap:= True;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption:= ExpandConstant('{cm:SelectTasksLabel}');
Parent := WizardForm;
end;

DesktopCheck:=BtnCreate(WizardForm.Handle,ScaleX(40),ScaleY(110),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(DesktopCheck,BtnClickEventID,WrapBtnCallback(@DesktopClick,1));
BtnSetEvent(DesktopCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(DesktopCheck,GetSysCursorHandle(32649));
BtnSetChecked(DesktopCheck,True);

DesktopLabel := TLabel.Create(WizardForm);
with DesktopLabel do begin
AutoSize:=False;
SetBounds(ScaleX(75), ScaleY(116), ScaleX(265), ScaleY(17));
OnClick:= @DesktopLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$00FFFF;
Font.Style:=[fsItalic];
Caption := ExpandConstant('{cm:Desktop}');
Parent := WizardForm;
end;

RedistCheck:=BtnCreate(WizardForm.Handle,ScaleX(40),ScaleY(135),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(RedistCheck,BtnClickEventID,WrapBtnCallback(@RedistClick,1));
BtnSetEvent(RedistCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(RedistCheck,GetSysCursorHandle(32649));
BtnSetChecked(RedistCheck, False);

RedistLabel := TLabel.Create(WizardForm);
with RedistLabel do begin
AutoSize:=False;
SetBounds(ScaleX(75), ScaleY(141), ScaleX(265), ScaleY(17));
OnClick:= @RedistLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption := ExpandConstant('{cm:Redist}');
Parent := WizardForm;
end;

DirectXCheck:=BtnCreate(WizardForm.Handle,ScaleX(70),ScaleY(160),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(DirectXCheck,BtnClickEventID,WrapBtnCallback(@DirectXClick,1));
BtnSetEvent(DirectXCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(DirectXCheck,GetSysCursorHandle(32649));
BtnSetChecked(DirectXCheck, False);

DirectXLabel := TLabel.Create(WizardForm);
with DirectXLabel do begin
AutoSize:=False;
SetBounds(ScaleX(100), ScaleY(166), ScaleX(195), ScaleY(17));
OnClick:= @DirectXLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption := ExpandConstant('{cm:DirectX}');
Parent := WizardForm;
end;

VisualCCheck:=BtnCreate(WizardForm.Handle,ScaleX(70),ScaleY(185),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(VisualCCheck,BtnClickEventID,WrapBtnCallback(@VisualCClick,1));
BtnSetEvent(VisualCCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(VisualCCheck,GetSysCursorHandle(32649));
BtnSetChecked(VisualCCheck, False);

VisualCLabel := TLabel.Create(WizardForm);
with VisualCLabel do begin
AutoSize:=False;
SetBounds(ScaleX(100), ScaleY(191), ScaleX(195), ScaleY(17));
OnClick:= @VisualCLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption := ExpandConstant('{cm:VisualC}');
Parent := WizardForm;
end;

PhysXCheck:=BtnCreate(WizardForm.Handle,ScaleX(70),ScaleY(210),ScaleX(25),ScaleY(25),ExpandConstant('{tmp}\CheckBox.png'),8,True);
BtnSetEvent(PhysXCheck,BtnClickEventID,WrapBtnCallback(@PhysXClick,1));
BtnSetEvent(PhysXCheck,BtnMouseEnterEventID,WrapBtnCallback(@WFBtnEnter,1));
BtnSetCursor(PhysXCheck,GetSysCursorHandle(32649));
BtnSetChecked(PhysXCheck, False);

PhysXLabel := TLabel.Create(WizardForm);
with PhysXLabel do begin
AutoSize:=False;
SetBounds(ScaleX(100), ScaleY(216), ScaleX(195), ScaleY(17));
OnClick:= @PhysXLabelClick;
Cursor:= CrHand;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Caption := ExpandConstant('{cm:PhysX}');
Parent := WizardForm;
end;


StatusLabel := TLabel.Create(WizardForm);
with StatusLabel do begin
AutoSize:=False;
SetBounds(ScaleX(40), ScaleY(80), ScaleX(400), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold,fsItalic];
Parent := WizardForm;
end;

FilenameLabel := TLabel.Create(WizardForm);
with FilenameLabel do begin
AutoSize:=False;
SetBounds(ScaleX(40), ScaleY(100), ScaleX(417), ScaleY(17));
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Parent := WizardForm;
end;

ProgressInfoLabel := TLabel.Create(WizardForm);
with ProgressInfoLabel do
begin
AutoSize:=False;
#ifdef ISDone
SetBounds (420, 132, ScaleX(638), ScaleY(50));
#else
SetBounds (-70, 165, ScaleX(638), ScaleY(50));
Alignment := taCenter;
#endif
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Parent := WizardForm;
end;

ProgressInfoLabel2 := TLabel.Create(WizardForm);
with ProgressInfoLabel2 do
begin
AutoSize:=False;
#ifdef ISDone
SetBounds (-70, 200, ScaleX(638), ScaleY(50));
#else
SetBounds (-70, 190, ScaleX(638), ScaleY(50));
#endif
Alignment := taCenter;
Transparent:=True;
Font.Name:= 'Georgia'
Font.Size:= 8;
Font.Color:=$FFFFFF;
Font.Style:=[fsItalic];
Parent := WizardForm;
end;


FinishedHeadingLabel:= TLabel.Create(WizardForm);
with FinishedHeadingLabel do begin
AutoSize:=False
SetBounds(ScaleX(75), ScaleY(60), ScaleX(350), ScaleY(65));
WordWrap:=True
Alignment := taCenter;
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 13;
Font.Color:=$FFFFFF;
Font.Style:=[fsBold]
Caption:= ExpandConstant('{cm:FinishedHeading}');
Parent:=WizardForm;
end;

FinishedLabel:=TLabel.Create(WizardForm);
with FinishedLabel do begin
AutoSize:=False
SetBounds(ScaleX(75), ScaleY(125), ScaleX(348), ScaleY(200));
WordWrap:=True
Transparent:=True
Font.Name:='Georgia';
Font.Size:= 10;
Font.Color:=$FFFFFF;
Font.Style := [fsBold, fsItalic];
Caption:= ExpandConstant('{cm:FinishedLabel}')+#13#13+ExpandConstant('{cm:FinishedLabel2}');
Parent:=WizardForm;
end;
end;



function InitializeUninstall(): Boolean;
begin
FileCopy(ExpandConstant('{app}\isskin.dll'), ExpandConstant('{tmp}\isskin.dll'), False);
FileCopy(ExpandConstant('{app}\Grey&Black.cjstyles'), ExpandConstant('{tmp}\Grey&Black.cjstyles'), False);
FileCopy(ExpandConstant('{app}\InnoCallback.dll'), ExpandConstant('{tmp}\InnoCallback.dll'), False);
LoadSkinUninst(ExpandConstant('{tmp}\Grey&Black.cjstyles'), '');
Result := True;
end;

procedure DeleteSavedGames(CurUninstallStep: TUninstallStep);
begin
if CurUninstallStep=usUninstall then
if DirExists(ExpandConstant('{commondocs}')+'\-') then
if MsgBox(ExpandConstant('{cm:DeleteSave}'), mbInformation, MB_YESNO) = idYes then
DelTree(ExpandConstant('{commondocs}')+'\-', True, True, True);
end;


procedure HideComponents;
begin
WelcomeLabel1.Hide;
WelcomeLabel2.Hide;
SelectDirLabel.Hide;
SelectDirBrowseLabel.Hide;
DirEditLabel.Hide;
TotalSpaceLabel.Hide;
FreeSpaceLabel.Hide;
NeedSpaceLabel.Hide;
NeedSpaceTLabel.Hide;
NoIconsLabel.Hide;
SelectStartMenuFolderLabel.Hide;
SelectStartMenuFolderBrowseLabel.Hide;
GroupEditLabel.Hide;
RequirementsLbl.Hide;
NextLbl.Hide;
ProcessorLbl.Hide;
ProcessorNameLbl.Hide;
VideoCardLbl.Hide;
VideoCardNameLbl.Hide;
SoundCardLbl.Hide;
SoundCardNameLbl.Hide;
RAMLbl.Hide;
RAMTotalLbl.Hide;
SystemLbl.Hide;
SystemNameLbl.Hide;
SelectTasksLabel.Hide;
DesktopLabel.Hide;
RedistLabel.Hide;
DirectXLabel.Hide;
VisualCLabel.Hide;
PhysXLabel.Hide;
StatusLabel.Hide;
FilenameLabel.Hide;
FinishedHeadingLabel.Hide;
FinishedLabel.Hide;
ProgressInfoLabel.Hide;
ProgressInfoLabel2.Hide;
#ifdef Components
WizardForm.ComponentsList.Hide;
SelectComponentsLabel.Hide;
#endif
#ifdef FreeArc
LabelStatusRollback.Hide;
LabelStatus.Hide;
#endif
#ifdef ISDone
LabelStatusRollback.Hide;
LabelStatus.Hide;
LabelTime1.Hide;
LabelTime2.Hide;
LabelTime3.Hide;
ImgSetVisibility(PBBkg1Img,False);
ImgSetVisibility(PB2Img,False);
#endif
end;

procedure ShowComponents(CurPageID: Integer);
begin
PageNameLabel.Caption:=WizardForm.PageNameLabel.Caption
PageDescriptionLabel.Caption:=WizardForm.PageDescriptionLabel.Caption
if CurPageID > wpWelcome then
if CurPageID < wpFinished then ImgSetVisibility(WizardSmallImage,True);
if CurPageID > wpWelcome then
if CurPageID < wpFinished then ImgSetVisibility(Line,True);
if CurPageID > wpWelcome then
if CurPageID < wpFinished then BtnSetVisibility(MusicButton,True);
case CurPageID of
wpWelcome: begin
ImgSetVisibility(WizardImg,True);
ImgSetVisibility(Workspace,True);
WelcomeLabel1.Show
WelcomeLabel2.Show
end;
SystemPage.ID: begin
ImgSetVisibility(RequirementsPanel,True);
RequirementsLbl.Show;
NextLbl.Show;
ProcessorLbl.Show;
ProcessorNameLbl.Show;
VideoCardLbl.Show;
VideoCardNameLbl.Show;
SoundCardLbl.Show;
SoundCardNameLbl.Show;
RAMLbl.Show;
RAMTotalLbl.Show;
SystemLbl.Show;
SystemNameLbl.Show;
BtnSetVisibility(MusicButton,True);
ImgSetVisibility(WizardSmallImage,True);
ImgSetVisibility(Line,True);
end;
wpSelectDir: begin
ImgSetVisibility(Edit,True);
ImgSetVisibility(DirFolder,True);
ImgSetVisibility(HardDrivePanel,True)
ImgSetPosition(HardDrivePanel, 90, 203, 280, 90);
ImgSetVisibility(HDD,True);
SelectDirLabel.Show
SelectDirBrowseLabel.Show
DirEditLabel.Show;
TotalSpaceLabel.Show;
FreeSpaceLabel.Show;
NeedSpaceLabel.Show;
NeedSpaceTLabel.Show;
BtnSetVisibility(hDirBrowseBtn,True);
end;
#ifdef Components
wpSelectComponents: begin
WizardForm.ComponentsList.Show;
ImgSetVisibility(HardDrivePanel,True);
ImgSetPosition(HardDrivePanel, 49, 149, 402, 122);
SelectComponentsLabel.Show;
end;
#endif
wpSelectProgramGroup: begin
ImgSetVisibility(GroupFolder,True);
ImgSetVisibility(Edit,True);
BtnSetVisibility(hGroupBrowseBtn,True);
BtnSetVisibility(NoIconsCheck,True);
SelectStartMenuFolderLabel.Show;
SelectStartMenuFolderBrowseLabel.Show;
WizardForm.GroupBrowseButton.Show;
GroupEditLabel.Show;
NoIconsLabel.Show;
end;
SelectTasksPage.ID: begin
BtnSetVisibility(DesktopCheck,True);
BtnSetVisibility(RedistCheck,True);
BtnSetVisibility(DirectXCheck,True);
BtnSetVisibility(VisualCCheck,True);
BtnSetVisibility(PhysXCheck,True);
SelectTasksLabel.Show;
DesktopLabel.Show;
RedistLabel.Show;
DirectXLabel.Show;
VisualCLabel.Show;
PhysXLabel.Show;
BtnSetVisibility(MusicButton,True);
ImgSetVisibility(WizardSmallImage,True);
ImgSetVisibility(Line,True);
WizardForm.NextButton.Caption:=SetupMessage(msgButtonInstall);
end;
wpInstalling: begin
StatusLabel.Show;
FilenameLabel.Show;
ProgressInfoLabel.Show;
ProgressInfoLabel2.Show;
#ifdef ISDone
LabelTime1.Show;
LabelTime2.Show;
#endif
end;
wpFinished: begin
ImgSetVisibility(WizardFinishImage,True);
ImgSetVisibility(Workspace,True);
FinishedHeadingLabel.Show;
FinishedLabel.Show;
#ifdef ISDone
LabelTime3.Show;
#endif
end;
end;
end;



procedure AllCancel;
begin
SetWindowLong(WizardForm.ProgressGauge.Handle, -4, PBOldProc);
ImgSetVisibility(PBImg,False);
ImgSetVisibility(PBBkgImg,False);
ImgApplyChanges(WizardForm.Handle);
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
#ifdef FreeArc
UnpackingArc(CurStep);
#endif
#ifdef ISDone
UnpackingISDone(CurStep);
#endif
case CurStep of
ssInstall: begin
if GetArrayLength(ADisk)>0 then begin
KillTimer(WizardForm.Handle,WFDiskTimerID);
    SetArrayLength(ADisk,0);
end;
if GetArrayLength(ASysReq)>0 then begin
KillTimer(WizardForm.Handle,WFSysReqTimerID);
    SetArrayLength(ASysReq,0);
end;
#ifdef ISDone
if MyError or (Cancel <> 0) then
begin
WizardForm.StatusLabel.Hide;
LabelStatusRollback.Show;
FilenameLabel.Hide;
LabelPct.Hide;
#ifdef SecondProgressBar
Label2Pct.Hide;
#endif
ProgressInfoLabel.Hide;
ProgressInfoLabel2.Hide;
LabelCurrFileName.Hide;
LabelStatus.Hide;
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
LabelTime1.Hide;
LabelTime2.Hide;
LabelTime3.Hide;
BtnSetEnabled(CancelUnpackingBtn, False);
BtnSetEnabled(hCancelBtn, False);
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
ImgSetVisibility(PBImg,False);
ImgSetVisibility(PB1Img,False);
ImgSetVisibility(PB2Img,False);
ImgSetVisibility(PBBkgImg,False);
ImgSetVisibility(PBBkg1Img,False);
ImgApplyChanges(WizardForm.Handle);
end;
#endif
#ifdef FreeArc
if (UnPackError <> 0) then
begin
WizardForm.StatusLabel.Hide;
LabelStatusRollback.Show;
FilenameLabel.Hide;
LabelStatus.Hide;
ProgressInfoLabel.Hide;
ProgressInfoLabel2.Hide;
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
BtnSetEnabled(CancelUnpackingBtn, False);
BtnSetEnabled(hCancelBtn, False);
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
ImgSetVisibility(PBImg,False);
ImgSetVisibility(PB1Img,False);
ImgSetVisibility(PBBkgImg,False);
ImgApplyChanges(WizardForm.Handle);
end;
#endif
WizardForm.ProgressGauge.Visible:=False;
#ifndef ISDone
#ifndef FreeArc

PBBkgImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\ProgressBackground.png'),41,130,413,20,True,True);
PBImg:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\ProgressImg.png'),43,132,0,16,True,True);
ImgApplyChanges(WizardForm.Handle);
PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,WndProcCallBack(@PBProc,4));
#endif
#endif
     sTime:=GetTickCount;
eTime:=sTime;
end;
ssPostInstall: AllCancel;
end;
end;

procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
begin
DeleteSavedGames(CurUninstallStep);
end;

procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
if CurPageID=wpInstalling then begin
Confirm:=False;
Cancel:=ExitSetupMsgBox;
if Cancel then begin
AllCancel;
StatusLabel.Caption:=SetupMessage(msgStatusRollback);
FilenameLabel.Hide;
ProgressInfoLabel.Hide;
ProgressInfoLabel2.Hide;
PageNameLabel.Hide;
PageDescriptionLabel.Hide;
WizardForm.CancelButton.Enabled:=False;
end;
end;
end;


procedure LogoLabelOnClick(Sender: TObject);
var
ErrorCode: Integer;
begin
ShellExec('open', 'http://hurtom.com/', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode)
end;

procedure LogoCreate;
begin
LogoPanel := TPanel.Create(WizardForm);
with LogoPanel do
begin
Parent := WizardForm;
Left := ScaleX(0);
Top := ScaleY(315);
Width := ScaleX(190);
Height := ScaleY(50);
BevelOuter := bvNone;

LogoImage := TBitmapImage.Create(WizardForm);
with LogoImage do
begin
Parent := LogoPanel;
Left := ScaleX(0);
Top := ScaleY(0);
AutoSize:=true;
ReplaceColor:=clFuchsia;
ReplaceWithColor:=clBtnFace;
ExtractTemporaryFile('logo.bmp');
Bitmap.LoadFromFile(ExpandConstant('{tmp}\logo.bmp'));

LogoLabel := TLabel.Create(WizardForm);
with LogoLabel do
begin
Parent := LogoPanel;
Width := LogoPanel.Width;
Height := LogoPanel.Height;
Transparent:=True;
Cursor := crHand;
OnClick:=@LogoLabelOnClick;
end;
end;
end
end;

procedure InitializeWizard2;
begin
InsertMusic;
CreateWizardImage;
ButtonsTextures;
CreatePageComponents;
LogoCreate;


#ifdef FreeArc
CreateArcComponents;
#endif

#ifdef ISDone
CreateISDoneComponents;
#endif

end;



procedure CurPageChanged(CurPageID: Integer);
begin
SetStateNewButtons;
HideComponents;
BtnSetVisibility(MusicButton,False);
BtnSetVisibility(hDirBrowseBtn,False);
BtnSetVisibility(hGroupBrowseBtn,False);
ImgSetVisibility(WizardImg,False);
ImgSetVisibility(Workspace,False);
ImgSetVisibility(WizardSmallImage,False);
ImgSetVisibility(Line,False);
ImgSetVisibility(WizardFinishImage,False);
ImgSetVisibility(Edit,False);
ImgSetVisibility(DirFolder,False);
ImgSetVisibility(GroupFolder,False);
ImgSetVisibility(HardDrivePanel,False);
ImgSetVisibility(HDD,False);
ImgSetVisibility(PBImg,False);
ImgSetVisibility(PBBkgImg,False);
BtnSetVisibility(NoIconsCheck,False);
ImgSetVisibility(RequirementsPanel,False);
BtnSetVisibility(DesktopCheck,False);
BtnSetVisibility(RedistCheck,False);
BtnSetVisibility(DirectXCheck,False);
BtnSetVisibility(VisualCCheck,False);
BtnSetVisibility(PhysXCheck,False);

ShowComponents(CurPageID);

#ifdef FreeArc
UnpackingArcFinished(CurPageID);
#endif

#ifdef ISDone
UnpackingISDoneFinished(CurPageID);
#endif

ImgApplyChanges(WizardForm.Handle);

if GetArrayLength(ASysReq)>0 then
if CurPageID=SystemPage.ID then SetTimer(WizardForm.Handle,WFSysReqTimerID,1000,WrapTimerProc(@SysReqFlashing,4))
else KillTimer(WizardForm.Handle,WFSysReqTimerID);

if CurPageID=wpSelectDir then begin
OldDisk:='';
GetFreeSpaceCaption(nil);
end else if GetArrayLength(ADisk)>0 then KillTimer(WizardForm.Handle,WFDiskTimerID);

if CurPageID=wpFinished then begin
#ifdef FreeArc
BtnSetVisibility(CancelUnpackingBtn, False);
#endif
DeinitProgressBar;
end;
end;

procedure DeInitializeSetup();
begin
gdipShutdown;
ShowWindow(StrToInt(ExpandConstant('{wizardhwnd}')), 0);
UnloadSkin;
BASS_Stop;
BASS_Free;
end;

procedure DeinitializeUninstall();
begin
UnloadSkinUninst();
end;



[code]
procedure InitializeWizard1();
begin
WizardForm.Position:=poScreenCenter;
end;

[Code]
procedure InitializeWizard();
begin
InitializeWizard1();
InitializeWizard2();

end;

[/more]
Автор: vovka00723
Дата сообщения: 01.07.2011 19:12
подскажите можно ли как-нибудь узнать размер заданной папки, а именно пустая она или нет?
Автор: tabak96
Дата сообщения: 01.07.2011 21:13
Ребята,помогите мне с скриптом что на предыдущей странице.И скажите как указать в скрипте сколько памяти требуется для установки игры.
Автор: vovka00723
Дата сообщения: 01.07.2011 21:21
tabak96
сколько памяти требуется - смотри с свойствах архивов, смотря с каким словарем ты их паковал
и у тебя скрипт на исдоне 0,4 видимо, возьми лучше сделай на версии 0,5 - она постабильнее
Автор: Despofix
Дата сообщения: 01.07.2011 21:42
использую isdone 0.6 b

в скрипте прописано [more=следующее] if not PrecompInit(PCFVer) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data 1.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISArcExtract ( 0, 0, ExpandConstant('{src}\data 2.bin'), ExpandConstant('{app}'), '', false, '', '', ExpandConstant('{app}'), notPCFonFLY {PCFonFLY}) then break;
if not ISSRepExtract ( 0, 0, ExpandConstant('{app}\data 2.pcf.srp'),ExpandConstant('{app}\data 2.pcf'), true) then break;
if not ISPrecompExtract( 0, 0, ExpandConstant('{app}\data 2.pcf'), ExpandConstant('{app}\data 2.7z'), true) then break;
if not IS7ZipExtract ( 0, 0, ExpandConstant('{app}\data 2.7z'), ExpandConstant('{app}'), true, '') then break;[/more],но архив data 2.7z почему то не удаляется после того как из него файлы извлеклись. что за хрень?
Автор: vovka00723
Дата сообщения: 01.07.2011 22:16
а версия прекомпа какая?
Автор: Despofix
Дата сообщения: 01.07.2011 22:22
0.4.1
Автор: vovka00723
Дата сообщения: 01.07.2011 22:25
Despofix
лучше 0.38 используй, последующие версии вроде глюканутые
Автор: Despofix
Дата сообщения: 01.07.2011 22:28
vovka00723
причем тут прекомп?
Автор: vovka00723
Дата сообщения: 01.07.2011 22:32
ну у тебя перед распаковкой 7z идет ведь распаковка precomp
проверь при распаковке имена архивов правильные создаются после прекомпа?
Автор: Despofix
Дата сообщения: 01.07.2011 22:42
vovka00723
если бы имена архивов были не правильно написаны тогда бы ошибка вылезла что нет того или иного архива
Автор: vovka00723
Дата сообщения: 01.07.2011 22:43
тогда хз, наверно баг дллки
Автор: ALExey1995
Дата сообщения: 02.07.2011 00:55
Despofix
Юзай http://rghost.ru/11626461
Автор: tabak96
Дата сообщения: 02.07.2011 01:13
Те траблы которые у меня были я решил.Теперь хочу спросить,у меня идет установка в 2 параллельных прогресс бара http://s45.radikal.ru/i108/1107/2a/3d5c4024a637.jpg - вот так(прогресс бары рассчитаны только на распаковку жатых мною файлов,когда они дойдут до 100% будет написано "Распаковка файлов" и пустая страница - будет распаковываться файлы игры(не жатые(app))
Можно как нибудь сделать что бы на распаковку файлов(src)был отдельный прогресс бар,а на распаковку файлов игры(не жатых(app)) был отдельный маленький,который располагался за большим и был отделенный.Такое в репаках видел.
Автор: ENERGES
Дата сообщения: 02.07.2011 09:48
Мужики подскажите как по чернить эту облость

Страницы: 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177

Предыдущая тема: поиск


Форум Ru-Board.club — поднят 15-09-2016 числа. Цель - сохранить наследие старого Ru-Board, истории становления российского интернета. Сделано для людей.