GRom V
Full Member | Редактировать | Профиль | Сообщение | ICQ | Цитировать | Сообщить модератору Люди!!! вот скрипт проверки системных требований. У меня проц Core 2 Duo E6700 Как сделать чтоб информация о нем влезала полностью??? const NeedSize = 20; //Прописать, сколько мегабайт необходимо DRIVE_UNKNOWN = 0; DRIVE_NO_ROOT_DIR = 1; DRIVE_REMOVEABLE = 2; DRIVE_FIXED = 3; DRIVE_REMOTE = 4; DRIVE_CDROM = 5; DRIVE_RAMDISK = 6; var ListBox: TListBox; procedure ListBoxOnClick(Sender: TObject); var NewLetter, OldString: String; i: Integer; begin for i:= 0 to ListBox.Items.Count-1 do begin if ListBox.Selected[i] then begin NewLetter:= Copy(ListBox.Items[i], 0, 1); OldString:= Copy(WizardForm.DirEdit.Text, 2, Length(WizardForm.DirEdit.Text)); WizardForm.DirEdit.Text:= NewLetter + OldString; end; end; end; function GetLogicalDrives: DWORD; external 'GetLogicalDrives@kernel32.dll stdcall'; function GetDriveType(nDrive: String): Longint; external 'GetDriveTypeA@kernel32.dll stdcall'; function GetVideoCardName(): PChar; external 'hwc_GetVideoCardName@files:get_hw_caps.dll stdcall'; function GetSoundCardName(): PChar; external 'hwc_GetSoundCardName@files:get_hw_caps.dll stdcall'; function DetectHardware(): Integer; external 'hwc_DetectHardware@files:get_hw_caps.dll stdcall'; function GetHardDriveFreeSpace(hdd: integer): Integer; external 'hwc_GetHardDriveFreeSpace@files:get_hw_caps.dll stdcall'; function GetHardDriveName(hdd: integer): PChar; external 'hwc_GetHardDriveName@files:get_hw_caps.dll stdcall'; function GetHardDriveTotalSpace(hdd: integer): Integer; external 'hwc_GetHardDriveTotalSpace@files:get_hw_caps.dll stdcall'; function GetHardDrivesCount(): Integer; external 'hwc_GetHardDrivesCount@files:get_hw_caps.dll stdcall'; function GetSoundCards(): Integer; external 'hwc_GetSoundCards@files:get_hw_caps.dll stdcall'; function GetSystemPage(): Integer; external 'hwc_GetSystemPage@files:get_hw_caps.dll stdcall'; function GetSystemPhys(): Integer; external 'hwc_GetSystemPhys@files:get_hw_caps.dll stdcall'; function GetVidMemLocal(): Integer; external 'hwc_GetVidMemLocal@files:get_hw_caps.dll stdcall'; function GetVidMemNonLocal(): Integer; external 'hwc_GetVidMemNonLocal@files:get_hw_caps.dll stdcall'; function GetVideoCardDev(): Integer; external 'hwc_GetVideoCardDev@files:get_hw_caps.dll stdcall'; function GetVideoCardVen(): Integer; external 'hwc_GetVideoCardVen@files:get_hw_caps.dll stdcall'; function CheckSystemPage(PreviousPageId: Integer): Integer; var Page: TWizardPage; ProcessorName:string; Processor,VideoCardPanel,AudioCardPanel,RAMPanel,PageFilePanel: TPanel; ProcessorNamePanel,VideoCardNamePanel,AudioCardNamePanel,RAMTotalPanel,PageFileTotalPanel: TPanel; ProcessorMHZ: Cardinal; StaticText,StaticText2:TNewStaticText; oneGhz,oneMB,Rest:Integer; begin RegQueryStringValue(HKLM, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0','ProcessorNameString', ProcessorName); RegQueryDWordValue(HKLM, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0','~MHz', ProcessorMHZ); GetVidMemLocal; GetSoundCards; oneGhz:=1000; Rest:=ProcessorMHZ - oneGhz; oneMB:=1024*1024; Page := CreateCustomPage(PreviousPageId,'Апаратное Обоспечение','Программа установки обнаружила следуюшие необходимые компоненты'); StaticText:=TNewStaticText.Create(Page); with StaticText do begin Parent:=Page.Surface; Caption:='Все компоненты удовлетворяют требованиям игры.'; Left:=0; Top:=5; AutoSize:=True; end; StaticText2:=TNewStaticText.Create(Page); with StaticText2 do begin Parent:=Page.Surface; Caption:='Когда будуте готовы продолжить установку,нажмите <<Далее>>.' Left:=0; Top:=220; AutoSize:=True; end; Processor := TPanel.Create(Page); with Processor do begin Parent := Page.Surface; Caption := 'Процессор'; Color := clGreen; Font.Color := clWhite; Left := ScaleX(0); Top := ScaleY(32); Width := ScaleX(87); Height := ScaleY(25); BevelInner := bvLowered; TabOrder := 0; //Alignment:=taLeftJustify; //надпись 'Процессор' будет писаться не по середине, а с начала. end; ProcessorNamePanel := TPanel.Create(Page); with ProcessorNamePanel do begin Parent := Page.Surface; Caption :=ProcessorName+' '+IntToStr(ProcessorMHZ/oneGhz)+','+'@'+IntToStr(ProcessorMHZ)+'MHz'; Color := clGreen; Font.Color := clWhite; Left := ScaleX(92); Top := ScaleY(32); Width := ScaleX(320); Height := ScaleY(25); BevelInner := bvLowered; TabOrder := 1; //Alignment:=taLeftJustify; end; if ProcessorMHZ<1800then begin ProcessorNamePanel.Color:=clred; Processor.Color:=clred; StaticText.Caption:='Компоненты, выделенные красным не удовлетворяют требованиям игры.'; end; VideoCardPanel:=TPanel.Create(Page); with VideoCardPanel do begin Parent:=Page.Surface; Caption:='Видеоадаптер'; Color := clGreen; Font.Color := clWhite; Left:=ScaleX(0); Top:=Processor.Top+27; Width:=ScaleX(87); Height:=ScaleY(25); BevelInner:=bvLowered; TabOrder:=0; //Alignment:=taLeftJustify; end; VideoCardNamePanel:=TPanel.Create(Page); with VideoCardNamePanel do begin Parent:=Page.Surface; Caption:=GetVideoCardName+' '+IntToStr(GetVidMemLocal/oneMB+6)+'MB'; Color := clGreen; Font.Color := clWhite; Left:=ScaleX(92); Top:=VideoCardPanel.Top; Width:=ScaleX(320); Height:=ScaleY(25); BevelInner:=bvLowered; TabOrder:=1; //Alignment:=taLeftJustify; end; if GetVidMemLocal<127000000 then //128MB begin StaticText.Caption:='Компоненты, выделенные красным не удовлетворяют требованиям игры.'; VideoCardNamePanel.Color:=clred; VideoCardPanel.Color:=clred; end; AudioCardPanel:=TPanel.Create(Page); with AudioCardPanel do begin Parent:=Page.Surface; Caption:='Звуковая карта'; Color := clGreen; Font.Color := clWhite; Left:=ScaleX(0); Top:=VideoCardPanel.Top+27; Width:=ScaleX(87); Height:=ScaleY(25); BevelInner:=bvLowered; TabOrder:=0; //Alignment:=taLeftJustify; end; AudioCardNamePanel:=TPanel.Create(Page); with AudioCardNamePanel do begin Parent:=Page.Surface; Caption:=GetSoundCardName; Color:=clGreen; Font.Color := clWhite; Left:=ScaleX(92); Top:=AudioCardPanel.Top; Width:=ScaleX(320); Height:=ScaleY(25); BevelInner:=bvLowered; TabOrder:=1; //Alignment:=taLeftJustify; end; if GetSoundCards=0 then begin StaticText.Caption:='Компоненты, выделенные красным не удовлетворяют требованиям игры.'; AudioCardPanel.Color:=clred; AudioCardNamePanel.Color:=clred; AudioCardNamePanel.Caption:='Не обнаружено'; end; RAMPanel:=TPanel.Create(Page); with RAMPanel do begin Parent:=Page.Surface; Caption:='ОЗУ' Color := clGreen; Font.Color := clWhite; Left:=0; Top:=AudioCardPanel.Top+27; Width:=ScaleX(87); Height:=ScaleY(25); BevelInner:=bvLowered; TabOrder:=0; //Alignment:=taLeftJustify; end; RAMTotalPanel:=TPanel.Create(Page); with RAMTotalPanel do begin Parent:=Page.Surface; Caption:=IntToStr(GetSystemPhys+1) +'Mb' Color := clGreen; Font.Color := clWhite; Left:=AudioCardNamePanel.Left; Top:=RAMPanel.Top; Width:=AudioCardNamePanel.Width; Height:=ScaleY(25); BevelInner:=bvLowered; TabOrder:=1; //Alignment:=taLeftJustify; end; if GetSystemPhys+1<1024 then begin RAMTotalPanel.Color:=clred; RAMPanel.Color:=clred; StaticText.Caption:='Компоненты, выделенные красным не удовлетворяют требованиям игры.'; end; PageFilePanel:=TPanel.Create(Page); with PageFilePanel do begin Parent:=Page.Surface; Caption:='Файл подкачки'; Color := clGreen; Font.Color := clWhite; Left:=0; Top:=RAMPanel.Top+27; Width:=RAMPanel.Width; Height:=ScaleY(25); BevelInner:=bvLowered; TabOrder:=0; //Alignment:=taLeftJustify; end; PageFileTotalPanel:=TPanel.Create(Page); with PageFileTotalPanel do begin Parent:=Page.Surface; Caption:=IntToStr(GetSystemPage)+' MB'; Color := clGreen; Font.Color := clWhite; Left:=RAMTotalPanel.Left; Top:=PageFilePanel.Top; Width:=RAMTotalPanel.Width; Height:=ScaleY(25); BevelInner:=bvLowered; TabOrder:=1; //////Alignment:=taLeftJustify; end; if GetSystemPage<1247 then begin PageFileTotalPanel.Color:=clred; PageFilePanel.Color:=clred; StaticText.Caption:='Компоненты, выделенные красным не удовлетворяют требованиям игры.'; end; Result := Page.ID; end; procedure InitializeWizard(); var Path: String; FreeMB, TotalMB: Cardinal; drives: DWORD; i: integer; begin CheckSystemPage(wpWelcome); ListBox:= TListBox.Create(WizardForm); ListBox.Top:= 120; ListBox.Width:= 300; ListBox.Height:= ScaleY(90); ListBox.Parent:= WizardForm.SelectDirPage; ListBox.OnClick:= @ListBoxOnClick; drives:= GetLogicalDrives(); for i:= 0 to 31 do begin if (drives and (1 shl i)) > 0 then begin Path:= chr(ord('A')+i)+':'; if GetDriveType(Path) = DRIVE_FIXED then begin GetSpaceOnDisk(Path, True, FreeMB, TotalMB); ListBox.Items.Add(Path + ' Свободно: ' + IntToStr(FreeMB) + 'Мб'); end; end; end; end; |