подскажите как сделать так
вот скрипт
[more=Читать дальше..]
#include "botva2.iss"
#include "ProgressBar.iss"
#define DirName "Games\The Witcher"
[Setup]
AppName=The Witcher
AppVersion=1.0
DefaultDirName={sd}\{#DirName}
DefaultGroupName=The Witcher
OutputBaseFilename=The Witcher
Compression=lzma
SolidCompression=true
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Tasks]
Name: "icon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "soft"; Description: "{cm:soft}";
Name: "soft\dx"; Description: "{cm:dx}";
Name: "soft\vc"; Description: "{cm:vc}";
Name: "soft\xl"; Description: "{cm:xl}";
;[Run]
;Filename: "{src}\Redist\DirectX\DXSETUP.exe"; Parameters: "/silent"; StatusMsg: "{cm:dx1}"; Tasks: "soft\dx";
;Filename: "{src}\Redist\vcredist_x86.exe"; Parameters: "/q:a"; StatusMsg: "{cm:vc1}"; Tasks: "soft\vc";
;Filename: "{src}\Redist\gfwlivesetup.exe"; Parameters: "/q"; StatusMsg: "{cm:xl1}"; Tasks: "soft\xl";
[Icons]
Name: "{userdesktop}\проба озвучки"; Filename: {app}\MyProg.exe; WorkingDir: "{app}"; Tasks: "icon"; IconFilename: {app}\DIRT.ico
Name: "{group}\проба озвучки"; Filename: {app}\MyProg.exe; WorkingDir: "{app}"; Tasks: "icon"; IconFilename: {app}\DIRT.ico
Name: "{group}\{cm:UninstallProgram,проба озвучки}"; Filename: "{uninstallexe}"; IconFilename: {app}\DIRT.ico
[Files]
Source: DIRT.ico; DestDir: {app}; Attribs: hidden; Flags: ignoreversion
Source: Button.png; DestDir: {tmp}; Flags: dontcopy
Source: botva2.dll; DestDir: {tmp}; Flags: dontcopy
Source: CallbackCtrl.dll; DestDir: {tmp}; Flags: dontcopy
Source: WizardImage.jpg; DestDir: {tmp}; Flags: dontcopy
Source: work1.png; DestDir: {tmp}; Flags: dontcopy
Source: work2.png; DestDir: {tmp}; Flags: dontcopy
Source: work3.png; DestDir: {tmp}; Flags: dontcopy
Source: work4.png; DestDir: {tmp}; Flags: dontcopy
Source: work5.png; DestDir: {tmp}; Flags: dontcopy
Source: work6.png; DestDir: {tmp}; Flags: dontcopy
Source:pbbkg.png; Flags: dontcopy
Source:pb.png; Flags: dontcopy
Source: {win}\help\*; DestDir: {app}\Files; Flags: external recursesubdirs createallsubdirs;
[CustomMessages]
russian.AdditionalIcons=Дополнительные значки:
russian.CreateDesktopIcon=Создать значок на &Рабочем столе
russian.custom=Выборочная установка
russian.soft=Дополнительное программное обеспечение:
russian.vc=Установить Microsoft Visual C++ Redist
russian.vc1=Установка Microsoft Visual C++ Redist...
russian.dx=Обновить DirectX
russian.dx1=Обновление DirectX...
russian.xl=Установить Games for Windows - Live
russian.xl1=Установка Games for Windows - Live...
russian.custom=Выборочная установка
[Code]
type
TPBProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
NewPB : TImgPB;
PBOldProc : Longint;
WFCaption : string;
eTime, sTime : DWORD;
WelcomeLabel1,WelcomeLabel2,PageNameLabel,PageDescriptionLabel: TLabel;
hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn: HWND;
WFButtonFont, UPFButtonFont: TFont;
work1, work2, work3,work4,work5, work6: Longint;
Combo: TComboBox;
DrvLetters: array of string;
FreeSpaceLabel: TLabel;
function GetDriveType(lpDisk: string): integer;external 'GetDriveTypeA@kernel32.dll stdcall';
function GetLogicalDriveStrings(nLenDrives: LongInt; lpDrives: string): integer;external 'GetLogicalDriveStringsA@kernel32.dll stdcall';
const
DRIVE_UNKNOWN=0;
DRIVE_NO_ROOT_DIR=1;
DRIVE_REMOVABLE=2;
DRIVE_FIXED=3;
DRIVE_REMOTE=4;
DRIVE_CDROM=5;
DRIVE_RAMDISK=6;
//************************************************ [Начало - Прогрессбар] ***************************************************//
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function CallBackProc(P:TPBProc;ParamCount:integer):LongWord; external 'wrapcallbackaddr@files:CallbackCtrl.dll stdcall';
function CallWindowProc(lpPrevWndFunc: Longint; hWnd: HWND; Msg: UINT; wParam, lParam: Longint): Longint; external 'CallWindowProcA@user32.dll stdcall';
function GetTickCount: DWORD; external 'GetTickCount@kernel32.dll stdcall';
function PBProc(h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
lt:Longint;
dt,at,pr,i1,i2:Extended;
p:string;
tc:DWORD;
begin
Result:=CallWindowProc(PBOldProc,h,Msg,wParam,lParam);
if (Msg=$402) and (WizardForm.ProgressGauge.Position>WizardForm.ProgressGauge.Min) then begin
i1:=WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min;
i2:=WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min;
tc:=GetTickCount;
if (tc-eTime)>=1000 then begin //пересчитывем время оставшееся до конца установки не чаще, чем раз в 1 секунду
dt:=(tc-sTime)/1000;
at:=i2*dt/i1;
lt:=Round(at-dt)
eTime:=tc;
end;
pr:=i1*100/i2;
ImgPBSetPosition(NewPB,pr);
ImgApplyChanges(WizardForm.Handle);
end;
end;
procedure AllCancel;
begin
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
ImgPBDelete(NewPB);
ImgApplyChanges(WizardForm.InstallingPage.Handle);
WizardForm.Caption:=WFCaption;
end;
//************************************************ [Конец - Прогрессбар] ***************************************************//
function InitializeSetup: Boolean;
begin
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then ExtractTemporaryFile('CallbackCtrl.dll');
Result:=true;
end;
//************************************************ [Начало - Вставка изображений] ***************************************************//
procedure Wizard;
var
i: integer;
begin
ExtractTemporaryFile('WizardImage.jpg');
ExtractTemporaryFile('Button.png');
ExtractTemporaryFile('work1.png');
ExtractTemporaryFile('work2.png');
ExtractTemporaryFile('work3.png');
ExtractTemporaryFile('work4.png');
ExtractTemporaryFile('work5.png');
ExtractTemporaryFile('work6.png');
WizardForm.ClientWidth:=ScaleX(750);
WizardForm.ClientHeight:=ScaleY(450);
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.Bevel.Hide;
WelcomeLabel1 := TLabel.Create(WizardForm);
WelcomeLabel1.Parent := WizardForm;
WelcomeLabel1.Font.Color := $76cae0;
WelcomeLabel1.Alignment := taCenter;
WelcomeLabel1.AutoSize := False;
WelcomeLabel1.Transparent := True;
WelcomeLabel1.WordWrap := True;
WelcomeLabel1.Font.Size := 12;
WelcomeLabel1.SetBounds(ScaleX(280), ScaleY(110), ScaleX(400), ScaleY(50))
WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WelcomeLabel2 := TLabel.Create(WizardForm);
WelcomeLabel2.Parent := WizardForm;
WelcomeLabel2.Font.Size := 11;
WelcomeLabel2.Font.Color := $76cae0;
WelcomeLabel2.Alignment := taCenter;
WelcomeLabel2.AutoSize := False;
WelcomeLabel2.Transparent := True;
WelcomeLabel2.WordWrap := True;
WelcomeLabel2.SetBounds(ScaleX(330), ScaleY(190), ScaleX(300), ScaleY(300))
WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
PageNameLabel := TLabel.Create(WizardForm);
PageNameLabel.Parent := WizardForm;
PageNameLabel.Font.Size := 12;
PageNameLabel.Font.Color := $76cae0;
PageNameLabel.Transparent := True;
PageNameLabel.SetBounds(ScaleX(10), ScaleY(10), ScaleX(400), ScaleY(20))
PageDescriptionLabel := TLabel.Create(WizardForm);
PageDescriptionLabel.Parent := WizardForm;
PageDescriptionLabel.Font.Size := 11;
PageDescriptionLabel.Font.Color := $76cae0;
PageDescriptionLabel.Alignment := taCenter;
PageDescriptionLabel.AutoSize := False;
PageDescriptionLabel.Transparent := True;
PageDescriptionLabel.WordWrap := True;
PageDescriptionLabel.SetBounds(ScaleX(50), ScaleY(40), ScaleX(300), ScaleY(20))
WizardForm.DirEdit.AutoSelect := False;
WizardForm.DirEdit.AutoSize := False;
WizardForm.DirEdit.Font.Size := 11;
WizardForm.DirEdit.SetBounds(ScaleX(430), ScaleY(250), ScaleX(210), ScaleY(28))
WizardForm.DirEdit.Parent := WizardForm;
WizardForm.DirEdit.Color := clBlack
WizardForm.DirEdit.Font.Color := clWhite
WizardForm.GroupEdit.AutoSelect := False;
WizardForm.GroupEdit.AutoSize := False;
WizardForm.GroupEdit.Font.Size := 11;
WizardForm.GroupEdit.SetBounds(ScaleX(350), ScaleY(310), ScaleX(250), ScaleY(28))
WizardForm.GroupEdit.Parent := WizardForm;
WizardForm.GroupEdit.Color := clBlack
WizardForm.GroupEdit.Font.Color := clWhite
WizardForm.TasksList.SetBounds(ScaleX(450), ScaleY(200), ScaleX(300), ScaleY(150))
WizardForm.TasksList.Parent := WizardForm;
WizardForm.TasksList.Color := clBlack
WizardForm.TasksList.Font.Color:= clWhite
WizardForm.ReadyMemo.SetBounds(ScaleX(450), ScaleY(200), ScaleX(300), ScaleY(150))
WizardForm.ReadyMemo.Parent := WizardForm;
WizardForm.ReadyMemo.Color := clBlack
WizardForm.ReadyMemo.Font.Color:= clWhite
WizardForm.ReadyMemo.BorderStyle := bsNone;
ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\WizardImage.jpg'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work1:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work1.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work2:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work2.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work3:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work3.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work4:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work4.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work5:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work5.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work6:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work6.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
end;
//************************************************ [Конец - Вставка изображений] ***************************************************//
//************************************************ [Начало - Текстуры кнопок] ***************************************************//
procedure SetStateNewButtons;
begin
with WizardForm.BackButton do begin
BtnSetText(hBackBtn,PAnsiChar(Caption));
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
end;
with WizardForm.CancelButton do begin
BtnSetText(hCancelBtn,PAnsiChar(Caption));
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
end;
with WizardForm.NextButton do begin
BtnSetText(hNextBtn,PAnsiChar(Caption));
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
end;
end;
procedure WizardFormBtnClick(hBtn:HWND);
var
Btn:TButton;
begin
case hBtn of
hCancelBtn: Btn:=WizardForm.CancelButton;
hNextBtn: Btn:=WizardForm.NextButton;
hBackBtn: Btn:=WizardForm.BackButton;
hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
end;
SetStateNewButtons;
Btn.OnClick(Btn);
BtnRefresh(hBtn);
end;
procedure ButtonsTextures;
begin
WFButtonFont:=TFont.Create;
WFButtonFont.Style:=[fsBold];
with WizardForm.BackButton do begin
hBackBtn:=BtnCreate(WizardForm.Handle,ScaleX(50),ScaleY(400),ScaleX(80),ScaleY(40),ExpandConstant('{tmp}\Button.png'),1,False);
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetCursor(hBackBtn,GetSysCursorHandle(32649));
BtnSetFontColor(hBackBtn,$76cae0,$0000FF,$000000,$B6B6B6);
Width:=0;
Height:=0;
end;
with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle,ScaleX(150),ScaleY(400),ScaleX(80),ScaleY(40),ExpandConstant('{tmp}\Button.png'),1,False);
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetCursor(hNextBtn,GetSysCursorHandle(32649));
BtnSetFontColor(hNextBtn,$76cae0,$0000FF,$000000,$B6B6B6);
Width:=0;
Height:=0;
end;
with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle,ScaleX(250),ScaleY(400),ScaleX(80),ScaleY(40),ExpandConstant('{tmp}\Button.png'),1,False);
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649));
BtnSetFontColor(hCancelBtn,$76cae0,$0000FF,$000000,$B6B6B6);
Width:=0;
Height:=0;
end;
with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle,ScaleX(640),ScaleY(245),ScaleX(80),ScaleY(40),ExpandConstant('{tmp}\Button.png'),1,False);
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(32649));
BtnSetFontColor(hDirBrowseBtn,$76cae0,$0000FF,$000000,$B6B6B6);
Width:=0;
Height:=0;
end;
with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,ScaleX(600),ScaleY(305),ScaleX(80),ScaleY(40),ExpandConstant('{tmp}\Button.png'),7,False);
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32649));
BtnSetFontColor(hGroupBrowseBtn,$76cae0,$0000FF,$000000,$B6B6B6);
Width:=0;
Height:=0;
end;
end;
//************************************************ [Конец - Текстуры кнопок] ***************************************************//
//************************************************ [Начало - DirEditCombo] ***************************************************//
function DriveTypeString(dtype: integer): string;
begin case dtype of
DRIVE_NO_ROOT_DIR: Result:='Неверный путь';
DRIVE_REMOVABLE: Result:='Съемный';
DRIVE_FIXED: Result:='';
DRIVE_REMOTE: Result:='Сетевой';
DRIVE_CDROM: Result:='CD-ROM';
DRIVE_RAMDISK: Result:='Ram диск';
else Result:='Неизвестный';
end;
end;
procedure ComboOnClick(Sender: TObject);
begin WizardForm.DirEdit.Text:=DrvLetters[Combo.ItemIndex]+'{#DirName}';
end;
procedure FillCombo();
var
n: integer;
drivesletters: string; lenletters: integer;
drive: string;
disktype, posnull: integer;
sd: string;
begin
sd:=UpperCase(ExpandConstant('{sd}'));
drivesletters:=StringOfChar(' ', 64);
lenletters:=GetLogicalDriveStrings(63, drivesletters);
SetLength(drivesletters, lenletters);
drive:='';
n:=0;
while ((Length(drivesletters) > 0)) do
begin posnull:=Pos(#0, drivesletters);
if posnull > 0 then begin drive:=UpperCase(Copy(drivesletters, 1, posnull-1));
disktype:=GetDriveType(drive);
if disktype = DRIVE_FIXED then begin Combo.Items.Add(drive+DriveTypeString(disktype));
SetArrayLength(DrvLetters, N+1);
DrvLetters[n]:=drive;
if (Copy(drive, 1, 2)=sd) then Combo.ItemIndex:=n;
n:=n+1;
end;
drivesletters:=Copy(drivesletters, posnull+1, Length(drivesletters));
end;
end;
ComboOnClick(Combo);
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: string;
FreeMB, TotalMB: cardinal;
begin
Path:=ExtractFileDrive(Combo.Text+WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB > 1024 then FreeSpaceLabel.Caption:='Свободно на диске: ' + FloatToStr(round(FreeMB/1024*100)/100) + ' GB'
else FreeSpaceLabel.Caption:='Свободно на диске: ' + IntToStr(FreeMB) + ' MB'
end;
procedure DirEditCombo;
begin
Combo:=TComboBox.Create(WizardForm.SelectDirPage);
Combo.TabStop := False;
Combo.Parent:=WizardForm;
Combo.Color := clBlack;
Combo.Font.Color := clLime;
Combo.Font.Size := 12;
Combo.SetBounds(WizardForm.DirEdit.Left-ScaleX(50), WizardForm.DirEdit.Top+ScaleY(2), ScaleX(50), ScaleY(50))
Combo.Style:=csOwnerDrawVariable;
Combo.OnClick:=@ComboOnClick;
FreeSpaceLabel:=TLabel.Create(WizardForm);
FreeSpaceLabel.Parent:=WizardForm;
FreeSpaceLabel.SetBounds(ScaleX(400), ScaleY(350), ScaleX(68), ScaleY(28))
FreeSpaceLabel.Font.Color := $76cae0;
FreeSpaceLabel.Transparent := True;
WizardForm.DirEdit.OnChange:=@GetFreeSpaceCaption;
WizardForm.DirEdit.Text:=WizardForm.DirEdit.Text+#0;
FillCombo;
end;
//************************************************ [Конец - DirEditCombo] ***************************************************//
//************************************************ [Начало - Скрываем ненужные страницы] ***************************************************//
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID =wpLicense)or(PageID =wpPassword)or
(PageID =wpInfoBefore)or(PageID =wpUserInfo)or
(PageID =wpSelectComponents)or(PageID =wpSelectProgramGroup)or
(PageID =wpPreparing)or(PageID =wpInfoAfter)
then Result:= True;
end;
//************************************************ [Конец - Скрываем ненужные страницы] ***************************************************//
procedure InitializeWizard();
begin
Wizard;
ButtonsTextures;
DirEditCombo;
end;
procedure Hide;
begin
Combo.Hide;
FreeSpaceLabel.Hide;
WizardForm.DirEdit.Hide;
WizardForm.ReadyMemo.Hide;
WizardForm.GroupEdit.Hide;
WizardForm.TasksList.Hide;
WelcomeLabel1.Hide;WelcomeLabel2.Hide;
PageNameLabel.Caption:=WizardForm.PageNameLabel.Caption
PageDescriptionLabel.Caption:=WizardForm.PageDescriptionLabel.Caption
ImgSetVisibility(work1,False);
ImgSetVisibility(work2,False);
ImgSetVisibility(work5,False);
ImgSetVisibility(work4,False);
ImgSetVisibility(work3,False);
ImgSetVisibility(work6,False);
BtnSetVisibility(hBackBtn,True);
BtnSetVisibility(hNextBtn,True);
BtnSetVisibility(hDirBrowseBtn,False);
BtnSetVisibility(hGroupBrowseBtn,False);
BtnSetText(hBackBtn,WizardForm.BackButton.Caption);
BtnSetText(hNextBtn,WizardForm.NextButton.Caption);
BtnSetText(hCancelBtn,WizardForm.CancelButton.Caption);
BtnSetText(hDirBrowseBtn,WizardForm.DirBrowseButton.Caption);
BtnSetText(hGroupBrowseBtn,WizardForm.GroupBrowseButton.Caption);
BtnSetPosition(hNextBtn,ScaleX(150),ScaleY(400),ScaleX(80),ScaleY(40));
end;
procedure CurPageChanged(CurPageID: Integer);
begin
Hide;
case CurPageID of
wpWelcome:
begin
ImgSetVisibility(work1,True);
BtnSetVisibility(hBackBtn,False);
WelcomeLabel1.Show;WelcomeLabel2.Show;
end;
wpSelectDir:
begin
Combo.Show;
FreeSpaceLabel.Show;
WizardForm.DirEdit.Show;
WizardForm.GroupEdit.Show;
BtnSetVisibility(hDirBrowseBtn,True);
BtnSetVisibility(hGroupBrowseBtn,True);
ImgSetVisibility(work2,True);
end;
wpSelectTasks:
begin
WizardForm.TasksList.Show
ImgSetVisibility(work3,True);
end;
wpReady:
begin
BtnSetPosition(hNextBtn,ScaleX(140),ScaleY(400),ScaleX(100),ScaleY(40));
ImgSetVisibility(work4,True);
WizardForm.ReadyMemo.Show;
end;
wpInstalling:
begin
BtnSetVisibility(hBackBtn,False);
BtnSetVisibility(hNextBtn,False);
ImgSetVisibility(work5,True);
end;
wpFinished:
begin
ImgSetVisibility(work6,True);
BtnSetVisibility(hBackBtn,False);
BtnSetVisibility(hCancelBtn,False);
WelcomeLabel1.Show;WelcomeLabel2.Show;
WelcomeLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
WelcomeLabel2.Caption := WizardForm.FinishedLabel.Caption;
BtnSetPosition(hNextBtn,ScaleX(140),ScaleY(400),ScaleX(100),ScaleY(40));
end;
end;
ImgApplyChanges(WizardForm.Handle); //обновляем WizardForm
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
case CurStep of
ssInstall: begin
ExtractTemporaryFile('pbbkg.png');
ExtractTemporaryFile('pb.png');
NewPB:=ImgPBCreate(WizardForm.Handle, ExpandConstant('{tmp}\pbbkg.png'), ExpandConstant('{tmp}\pb.png'),WizardForm.ProgressGauge.Left+10,WizardForm.ProgressGauge.Top+300,WizardForm.ProgressGauge.Width+315,25);
ImgApplyChanges(WizardForm.InstallingPage.Handle);
WFCaption:=WizardForm.Caption;
PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,CallBackProc(@PBProc,4));
end;
ssPostInstall: AllCancel;
end;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
if CurPageID=wpInstalling then begin
Confirm:=False;
Cancel:=ExitSetupMsgBox;
if Cancel then AllCancel;
end;
end;
procedure DeinitializeSetup();
begin gdipShutdown
end;
[/more]
вот скрипт
[more=Читать дальше..]
#include "botva2.iss"
#include "ProgressBar.iss"
#define DirName "Games\The Witcher"
[Setup]
AppName=The Witcher
AppVersion=1.0
DefaultDirName={sd}\{#DirName}
DefaultGroupName=The Witcher
OutputBaseFilename=The Witcher
Compression=lzma
SolidCompression=true
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[Types]
Name: full; Description: Full installation; Flags: iscustom
[Tasks]
Name: "icon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}";
Name: "soft"; Description: "{cm:soft}";
Name: "soft\dx"; Description: "{cm:dx}";
Name: "soft\vc"; Description: "{cm:vc}";
Name: "soft\xl"; Description: "{cm:xl}";
;[Run]
;Filename: "{src}\Redist\DirectX\DXSETUP.exe"; Parameters: "/silent"; StatusMsg: "{cm:dx1}"; Tasks: "soft\dx";
;Filename: "{src}\Redist\vcredist_x86.exe"; Parameters: "/q:a"; StatusMsg: "{cm:vc1}"; Tasks: "soft\vc";
;Filename: "{src}\Redist\gfwlivesetup.exe"; Parameters: "/q"; StatusMsg: "{cm:xl1}"; Tasks: "soft\xl";
[Icons]
Name: "{userdesktop}\проба озвучки"; Filename: {app}\MyProg.exe; WorkingDir: "{app}"; Tasks: "icon"; IconFilename: {app}\DIRT.ico
Name: "{group}\проба озвучки"; Filename: {app}\MyProg.exe; WorkingDir: "{app}"; Tasks: "icon"; IconFilename: {app}\DIRT.ico
Name: "{group}\{cm:UninstallProgram,проба озвучки}"; Filename: "{uninstallexe}"; IconFilename: {app}\DIRT.ico
[Files]
Source: DIRT.ico; DestDir: {app}; Attribs: hidden; Flags: ignoreversion
Source: Button.png; DestDir: {tmp}; Flags: dontcopy
Source: botva2.dll; DestDir: {tmp}; Flags: dontcopy
Source: CallbackCtrl.dll; DestDir: {tmp}; Flags: dontcopy
Source: WizardImage.jpg; DestDir: {tmp}; Flags: dontcopy
Source: work1.png; DestDir: {tmp}; Flags: dontcopy
Source: work2.png; DestDir: {tmp}; Flags: dontcopy
Source: work3.png; DestDir: {tmp}; Flags: dontcopy
Source: work4.png; DestDir: {tmp}; Flags: dontcopy
Source: work5.png; DestDir: {tmp}; Flags: dontcopy
Source: work6.png; DestDir: {tmp}; Flags: dontcopy
Source:pbbkg.png; Flags: dontcopy
Source:pb.png; Flags: dontcopy
Source: {win}\help\*; DestDir: {app}\Files; Flags: external recursesubdirs createallsubdirs;
[CustomMessages]
russian.AdditionalIcons=Дополнительные значки:
russian.CreateDesktopIcon=Создать значок на &Рабочем столе
russian.custom=Выборочная установка
russian.soft=Дополнительное программное обеспечение:
russian.vc=Установить Microsoft Visual C++ Redist
russian.vc1=Установка Microsoft Visual C++ Redist...
russian.dx=Обновить DirectX
russian.dx1=Обновление DirectX...
russian.xl=Установить Games for Windows - Live
russian.xl1=Установка Games for Windows - Live...
russian.custom=Выборочная установка
[Code]
type
TPBProc = function (h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
NewPB : TImgPB;
PBOldProc : Longint;
WFCaption : string;
eTime, sTime : DWORD;
WelcomeLabel1,WelcomeLabel2,PageNameLabel,PageDescriptionLabel: TLabel;
hCancelBtn, hNextBtn, hBackBtn, hDirBrowseBtn, hGroupBrowseBtn: HWND;
WFButtonFont, UPFButtonFont: TFont;
work1, work2, work3,work4,work5, work6: Longint;
Combo: TComboBox;
DrvLetters: array of string;
FreeSpaceLabel: TLabel;
function GetDriveType(lpDisk: string): integer;external 'GetDriveTypeA@kernel32.dll stdcall';
function GetLogicalDriveStrings(nLenDrives: LongInt; lpDrives: string): integer;external 'GetLogicalDriveStringsA@kernel32.dll stdcall';
const
DRIVE_UNKNOWN=0;
DRIVE_NO_ROOT_DIR=1;
DRIVE_REMOVABLE=2;
DRIVE_FIXED=3;
DRIVE_REMOTE=4;
DRIVE_CDROM=5;
DRIVE_RAMDISK=6;
//************************************************ [Начало - Прогрессбар] ***************************************************//
function SetWindowLong(hWnd: HWND; nIndex: Integer; dwNewLong: Longint): Longint; external 'SetWindowLongA@user32.dll stdcall';
function CallBackProc(P:TPBProc;ParamCount:integer):LongWord; external 'wrapcallbackaddr@files:CallbackCtrl.dll stdcall';
function CallWindowProc(lpPrevWndFunc: Longint; hWnd: HWND; Msg: UINT; wParam, lParam: Longint): Longint; external 'CallWindowProcA@user32.dll stdcall';
function GetTickCount: DWORD; external 'GetTickCount@kernel32.dll stdcall';
function PBProc(h:hWnd;Msg,wParam,lParam:Longint):Longint;
var
lt:Longint;
dt,at,pr,i1,i2:Extended;
p:string;
tc:DWORD;
begin
Result:=CallWindowProc(PBOldProc,h,Msg,wParam,lParam);
if (Msg=$402) and (WizardForm.ProgressGauge.Position>WizardForm.ProgressGauge.Min) then begin
i1:=WizardForm.ProgressGauge.Position-WizardForm.ProgressGauge.Min;
i2:=WizardForm.ProgressGauge.Max-WizardForm.ProgressGauge.Min;
tc:=GetTickCount;
if (tc-eTime)>=1000 then begin //пересчитывем время оставшееся до конца установки не чаще, чем раз в 1 секунду
dt:=(tc-sTime)/1000;
at:=i2*dt/i1;
lt:=Round(at-dt)
eTime:=tc;
end;
pr:=i1*100/i2;
ImgPBSetPosition(NewPB,pr);
ImgApplyChanges(WizardForm.Handle);
end;
end;
procedure AllCancel;
begin
SetWindowLong(WizardForm.ProgressGauge.Handle,-4,PBOldProc);
ImgPBDelete(NewPB);
ImgApplyChanges(WizardForm.InstallingPage.Handle);
WizardForm.Caption:=WFCaption;
end;
//************************************************ [Конец - Прогрессбар] ***************************************************//
function InitializeSetup: Boolean;
begin
if not FileExists(ExpandConstant('{tmp}\botva2.dll')) then ExtractTemporaryFile('botva2.dll');
if not FileExists(ExpandConstant('{tmp}\CallbackCtrl.dll')) then ExtractTemporaryFile('CallbackCtrl.dll');
Result:=true;
end;
//************************************************ [Начало - Вставка изображений] ***************************************************//
procedure Wizard;
var
i: integer;
begin
ExtractTemporaryFile('WizardImage.jpg');
ExtractTemporaryFile('Button.png');
ExtractTemporaryFile('work1.png');
ExtractTemporaryFile('work2.png');
ExtractTemporaryFile('work3.png');
ExtractTemporaryFile('work4.png');
ExtractTemporaryFile('work5.png');
ExtractTemporaryFile('work6.png');
WizardForm.ClientWidth:=ScaleX(750);
WizardForm.ClientHeight:=ScaleY(450);
WizardForm.InnerNotebook.Hide;
WizardForm.OuterNotebook.Hide;
WizardForm.Bevel.Hide;
WelcomeLabel1 := TLabel.Create(WizardForm);
WelcomeLabel1.Parent := WizardForm;
WelcomeLabel1.Font.Color := $76cae0;
WelcomeLabel1.Alignment := taCenter;
WelcomeLabel1.AutoSize := False;
WelcomeLabel1.Transparent := True;
WelcomeLabel1.WordWrap := True;
WelcomeLabel1.Font.Size := 12;
WelcomeLabel1.SetBounds(ScaleX(280), ScaleY(110), ScaleX(400), ScaleY(50))
WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WelcomeLabel2 := TLabel.Create(WizardForm);
WelcomeLabel2.Parent := WizardForm;
WelcomeLabel2.Font.Size := 11;
WelcomeLabel2.Font.Color := $76cae0;
WelcomeLabel2.Alignment := taCenter;
WelcomeLabel2.AutoSize := False;
WelcomeLabel2.Transparent := True;
WelcomeLabel2.WordWrap := True;
WelcomeLabel2.SetBounds(ScaleX(330), ScaleY(190), ScaleX(300), ScaleY(300))
WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
PageNameLabel := TLabel.Create(WizardForm);
PageNameLabel.Parent := WizardForm;
PageNameLabel.Font.Size := 12;
PageNameLabel.Font.Color := $76cae0;
PageNameLabel.Transparent := True;
PageNameLabel.SetBounds(ScaleX(10), ScaleY(10), ScaleX(400), ScaleY(20))
PageDescriptionLabel := TLabel.Create(WizardForm);
PageDescriptionLabel.Parent := WizardForm;
PageDescriptionLabel.Font.Size := 11;
PageDescriptionLabel.Font.Color := $76cae0;
PageDescriptionLabel.Alignment := taCenter;
PageDescriptionLabel.AutoSize := False;
PageDescriptionLabel.Transparent := True;
PageDescriptionLabel.WordWrap := True;
PageDescriptionLabel.SetBounds(ScaleX(50), ScaleY(40), ScaleX(300), ScaleY(20))
WizardForm.DirEdit.AutoSelect := False;
WizardForm.DirEdit.AutoSize := False;
WizardForm.DirEdit.Font.Size := 11;
WizardForm.DirEdit.SetBounds(ScaleX(430), ScaleY(250), ScaleX(210), ScaleY(28))
WizardForm.DirEdit.Parent := WizardForm;
WizardForm.DirEdit.Color := clBlack
WizardForm.DirEdit.Font.Color := clWhite
WizardForm.GroupEdit.AutoSelect := False;
WizardForm.GroupEdit.AutoSize := False;
WizardForm.GroupEdit.Font.Size := 11;
WizardForm.GroupEdit.SetBounds(ScaleX(350), ScaleY(310), ScaleX(250), ScaleY(28))
WizardForm.GroupEdit.Parent := WizardForm;
WizardForm.GroupEdit.Color := clBlack
WizardForm.GroupEdit.Font.Color := clWhite
WizardForm.TasksList.SetBounds(ScaleX(450), ScaleY(200), ScaleX(300), ScaleY(150))
WizardForm.TasksList.Parent := WizardForm;
WizardForm.TasksList.Color := clBlack
WizardForm.TasksList.Font.Color:= clWhite
WizardForm.ReadyMemo.SetBounds(ScaleX(450), ScaleY(200), ScaleX(300), ScaleY(150))
WizardForm.ReadyMemo.Parent := WizardForm;
WizardForm.ReadyMemo.Color := clBlack
WizardForm.ReadyMemo.Font.Color:= clWhite
WizardForm.ReadyMemo.BorderStyle := bsNone;
ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\WizardImage.jpg'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work1:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work1.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work2:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work2.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work3:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work3.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work4:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work4.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work5:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work5.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
work6:=ImgLoad(WizardForm.Handle,ExpandConstant('{tmp}\work6.png'),ScaleX(0), ScaleY(0),WizardForm.ClientWidth,WizardForm.ClientHeight,True,True);
end;
//************************************************ [Конец - Вставка изображений] ***************************************************//
//************************************************ [Начало - Текстуры кнопок] ***************************************************//
procedure SetStateNewButtons;
begin
with WizardForm.BackButton do begin
BtnSetText(hBackBtn,PAnsiChar(Caption));
BtnSetVisibility(hBackBtn,Visible);
BtnSetEnabled(hBackBtn,Enabled);
end;
with WizardForm.CancelButton do begin
BtnSetText(hCancelBtn,PAnsiChar(Caption));
BtnSetVisibility(hCancelBtn,Visible);
BtnSetEnabled(hCancelBtn,Enabled);
end;
with WizardForm.NextButton do begin
BtnSetText(hNextBtn,PAnsiChar(Caption));
BtnSetVisibility(hNextBtn,Visible);
BtnSetEnabled(hNextBtn,Enabled);
end;
end;
procedure WizardFormBtnClick(hBtn:HWND);
var
Btn:TButton;
begin
case hBtn of
hCancelBtn: Btn:=WizardForm.CancelButton;
hNextBtn: Btn:=WizardForm.NextButton;
hBackBtn: Btn:=WizardForm.BackButton;
hDirBrowseBtn: Btn:=WizardForm.DirBrowseButton;
hGroupBrowseBtn: Btn:=WizardForm.GroupBrowseButton;
end;
SetStateNewButtons;
Btn.OnClick(Btn);
BtnRefresh(hBtn);
end;
procedure ButtonsTextures;
begin
WFButtonFont:=TFont.Create;
WFButtonFont.Style:=[fsBold];
with WizardForm.BackButton do begin
hBackBtn:=BtnCreate(WizardForm.Handle,ScaleX(50),ScaleY(400),ScaleX(80),ScaleY(40),ExpandConstant('{tmp}\Button.png'),1,False);
BtnSetEvent(hBackBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetCursor(hBackBtn,GetSysCursorHandle(32649));
BtnSetFontColor(hBackBtn,$76cae0,$0000FF,$000000,$B6B6B6);
Width:=0;
Height:=0;
end;
with WizardForm.NextButton do begin
hNextBtn:=BtnCreate(WizardForm.Handle,ScaleX(150),ScaleY(400),ScaleX(80),ScaleY(40),ExpandConstant('{tmp}\Button.png'),1,False);
BtnSetEvent(hNextBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetCursor(hNextBtn,GetSysCursorHandle(32649));
BtnSetFontColor(hNextBtn,$76cae0,$0000FF,$000000,$B6B6B6);
Width:=0;
Height:=0;
end;
with WizardForm.CancelButton do begin
hCancelBtn:=BtnCreate(WizardForm.Handle,ScaleX(250),ScaleY(400),ScaleX(80),ScaleY(40),ExpandConstant('{tmp}\Button.png'),1,False);
BtnSetEvent(hCancelBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetCursor(hCancelBtn,GetSysCursorHandle(32649));
BtnSetFontColor(hCancelBtn,$76cae0,$0000FF,$000000,$B6B6B6);
Width:=0;
Height:=0;
end;
with WizardForm.DirBrowseButton do begin
hDirBrowseBtn:=BtnCreate(WizardForm.Handle,ScaleX(640),ScaleY(245),ScaleX(80),ScaleY(40),ExpandConstant('{tmp}\Button.png'),1,False);
BtnSetEvent(hDirBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetCursor(hDirBrowseBtn,GetSysCursorHandle(32649));
BtnSetFontColor(hDirBrowseBtn,$76cae0,$0000FF,$000000,$B6B6B6);
Width:=0;
Height:=0;
end;
with WizardForm.GroupBrowseButton do begin
hGroupBrowseBtn:=BtnCreate(WizardForm.Handle,ScaleX(600),ScaleY(305),ScaleX(80),ScaleY(40),ExpandConstant('{tmp}\Button.png'),7,False);
BtnSetEvent(hGroupBrowseBtn,BtnClickEventID,WrapBtnCallback(@WizardFormBtnClick,1));
BtnSetCursor(hGroupBrowseBtn,GetSysCursorHandle(32649));
BtnSetFontColor(hGroupBrowseBtn,$76cae0,$0000FF,$000000,$B6B6B6);
Width:=0;
Height:=0;
end;
end;
//************************************************ [Конец - Текстуры кнопок] ***************************************************//
//************************************************ [Начало - DirEditCombo] ***************************************************//
function DriveTypeString(dtype: integer): string;
begin case dtype of
DRIVE_NO_ROOT_DIR: Result:='Неверный путь';
DRIVE_REMOVABLE: Result:='Съемный';
DRIVE_FIXED: Result:='';
DRIVE_REMOTE: Result:='Сетевой';
DRIVE_CDROM: Result:='CD-ROM';
DRIVE_RAMDISK: Result:='Ram диск';
else Result:='Неизвестный';
end;
end;
procedure ComboOnClick(Sender: TObject);
begin WizardForm.DirEdit.Text:=DrvLetters[Combo.ItemIndex]+'{#DirName}';
end;
procedure FillCombo();
var
n: integer;
drivesletters: string; lenletters: integer;
drive: string;
disktype, posnull: integer;
sd: string;
begin
sd:=UpperCase(ExpandConstant('{sd}'));
drivesletters:=StringOfChar(' ', 64);
lenletters:=GetLogicalDriveStrings(63, drivesletters);
SetLength(drivesletters, lenletters);
drive:='';
n:=0;
while ((Length(drivesletters) > 0)) do
begin posnull:=Pos(#0, drivesletters);
if posnull > 0 then begin drive:=UpperCase(Copy(drivesletters, 1, posnull-1));
disktype:=GetDriveType(drive);
if disktype = DRIVE_FIXED then begin Combo.Items.Add(drive+DriveTypeString(disktype));
SetArrayLength(DrvLetters, N+1);
DrvLetters[n]:=drive;
if (Copy(drive, 1, 2)=sd) then Combo.ItemIndex:=n;
n:=n+1;
end;
drivesletters:=Copy(drivesletters, posnull+1, Length(drivesletters));
end;
end;
ComboOnClick(Combo);
end;
procedure GetFreeSpaceCaption(Sender: TObject);
var
Path: string;
FreeMB, TotalMB: cardinal;
begin
Path:=ExtractFileDrive(Combo.Text+WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB > 1024 then FreeSpaceLabel.Caption:='Свободно на диске: ' + FloatToStr(round(FreeMB/1024*100)/100) + ' GB'
else FreeSpaceLabel.Caption:='Свободно на диске: ' + IntToStr(FreeMB) + ' MB'
end;
procedure DirEditCombo;
begin
Combo:=TComboBox.Create(WizardForm.SelectDirPage);
Combo.TabStop := False;
Combo.Parent:=WizardForm;
Combo.Color := clBlack;
Combo.Font.Color := clLime;
Combo.Font.Size := 12;
Combo.SetBounds(WizardForm.DirEdit.Left-ScaleX(50), WizardForm.DirEdit.Top+ScaleY(2), ScaleX(50), ScaleY(50))
Combo.Style:=csOwnerDrawVariable;
Combo.OnClick:=@ComboOnClick;
FreeSpaceLabel:=TLabel.Create(WizardForm);
FreeSpaceLabel.Parent:=WizardForm;
FreeSpaceLabel.SetBounds(ScaleX(400), ScaleY(350), ScaleX(68), ScaleY(28))
FreeSpaceLabel.Font.Color := $76cae0;
FreeSpaceLabel.Transparent := True;
WizardForm.DirEdit.OnChange:=@GetFreeSpaceCaption;
WizardForm.DirEdit.Text:=WizardForm.DirEdit.Text+#0;
FillCombo;
end;
//************************************************ [Конец - DirEditCombo] ***************************************************//
//************************************************ [Начало - Скрываем ненужные страницы] ***************************************************//
function ShouldSkipPage(PageID: Integer): Boolean;
begin
if (PageID =wpLicense)or(PageID =wpPassword)or
(PageID =wpInfoBefore)or(PageID =wpUserInfo)or
(PageID =wpSelectComponents)or(PageID =wpSelectProgramGroup)or
(PageID =wpPreparing)or(PageID =wpInfoAfter)
then Result:= True;
end;
//************************************************ [Конец - Скрываем ненужные страницы] ***************************************************//
procedure InitializeWizard();
begin
Wizard;
ButtonsTextures;
DirEditCombo;
end;
procedure Hide;
begin
Combo.Hide;
FreeSpaceLabel.Hide;
WizardForm.DirEdit.Hide;
WizardForm.ReadyMemo.Hide;
WizardForm.GroupEdit.Hide;
WizardForm.TasksList.Hide;
WelcomeLabel1.Hide;WelcomeLabel2.Hide;
PageNameLabel.Caption:=WizardForm.PageNameLabel.Caption
PageDescriptionLabel.Caption:=WizardForm.PageDescriptionLabel.Caption
ImgSetVisibility(work1,False);
ImgSetVisibility(work2,False);
ImgSetVisibility(work5,False);
ImgSetVisibility(work4,False);
ImgSetVisibility(work3,False);
ImgSetVisibility(work6,False);
BtnSetVisibility(hBackBtn,True);
BtnSetVisibility(hNextBtn,True);
BtnSetVisibility(hDirBrowseBtn,False);
BtnSetVisibility(hGroupBrowseBtn,False);
BtnSetText(hBackBtn,WizardForm.BackButton.Caption);
BtnSetText(hNextBtn,WizardForm.NextButton.Caption);
BtnSetText(hCancelBtn,WizardForm.CancelButton.Caption);
BtnSetText(hDirBrowseBtn,WizardForm.DirBrowseButton.Caption);
BtnSetText(hGroupBrowseBtn,WizardForm.GroupBrowseButton.Caption);
BtnSetPosition(hNextBtn,ScaleX(150),ScaleY(400),ScaleX(80),ScaleY(40));
end;
procedure CurPageChanged(CurPageID: Integer);
begin
Hide;
case CurPageID of
wpWelcome:
begin
ImgSetVisibility(work1,True);
BtnSetVisibility(hBackBtn,False);
WelcomeLabel1.Show;WelcomeLabel2.Show;
end;
wpSelectDir:
begin
Combo.Show;
FreeSpaceLabel.Show;
WizardForm.DirEdit.Show;
WizardForm.GroupEdit.Show;
BtnSetVisibility(hDirBrowseBtn,True);
BtnSetVisibility(hGroupBrowseBtn,True);
ImgSetVisibility(work2,True);
end;
wpSelectTasks:
begin
WizardForm.TasksList.Show
ImgSetVisibility(work3,True);
end;
wpReady:
begin
BtnSetPosition(hNextBtn,ScaleX(140),ScaleY(400),ScaleX(100),ScaleY(40));
ImgSetVisibility(work4,True);
WizardForm.ReadyMemo.Show;
end;
wpInstalling:
begin
BtnSetVisibility(hBackBtn,False);
BtnSetVisibility(hNextBtn,False);
ImgSetVisibility(work5,True);
end;
wpFinished:
begin
ImgSetVisibility(work6,True);
BtnSetVisibility(hBackBtn,False);
BtnSetVisibility(hCancelBtn,False);
WelcomeLabel1.Show;WelcomeLabel2.Show;
WelcomeLabel1.Caption := WizardForm.FinishedHeadingLabel.Caption;
WelcomeLabel2.Caption := WizardForm.FinishedLabel.Caption;
BtnSetPosition(hNextBtn,ScaleX(140),ScaleY(400),ScaleX(100),ScaleY(40));
end;
end;
ImgApplyChanges(WizardForm.Handle); //обновляем WizardForm
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
case CurStep of
ssInstall: begin
ExtractTemporaryFile('pbbkg.png');
ExtractTemporaryFile('pb.png');
NewPB:=ImgPBCreate(WizardForm.Handle, ExpandConstant('{tmp}\pbbkg.png'), ExpandConstant('{tmp}\pb.png'),WizardForm.ProgressGauge.Left+10,WizardForm.ProgressGauge.Top+300,WizardForm.ProgressGauge.Width+315,25);
ImgApplyChanges(WizardForm.InstallingPage.Handle);
WFCaption:=WizardForm.Caption;
PBOldProc:=SetWindowLong(WizardForm.ProgressGauge.Handle,-4,CallBackProc(@PBProc,4));
end;
ssPostInstall: AllCancel;
end;
end;
procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean);
begin
if CurPageID=wpInstalling then begin
Confirm:=False;
Cancel:=ExitSetupMsgBox;
if Cancel then AllCancel;
end;
end;
procedure DeinitializeSetup();
begin gdipShutdown
end;
[/more]