Автор: clemenco
Дата сообщения: 11.12.2008 13:22
Скрестил два кода, Vista Lite Skin и Системные требования. Получилось:
[more]
#define WizardImage "WizardImage.bmp"
#define SysButtonImage "SysButtonImage.bmp"
[Setup]
AppName=Vista Lite Skin
AppVerName=Vista Lite Skin
DefaultDirName={pf}\Vista Lite Skin
WizardImageFile={#WizardImage}
[Files]
Source: {#SysButtonImage}; DestDir: {tmp}; Flags: dontcopy
Source: get_hw_caps.dll; Flags: dontcopy
[Code]
Const
FontColor = $ffffff; //цвет шрифта
CaptionLabel = $e3be2e; //цвет заднего текста заголовка окна
CaptionLabel2 = $ffffff; //цвет текста заголовка окна
BeveledLabelFontColor = clBlue; //цвет текста в нижнем левом углу
Radius = 9; //радиус углов WizardForm
WM_SYSCOMMAND = $0112;
SmallBitmapWidth= 170; oneMB= 1024*1024; LightColor= $EEEEEE; GreenColor= $C0DCC0; RedColor= $CCCCFF; BufferLen= 32;
NeedMB= 100; NeedMHZ= 3500; NeedRAM= 128; NeedVRAM= 64; NeedSys= 5.0; NeedSp= 0; NeedSwap= 256; NeedProgram= 'Software\Microsoft\.NETFramework';
type TMemoryStatus = record dwLength, dwMemoryLoad, dwTotalPhys, dwAvailPhys, dwTotalPageFile, dwAvailPageFile, dwTotalVirtual, dwAvailVirtual: Longint; end;
var Check: Boolean; Memory: TMemoryStatus; FreeMB, TotalMB: Cardinal; VolumeSerialNo, MaxComponentLength, FileSystemFlags: Longint; i, CurPage, errorCode: Integer; VolumeName, FileSystemName, UpdateHint, UserSelectDir: String; CancelButton, InfoButton, UpdateButton: TButton; ListBox: TListBox; InfoPage: TWizardPage; CheckFolders: TCheckBox; System, SystemNamePanel, Processor, ProcessorName, VideoCardPanel, VideoCardName, AudioCardPanel, AudioCardName, RAMPanel, RAMSize, PageFilePanel, PageFileSize, NeedSoft, NeedSoftName, Hdd, HddSize, Folders, FoldersSize: TPanel;
procedure GlobalMemoryStatus(var lpBuffer: TMemoryStatus); external 'GlobalMemoryStatus@kernel32.dll';
function GetSystemMetrics(nIndex: Integer):Integer; external 'GetSystemMetrics@user32.dll stdcall';
function sndPlaySound(lpszSoundName: string; uFlags: cardinal):integer; external 'sndPlaySoundA@winmm.dll stdcall';
function GetHardDrivesCount: Integer; external 'hwc_GetHardDrivesCount@files:get_hw_caps.dll stdcall';
function GetHardDriveName(hdd: Integer): PChar; external 'hwc_GetHardDriveName@files:get_hw_caps.dll stdcall';
function GetSoundCards: Integer; external 'hwc_GetSoundCards@files:get_hw_caps.dll stdcall';
function GetSoundCardName: PChar; external 'hwc_GetSoundCardName@files:get_hw_caps.dll stdcall';
function GetSystemPage: Integer; external 'hwc_GetSystemPage@files:get_hw_caps.dll stdcall';
function GetVideoCardName: PChar; external 'hwc_GetVideoCardName@files:get_hw_caps.dll stdcall';
function GetVidMemLocal: Integer; external 'hwc_GetVidMemLocal@files:get_hw_caps.dll stdcall';
function GetVolumeInformation(PathName,VolumeName: PChar; VolumeNameSize,VolumeSerialNumber,MaxComponentLength,FileSystemFlags: Longint; FileSystemName: PChar; FileSystemNameSize: Longint): Longint; external 'GetVolumeInformationA@kernel32.dll stdcall';
Function CalcDirSize(const fromDir, fileMask: string; SubDirsAllow: Boolean): Extended; Var FSR, DSR: TFindRec; FindResult: Boolean;
Begin
FindResult:= FindFirst(AddBackslash(fromDir) + fileMask, FSR);
Try
while FindResult do
begin
if FSR.Attributes and FILE_ATTRIBUTE_DIRECTORY = 0 then if FSR.SizeLow > $7FFFFFFF then Result:= Result + FSR.SizeLow + $7FFFFFFF + $7FFFFFFF + 2 else Result:= Result + FSR.SizeLow
FindResult:= FindNext(FSR)
end;
FindResult:= FindFirst(AddBackslash(fromDir) + '*.*', DSR)
While FindResult and SubDirsAllow do
begin
if ((DSR.Attributes and FILE_ATTRIBUTE_DIRECTORY) = FILE_ATTRIBUTE_DIRECTORY) and not ((DSR.Name = '.') or (DSR.Name = '..')) then {Recursion} Result:= Result + CalcDirSize(AddBackslash(fromDir) + DSR.Name, fileMask, SubDirsAllow)
FindResult:= FindNext(DSR)
end;
Finally
FindClose(FSR); FindClose(DSR); end;
End;
Function MorG(MB: Integer; autoGB: Boolean): string; {Перевод числа в строку объёма Мб/Гб (до 3х знаков после запятой)}
Begin If (MB < 1000) or not autoGB then Result:= IntToStr(MB)+ 'Мб' else Result:= FloatToStr(round(MB/1024*1000)/1000)+ 'Гб'; StringChange(Result, ',', '.') End;
Var
YesRadio,NoRadio: TRadioButton;
WelcomeLabel1,WelcomeLabel2,LicenseLabel1,LicenseAcceptedLabel,LicenseNotAcceptedLabel,PasswordLabel,PasswordEditLabel,
InfoBeforeClickLabel,UserInfoNameLabel,UserInfoOrgLabel,UserInfoSerialLabel,SelectDirLabel,SelectDirBrowseLabel,DiskSpaceLabel,
SelectComponentsLabel,ComponentsDiskSpaceLabel,SelectStartMenuFolderLabel,SelectStartMenuFolderBrowseLabel,NoIconsLabel,
SelectTasksLabel,ReadyLabel,StatusLabel,InfoAfterClickLabel,FinishedHeadingLabel,FinishedLabel,YesRadioLabel,NoRadioLabel,
BeveledLabel,PageNameLabel,PageDescriptionLabel,WizardLabel,MinLabel,ExtLabel,WizardCaptionLabel,WizardCaptionLabel2: TLabel;
MinPanel,ExtPanel: Tpanel;
MinImage,ExtImage: TBitmapImage;
FormRegion: tHandle;
function CreateRoundRectRgn(p1, p2, p3, p4, p5, p6: Integer): THandle; external 'CreateRoundRectRgn@gdi32 stdcall';
function SetWindowRgn(hWnd: HWND; hRgn: THandle; bRedraw: Boolean): Integer; external 'SetWindowRgn@user32 stdcall';
function ShowWindow(hWnd: LongWord; nCmdShow: LongWord): LongWord; external 'ShowWindow@user32.dll stdcall';
function ReleaseCapture(): Longint; external 'ReleaseCapture@user32.dll stdcall';
Procedure CheckFoldersOnClick(Sender: TObject);
Begin
if CheckFolders.State= cbChecked then begin
if (UpdateHint = '') or (InfoButton.Tag= 1) then begin
InfoButton.Caption:= 'Подсчёт папок...'; InfoButton.Cursor:= crAppStart; UpdateButton.Cursor:= crAppStart; CheckFolders.Cursor:= crAppStart;
if UserSelectDir='' then FoldersSize.Caption:=' Система: '+ MorG(Trunc(CalcDirSize(ExpandConstant('{%windir}'),'*',True)/oneMB),True) +' ('+ MorG(Trunc(CalcDirSize(ExpandConstant('{%windir}\Temp'),'*',True)/oneMB + CalcDirSize(ExpandConstant('{reg:HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders,Local Settings}\Temp'),'*',True)/oneMB),True) +' Temp), Браузер: ' + MorG(Trunc(CalcDirSize(ExpandConstant('{reg:HKCU\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders,Cache}'),'*',True)/oneMB),True)
else FoldersSize.Caption:=' ' +MorG(Trunc(CalcDirSize(UserSelectDir,'*',True)/oneMB),True)+ ' ...' +Copy(UserSelectDir, Length(UserSelectDir)-46, 46)
UpdateHint:=FoldersSize.Caption
end else FoldersSize.Caption:=UpdateHint;
InfoButton.Caption:= 'Скрыть сведения'; InfoButton.Cursor:= crDefault; UpdateButton.Cursor:= crDefault; UpdateButton.Hint:=UserSelectDir; CheckFolders.Cursor:= crHand;
CancelButton.Tag:= 1
end else
CancelButton.Tag:= 0
End;
Procedure UpdateButtonOnClick(Sender: TObject); var Version: TWindowsVersion; NoPass: Boolean; CpuMHZ: Cardinal;
Begin
Check:=True; RegQueryDWordValue(HKLM,'Hardware\Description\System\CentralProcessor\0','~MHz',CpuMHZ); GetWindowsVersionEx(Version); GlobalMemoryStatus(Memory); GetSpaceOnDisk(ExpandConstant('{sd}'),True,FreeMB,TotalMB); VolumeName:= StringOfChar(' ', BufferLen); FileSystemName:= StringOfChar(' ', BufferLen); GetVolumeInformation(ExpandConstant('{sd}\'), VolumeName, BufferLen-1, VolumeSerialNo, MaxComponentLength, FileSystemFlags, FileSystemName, BufferLen-1);
with System do begin
Caption:= ' О системе'; Color:= LightColor; Parent:= InfoPage.Surface;
Top:= ScaleY(12); Width:= ScaleX(114); Height:= ScaleY(24); BevelOuter:= bvLowered; end;
with SystemNamePanel do begin //Windows versions
Caption:=ExpandConstant('{reg:HKLM\Software\Microsoft\Windows NT\CurrentVersion,ProductName} ') + ExpandConstant('{reg:HKLM\Software\Microsoft\Windows NT\CurrentVersion,CSDVersion} ') +'сборка ' +IntToStr(Version.Major) +'.' +IntToStr(Version.Minor);
If Pos('Microsoft', Caption) > 0 Then Caption:=Copy(Caption, 10, 45);
Top:= System.Top; Left:= System.Left + System.Width -2; Width:= ScaleX(305); Height:= System.Height; Parent:= InfoPage.Surface; BevelOuter:= bvLowered; Alignment:=taLeftJustify; Color:= GreenColor; Hint:='Свойства системы'; ShowHint:=True; Cursor:= crHand;
If (NeedSys*10 > (Version.Major*10 +Version.Minor)) or (NeedSp >Version.ServicePackMajor) then begin Caption:= Caption + ' (< ' +FloatToStr(NeedSys)+ ' SP' +IntToStr(NeedSp) + ')'; Color:= RedColor; NoPass:= True; end else Caption:= Caption + '.' + IntToStr(Version.Build); end;
with Processor do begin
Caption:= ' Процессор'; Color:= System.Color; Parent:= InfoPage.Surface;
Top:= System.Top + System.Height - 2; Left:= System.Left; Width:= System.Width; Height:= System.Height; BevelOuter:= bvLowered; end;
with ProcessorName do begin //CPU
Caption:=' '+ Trim(ExpandConstant('{reg:HKLM\Hardware\Description\System\CentralProcessor\0,ProcessorNameString}'))+ ' ' +FloatToStr(CpuMHZ/1000) +'GHz'
Top:= Processor.Top; Left:= SystemNamePanel.Left; Width:= SystemNamePanel.Width; Height:= System.Height; BevelOuter:= bvLowered; Parent:= InfoPage.Surface; Alignment:=taLeftJustify; Color:= GreenColor; Hint:='Управление компьютером'; ShowHint:=True; Cursor:= crHand;
if CpuMHZ < NeedMHZ then begin Caption:= Caption + ' (< ' + FloatToStr(round(NeedMHZ)/1000)+ ')'; Color:= RedColor; NoPass:= True; end; end;
with RAMPanel do begin
Caption:=' Объём памяти'; Color:= System.Color; Parent:= InfoPage.Surface;
Top:=Processor.Top + System.Height - 2; Left:= System.Left; Width:= System.Width; Height:= System.Height; BevelOuter:= bvLowered; end;
with RAMSize do begin //RAM
Caption:=' '+MorG(round(Memory.dwTotalPhys/oneMB/64)*64,False) +' всего, '+ MorG(Memory.dwAvailPhys/oneMB,False) +' свободно, '
Top:=RAMPanel.Top; Left:= SystemNamePanel.Left; Width:= SystemNamePanel.Width; Height:= System.Height; BevelOuter:= bvLowered; Parent:= InfoPage.Surface; Alignment:=taLeftJustify; Color:= GreenColor; Hint:='Учетные записи пользователей'; ShowHint:=True; Cursor:= crHand;
if round(Memory.dwTotalPhys/oneMB/64)*64 < NeedRAM then begin Caption:= Caption + 'требуется ' + MorG(NeedRAM,False); Color:= RedColor; NoPass:= True; end else Caption:= Caption +MorG((Memory.dwTotalPhys - Memory.dwAvailPhys)/oneMB,False) +' используется'; end;
with VideoCardPanel do begin
Caption:=' Видеоадаптер'; Color:= System.Color; Parent:= InfoPage.Surface;
Top:=RAMPanel.Top + System.Height - 2; Left:= System.Left; Width:= System.Width; Height:= System.Height; BevelOuter:= bvLowered; end;
with VideoCardName do begin //Video
Caption:= ' ' + Trim(GetVideoCardName)+ ', '+ MorG(round(GetVidMemLocal/oneMB/64)*64,False);
Top:=VideoCardPanel.Top; Left:= SystemNamePanel.Left; Width:= SystemNamePanel.Width; Height:= System.Height; BevelOuter:= bvLowered; Parent:= InfoPage.Surface; Alignment:=taLeftJustify; Color:= GreenColor; Hint:='Свойства: Экран'; ShowHint:=True; Cursor:= crHand;
if round(GetVidMemLocal/oneMB/64)*64 < NeedVRAM then begin Caption:= Caption + ' (< ' + MorG(NeedVRAM,False)+ ')'; Color:= RedColor; NoPass:= True; end;
Caption:= Caption + ', '+ IntToStr(GetSystemMetrics(0)) + 'x' +IntToStr(GetSystemMetrics(1)); end;
with AudioCardPanel do begin
Caption:=' Звуковая карта'; Color:= System.Color; Parent:= InfoPage.Surface;
Top:=VideoCardPanel.Top + System.Height - 2; Left:= System.Left; Width:= System.Width; Height:= System.Height; BevelOuter:= bvLowered; end;
with AudioCardName do begin //Sound card
if Pos('SB', UpperCase(GetSoundCardName)) > 0 then Caption:=' Creative Sound Blaster ' +Copy(GetSoundCardName,Pos('SB', UpperCase(GetSoundCardName))+3,Length(GetSoundCardName)) else Caption:=' '+GetSoundCardName + ' (рекомендуется Creative X-Fi)'
Top:=AudioCardPanel.Top; Left:= SystemNamePanel.Left; Width:= SystemNamePanel.Width; Height:= System.Height; BevelOuter:= bvLowered; Parent:= InfoPage.Surface; Alignment:=taLeftJustify; Color:= GreenColor; Hint:='Звуки и аудиоустройства'; ShowHint:=True; Cursor:= crHand;
if GetSoundCards = 0 then begin Caption:=' Устройство не обнаружено'; Color:= RedColor; NoPass:= True; end; end;
with NeedSoft do begin
Caption:=' Программы'; Color:= System.Color; Parent:= InfoPage.Surface;
Top:=AudioCardPanel.Top + System.Height - 2; Left:= System.Left; Width:= System.Width; Height:= System.Height; BevelOuter:= bvLowered; end;
with NeedSoftName do begin //Check Registry key
Top:=NeedSoft.Top; Left:= SystemNamePanel.Left; Width:= SystemNamePanel.Width; Height:= System.Height; BevelOuter:= bvLowered; Parent:= InfoPage.Surface; Alignment:=taLeftJustify; Color:= GreenColor; Hint:='Установка и удаление программ'; ShowHint:=True; Cursor:= crHand;
if RegKeyExists(HKLM, NeedProgram)= true then Caption:=' Пакет Microsoft .NET Framework установлен' else begin Caption:=' Требуется установить Microsoft .NET Framework'; Color:= RedColor; NoPass:= True; end; end;
with PageFilePanel do begin
Caption:=' Файл подкачки'; Color:= System.Color; Parent:= InfoPage.Surface;
Top:=NeedSoft.Top + System.Height - 2; Left:= System.Left; Width:= System.Width; Height:= System.Height; BevelOuter:= bvLowered; end;
with PageFileSize do begin //Virtual memory
Caption:=' '+MorG(GetSystemPage,False)+' всего, ';
Top:=PageFilePanel.Top; Left:= SystemNamePanel.Left; Width:= SystemNamePanel.Width; Height:= System.Height; BevelOuter:= bvLowered; Parent:= InfoPage.Surface; Alignment:=taLeftJustify; Color:= GreenColor; Hint:='Быстродействие'; ShowHint:=True; Cursor:= crHand;
if GetSystemPage < NeedSwap then begin Caption:= Caption + 'требуется не менее '+ MorG(NeedSwap,False); Color:= RedColor; NoPass:= True; end else Caption:= Caption + MorG((Memory.dwTotalPageFile - Memory.dwAvailPageFile)/oneMB,True) +' занято системным кэшем'; end;
with Hdd do begin
Caption:=' Системный диск'; Color:= System.Color; Parent:= InfoPage.Surface;
Top:=PageFilePanel.Top + System.Height - 2; Left:= System.Left; Width:= System.Width; Height:= System.Height; BevelOuter:= bvLowered; end;
with HddSize do begin //System drive
Caption:=' '+ MorG(TotalMB,True)+ ' всего, '+ IntToStr(round((TotalMB-FreeMB)/TotalMB*100))+ '% занято, '+ MorG(FreeMB,True)+ ' свободно';
Top:=Hdd.Top; Left:= SystemNamePanel.Left; Width:= SystemNamePanel.Width; Height:= System.Height; BevelOuter:= bvLowered; Parent:= InfoPage.Surface; Alignment:=taLeftJustify; Color:= GreenColor; Hint:='Очистка диска'; ShowHint:=True; Cursor:= crHand;
if FreeMB < NeedMB then begin Caption:= Caption +' (< '+ MorG(NeedMB,True)+ ')'; Color:= RedColor; NoPass:= True; end else Caption:= Caption +', '+ Trim(FileSystemName); end;
with Folders do begin
Color:= System.Color; Parent:= InfoPage.Surface;
Top:=Hdd.Top + System.Height -2; Left:= System.Left; Width:= System.Width; Height:= System.Height; BevelOuter:= bvLowered; end;
CheckFolders:= TCheckBox.Create(InfoPage);
with CheckFolders do begin
OnClick:= @CheckFoldersOnClick; Hint:='Подсчёт размера папок займёт некоторое время...'; ShowHint:=True; if CancelButton.Tag= 0 then State:= cbUnChecked else State:= cbChecked;
Caption:='Объём папок'; Color:= System.Color; Parent:= InfoPage.Surface; BringToFront; Cursor:= crHand; Top:=Folders.Top +ScaleY(5); Left:= System.Left +ScaleX(10); Width:= System.Width -ScaleX(15); end;
with FoldersSize do begin //calculate Size of User Folders
if CheckFolders.State= cbUnChecked then if UserSelectDir='' then Caption:=' Система: '+ ExpandConstant('{%windir}') +', Temporary Internet Files' else Caption:=' ...' + Copy(UserSelectDir, Length(UserSelectDir)-50, 50)
Top:=Folders.Top; Left:= SystemNamePanel.Left; Width:= SystemNamePanel.Width; Height:= System.Height; BevelOuter:= bvLowered; Parent:= InfoPage.Surface; Alignment:=taLeftJustify; Color:= GreenColor; Hint:='Щёлкните здесь для подсчёта размера другой папки...'; ShowHint:=True; Cursor:= crHand; end;
with TPanel.Create(InfoPage) do begin Parent:= InfoPage.Surface; BevelOuter:= bvLowered; Top:=System.Top; Height:= (System.Height-2)*9+2; Left:= SystemNamePanel.Left + SystemNamePanel.Width -2; end; with TPanel.Create(InfoPage) do begin Parent:= InfoPage.Surface; BevelOuter:= bvLowered; Top:=Folders.Top + System.Height -2; Left:= System.Left - 25; Width:= WizardForm.ClientWidth; end; with TPanel.Create(InfoPage) do begin Parent:= InfoPage.Surface; BevelOuter:= bvNone; Top:=System.Top; Height:= (System.Height-2)*9+2; Left:= SystemNamePanel.Left + SystemNamePanel.Width-1; end;
with TPanel.Create(InfoPage) do begin Parent:= InfoPage.Surface; BevelOuter:= bvNone; Top:=System.Top; Left:= System.Left; Height:= 1; Width:= 1; end; with TPanel.Create(InfoPage) do begin Parent:= InfoPage.Surface; BevelOuter:= bvNone; Top:=System.Top; Left:= SystemNamePanel.Left + SystemNamePanel.Width -2; Height:= 1; Width:= 1; end; with TPanel.Create(InfoPage) do begin Parent:= InfoPage.Surface; BevelOuter:= bvNone; Top:=Folders.Top + System.Height -2; Left:= System.Left; Height:= 1; Width:= 1; end; with TPanel.Create(InfoPage) do begin Parent:= InfoPage.Surface; BevelOuter:= bvNone; Top:=Folders.Top + System.Height -2; Left:= SystemNamePanel.Left + SystemNamePanel.Width -2; Height:= 1; Width:= 1; end;
if NoPass then begin WizardForm.PageDescriptionLabel.Font.Color:=$402080 InfoPage.Description:='Не все компоненты соответствуют требованиям программы, проверьте позиции, выделеные красным!' end;
End;
Procedure CloseInfo; Begin If InfoButton.Tag= 1 then InfoButton.OnClick(InfoButton) End;
Function BackButtonClick(CurPageID: Integer): Boolean; Begin Result:= True CloseInfo End;
Function NextButtonClick(CurPageID: Integer): Boolean;
Begin If InfoButton.Tag= 1 then else Result:= True
if (i =wpWelcome) and (InfoButton.Tag= 1) then Result:= True
CloseInfo
if (CurPageID = wpWelcome) and Not(Check) then begin InfoButton.OnClick(InfoButton) Result:= False end
End;
Procedure CancelButtonClick(CurPageID: Integer; var Cancel, Confirm: Boolean); //С началом установки включаем подтверждение при нажатии на кнопку 'Отмена'
Begin If CurPageID <> wpInstalling then Confirm:= False End;
procedure ListBoxOnClick(Sender: TObject);
Begin for i:= 0 to ListBox.Items.Count-1 do if ListBox.Selected[i] then WizardForm.DirEdit.Text:= Copy(ListBox.Items[i],1,1) +Copy(WizardForm.DirEdit.Text, 2, Length(WizardForm.DirEdit.Text)); End;
Procedure DirOnClick(Sender: TObject);
Begin UserSelectDir:= WizardForm.DirEdit.Text If BrowseForFolder('Выберите папку для установки или создайте новую', UserSelectDir, True) then WizardForm.DirEdit.Text:= UserSelectDir End;
Procedure SystemNamePanelOnClick(Sender: TObject);
Begin Exec(ExpandConstant('{sys}\rundll32.exe'), 'shell32.dll, Control_RunDLL sysdm.cpl', '', sw_Hide, ewWaitUntilTerminated, errorCode); UpdateButton.OnClick(UpdateButton); End;
Procedure ProcessorNameOnClick(Sender: TObject);
Begin ShellExec('open', ExpandConstant('{sys}\compmgmt.msc'), '', '', sw_Show, ewWaitUntilTerminated, errorCode); UpdateButton.OnClick(UpdateButton); End;
Procedure RAMSizeOnClick(Sender: TObject);
Begin Exec(ExpandConstant('{sys}\control.exe'), 'userpasswords2', '', sw_Hide, ewNoWait, errorCode) End;
Procedure VideoCardNameOnClick(Sender: TObject);
Begin Exec(ExpandConstant('{sys}\control.exe'), 'desk.cpl,,3', '', sw_Hide, ewWaitUntilTerminated, errorCode); UpdateButton.OnClick(UpdateButton); End;
Procedure AudioCardNameOnClick(Sender: TObject);
Begin Exec(ExpandConstant('{sys}\control.exe'), 'mmsys.cpl', '', sw_Hide, ewNoWait, errorCode) End;
Procedure NeedSoftNameOnClick(Sender: TObject);
Begin Exec(ExpandConstant('{sys}\control.exe'), 'appwiz.cpl', '', sw_Hide, ewNoWait, errorCode) End;
Procedure PageFileSizeOnClick(Sender: TObject);
Begin Exec(ExpandConstant('{sys}\rundll32.exe'), 'shell32.dll, Control_RunDLL sysdm.cpl,,3', '', sw_Hide, ewWaitUntilTerminated, errorCode); UpdateButton.OnClick(UpdateButton); End;
Procedure HddSizeOnClick(Sender: TObject);
Begin ShellExec('open', ExpandConstant('{sys}\cleanmgr.exe'), '', '', sw_Show, ewWaitUntilTerminated, errorCode); UpdateButton.OnClick(UpdateButton); End;
Procedure FoldersSizeOnClick(Sender: TObject);
Begin if BrowseForFolder('Выберите папку для подсчёта её размера:', UserSelectDir, False) then begin CheckFolders.State:= cbUnChecked; CheckFolders.State:= cbChecked; end End;
Procedure InfoButtonOnClick(Sender: TObject);
Begin
if InfoButton.Tag= 0 then begin
InfoPage:= CreateCustomPage(CurPage, 'Проверка системных требований', 'Все компоненты соответствуют требованиям программы')
System:=TPanel.Create(InfoPage); SystemNamePanel:=TPanel.Create(InfoPage); SystemNamePanel.OnClick:= @SystemNamePanelOnClick
Processor:=TPanel.Create(InfoPage); ProcessorName:=TPanel.Create(InfoPage); ProcessorName.OnClick:= @ProcessorNameOnClick
RAMPanel:=TPanel.Create(InfoPage); RAMSize:=TPanel.Create(InfoPage); RAMSize.OnClick:= @RAMSizeOnClick
VideoCardPanel:=TPanel.Create(InfoPage); VideoCardName:=TPanel.Create(InfoPage); VideoCardName.OnClick:= @VideoCardNameOnClick
AudioCardPanel:=TPanel.Create(InfoPage); AudioCardName:=TPanel.Create(InfoPage); AudioCardName.OnClick:= @AudioCardNameOnClick
NeedSoft:=TPanel.Create(InfoPage); NeedSoftName:=TPanel.Create(InfoPage); NeedSoftName.OnClick:= @NeedSoftNameOnClick
PageFilePanel:=TPanel.Create(InfoPage); PageFileSize:=TPanel.Create(InfoPage); PageFileSize.OnClick:= @PageFileSizeOnClick
Hdd:=TPanel.Create(InfoPage); HddSize:=TPanel.Create(InfoPage); HddSize.OnClick:= @HddSizeOnClick
Folders:=TPanel.Create(InfoPage); FoldersSize:=TPanel.Create(InfoPage); FoldersSize.OnClick:= @FoldersSizeOnClick;
UpdateButton:= TButton.Create(WizardForm);
with UpdateButton do begin Top:= CancelButton.Top; Left:= InfoButton.Left + InfoButton.Width; Width:= CancelButton.Width; Caption:= 'Обновить'; OnClick:= @UpdateButtonOnClick; Parent:= WizardForm; Hint:=UserSelectDir; ShowHint:=True; end;
UpdateButton.OnClick(UpdateButton);
WizardForm.NextButton.OnClick(WizardForm.NextButton);
InfoButton.Caption:= 'Скрыть сведения'; InfoButton.Cursor:= crDefault; InfoButton.Tag:= 1;
end else begin
InfoButton.Caption:= 'О системе'; InfoButton.Cursor:= crHelp; InfoButton.Tag:= 0;
WizardForm.BackButton.OnClick(WizardForm.BackButton);
WizardForm.PageDescriptionLabel.Font.Color:= WizardForm.PageNameLabel.Font.Color
UpdateButton.Free
InfoPage.Free
end
End;
procedure WizardLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture
SendMessage(WizardForm.Handle, WM_SYSCOMMAND, $F012, 0)
end;
procedure ShapeForm(aForm: TForm; edgeSize: integer);
begin
FormRegion:=CreateRoundRectRgn(0,0, aForm.width, aForm.height, edgeSize,edgeSize)
SetWindowRgn(aForm.Handle, FormRegion, True)
end;
procedure MinLabelOnClick(Sender: TObject);
begin
ShowWindow(WizardForm.Handle, SW_SHOWMINIMIZED)
end;
procedure ExtLabelOnClick(Sender: TObject);
begin
WizardForm.Close
end;
procedure MinLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
MinImage.Left:=-44
end;
procedure MinLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
MinImage.Left:=0
end;
procedure ExtLabelMouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ExtImage.Left:=-44
end;
procedure ExtLabelMouseUp(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
begin
ExtImage.Left:=0
end;
Procedure LicenseAcceptedOnClick (Sender: TObject);
begin
WizardForm.LicenseAcceptedRadio.Checked:=True
end;
Procedure LicenseNotAcceptedOnClick (Sender: TObject);
begin
WizardForm.LicenseNotAcceptedRadio.Checked:=True
end;
Procedure NoIconsLabelOnClick (Sender: TObject);
begin
WizardForm.NoIconsCheck.Checked:=Not(WizardForm.NoIconsCheck.Checked)
end;
Procedure YesRadioOnClick (Sender: TObject);
begin
WizardForm.YesRadio.Checked:=True
end;
Procedure NoRadioOnClick (Sender: TObject);
begin
WizardForm.NoRadio.Checked:=True
end;
Procedure HideAll();
begin
WizardForm.Bevel.Hide
WizardForm.Bevel1.Hide
WizardForm.MainPanel.Hide
WizardForm.BeveledLabel.Hide
WizardForm.OuterNotebook.Hide
WizardForm.InnerNotebook.Hide
WelcomeLabel1.Hide
WelcomeLabel2.Hide
LicenseLabel1.Hide
WizardForm.LicenseMemo.Hide
WizardForm.LicenseAcceptedRadio.Hide
LicenseAcceptedLabel.Hide
WizardForm.LicenseNotAcceptedRadio.Hide
LicenseNotAcceptedLabel.Hide
PasswordLabel.Hide
PasswordEditLabel.Hide
WizardForm.PasswordEdit.Hide
InfoBeforeClickLabel.Hide
WizardForm.InfoBeforeMemo.Hide
UserInfoNameLabel.Hide
WizardForm.UserInfoNameEdit.Hide
UserInfoOrgLabel.Hide
WizardForm.UserInfoOrgEdit.Hide
UserInfoSerialLabel.Hide
WizardForm.UserInfoSerialEdit.Hide
SelectDirLabel.Hide
SelectDirBrowseLabel.Hide
WizardForm.DirEdit.Hide
WizardForm.DirBrowseButton.Hide
DiskSpaceLabel.Hide
SelectComponentsLabel.Hide
WizardForm.TypesCombo.Hide
WizardForm.ComponentsList.Hide
ComponentsDiskSpaceLabel.Hide
SelectStartMenuFolderLabel.Hide
SelectStartMenuFolderBrowseLabel.Hide
WizardForm.GroupEdit.Hide
WizardForm.GroupBrowseButton.Hide
WizardForm.NoIconsCheck.Hide
NoIconsLabel.Hide
SelectTasksLabel.Hide
WizardForm.TasksList.Hide
ReadyLabel.Hide
WizardForm.ReadyMemo.Hide
StatusLabel.Hide
WizardForm.ProgressGauge.Hide
InfoAfterClickLabel.Hide
WizardForm.InfoAfterMemo.Hide
FinishedHeadingLabel.Hide
FinishedLabel.Hide
WizardForm.RunList.Hide
YesRadio.Hide
YesRadioLabel.Hide
NoRadio.Hide
NoRadioLabel.Hide
end;
Procedure InitializeSkin();
begin
ExtractTemporaryFile('{#SysButtonImage}')
WizardForm.Width:=697
WizardForm.Height:=529
WizardForm.BorderStyle:=bsNone
WizardForm.Center
ShapeForm(WizardForm, radius)
WizardForm.WizardBitmapImage.Left:=0
WizardForm.WizardBitmapImage.Top:=0
WizardForm.WizardBitmapImage.AutoSize:=True
WizardForm.WizardBitmapImage.Enabled:=False
WizardForm.WizardBitmapImage.Parent:=WizardForm
WizardLabel:=TLabel.Create(WizardForm)
WizardLabel.Width:=WizardForm.Width
WizardLabel.Height:=WizardForm.Height
WizardLabel.AutoSize:=False
WizardLabel.Transparent:=True
WizardLabel.OnMouseDown:=@WizardLabelMouseDown
WizardLabel.Parent:=WizardForm
WizardCaptionLabel:=TLabel.Create(WizardForm)
WizardCaptionLabel.Left:=11
WizardCaptionLabel.Top:=9
WizardCaptionLabel.Transparent:=True
WizardCaptionLabel.Font.Size:=10
WizardCaptionLabel.Font.Style:=[fsBold]
WizardCaptionLabel.Font.Color:=CaptionLabel
WizardCaptionLabel.Caption:=WizardForm.Caption
WizardCaptionLabel.OnMouseDown:=@WizardLabelMouseDown
WizardCaptionLabel.Parent:=WizardForm
WizardCaptionLabel2:=TLabel.Create(WizardForm)
WizardCaptionLabel2.Left:=10
WizardCaptionLabel2.Top:=8
WizardCaptionLabel2.Transparent:=True
WizardCaptionLabel2.Font.Size:=10
WizardCaptionLabel2.Font.Style:=[fsBold]
WizardCaptionLabel2.Font.Color:=CaptionLabel2
WizardCaptionLabel2.Caption:=WizardForm.Caption
WizardCaptionLabel2.OnMouseDown:=@WizardLabelMouseDown
WizardCaptionLabel2.Parent:=WizardForm
MinPanel:=TPanel.Create(WizardForm)
MinPanel.Left:=602
MinPanel.Top:=0
MinPanel.Width:=44
MinPanel.Height:=18
MinPanel.Parent:=WizardForm
MinImage:=TBitmapImage.Create(WizardForm)
MinImage.Left:=0
MinImage.Top:=0
MinImage.AutoSize:=True
MinImage.Enabled:=False
MinImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\{#SysButtonImage}'))
MinImage.Parent:=MinPanel
MinLabel:=TLabel.Create(WizardForm)
MinLabel.Left:=0
MinLabel.Top:=0
MinLabel.Width:=44
MinLabel.Height:=18
MinLabel.AutoSize:=False
MinLabel.Transparent:=True
MinLabel.OnClick:=@MinLabelOnClick
MinLabel.OnMouseDown:=@MinLabelMouseDown
MinLabel.OnMouseUp:=@MinLabelMouseUp
MinLabel.Parent:=MinPanel
ExtPanel:=TPanel.Create(WizardForm)
ExtPanel.Left:=646
ExtPanel.Top:=0
ExtPanel.Width:=44
ExtPanel.Height:=18
ExtPanel.Parent:=WizardForm
ExtImage:=TBitmapImage.Create(WizardForm)
ExtImage.Left:=0
ExtImage.Top:=-18
ExtImage.AutoSize:=True
ExtImage.Enabled:=False
ExtImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\{#SysButtonImage}'))
ExtImage.Parent:=ExtPanel
ExtLabel:=TLabel.Create(WizardForm)
ExtLabel.Left:=0
ExtLabel.Top:=0
ExtLabel.Width:=44
ExtLabel.Height:=18
ExtLabel.AutoSize:=False
ExtLabel.Transparent:=True
ExtLabel.OnClick:=@ExtLabelOnClick
ExtLabel.OnMouseDown:=@ExtLabelMouseDown
ExtLabel.OnMouseUp:=@ExtLabelMouseUp
ExtLabel.Parent:=ExtPanel
WizardForm.BackButton.Left:=293
WizardForm.BackButton.Top:=485
WizardForm.BackButton.Width:=77
WizardForm.BackButton.Height:=25
WizardForm.NextButton.Left:=375
WizardForm.NextButton.Top:=485
WizardForm.NextButton.Width:=77
WizardForm.NextButton.Height:=25
WizardForm.CancelButton.Left:=600
WizardForm.CancelButton.Top:=485
WizardForm.CancelButton.Width:=77
WizardForm.CancelButton.Height:=25
PageNameLabel:=TLabel.Create(WizardForm)
PageNameLabel.Left:=20
PageNameLabel.Top:=40
PageNameLabel.Transparent:=True
PageNameLabel.Font.Style:=[fsBold]
PageNameLabel.Font.Color:=FontColor
PageNameLabel.OnMouseDown:=@WizardLabelMouseDown
PageNameLabel.Parent:=WizardForm
PageDescriptionLabel:=TLabel.Create(WizardForm)
PageDescriptionLabel.Left:=30
PageDescriptionLabel.Top:=60
PageDescriptionLabel.Transparent:=True
PageDescriptionLabel.Font.Color:=FontColor
PageDescriptionLabel.OnMouseDown:=@WizardLabelMouseDown
PageDescriptionLabel.Parent:=WizardForm
BeveledLabel:=TLabel.Create(WizardForm)
BeveledLabel.Left:=10
BeveledLabel.Top:=490
BeveledLabel.Font.Color:=BeveledLabelFontColor
BeveledLabel.Transparent:=True
BeveledLabel.Caption:=WizardForm.BeveledLabel.Caption
BeveledLabel.Parent:=WizardForm
WizardForm.BeveledLabel.Left:=700
// wpWelcome
WelcomeLabel1:=TLabel.Create(WizardForm)
WelcomeLabel1.Left:=205
WelcomeLabel1.Top:=210
WelcomeLabel1.Width:=465
WelcomeLabel1.Height:=28
WelcomeLabel1.AutoSize:=False
WelcomeLabel1.WordWrap:=True
WelcomeLabel1.Transparent:=True
WelcomeLabel1.Font.Color:=FontColor
WelcomeLabel1.Font.Style:=[fsBold]
WelcomeLabel1.Caption:=WizardForm.WelcomeLabel1.Caption
WelcomeLabel1.OnMouseDown:=@WizardLabelMouseDown
WelcomeLabel1.Parent:=WizardForm
WelcomeLabel2:=TLabel.Create(WizardForm)
WelcomeLabel2.Left:=205
WelcomeLabel2.Top:=250
WelcomeLabel2.Width:=465
WelcomeLabel2.Height:=200
WelcomeLabel2.AutoSize:=False
WelcomeLabel2.WordWrap:=True
WelcomeLabel2.Font.Color:=FontColor
WelcomeLabel2.Transparent:=True
WelcomeLabel2.Caption:=WizardForm.WelcomeLabel2.Caption
WelcomeLabel2.OnMouseDown:=@WizardLabelMouseDown
WelcomeLabel2.Parent:=WizardForm
// wpLicense
LicenseLabel1:=TLabel.Create(WizardForm)
LicenseLabel1.Left:=205
LicenseLabel1.Top:=110
LicenseLabel1.Width:=465
LicenseLabel1.Height:=28
LicenseLabel1.AutoSize:=False
LicenseLabel1.WordWrap:=True
LicenseLabel1.Font.Color:=FontColor
LicenseLabel1.Transparent:=True
LicenseLabel1.Caption:=WizardForm.LicenseLabel1.Caption
LicenseLabel1.OnMouseDown:=@WizardLabelMouseDown
LicenseLabel1.Parent:=WizardForm
WizardForm.LicenseMemo.Left:=205
WizardForm.LicenseMemo.Top:=148
WizardForm.LicenseMemo.Width:=465
WizardForm.LicenseMemo.Height:=266
WizardForm.LicenseMemo.Parent:=WizardForm
WizardForm.LicenseAcceptedRadio.Left:=205
WizardForm.LicenseAcceptedRadio.Top:=425
WizardForm.LicenseAcceptedRadio.Width:=14
WizardForm.LicenseAcceptedRadio.Height:=14
WizardForm.LicenseAcceptedRadio.Color:=$d28b23
WizardForm.LicenseAcceptedRadio.Parent:=WizardForm
LicenseAcceptedLabel:=TLabel.Create(WizardForm)
LicenseAcceptedLabel.Left:=221
LicenseAcceptedLabel.Top:=425
LicenseAcceptedLabel.Font.Color:=FontColor
LicenseAcceptedLabel.Transparent:=True
LicenseAcceptedLabel.BringToFront
LicenseAcceptedLabel.Caption:=WizardForm.LicenseAcceptedRadio.Caption
LicenseAcceptedLabel.OnClick:=@LicenseAcceptedOnClick
LicenseAcceptedLabel.Parent:=WizardForm
WizardForm.LicenseNotAcceptedRadio.Left:=205
WizardForm.LicenseNotAcceptedRadio.Top:=445
WizardForm.LicenseNotAcceptedRadio.Width:=14
WizardForm.LicenseNotAcceptedRadio.Height:=14
WizardForm.LicenseNotAcceptedRadio.Color:=$d99738
WizardForm.LicenseNotAcceptedRadio.Parent:=WizardForm
LicenseNotAcceptedLabel:=TLabel.Create(WizardForm)
LicenseNotAcceptedLabel.Left:=221
LicenseNotAcceptedLabel.Top:=445
LicenseNotAcceptedLabel.Font.Color:=FontColor
LicenseNotAcceptedLabel.Transparent:=True
LicenseNotAcceptedLabel.Caption:=WizardForm.LicenseNotAcceptedRadio.Caption
LicenseNotAcceptedLabel.OnClick:=@LicenseNotAcceptedOnClick
LicenseNotAcceptedLabel.Parent:=WizardForm
// wpPassword
PasswordLabel:=TLabel.Create(WizardForm)
PasswordLabel.Left:=205
PasswordLabel.Top:=110
PasswordLabel.Width:=465
PasswordLabel.Height:=28
PasswordLabel.AutoSize:=False
PasswordLabel.WordWrap:=True
PasswordLabel.Font.Color:=FontColor
PasswordLabel.Transparent:=True
PasswordLabel.Caption:=WizardForm.PasswordLabel.Caption
PasswordLabel.OnMouseDown:=@WizardLabelMouseDown
PasswordLabel.Parent:=WizardForm
PasswordEditLabel:=TLabel.Create(WizardForm)
PasswordEditLabel.Left:=205
PasswordEditLabel.Top:=144
PasswordEditLabel.Font.Color:=FontColor
PasswordEditLabel.Transparent:=True
PasswordEditLabel.Caption:=WizardForm.PasswordEditLabel.Caption
PasswordEditLabel.OnMouseDown:=@WizardLabelMouseDown
PasswordEditLabel.Parent:=WizardForm
WizardForm.PasswordEdit.Left:=205
WizardForm.PasswordEdit.Top:=160
WizardForm.PasswordEdit.Width:=465
WizardForm.PasswordEdit.Height:=21
WizardForm.PasswordEdit.Color:=$ffffff
WizardForm.PasswordEdit.Font.Color:=$000000
WizardForm.PasswordEdit.Parent:= WizardForm
// wpInfoBefore
InfoBeforeClickLabel:=TLabel.Create(WizardForm)
InfoBeforeClickLabel.Left:=205
InfoBeforeClickLabel.Top:=110
InfoBeforeClickLabel.Font.Color:=FontColor
InfoBeforeClickLabel.Transparent:=True
InfoBeforeClickLabel.Caption:=WizardForm.InfoBeforeClickLabel.Caption
InfoBeforeClickLabel.OnMouseDown:=@WizardLabelMouseDown
InfoBeforeClickLabel.Parent:=WizardForm
WizardForm.InfoBeforeMemo.Left:=205
WizardForm.InfoBeforeMemo.Top:=134
WizardForm.InfoBeforeMemo.Width:=465
WizardForm.InfoBeforeMemo.Height:=300
WizardForm.InfoBeforeMemo.Parent:= WizardForm
// wpUserInfo
UserInfoNameLabel:=TLabel.Create(WizardForm)
UserInfoNameLabel.Left:=205
UserInfoNameLabel.Top:=110
UserInfoNameLabel.Font.Color:=FontColor
UserInfoNameLabel.Transparent:=True
UserInfoNameLabel.Caption:=WizardForm.UserInfoNameLabel.Caption
UserInfoNameLabel.OnMouseDown:=@WizardLabelMouseDown
UserInfoNameLabel.Parent:=WizardForm
WizardForm.UserInfoNameEdit.Left:=205
WizardForm.UserInfoNameEdit.Top:=126
WizardForm.UserInfoNameEdit.Width:=465
WizardForm.UserInfoNameEdit.Height:=21
WizardForm.UserInfoNameEdit.Color:=$ffffff
WizardForm.UserInfoNameEdit.Font.Color:=$000000
WizardForm.UserInfoNameEdit.Parent:= WizardForm
UserInfoOrgLabel:=TLabel.Create(WizardForm)
UserInfoOrgLabel.Left:=205
UserInfoOrgLabel.Top:=162
UserInfoOrgLabel.Font.Color:=FontColor
UserInfoOrgLabel.Transparent:=True
UserInfoOrgLabel.Caption:=WizardForm.UserInfoOrgLabel.Caption
UserInfoOrgLabel.OnMouseDown:=@WizardLabelMouseDown
UserInfoOrgLabel.Parent:=WizardForm
WizardForm.UserInfoOrgEdit.Left:=205
WizardForm.UserInfoOrgEdit.Top:=178
WizardForm.UserInfoOrgEdit.Width:=465
WizardForm.UserInfoOrgEdit.Height:=21
WizardForm.UserInfoOrgEdit.Color:=$ffffff
WizardForm.UserInfoOrgEdit.Font.Color:=$000000
WizardForm.UserInfoOrgEdit.Parent:= WizardForm
UserInfoSerialLabel:=TLabel.Create(WizardForm)
UserInfoSerialLabel.Left:=205
UserInfoSerialLabel.Top:=214
UserInfoSerialLabel.Font.Color:=FontColor
UserInfoSerialLabel.Transparent:=True
UserInfoSerialLabel.Caption:=WizardForm.UserInfoSerialLabel.Caption
UserInfoSerialLabel.OnMouseDown:=@WizardLabelMouseDown
UserInfoSerialLabel.Parent:=WizardForm
WizardForm.UserInfoSerialEdit.Left:=205
WizardForm.UserInfoSerialEdit.Top:=230
WizardForm.UserInfoSerialEdit.Width:=465
WizardForm.UserInfoSerialEdit.Height:=21
WizardForm.UserInfoSerialEdit.Color:=$ffffff
WizardForm.UserInfoSerialEdit.Font.Color:=$000000
WizardForm.UserInfoSerialEdit.Parent:= WizardForm
// wpSelectDir
SelectDirLabel:=TLabel.Create(WizardForm)
SelectDirLabel.Left:=205
SelectDirLabel.Top:=110
SelectDirLabel.Width:=465
SelectDirLabel.Height:=28
SelectDirLabel.AutoSize:=False
SelectDirLabel.WordWrap:=True
SelectDirLabel.Font.Color:=FontColor
SelectDirLabel.Transparent:=True
SelectDirLabel.Caption:=WizardForm.SelectDirLabel.Caption
SelectDirLabel.OnMouseDown:=@WizardLabelMouseDown
SelectDirLabel.Parent:=WizardForm
SelectDirBrowseLabel:=TLabel.Create(WizardForm)
SelectDirBrowseLabel.Left:=205
SelectDirBrowseLabel.Top:=140
SelectDirBrowseLabel.Width:=465
SelectDirBrowseLabel.Height:=28
SelectDirBrowseLabel.AutoSize:=False
SelectDirBrowseLabel.WordWrap:=True
SelectDirBrowseLabel.Font.Color:=FontColor
SelectDirBrowseLabel.Transparent:=True
SelectDirBrowseLabel.Caption:=WizardForm.SelectDirBrowseLabel.Caption
SelectDirBrowseLabel.OnMouseDown:=@WizardLabelMouseDown
SelectDirBrowseLabel.Parent:=WizardForm
WizardForm.DirEdit.Left:=205
WizardForm.DirEdit.Top:=400
WizardForm.DirEdit.Width:=370
WizardForm.DirEdit.Height:=21
WizardForm.DirEdit.Color:=$ffffff
WizardForm.DirEdit.Font.Color:=$000000
WizardForm.DirEdit.Parent:= WizardForm
WizardForm.DirBrowseButton.Left:=593
WizardForm.DirBrowseButton.Top:=398
WizardForm.DirBrowseButton.Width:=77
WizardForm.DirBrowseButton.Height:=25
WizardForm.DirBrowseButton.Parent:= WizardForm
DiskSpaceLabel:=TLabel.Create(WizardForm)
DiskSpaceLabel.Left:=205
DiskSpaceLabel.Top:=435
DiskSpaceLabel.Font.Color:=FontColor
DiskSpaceLabel.Transparent:=True
DiskSpaceLabel.Caption:=WizardForm.DiskSpaceLabel.Caption
DiskSpaceLabel.OnMouseDown:=@WizardLabelMouseDown
DiskSpaceLabel.Parent:=WizardForm
// wpSelectComponents
SelectComponentsLabel:=TLabel.Create(WizardForm)
SelectComponentsLabel.Left:=205
SelectComponentsLabel.Top:=110
SelectComponentsLabel.Width:=465
SelectComponentsLabel.Height:=42
SelectComponentsLabel.AutoSize:=False
SelectComponentsLabel.WordWrap:=True
SelectComponentsLabel.Font.Color:=FontColor
SelectComponentsLabel.Transparent:=True
SelectComponentsLabel.Caption:=WizardForm.SelectComponentsLabel.Caption
SelectComponentsLabel.OnMouseDown:=@WizardLabelMouseDown
SelectComponentsLabel.Parent:=WizardForm
WizardForm.TypesCombo.Left:=205
WizardForm.TypesCombo.Top:=154
WizardForm.TypesCombo.Width:=465
WizardForm.TypesCombo.Height:=21
WizardForm.TypesCombo.Color:=$ffffff
WizardForm.TypesCombo.Font.Color:=$000000
WizardForm.TypesCombo.Style:=csDropDown
WizardForm.TypesCombo.Parent:= WizardForm
WizardForm.ComponentsList.Left:=205
WizardForm.ComponentsList.Top:=178
WizardForm.ComponentsList.Width:=465
WizardForm.ComponentsList.Height:=243
WizardForm.ComponentsList.Color:=$ffffff
WizardForm.ComponentsList.Font.Color:=$000000
WizardForm.ComponentsList.Parent:= WizardForm
ComponentsDiskSpaceLabel:=TLabel.Create(WizardForm)
ComponentsDiskSpaceLabel.Left:=205
ComponentsDiskSpaceLabel.Top:=435
ComponentsDiskSpaceLabel.Font.Color:=FontColor
ComponentsDiskSpaceLabel.Transparent:=True
ComponentsDiskSpaceLabel.Caption:=WizardForm.ComponentsDiskSpaceLabel.Caption
ComponentsDiskSpaceLabel.OnMouseDown:=@WizardLabelMouseDown
ComponentsDiskSpaceLabel.Parent:=WizardForm
// wpSelectProgramGroup
SelectStartMenuFolderLabel:=TLabel.Create(WizardForm)
SelectStartMenuFolderLabel.Left:=205
SelectStartMenuFolderLabel.Top:=110
SelectStartMenuFolderLabel.Width:=465
SelectStartMenuFolderLabel.Height:=28
SelectStartMenuFolderLabel.AutoSize:=False
SelectStartMenuFolderLabel.WordWrap:=True
SelectStartMenuFolderLabel.Font.Color:=FontColor
SelectStartMenuFolderLabel.Transparent:=True
SelectStartMenuFolderLabel.Caption:=WizardForm.SelectStartMenuFolderLabel.Caption
SelectStartMenuFolderLabel.OnMouseDown:=@WizardLabelMouseDown
SelectStartMenuFolderLabel.Parent:=WizardForm
SelectStartMenuFolderBrowseLabel:=TLabel.Create(WizardForm)
SelectStartMenuFolderBrowseLabel.Left:=205
SelectStartMenuFolderBrowseLabel.Top:=140
SelectStartMenuFolderBrowseLabel.Width:=465
SelectStartMenuFolderBrowseLabel.Height:=28
SelectStartMenuFolderBrowseLabel.AutoSize:=False
SelectStartMenuFolderBrowseLabel.WordWrap:=True
SelectStartMenuFolderBrowseLabel.Font.Color:=FontColor
SelectStartMenuFolderBrowseLabel.Transparent:=True
SelectStartMenuFolderBrowseLabel.Caption:=WizardForm.SelectStartMenuFolderBrowseLabel.Caption
SelectStartMenuFolderBrowseLabel.OnMouseDown:=@WizardLabelMouseDown
SelectStartMenuFolderBrowseLabel.Parent:=WizardForm
WizardForm.GroupEdit.Left:=205
WizardForm.GroupEdit.Top:=400
WizardForm.GroupEdit.Width:=370
WizardForm.GroupEdit.Height:=21
WizardForm.GroupEdit.Color:=$ffffff
WizardForm.GroupEdit.Font.Color:=$000000
WizardForm.GroupEdit.Parent:= WizardForm
WizardForm.GroupBrowseButton.Left:=593
WizardForm.GroupBrowseButton.Top:=398
WizardForm.GroupBrowseButton.Width:=77
WizardForm.GroupBrowseButton.Height:=25
WizardForm.GroupBrowseButton.Parent:= WizardForm
WizardForm.NoIconsCheck.Left:=205
WizardForm.NoIconsCheck.Top:=435
WizardForm.NoIconsCheck.Width:=13
WizardForm.NoIconsCheck.Height:=13
WizardForm.NoIconsCheck.Visible:=True
WizardForm.NoIconsCheck.Parent:= WizardForm
NoIconsLabel:=TLabel.Create(WizardForm)
NoIconsLabel.Left:=221
NoIconsLabel.Top:=435
NoIconsLabel.Font.Color:=FontColor
NoIconsLabel.Transparent:=True
NoIconsLabel.OnClick:=@NoIconsLabelOnClick
NoIconsLabel.Caption:=WizardForm.NoIconsCheck.Caption
NoIconsLabel.Parent:=WizardForm
// wpSelectTasks
SelectTasksLabel:=TLabel.Create(WizardForm)
SelectTasksLabel.Left:=205
SelectTasksLabel.Top:=110
SelectTasksLabel.Width:=465
SelectTasksLabel.Height:=28
SelectTasksLabel.AutoSize:=False
SelectTasksLabel.WordWrap:=True
SelectTasksLabel.Font.Color:=FontColor
SelectTasksLabel.Transparent:=True
SelectTasksLabel.Caption:=WizardForm.SelectTasksLabel.Caption
SelectTasksLabel.OnMouseDown:=@WizardLabelMouseDown
SelectTasksLabel.Parent:=WizardForm
WizardForm.TasksList.Left:=205
WizardForm.TasksList.Top:=154
WizardForm.TasksList.Width:=465
WizardForm.TasksList.Height:=300
WizardForm.TasksList.Color:=$ffffff
WizardForm.TasksList.Font.Color:=$000000
WizardForm.TasksList.Parent:= WizardForm
// wpReady
ReadyLabel:=TLabel.Create(WizardForm)
ReadyLabel.Left:=205
ReadyLabel.Top:=110
ReadyLabel.Width:=465
ReadyLabel.Height:=28
ReadyLabel.AutoSize:=False
ReadyLabel.WordWrap:=True
ReadyLabel.Font.Color:=FontColor
ReadyLabel.Transparent:=True
ReadyLabel.OnMouseDown:=@WizardLabelMouseDown
ReadyLabel.Parent:=WizardForm
WizardForm.ReadyMemo.Left:=205
WizardForm.ReadyMemo.Top:=144
WizardForm.ReadyMemo.Width:=465
WizardForm.ReadyMemo.Height:=300
WizardForm.ReadyMemo.Color:=$ffffff
WizardForm.ReadyMemo.Font.Color:=$000000
WizardForm.ReadyMemo.Parent:= WizardForm
// wpInstalling
StatusLabel:=TLabel.Create(WizardForm)
StatusLabel.Left:=205
StatusLabel.Top:=110
StatusLabel.Font.Color:=FontColor
StatusLabel.Transparent:=True
StatusLabel.Caption:=WizardForm.Caption +'...'
StatusLabel.OnMouseDown:=@WizardLabelMouseDown
StatusLabel.Parent:=WizardForm
WizardForm.ProgressGauge.Left:=205
WizardForm.ProgressGauge.Top:=140
WizardForm.ProgressGauge.Width:=465
WizardForm.ProgressGauge.Height:=21
WizardForm.ProgressGauge.Parent:= WizardForm
// wpInfoAfter
InfoAfterClickLabel:=TLabel.Create(WizardForm)
InfoAfterClickLabel.Left:=205
InfoAfterClickLabel.Top:=110
InfoAfterClickLabel.Font.Color:=FontColor
InfoAfterClickLabel.Transparent:=True
InfoAfterClickLabel.Caption:=WizardForm.InfoAfterClickLabel.Caption
InfoAfterClickLabel.OnMouseDown:=@WizardLabelMouseDown
InfoAfterClickLabel.Parent:=WizardForm
WizardForm.InfoAfterMemo.Left:=205
WizardForm.InfoAfterMemo.Top:=144
WizardForm.InfoAfterMemo.Width:=465
WizardForm.InfoAfterMemo.Height:=300
WizardForm.InfoAfterMemo.Parent:= WizardForm
// wpFinished
FinishedHeadingLabel:=TLabel.Create(WizardForm)
FinishedHeadingLabel.Left:=205
FinishedHeadingLabel.Top:=190
FinishedHeadingLabel.Width:=465
FinishedHeadingLabel.Height:=28
FinishedHeadingLabel.AutoSize:=False
FinishedHeadingLabel.WordWrap:=True
FinishedHeadingLabel.Transparent:=True
FinishedHeadingLabel.Font.Color:=FontColor
FinishedHeadingLabel.Font.Style:=[fsBold]
FinishedHeadingLabel.Caption:=WizardForm.FinishedHeadingLabel.Caption
FinishedHeadingLabel.OnMouseDown:=@WizardLabelMouseDown
FinishedHeadingLabel.Parent:=WizardForm
FinishedLabel:=TLabel.Create(WizardForm)
FinishedLabel.Left:=205
FinishedLabel.Top:=230
FinishedLabel.Width:=465
FinishedLabel.Height:=56
FinishedLabel.AutoSize:=False
FinishedLabel.WordWrap:=True
FinishedLabel.Font.Color:=FontColor
FinishedLabel.Transparent:=True
FinishedLabel.Caption:=WizardForm.FinishedLabel.Caption
FinishedLabel.OnMouseDown:=@WizardLabelMouseDown
FinishedLabel.Parent:=WizardForm
WizardForm.RunList.Left:=205
WizardForm.RunList.Top:=310
WizardForm.RunList.Width:=465
WizardForm.RunList.Height:=120
WizardForm.RunList.Color:=$ffffff
WizardForm.RunList.Font.Color:=$000000
WizardForm.RunList.Parent:= WizardForm
YesRadio:=TRadioButton.Create(WizardForm)
YesRadio.Left:=205
YesRadio.Top:=310
YesRadio.Width:=13
YesRadio.Height:=13
YesRadio.Color:=$b58434
YesRadio.OnClick:=@YesRadioOnClick
YesRadio.Parent:=WizardForm
YesRadioLabel:=TLabel.Create(WizardForm)
YesRadioLabel.Left:=221
YesRadioLabel.Top:=310
YesRadioLabel.Font.Color:=FontColor
YesRadioLabel.Transparent:=True
YesRadioLabel.Caption:=WizardForm.YesRadio.Caption
YesRadioLabel.Parent:=WizardForm
NoRadio:=TRadioButton.Create(WizardForm)
NoRadio.Left:=205
NoRadio.Top:=330
NoRadio.Width:=13
NoRadio.Height:=13
NoRadio.Color:=$b58434
NoRadio.OnClick:=@NoRadioOnClick
NoRadio.Parent:=WizardForm
NoRadioLabel:=TLabel.Create(WizardForm)
NoRadioLabel.Left:=221
NoRadioLabel.Top:=330
NoRadioLabel.Font.Color:=FontColor
NoRadioLabel.Transparent:=True
NoRadioLabel.Caption:=WizardForm.NoRadio.Caption
NoRadioLabel.Parent:=WizardForm
end;
Procedure ShowPageComponents(CurPageID: Integer);
begin
PageNameLabel.Caption:=WizardForm.PageNameLabel.Caption
PageDescriptionLabel.Caption:=WizardForm.PageDescriptionLabel.Caption
Case CurPageID of
wpWelcome:
begin
WelcomeLabel1.Show
WelcomeLabel2.Show
end
wpLicense:
begin
LicenseLabel1.Show
WizardForm.LicenseMemo.Show
WizardForm.LicenseAcceptedRadio.Show
LicenseAcceptedLabel.Show
WizardForm.LicenseNotAcceptedRadio.Show
LicenseNotAcceptedLabel.Show
end
wpPassword:
begin
PasswordLabel.Show
PasswordEditLabel.Show
WizardForm.PasswordEdit.Show
end
wpInfoBefore:
begin
InfoBeforeClickLabel.Show
WizardForm.InfoBeforeMemo.Show
end
wpUserInfo:
begin
UserInfoNameLabel.Show
WizardForm.UserInfoNameEdit.Show
UserInfoOrgLabel.Show
WizardForm.UserInfoOrgEdit.Show
UserInfoSerialLabel.Show
WizardForm.UserInfoSerialEdit.Show
end
wpSelectDir:
begin
SelectDirLabel.Show
SelectDirBrowseLabel.Show
WizardForm.DirEdit.Show
WizardForm.DirBrowseButton.Show
DiskSpaceLabel.Show
end
wpSelectComponents:
begin
SelectComponentsLabel.Show
WizardForm.TypesCombo.Show
WizardForm.ComponentsList.Show
ComponentsDiskSpaceLabel.Show
end
wpSelectProgramGroup:
begin
SelectStartMenuFolderLabel.Show
SelectStartMenuFolderBrowseLabel.Show
WizardForm.GroupEdit.Show
WizardForm.GroupBrowseButton.Show
WizardForm.NoIconsCheck.Show
NoIconsLabel.Show
end
wpSelectTasks:
begin
SelectTasksLabel.Show
WizardForm.TasksList.Show
end
wpReady:
begin
ReadyLabel.Show
ReadyLabel.Caption:=WizardForm.ReadyLabel.Caption
WizardForm.ReadyMemo.Show
end
wpInstalling:
begin
StatusLabel.Show
WizardForm.ProgressGauge.Show
end
wpInfoAfter:
begin
InfoAfterClickLabel.Show
WizardForm.InfoAfterMemo.Show
end
wpFinished:
begin
FinishedHeadingLabel.Show
FinishedLabel.Show
FinishedLabel.Caption:=WizardForm.FinishedLabel.Caption
WizardForm.RunList.Show
//YesRadio.Checked:=True
//YesRadio.Show
//YesRadioLabel.Show
//NoRadio.Show
//NoRadioLabel.Show
end
end;
end;
Procedure InitializeWizard();
begin
InitializeSkin
CancelButton:= WizardForm.CancelButton;
InfoButton:= TButton.Create(WizardForm);
with InfoButton do begin Left:= WizardForm.ClientWidth - CancelButton.Left - CancelButton.Width; Top:= CancelButton.Top; Width:= CancelButton.Width +ScaleX(20); Height:= CancelButton.Height; Caption:= 'О системе'; Hint:='Проверка системных требований'; ShowHint:=True; OnClick:= @InfoButtonOnClick; Parent:= WizardForm; end;
with WizardForm.PageNameLabel do begin Top:= Top - 2; Left:=Left - 4; Width:= Width -i + 16; end;
with WizardForm.PageDescriptionLabel do begin Top:= Top -2; Left:=Left -10; Width:= Width -i +24; end;
with WizardForm.TypesCombo do begin Width:= ScaleX(170); Top:= WizardForm.SelectComponentsLabel.Top; end;
with WizardForm.ComponentsList do begin Top:=1 + WizardForm.TypesCombo.Top + WizardForm.TypesCombo.Height; Height:=ScaleY(18) + WizardForm.ComponentsDiskSpaceLabel.Top -Top; end;
with WizardForm.ComponentsDiskSpaceLabel do begin Top:=3; Left:=ScaleX(20) + WizardForm.TypesCombo.Width; end;
WizardForm.SelectComponentsLabel.Visible:= False;
WizardForm.DirBrowseButton.OnClick:= @DirOnClick;
ListBox:= TListBox.Create(WizardForm)
with TNewStaticText.Create(WizardForm) do begin Top:= WizardForm.DirEdit.Top +WizardForm.DirEdit.Height +ScaleY(8); Font.Name:= 'Lucida Sans Unicode'; Caption:='Список локальных дисков, присутствующих в системе:'; Parent:= WizardForm.SelectDirPage; end;
End;
procedure CurPageChanged(CurPageID: Integer);
begin
HideAll
ShowPageComponents(CurPageID)
i:=CurPage; CurPage:= CurPageID
If WizardForm.FindComponent('CancelButton') is TButton then CancelButton.Caption:= 'Выход';
case CurPageID of
wpWelcome: sndPlaySound(ExpandConstant('{win}\Media\start.wav'), 1)
wpSelectDir: begin
with ListBox do begin Parent:= WizardForm.SelectDirPage; Items.Clear; Color:= $EEEEEE; Font.Size:= 9; Font.Name:= 'Courier New'; OnClick:= @ListBoxOnClick; Top:= WizardForm.DirEdit.Top +WizardForm.DirEdit.Height +ScaleY(30); Width:= WizardForm.DirBrowseButton.Left + WizardForm.DirBrowseButton.Width - WizardForm.DirEdit.Left; Height:= WizardForm.DiskSpaceLabel.Top -Top -9;
for i:=0 to GetHardDrivesCount-1 do begin VolumeName:= StringOfChar(' ', BufferLen); FileSystemName:= StringOfChar(' ', BufferLen); GetSpaceOnDisk(GetHardDriveName(i), True, FreeMB, TotalMB); GetVolumeInformation(GetHardDriveName(i), VolumeName, BufferLen-1, VolumeSerialNo, MaxComponentLength, FileSystemFlags, FileSystemName, BufferLen-1); if Trim(VolumeName)='' then VolumeName:='без метки';
Items.Add(Copy(Uppercase(GetHardDriveName(i)),0,2)+ PadL(MorG(TotalMB,True),11) +' всего| '+ PadL(MorG(FreeMB,True),9)+ PadL(FloatToStr(round(FreeMB/TotalMB*100)),4)+ '% своб| '+ PadL(Trim(FileSystemName),5)+ '| '+ Trim(VolumeName)); end; end; end
wpInstalling: begin CancelButton.Caption:= 'Прервать' InfoButton.Visible:= False end;
wpFinished: sndPlaySound(ExpandConstant('{win}\Media\tada.wav'), 1) end;
end;
[/more]
При нажатии на кнопку о системе, выводится пустая страница. Видимо нужно прописать содержимое этой страницы в HideAll, InitializeSkin и ShowPageComponents. Если да, то как это сделать? И можно ли их совместить в том виде в каком они здесь представлены? Если нет, может у кого есть другие варианты.
PS Навыков в програмировании не имею.