Cash xXx
Newbie | Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору
Цитата: [Setup] AppName=System Check AppVerName=System Check DefaultDirName={pf32}\System Check [Files] Source: C:\Program Files\Inno Setup 5\get_hw_caps.dll; Flags: dontcopy [Code] 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,ProcessorNamePanel,VideoCardNamePanel,VideoCardPanel,AudioCardNamePanel,RAMTotalPanel,PageFileTotalPanel,AudioCardPanel,RAMPanel,PageFilePanel: TMemo; 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 := TMemo.Create(Page); with Processor do begin Parent := Page.Surface; Lines.Add(ExpandConstant(' Процессор')); Color := -16777194; Left := ScaleX(0); Top := ScaleY(32); Width := ScaleX(104); Height := ScaleY(21); ReadOnly := True; Cursor := crArrow; end; ProcessorNamePanel := TMemo.Create(Page); with ProcessorNamePanel do begin Parent := Page.Surface; Lines.Add(' '+ProcessorName+' '+IntToStr(ProcessorMHZ/oneGhz)+','+IntToStr(Rest)+'GHz'+' '+'@'+IntToStr(ProcessorMHZ)+'MHz'); Left := ScaleX(109); Top := ScaleY(32); Width := ScaleX(304); Height := ScaleY(21); Color := $CCFFCC; ReadOnly := True; Cursor := crArrow; end; //частота процессора// if ProcessorMHZ<1000 then begin ProcessorNamePanel.Color:=$CCFFCC; StaticText.Caption:='Компоненты, выделенные красным не удовлетворяют требованиям игры.'; end; VideoCardPanel:=TMemo.Create(Page); with VideoCardPanel do begin Parent := Page.Surface; Lines.Add(ExpandConstant(' Видеоадаптер')); Color := -16777194; Left:=ScaleX(0); Top:=Processor.Top+27; Width:=ScaleX(104); Height:=ScaleY(21); ReadOnly := True; Cursor := crArrow; end; VideoCardNamePanel:=TMemo.Create(Page); with VideoCardNamePanel do begin Parent:=Page.Surface; Lines.Add(' '+GetVideoCardName+' '+IntToStr(GetVidMemLocal/oneMB)+' MB'); Left:=ScaleX(109); Top:=VideoCardPanel.Top; Width:=ScaleX(304); Height:=ScaleY(21); Color := $CCFFCC; ReadOnly := True; Cursor := crArrow; end; //видео память// if GetVidMemLocal<63500000 then //64MB begin StaticText.Caption:='Компоненты, выделенные красным не удовлетворяют требованиям игры.'; VideoCardNamePanel.Color:=$CCFFCC; end AudioCardPanel:=TMemo.Create(Page); with AudioCardPanel do begin Parent := Page.Surface; Lines.Add(ExpandConstant(' Звуковая карта')); Color := -16777194; Left := ScaleX(0); Top:=VideoCardPanel.Top+27; Width := ScaleX(104); Height := ScaleY(21); ReadOnly := True; Cursor := crArrow; end; AudioCardNamePanel:=TMemo.Create(Page); with AudioCardNamePanel do begin Parent:=Page.Surface; Lines.Add(' '+GetSoundCardName); Left:=ScaleX(109); Top:=AudioCardPanel.Top; Width:=ScaleX(304); Height:=ScaleY(21); Color := $CCFFCC; ReadOnly := True; Cursor := crArrow; end; //аудио// if GetSoundCards=0 then begin StaticText.Caption:='Компоненты, выделенные красным не удовлетворяют требованиям игры.'; with AudioCardNamePanel do begin Color:=$CCFFCC; Lines.Add('Не обнаружено'); ReadOnly := True; Cursor := crArrow; end; end; RAMPanel:=TMemo.Create(Page); with RAMPanel do begin Parent := Page.Surface; Lines.Add(ExpandConstant(' ОЗУ')); Color := -16777194; Left := ScaleX(0); Top:=AudioCardPanel.Top+27; Width := ScaleX(104); Height := ScaleY(21); ReadOnly := True; Cursor := crArrow; end; RAMTotalPanel:=TMemo.Create(Page); with RAMTotalPanel do begin Parent:=Page.Surface; Lines.Add(' '+IntToStr(GetSystemPhys+1) +' MB'); Left:=AudioCardNamePanel.Left; Top:=RAMPanel.Top; Width:=AudioCardNamePanel.Width; Height:=ScaleY(21); Color := $CCFFCC; ReadOnly := True; Cursor := crArrow; end; //оперативка// if GetSystemPhys+1<256 then begin RAMTotalPanel.Color:=$CBC0FF; StaticText.Caption:='Компоненты, выделенные красным не удовлетворяют требованиям игры.'; end; PageFilePanel:=TMemo.Create(Page); with PageFilePanel do begin Parent := Page.Surface; Lines.Add(ExpandConstant(' Файл подкачки')); Color := -16777194; Left := ScaleX(0); Top:=RAMPanel.Top+27; Width := ScaleX(104); Height := ScaleY(21); ReadOnly := True; Cursor := crArrow; end; PageFileTotalPanel:=TMemo.Create(Page); with PageFileTotalPanel do begin Parent:=Page.Surface; Lines.Add(' '+IntToStr(GetSystemPage)+' MB'); Left:=RAMTotalPanel.Left; Top:=PageFilePanel.Top; Width:=RAMTotalPanel.Width; Height:=ScaleY(21); Color := $CCFFCC; ReadOnly := True; Cursor := crArrow; end; //файл подкачки// if GetSystemPage<756 then begin PageFileTotalPanel.Color:=$CCFFCC; StaticText.Caption:='Компоненты, выделенные красным не удовлетворяют требованиям игры.'; end; Result := Page.ID; end; procedure InitializeWizard(); begin CheckSystemPage(wpWelcome); end; | Добавлено: Как отключить сообщение: "Недостаточно места на диске. Установка требует не менее %1 Кб свободного места, а на выбранном Вами диске доступно только %2 Кб.%n%nВы желаете тем не менее продолжить установку?" |