Войти

Показать полную графическую версию : [архив] Скрипты Inno Setup. Помощь и советы [часть 2]


Страниц : 1 2 3 4 5 6 7 8 9 [10] 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133

A1EXXX
28-09-2009, 19:10
Stef1979, после нужного файла добавляй Tasks: "chk1"; - для первого, Tasks: "chk2"; - для второго, например:
[Tasks]
Name: chk1; Description: Ключ 1; GroupDescription: Дополнительно:; Flags: exclusive
Name: chk2; Description: Ключ 2; GroupDescription: Дополнительно:; Flags: exclusive

[Files]
Source: C:\1.bmp; DestDir: {app}; Flags: ignoreversion; Tasks: "chk1";
Source: C:\2.mp3; DestDir: {app}; Flags: ignoreversion; Tasks: "chk2";

Serega
28-09-2009, 19:46
K.I.S. 2010 сообщает, что REG-Converter содержит вирус virus.Win32.induc.a! Это правда?!! »
Я так понимаю вы говорите про Converter v.0.1.2, если да, то советую прочитать это сообщение.
Я даже и не думал, что до сих пор скачивают Converter v.0.1.2, в то время, когда уже есть Converter v.0.1.3.
Крошечный reg-файл из нескольких строк конвертирует секунд 7 - 10 и при этом CPU загружает на 100%! »
Если там действительно несколько строк, то откровенно говоря вы лукавите про 7-10 секунд...
p.s. 2
Убери-ка быстро от-туда вирус и не обманывай простых пользователей!!! »
Вы наверное меня с кем-то спутали?
Мы с Вами на ТЫ не переходили и я Вам не мальчик, чтоб говорить со мной в таком тоне.
Выбирайте выражения.
Я никого не заставляю пользоваться своей программой, не нравиться - не используйте, а делайте все руками.

P.S.
Проверка Converter v.0.1.3 на Virustotal (http://www.virustotal.com/ru/analisis/74bc6ded9ae227c08c63b82536663d619f88e49e88cd7e1b12895b732e9020d0-1254154704) и Антивирусный сканер Jotti (http://virusscan.jotti.org/ru/scanresult/246c9ae955ac067b12f42b6057ef68ae6d426fd6).

Stef1979
29-09-2009, 07:27
Stef1979, после нужного файла добавляй Tasks: "chk1"; - для первого, Tasks: "chk2"; - для второго, например: » Спасибо большое!

S.E.K.T.O.R.
29-09-2009, 18:33
Serega помогите пожалуйста сделать следующее:

Проверку операционной системы из зтого [Code]
var state: boolean;

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;
Text: TNewStaticText;

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 DelSp(const s: string): string; // функция удаления пробелов в начале строки
var
c, i: integer;
stt, st, st1: string;
begin
c := 0;
st := s;

for i := 1 to Length(st) do
begin

stt := copy(st, i, 1);
if (stt = ' ') and (c >= 1) then
begin
st1 := st1;
c := c + 1;
end
else if (stt = ' ') and (c = 0) then
begin
c := c + 1;
st1 := st1 + stt;
end
else if (stt <> ' ') then
begin
c := 0;
st1 := st1 + stt;
end
end;

Result := st1;
end;



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;


procedure InitializeWizard();
var
Page: TWizardPage;
Text: TNewStaticText;
Memo: TMemo;
Path: string;
FreeMB, TotalMB: Cardinal;
drives: DWORD;
i: integer;
begin
Text := TNewStaticText.Create(WizardForm);
Text.Top := 102;
Text.Width := 332;
Text.Height := 14;
Text.Caption := 'Список жестких дисков и свободного места';
Text.Parent := WizardForm.SelectDirPage;

ListBox := TListBox.Create(WizardForm);
ListBox.Top := 120;
ListBox.Width := 332;
ListBox.Height := ScaleY(90);
ListBox.Parent := WizardForm.SelectDirPage;
ListBox.OnClick := @ListBoxOnClick;
ListBox.Font.Name := 'Courier New';
ListBox.Font.Size := 10;
ListBox.Font.Style := [fsBold];
ListBox.Color := clBtnFace;

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);
if FreeMB>1024 then ListBox.Items.Add(Path + ' ' + IntToStr(round(FreeMB / TotalMB * 100)) + '% ' + floatToStr(round(FreeMB/1024*100)/100) + ' GB')
else ListBox.Items.Add(Path + ' ' + IntToStr(round(FreeMB / TotalMB * 100)) + '% ' + IntToStr(FreeMB) + ' MB');
end;
end;
end;
end;


function NextButtonClick(CurPageID: Integer): Boolean;
var
Path,s: String;
FreeMB, TotalMB: Cardinal;
begin
Result:= True;
if CurPageID = wpSelectDir then
begin
Path:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB < (NeedSize*1024) then
begin
if FreeMB>1024 then
begin
s:='Для установки приложения необходимо '+ IntTostr(NeedSize)+ ' GB,'#13+'а на выбранном Вами диске доступно только '+ floatToStr(round(FreeMB/1024*100)/100) + ' GB!'
end
else s:='Для установки приложения необходимо '+ IntTostr(NeedSize)+ ' GB,'#13+'а на выбранном Вами диске доступно только '+ + IntToStr(FreeMB)+' MB';
MsgBox(s, mbCriticalError, MB_OK)
Result := False;
end;
end;
end;




procedure CurPageChanged(CurPageID: Integer);
var
Page: TWizardPage;
Text: TNewStaticText;
Memo,Windows,SP,Version,Build,registered,WindowsName,SP_Num,Version_Num,Build_num,registered_name: TMemo;
Os,OS1: string; // строка с названием необходимой ОС
// state: boolean;

ProcessorName: string;
Processor, VideoCardPanel, AudioCardPanel, RAMPanel, PageFilePanel: TMemo;
ProcessorNamePanel, VideoCardNamePanel, AudioCardNamePanel, RAMTotalPanel, PageFileTotalPanel: TMemo;
ProcessorMHZ: Cardinal;
StaticText, StaticText2: TNewStaticText;
VidRam: integer;

begin
if CurPageID = wpUserInfo then
begin
//подменяем сраницу информации о пользователе на информацию об ОС
wizardForm.UserInfoNameEdit.visible:=false;
wizardForm.UserInfoNameEdit.text:='Игрок'; //на случай, когда имя пользователя не указано в системе
wizardForm.UserInfoNameLabel.visible:=false;
wizardForm.UserInfoOrgLabel.visible:=false;
wizardForm.UserInfoOrgEdit.visible:=false;
wizardForm.UserInfoOrgEdit.text:='Группа игроков ';//на случай, когда организация не указано в системе
wizardForm.PageNameLabel.Caption := 'Аппаратное обеспечение и Операционная система';
wizardForm.PageDescriptionLabel.Caption := 'Программа установки обнаружила следующие необходимые компоненты и Операционную систему ';
RegQueryStringValue(HKLM, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0', 'ProcessorNameString', ProcessorName);
RegQueryDWordValue(HKLM, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0', '~MHz', ProcessorMHZ);

OS:=' Microsoft Windows XP Service Pack 2'; //строка является суммой из записей в реестре о Наименовании ОС и сервис-паке
OS1:=' Microsoft Windows 2000 Service Pack 4'; //строка является суммой из записей в реестре о Наименовании ОС и сервис-паке

Windows := TMemo.Create(WizardForm);

StaticText := TNewStaticText.Create(TNewStaticText.Create(WizardForm));
with StaticText do begin
Left := 0;
Top := 52;
Width := 417;
Height := 14;
Caption := 'Все компоненты удовлетворяют требованиям игры.';
Parent := WizardForm.UserInfoPage;
StaticText.font.color:=clGreen;
end


with Windows do
begin
Text := ' Операц. система';
Parent := WizardForm.UserInfoPage;

Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(20);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := clBtnFace;
end
Processor := TMemo.Create(WizardForm);
with Processor do begin
Text := ' Процессор';
Parent := WizardForm.UserInfoPage;

Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(77);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := clBtnFace;
end
VideoCardPanel := TMemo.Create(WizardForm);
with VideoCardPanel do begin
Text := ' Видеоадаптер';
Parent := WizardForm.UserInfoPage;

Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(104);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := clBtnFace;
end
AudioCardPanel := TMemo.Create(WizardForm);
with AudioCardPanel do begin
Text := ' Звуковая карта';
Parent := WizardForm.UserInfoPage;
Color := clBtnFace;
Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(131);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;

end
RAMPanel := TMemo.Create(WizardForm);
with RAMPanel do begin
Text := ' ОЗУ';
Parent := WizardForm.UserInfoPage;
Color := clBtnFace;
Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(158);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.


ReadOnly := True;

end

PageFilePanel := TMemo.Create(WizardForm);
with PageFilePanel do begin
Text := ' Файл подкачки';
Parent := WizardForm.UserInfoPage;
Color := clBtnFace;
Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(185);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.


ReadOnly := True;

ProcessorNamePanel := TMemo.Create(WizardForm);
with ProcessorNamePanel do begin

Text := DelSP(ProcessorName) + ' ' + IntToStr(ProcessorMHZ) + 'MHz'; //новое обработанное значение строки
Parent := WizardForm.UserInfoPage;

Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(77);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := $CCFFCC;

if ProcessorMHZ < 1800 then
begin
ProcessorNamePanel.Color := $ccccff;
StaticText.Caption := 'Не все компоненты удовлетворяют требованиям игры.';
StaticText.font.color:=clRed;
end;

VideoCardNamePanel := TMemo.Create(WizardForm);
with VideoCardNamePanel do begin
Text := ' ' + GetVideoCardName; //+' ОЗУ-'+inttostr(round(GetVidMemLocal/1000000))+' МБ'
Parent := WizardForm.UserInfoPage;
VidrAM := GetVidMemLocal / 1000000;

if VidRam > 127 then
begin
if VidRam < 200 then text := text + ' ОЗУ - 128 МB'
else if VidRam < 300 then text := text + ' ОЗУ - 256 МB'
else if VidRam < 400 then text := text + ' ОЗУ - 384 МB'
else if VidRam > 500 then text := text + ' ОЗУ - 512 МB';
end;

Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(104);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := $CCFFCC;

if GetVidMemLocal < 127000000 then //128 MB
begin
StaticText.Caption := 'Не все компоненты удовлетворяют требованиям игры.';
StaticText.font.color:=clRed;
VideoCardNamePanel.Color := $ccccff;
end;


end
AudioCardNamePanel := TMemo.Create(WizardForm);
with AudioCardNamePanel do begin
Text := ' ' + GetSoundCardName;
Parent := WizardForm.UserInfoPage;
Color := $CCFFCC;
Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(131);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R

ReadOnly := True;

end
RAMTotalPanel := TMemo.Create(WizardForm);
with RAMTotalPanel do begin
Text := ' ' + IntToStr(GetSystemPhys + 1) + ' MB';
Parent := WizardForm.UserInfoPage;
Color := $CCFFCC;

Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(158);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
if GetSystemPhys + 1 < 1024 then
begin
RAMTotalPanel.Color := $ccccff;
StaticText.Caption := 'Не все компоненты удовлетворяют требованиям игры.';
StaticText.font.color:=clRed;
end;
end;

PageFileTotalPanel := TMemo.Create(WizardForm);
with PageFileTotalPanel do begin
Text := ' ' + IntToStr(GetSystemPage) + ' MB';
Parent := WizardForm.UserInfoPage;
Color := $CCFFCC;

Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(185);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
if GetSystemPage < 1247 then
begin
PageFileTotalPanel.Color := $ccccff;
StaticText.Caption := 'Не все компоненты удовлетворяют требованиям игры.';
StaticText.font.color:=clRed;
end;
end;


end

if ExpandConstant('{reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,ProductName|}')='' then
begin

WindowsName := TMemo.Create(WizardForm);
with WindowsName do begin
Text := ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion,ProductName|}')+ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion,CSDVersion|}');
Parent := WizardForm.UserInfoPage;

Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(20);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := $CCFFCC;
end

end

end;

// Проверка Windows 9x
if ExpandConstant('{reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,ProductName|}')<>'' then
begin
WindowsName := TMemo.Create(WizardForm);
with WindowsName do begin
Text := ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,ProductName|}')+ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,CSDVersion|}');
Parent := WizardForm.UserInfoPage;
Color := $CCFFCC;
Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(20);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;

end

end;


if OS=(WindowsName.Text) then state:=true else
if OS1=(WindowsName.Text) then state:=true else state:=false;

Text := TNewStaticText.Create(WizardForm);
with Text do begin
Left := 0;
Top := 0;
Width := 417;
Height := 14;
if state then
begin
Font.Color:=clGreen;
WindowsName.color:=$CCFFCC;
// SP_Num.color:=$CCFFCC;
Caption := 'Операционная система соответствует требованиям игры.';
end
else
begin
Font.Color:=clREd;
WindowsName.color:=clRed;

WindowsName.Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
WindowsName.Top := ScaleY(20);
WindowsName.Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
WindowsName.Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.
WindowsName.ReadOnly := True;



Caption := 'Операционная система не соответствует требованиям игры.';
end
Parent := WizardForm.UserInfoPage;
end
Text := TNewStaticText.Create(TNewStaticText.Create(WizardForm));
with Text do begin
Left := 0;
Top := 220;
Width := 417;
Height := 14;
Caption := 'Когда Вы будете готовы продолжить установку, нажмите «Далее».';
Parent := WizardForm.UserInfoPage;
end




if not state then
begin
wizardForm.Nextbutton.enabled:=false;
end;
end;
end; добавить в этот [Code]

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;
Text: TNewStaticText;

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 GetLogicalDrives: DWORD;
external 'GetLogicalDrives@kernel32.dll stdcall';

function GetDriveType(nDrive: string): Longint;
external 'GetDriveTypeA@kernel32.dll stdcall';

function DelSp(const s: string): string; //функция удаления табуляции и пробелов в начале строки
var
c, i: integer;
stt, st, st1: string;
begin
c := 0;
st := s;

for i := 1 to Length(st) do
begin

stt := copy(st, i, 1);
if (stt = ' ') and (c >= 1) then
begin
st1 := st1;
c := c + 1;
end
else if (stt = ' ') and (c = 0) then
begin
c := c + 1;
st1 := st1 + stt;
end
else if (stt <> ' ') then
begin
c := 0;
st1 := st1 + stt;
end
end;

Result := st1;
end;

function CheckSystemPage(PreviousPageId: Integer): Integer;
var
Page: TWizardPage;
ProcessorName: string;

Processor, VideoCardPanel, AudioCardPanel, RAMPanel, PageFilePanel, WindowsPanel: TMemo;
ProcessorNamePanel, VideoCardNamePanel, AudioCardNamePanel, RAMTotalPanel, PageFileTotalPanel, WindowsNamePanel: TMemo;

ProcessorMHZ: Cardinal;
StaticText, StaticText2: TNewStaticText;
VidRam: integer;
begin
RegQueryStringValue(HKLM, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0', 'ProcessorNameString', ProcessorName);
RegQueryDWordValue(HKLM, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0', '~MHz', ProcessorMHZ);
GetVidMemLocal;
GetSoundCards;

Page := CreateCustomPage(PreviousPageId, 'Аппаратное Обеспечение', 'Программа установки обнаружила следующие необходимые компоненты');

StaticText := TNewStaticText.Create(Page);
with StaticText do
begin
Parent := Page.Surface;
Caption := 'Все компоненты удовлетворяют требованиям игры.';
Left := 0;
Top := 0;
AutoSize := True;
end;

StaticText2 := TNewStaticText.Create(Page);
with StaticText2 do
begin
Parent := Page.Surface;
Caption := 'Когда Вы будете готовы продолжить установку, нажмите «Далее».';
Left := 0;
Top := 220;
AutoSize := True;
end;

//******************************************* [Начало - Операционная система] ***************************************************//

WindowsPanel := TMemo.Create(Page);
with WindowsPanel do
begin
Text := ' Операц. система';
Parent := Page.Surface;

Left := ScaleX(0);
Top := ScaleY(165);
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;

WindowsNamePanel := TMemo.Create(Page);
with WindowsNamePanel do
begin

if ExpandConstant('{reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,ProductName|}')='' then
begin

WindowsNamePanel := TMemo.Create(Page);
with WindowsNamePanel do
begin
Text := ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion,ProductName|}')+ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion,CSDVersion|}');
Parent := Page.Surface;

Left := ScaleX(110);
Top := ScaleY(165);
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end
end
end;

//******************************************* [Конец - Операционная система] ***************************************************//


//******************************************* [Начало - Процессор] ***************************************************//

Processor := TMemo.Create(Page);
with Processor do
begin
Text := ' Процессор';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(0);
Top := ScaleY(30);
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;


ProcessorNamePanel := TMemo.Create(Page);
with ProcessorNamePanel do
begin
Text := DelSP(ProcessorName) + ' ' + IntToStr(ProcessorMHZ) + 'MHz'; //новое обработанное значение строки
//Caption :=ProcessorName+' '+IntToStr(ProcessorMHZ)+'MHz' ;
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(110);
Top := ScaleY(30);
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end;

if ProcessorMHZ < 1800 then //Минимальное количество частоты в MHz
begin
StaticText.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям игры.'#13+'Проверьте соответствие системным требованиям.';
ProcessorNamePanel.Color := $CCCCFF;
end;


//******************************************* [Конец - Процессор] ****************************************************//


//******************************************* [Начало - Видеоадаптер] ************************************************//

VideoCardPanel := TMemo.Create(Page);
with VideoCardPanel do
begin
Text := ' Видеоадаптер';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(0);
Top := Processor.Top + 27;
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;

VideoCardNamePanel := TMemo.Create(Page);
with VideoCardNamePanel do
begin
Text := ' ' + GetVideoCardName; //+' ОЗУ-'+inttostr(round(GetVidMemLocal/1000000))+' МБ';
//Caption:=' ОЗУ-'+inttostr(GetVidMemLocal)+' МБ';
Alignment := taLeftJustify;
Parent := Page.Surface;

VidrAM := GetVidMemLocal / 1000000;

if VidRam > 127 then
begin
if VidRam < 200 then Text := Text + '128 МB'
else if VidRam < 300 then Text := Text + '256 МB'
else if VidRam < 400 then Text := Text + '384 МB'
else if VidRam > 500 then Text := Text + '512 МB';
end;

Left := ScaleX(110);
Top := VideoCardPanel.Top;
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end;

if GetVidMemLocal < 127000000 then //Минимальное объем ОЗУ [в байтах] у видеоадаптера 128 MB
begin
StaticText.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям игры.'#13+'Проверьте соответствие системным требованиям.';
VideoCardNamePanel.Color := $CCCCFF;
end;

//******************************************* [Конец - Видеоадаптер] *************************************************//


//******************************************* [Начало - Звуковая карта] **********************************************//

AudioCardPanel := TMemo.Create(Page);
with AudioCardPanel do
begin
Text := ' Звуковая карта';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(0);
Top := VideoCardPanel.Top + 27;
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;

AudioCardNamePanel := TMemo.Create(Page);
with AudioCardNamePanel do
begin
Text := ' ' + GetSoundCardName;
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(110);
Top := AudioCardPanel.Top;
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end;

if
GetSoundCards = 0 then
begin
StaticText.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям игры.'#13+'Проверьте соответствие системным требованиям.';
AudioCardNamePanel.Color := $CCCCFF;
end;

//******************************************* [Конец - Звуковая карта] ***********************************************//


//******************************************* [Начало - ОЗУ] *********************************************************//

RAMPanel := TMemo.Create(Page);
with RAMPanel do
begin
Text := ' Память';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(0);
Top := AudioCardPanel.Top + 27;
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;

RAMTotalPanel := TMemo.Create(Page);
with RAMTotalPanel do
begin
Text := ' ' + IntToStr(GetSystemPhys + 1) + ' MB';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(110);
Top := RAMPanel.Top;
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end;

if GetSystemPhys + 1 < 1024 then //Минимальное объем ОЗУ 1 Гб или 1024 Мб
begin
StaticText.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям игры.'#13+'Проверьте соответствие системным требованиям.';
RAMTotalPanel.Color := $CCCCFF;
end;

//******************************************* [Конец - ОЗУ] **********************************************************//


//******************************************* [Начало - Файл подкачки] ***********************************************//

PageFilePanel := TMemo.Create(Page);
with PageFilePanel do
begin
Text := ' Файл подкачки';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(0);
Top := RAMPanel.Top + 27;
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;

PageFileTotalPanel := TMemo.Create(Page);
with PageFileTotalPanel do
begin
Text := ' ' + IntToStr(GetSystemPage) + ' MB';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(110);
Top := PageFilePanel.Top;
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end;

if GetSystemPage < 2048 then //Минимальное объем файла [в мегабайтах] подкачки 1 Гб или 1024 Мб
begin
StaticText.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям игры.'#13+'Проверьте соответствие системным требованиям.';
PageFileTotalPanel.Color := $CCCCFF;
end;

Result := Page.ID;
end;

//******************************************* [Конец - Файл подкачки] ************************************************//

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;

procedure InitializeWizard();
var
Page: TWizardPage;
Text: TNewStaticText;
Memo: TMemo;
Path: string;
FreeMB, TotalMB: Cardinal;
drives: DWORD;
i: integer;
begin
CheckSystemPage(wpLicense);

Text := TNewStaticText.Create(WizardForm);
Text.Top := 110;
Text.Width := 332;
Text.Height := 14;
Text.Caption := 'Список жестких дисков и свободного места';
Text.Parent := WizardForm.SelectDirPage;

ListBox := TListBox.Create(WizardForm);
ListBox.Top := 128;
ListBox.Width := 208;
ListBox.Height := ScaleY(84);
ListBox.Parent := WizardForm.SelectDirPage;
ListBox.OnClick := @ListBoxOnClick;
ListBox.Font.Name := 'Courier New';
ListBox.Font.Size := 10;
ListBox.Font.Style := [fsBold];
ListBox.Color := clBtnFace;

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);
if FreeMB>1024 then ListBox.Items.Add(Path + ' ' + IntToStr(round(FreeMB / TotalMB * 100)) + '% ' + floatToStr(round(FreeMB/1024*100)/100) + ' GB')
else ListBox.Items.Add(Path + ' ' + IntToStr(round(FreeMB / TotalMB * 100)) + '% ' + IntToStr(FreeMB) + ' MB');
end;
end;
end;
end; Панельки я сделал, проверку реестра добавил, а вот остальное чет не получается. Очень надеюсь на Вашу помощь!

Заранее большое спасибо :) :) :)

Serega
30-09-2009, 00:29
а вот остальное чет не получается. »
Что конкретно не получается? Просто get_hw_caps.dll у меня нет и поэтому проверить не могу, как должно выглядеть.

P.S.
Пример проверки системы, без get_hw_caps.dll

[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes

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

[Code]
type
PDisplay_Device = record
cb: DWord;
DeviceName: array [0..31] of char;
DeviceString: array [0..127] of char;
StateFlags: DWord;
DeviceID, DeviceKey: array [0..127] of char;
end;

TMixerCaps = record
vPid, vDriverVersion: DWord;
sName: array [0..31] of char;
Support, cDestinations: DWord;
end;

// Проверка версии Windows
#if Pos("4.", GetFileVersion(AddBackslash(GetEnv("windir")) + "Explorer.exe")) == 1
{Win9x}
TMemoryStatusEx = record
dwLength, dwMemoryLoad: DWord;
LoTotalPhys, LoAvailPhys, LoTotalPageFile, LoAvailPageFile,
LoTotalVirtual, LoAvailVirtual, LoAvailExtendedVirtual, HiTotalPhys,
HiAvailPhys, HiTotalPageFile, HiAvailPageFile, HiTotalVirtual, HiAvailVirtual,
HiAvailExtendedVirtual: Integer;
end;
function GlobalMemoryStatusEx(var lpBuffer: TMemoryStatusEx): Boolean;
external 'GlobalMemoryStatus@kernel32.dll stdcall';
#else
{WinNT}
TMemoryStatusEx = record
dwLength, dwMemoryLoad: DWord;
LoTotalPhys, HiTotalPhys, LoAvailPhys, HiAvailPhys,
LoTotalPageFile, HiTotalPageFile, LoAvailPageFile, HiAvailPageFile,
LoTotalVirtual, HiTotalVirtual, LoAvailVirtual, HiAvailVirtual, LoAvailExtendedVirtual,
HiAvailExtendedVirtual: Integer;
end;
function GlobalMemoryStatusEx(var lpBuffer: TMemoryStatusEx): Boolean;
external 'GlobalMemoryStatusEx@kernel32.dll stdcall';
#endif

const
DISPLAY_DEVICE_PRIMARY_DEVICE = 4;
oneMB = 1024*1024;
NeedMHz = 1800;
NeedVideoRAM = 128;
NeedSoundCard = 'Creative X-Fi';
NeedMB = 512;
NeedPageFile = 1024;

var
InfoPage: TWizardPage;
TopText, BottomText: TNewStaticText;
ChangeText: Boolean;
SystemPanel, ProcessorPanel, VideoPanel,
AudioPanel, RAMPanel, PageFilePanel: TMemo;
SystemVersionPanel, ProcessorMHzPanel, VideoRAMPanel,
AudioNamePanel, RAMTotalPanel, PageFileTotalPanel: TMemo;
lpCaps: TMixerCaps;
Version: TWindowsVersion;
MemoryEx: TMemoryStatusEx;
n, errCode: Integer;
Keys: TArrayOfString;
DeviceValue: Cardinal;
lpDisplayDevice: PDisplay_Device;

function GetSystemMetrics(nIndex: Integer): Integer;
external 'GetSystemMetrics@user32.dll stdcall';

function GetDeviceCaps(hDC, nIndex: Integer): Integer;
external 'GetDeviceCaps@GDI32 stdcall';

function CreateDC(lpDriverName, lpDeviceName, lpOutput: String; lpInitData: Integer): Integer;
external 'CreateDCA@GDI32 stdcall';

function EnumDisplayDevices(lpDevice, iDevNum: DWord; var lpDisplayDevice: PDisplay_Device; dwFlags: DWord): Boolean;
external 'EnumDisplayDevicesA@user32.dll stdcall';

function mixerGetDevCaps(uDeviceID: LongInt; var lpCaps: TMixerCaps; uSize: LongInt): LongInt;
external 'mixerGetDevCapsA@winmm.dll stdcall';

function mixerGetNumDevs: Integer;
external 'mixerGetNumDevs@winmm.dll stdcall';

// Дополнить число до кратного Multiple
function ToMultiple(Bytes, Multiple: Integer): Integer;
begin
if Abs(Bytes/Multiple) > Bytes/Multiple then
Result := (Bytes/Multiple + 1)*Multiple
else
Result := Bytes
end;

// Перевод числа в значение Бт/Кб/Мб/Гб/Тб (до 3х знаков после запятой)
function ByteOrTB(Bytes: Extended; noMB: Boolean): String;
begin
if not noMB then
Result := FloatToStr(Int(Bytes)) + ' Мб'
else
if Bytes < 1024 then
Result := FloatToStr(Int(Bytes)) + ' Бт'
else
if Bytes/1024 < 1024 then
Result := FloatToStr(round((Bytes/1024)*10)/10) + ' Кб'
else
if Bytes/oneMB < 1024 then
Result := FloatToStr(round(Bytes/oneMB*100)/100) + ' Мб'
else
if Bytes/oneMB/1000 < 1024 then
Result := FloatToStr(round(Bytes/oneMB/1024*1000)/1000) + ' Гб'
else
Result := FloatToStr(round(Bytes/oneMB/oneMB*1000)/1000) + ' Тб'
StringChange(Result, ',', '.')
end;

// Удаление начальных, конечных и повторных пробелов
function DelSp(String: String): String;
begin
while (Pos(' ', String) > 0) do Delete(String, Pos(' ', String), 1)
Result := Trim(String)
end;

function Size64(Hi, Lo: Integer): Extended;
begin
Result := Lo
if Lo < 0 then
Result := Result + $7FFFFFFF + $7FFFFFFF + 2
for Hi := Hi-1 downto 0 do Result := Result + $7FFFFFFF + $7FFFFFFF + 2
end;

function CheckCPU(NeedMHz: Integer): Boolean;
var
String: String;
begin
String := 'Hardware\Description\System\CentralProcessor'; RegGetSubkeyNames(HKLM, String, Keys) // Количество ядер
for n := 0 to GetArrayLength(Keys)-1 do
RegQueryStringValue(HKLM, String + '\' + Keys[n], 'ProcessorNameString', Keys[n])
if not RegQueryDWordValue(HKLM, String + '\0', '~MHz', DeviceValue) or (DeviceValue < NeedMHz) then
Exit
else
Result := True
end;

function CheckMemorySize(NeedRAM: Integer): Boolean;
begin
MemoryEx.dwLength := SizeOf(MemoryEx)
if not GlobalMemoryStatusEx(MemoryEx) then
MsgBox('Ошибка функции:' + #13 + 'GlobalMemoryStatusEx', mbError, mb_Ok)
else
if (ToMultiple(trunc(Size64(MemoryEx.HiTotalPhys, MemoryEx.LoTotalPhys)/oneMB), 16) < NeedRAM) then
Exit
else
Result := True
end;

procedure CreateCheckForm();
begin

TopText := TNewStaticText.Create(InfoPage)
with TopText do
begin
Parent := InfoPage.Surface
Left := 0
AutoSize := True
end

BottomText := TNewStaticText.Create(InfoPage)
with BottomText do
begin
Parent := InfoPage.Surface
Caption := 'Когда Вы будете готовы продолжить установку, нажмите «Далее».'
Font.Color := clBlack
Left := 0
Top := 200
AutoSize := True
end

SystemPanel := TMemo.Create(InfoPage)
with SystemPanel do
begin
Text := 'Система'
Alignment := taCenter
Parent := InfoPage.Surface
Left := ScaleX(0)
Top := ScaleY(33)
Width := ScaleX(100)
Height := ScaleY(22)
ReadOnly := True
Color := $EEEEEE
end

SystemVersionPanel := TMemo.Create(InfoPage)
with SystemVersionPanel do
begin
Alignment := taLeftJustify
Parent := InfoPage.Surface
Left := ScaleX(104)
Top := SystemPanel.Top
Width := ScaleX(310)
Height := ScaleY(22)
ReadOnly := True
end

ProcessorPanel := TMemo.Create(InfoPage)
with ProcessorPanel do
begin
Text := 'Процессор'
Alignment := taCenter
Parent := InfoPage.Surface
Left := ScaleX(0)
Top := SystemPanel.Top + 27
Width := ScaleX(100)
Height := ScaleY(22)
ReadOnly := True
Color := $EEEEEE
end

ProcessorMHzPanel := TMemo.Create(InfoPage)
with ProcessorMHzPanel do
begin
Alignment := taLeftJustify
Parent := InfoPage.Surface
Left := ScaleX(104)
Top := ProcessorPanel.Top
Width := ScaleX(310)
Height := ScaleY(22)
ReadOnly := True
end

VideoPanel := TMemo.Create(InfoPage)
with VideoPanel do
begin
Text := 'Видеоадаптер'
Alignment := taCenter
Parent := InfoPage.Surface
Left := ScaleX(0)
Top := ProcessorPanel.Top + 27
Width := ScaleX(100)
Height := ScaleY(22)
ReadOnly := True
Color := $EEEEEE
end

VideoRAMPanel := TMemo.Create(InfoPage)
with VideoRAMPanel do
begin
Alignment := taLeftJustify
Parent := InfoPage.Surface
Left := ScaleX(104)
Top := VideoPanel.Top
Width := ScaleX(310)
Height := ScaleY(22)
ReadOnly := True
end

AudioPanel := TMemo.Create(InfoPage)
with AudioPanel do
begin
Text := 'Звуковая карта'
Alignment := taCenter
Parent := InfoPage.Surface
Left := ScaleX(0)
Top := VideoPanel.Top + 27
Width := ScaleX(100)
Height := ScaleY(22)
ReadOnly := True
Color := $EEEEEE
end

AudioNamePanel := TMemo.Create(InfoPage)
with AudioNamePanel do
begin
Alignment := taLeftJustify
Parent := InfoPage.Surface
Left := ScaleX(104)
Top := AudioPanel.Top
Width := ScaleX(310)
Height := ScaleY(22)
ReadOnly := True
end

RAMPanel := TMemo.Create(InfoPage)
with RAMPanel do
begin
Text := 'Объём памяти'
Alignment := taCenter
Parent := InfoPage.Surface
Left := ScaleX(0)
Top := AudioPanel.Top + 27
Width := ScaleX(100)
Height := ScaleY(22)
ReadOnly := True
Color := $EEEEEE
end

RAMTotalPanel := TMemo.Create(InfoPage)
with RAMTotalPanel do
begin
Alignment := taLeftJustify
Parent := InfoPage.Surface
Left := ScaleX(104)
Top := RAMPanel.Top
Width := ScaleX(310)
Height := ScaleY(22)
ReadOnly := True
end

PageFilePanel := TMemo.Create(InfoPage)
with PageFilePanel do
begin
Text := 'Файл подкачки'
Alignment := taCenter
Parent := InfoPage.Surface
Left := ScaleX(0)
Top := RAMPanel.Top + 27
Width := ScaleX(100)
Height := ScaleY(22)
ReadOnly := True
Color := $EEEEEE
end;

PageFileTotalPanel := TMemo.Create(InfoPage)
with PageFileTotalPanel do
begin
Alignment := taLeftJustify
Parent := InfoPage.Surface
Left := ScaleX(104)
Top := PageFilePanel.Top
Width := ScaleX(310)
Height := ScaleY(22)
ReadOnly := True
end

end;

procedure UpdateInfo();
var
DeviceName, DeviceKey: String;
begin
ChangeText := False

GetWindowsVersionEx(Version)

// Операционная система:
SystemVersionPanel.Color := $CCFFCC

DeviceKey := 'Software\Microsoft\Windows NT\CurrentVersion'
if not UsingWinNT then StringChange(DeviceKey, 'Windows NT', 'Windows')
RegQueryStringValue(HKLM, DeviceKey, 'ProductName', DeviceName)
if RegQueryStringValue(HKLM, DeviceKey, 'CSDVersion', DeviceKey) then
DeviceName := DeviceName + ' ' + DeviceKey
StringChange(DeviceName, 'Microsoft ', '')
SystemVersionPanel.Text := ' ' + DeviceName + ' сборка ' + IntToStr(Version.Major) + '.' + IntToStr(Version.Minor) +
'.' + IntToStr(Version.Build)

if (Pos('2000 Service Pack 4', SystemVersionPanel.Text) = 0) and // Windows 2000 SP4
(Pos('XP Service Pack 2', SystemVersionPanel.Text) = 0) and // Windows XP SP2
(Pos('XP Service Pack 3', SystemVersionPanel.Text) = 0) and // Windows XP SP3
(Pos('Vista', SystemVersionPanel.Text) = 0) then // Windows Vista (c любым SP или без него)
begin
SystemVersionPanel.Color := $CCCCFF
ChangeText := True
end

// Процессор:
ProcessorMHzPanel.Color := $CCFFCC

if not CheckCPU(NeedMHz) then
begin
ProcessorMHzPanel.Color := $CCCCFF
ChangeText := True
end

ProcessorMHzPanel.Text := ' ' + DelSp(Keys[0]) + ' @' + IntToStr(DeviceValue) + ' MHz'
if GetArrayLength(Keys) > 1 then
ProcessorPanel.Text := 'Процессоры' // + ' (' + IntToStr(GetArrayLength(Keys)) + ')'

// Видеокарта:
VideoRAMPanel.Color := $CCFFCC

lpDisplayDevice.cb := SizeOf(lpDisplayDevice)
DeviceKey := ''
n := 0
while not (EnumDisplayDevices(0, n, lpDisplayDevice, 0) and
(lpDisplayDevice.StateFlags and DISPLAY_DEVICE_PRIMARY_DEVICE > 0)) and (n < 127) do n := n + 1
for n := 0 to 127 do DeviceKey := DeviceKey + lpDisplayDevice.DeviceKey[n]
Delete(DeviceKey, Pos(Chr(0), DeviceKey), 127) // Ключ драйвера получаем из API
StringChange(DeviceKey, '\Registry\Machine\', '')
errCode := 1
DeviceValue := 0
if RegQueryBinaryValue(HKLM, DeviceKey, 'HardwareInformation.MemorySize', DeviceName) then
for n := 1 to Length(DeviceName) do
begin
DeviceValue := DeviceValue + Ord(DeviceName[n])*errCode
errCode := errCode*$100
end
else
if RegQueryDWordValue(HKLM, DeviceKey, 'HardwareInformation.MemorySize', DeviceValue) then
else
RegQueryDWordValue(HKLM, DeviceKey + '\Info', 'VideoMemory', DeviceValue)
DeviceName := ''
for n := 0 to 127 do DeviceName := DeviceName + lpDisplayDevice.DeviceString[n]
Delete(DeviceName, Pos(Chr(0), DeviceName), 127)

if DeviceName <> '' then
if DeviceValue > 0 then
VideoRAMPanel.Text := ' ' + DelSp(DeviceName) + ', '+ ByteOrTB(DeviceValue/oneMB, False)
else
VideoRAMPanel.Text := ' ' + DelSp(DeviceName) + ' (Standard), '+ ByteOrTB(DeviceValue/oneMB, False)
else
begin
VideoRAMPanel.Text := ' Драйвер устройства не обнаружен'
VideoRAMPanel.Color := $CCCCFF
ChangeText := True
end
if (DeviceValue/oneMB < NeedVideoRAM) then
begin
VideoRAMPanel.Color := $CCCCFF
ChangeText := True
end
VideoRAMPanel.Text := VideoRAMPanel.Text + ', ' + IntToStr(GetSystemMetrics(0)) + 'x' +
IntToStr(GetSystemMetrics(1)) + ' (' + IntToStr(GetDeviceCaps(CreateDC('DISPLAY','','',0),14) *
GetDeviceCaps(CreateDC('DISPLAY','','',0),12)) + ' bit)'

// Звуковая карта:
AudioNamePanel.Color := $CCFFCC

// for errCode := 0 to 1 do // Вывод основного звукового устройства
for errCode := 0 to mixerGetNumDevs do
begin
mixerGetDevCaps(errCode-1, lpCaps, SizeOf(lpCaps))
DeviceName := ' '
for n := 0 to 31 do DeviceName := DeviceName + lpCaps.sName[n]
Delete(DeviceName, Pos(Chr(0), DeviceName), 31)
Delete(DeviceName, Pos(' [', DeviceName), 31)
StringChange(DeviceName, 'SB ', 'Creative ')
Delete(DeviceName, Pos(' Audio', DeviceName), 31)
SetArrayLength(Keys, errCode)
if errCode > 0 then Keys[errCode-1] := DeviceName
end

if GetArrayLength(Keys) > 1 then
begin
AudioPanel.Text := 'Звуковые карты'
// AudioPanel.Text := 'Звуковые карты (' + IntToStr(GetArrayLength(Keys)) +')'
AudioNamePanel.Text := ''
for n := 1 to GetArrayLength(Keys) do
AudioNamePanel.Text := AudioNamePanel.Text + Keys[n-1] // + '(' + IntToStr(n) + ')'
end
else
if GetArrayLength(Keys) = 0 then
begin
AudioNamePanel.Text := ' Драйвер устройства не обнаружен'
AudioNamePanel.Color := $CCCCFF
ChangeText := True
end
else
AudioNamePanel.Text := Keys[0]
if Pos(NeedSoundCard, AudioNamePanel.Text) = 0 then
AudioNamePanel.Text := AudioNamePanel.Text + ' (рекомендуется ' + NeedSoundCard + ')'

// Объём памяти:
RAMTotalPanel.Color := $CCFFCC
if not CheckMemorySize(NeedMB) then
begin
RAMTotalPanel.Color := $CCCCFF
ChangeText := True
end
RAMTotalPanel.Text := ' ' + ByteOrTB(ToMultiple(trunc(Size64(MemoryEx.HiTotalPhys, MemoryEx.LoTotalPhys)/oneMB), 16), False) + ' всего, ' +
ByteOrTB(ToMultiple(trunc(Size64(MemoryEx.HiTotalPhys, MemoryEx.LoTotalPhys)/oneMB), 16) -
Size64(MemoryEx.HiAvailPhys, MemoryEx.LoAvailPhys)/oneMB, False) + ' используется, ' +
ByteOrTB(Size64(MemoryEx.HiAvailPhys, MemoryEx.LoAvailPhys)/oneMB, False) + ' свободно'

// Виртуальная память:
PageFileTotalPanel.Color := $CCFFCC
PageFileTotalPanel.Text := ' ' + ByteOrTB(Size64(MemoryEx.HiTotalPageFile, MemoryEx.LoTotalPageFile)/oneMB, False) + ' всего, ' +
ByteOrTB((Size64(MemoryEx.HiTotalPageFile, MemoryEx.LoTotalPageFile) -
Size64(MemoryEx.HiAvailPageFile, MemoryEx.LoAvailPageFile))/oneMB, False) + ' занято системным кэшем'
if Size64(MemoryEx.HiTotalPageFile, MemoryEx.LoTotalPageFile)/oneMB < NeedPageFile then
begin
PageFileTotalPanel.Color := $CCCCFF
ChangeText := True
end

if ChangeText = True then
begin
TopText.Top := 0
TopText.Caption := 'Не все компоненты удовлетворяют минимальным требованиям.' #13
'Пожалуйста, проверьте позиции, выделенные красным цветом.'
TopText.Font.Color := clRed
WizardForm.NextButton.Enabled := False
end
else
begin
TopText.Caption := 'Все компоненты соответствуют минимальным требованиям.'
TopText.Font.Color := clGreen
TopText.Top := 8
WizardForm.NextButton.Enabled := True
end

end;

procedure InitializeWizard();
begin
InfoPage := CreateCustomPage(wpLicense, 'Аппаратное и программное обеспечение',
'Программа установки обнаружила следующие наобходимые компоненты.')
CreateCheckForm() // Создание объектов TMemo, в которых будет выводится информация о системе
UpdateInfo() // Обновление информации о системе
end;

procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = InfoPage.ID then UpdateInfo() // Обновление информации о системе
end;

S.E.K.T.O.R.
30-09-2009, 03:35
Ну во-первых, Serega, спасибо, что откликнулись!

Может я неправильно изложил суть проблемы, так вот: у меня есть скрипт проверки сист.требований, но без проверки ОС
http://i020.radikal.ru/0909/e7/21653b41e526t.jpg (http://radikal.ru/F/i020.radikal.ru/0909/e7/21653b41e526.jpg.html)
Для этого я нашел скрипт с проверкой ОС и хочю добавить нужные строки в свой скрипт (т.е. строки для проверки ОС), чтобы в итоге получить вот это
http://s41.radikal.ru/i091/0909/14/7682f44e5ea9t.jpg (http://radikal.ru/F/s41.radikal.ru/i091/0909/14/7682f44e5ea9.jpg.html)
Панели я создал (WindowsPanel, WindowsNamePanel), а вот добавить к ним все остальное нужное для проверки ОС не получается. Просьба: помогите добавить проверку ОС из var state: boolean;

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;
Text: TNewStaticText;

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 DelSp(const s: string): string; // функция удаления пробелов в начале строки
var
c, i: integer;
stt, st, st1: string;
begin
c := 0;
st := s;

for i := 1 to Length(st) do
begin

stt := copy(st, i, 1);
if (stt = ' ') and (c >= 1) then
begin
st1 := st1;
c := c + 1;
end
else if (stt = ' ') and (c = 0) then
begin
c := c + 1;
st1 := st1 + stt;
end
else if (stt <> ' ') then
begin
c := 0;
st1 := st1 + stt;
end
end;

Result := st1;
end;

procedure CurPageChanged(CurPageID: Integer);
var
Page: TWizardPage;
Text: TNewStaticText;
Memo,Windows,SP,Version,Build,registered,WindowsName,SP_Num,Version_Num,Build_num,registered_name: TMemo;
Os,OS1: string; // строка с названием необходимой ОС
// state: boolean;

ProcessorName: string;
Processor, VideoCardPanel, AudioCardPanel, RAMPanel, PageFilePanel: TMemo;
ProcessorNamePanel, VideoCardNamePanel, AudioCardNamePanel, RAMTotalPanel, PageFileTotalPanel: TMemo;
ProcessorMHZ: Cardinal;
StaticText, StaticText2: TNewStaticText;
VidRam: integer;

begin
if CurPageID = wpUserInfo then
begin
//подменяем сраницу информации о пользователе на информацию об ОС
wizardForm.UserInfoNameEdit.visible:=false;
wizardForm.UserInfoNameEdit.text:='Игрок'; //на случай, когда имя пользователя не указано в системе
wizardForm.UserInfoNameLabel.visible:=false;
wizardForm.UserInfoOrgLabel.visible:=false;
wizardForm.UserInfoOrgEdit.visible:=false;
wizardForm.UserInfoOrgEdit.text:='Группа игроков ';//на случай, когда организация не указано в системе
wizardForm.PageNameLabel.Caption := 'Аппаратное обеспечение и Операционная система';
wizardForm.PageDescriptionLabel.Caption := 'Программа установки обнаружила следующие необходимые компоненты и Операционную систему ';
RegQueryStringValue(HKLM, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0', 'ProcessorNameString', ProcessorName);
RegQueryDWordValue(HKLM, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0', '~MHz', ProcessorMHZ);

OS:=' Microsoft Windows XP Service Pack 2'; //строка является суммой из записей в реестре о Наименовании ОС и сервис-паке
OS1:=' Microsoft Windows 2000 Service Pack 4'; //строка является суммой из записей в реестре о Наименовании ОС и сервис-паке

Windows := TMemo.Create(WizardForm);

StaticText := TNewStaticText.Create(TNewStaticText.Create(WizardForm));
with StaticText do begin
Left := 0;
Top := 52;
Width := 417;
Height := 14;
Caption := 'Все компоненты удовлетворяют требованиям игры.';
Parent := WizardForm.UserInfoPage;
StaticText.font.color:=clGreen;
end


with Windows do
begin
Text := ' Операц. система';
Parent := WizardForm.UserInfoPage;

Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(20);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := clBtnFace;
end
Processor := TMemo.Create(WizardForm);
with Processor do begin
Text := ' Процессор';
Parent := WizardForm.UserInfoPage;

Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(77);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := clBtnFace;
end
VideoCardPanel := TMemo.Create(WizardForm);
with VideoCardPanel do begin
Text := ' Видеоадаптер';
Parent := WizardForm.UserInfoPage;

Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(104);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := clBtnFace;
end
AudioCardPanel := TMemo.Create(WizardForm);
with AudioCardPanel do begin
Text := ' Звуковая карта';
Parent := WizardForm.UserInfoPage;
Color := clBtnFace;
Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(131);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;

end
RAMPanel := TMemo.Create(WizardForm);
with RAMPanel do begin
Text := ' ОЗУ';
Parent := WizardForm.UserInfoPage;
Color := clBtnFace;
Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(158);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.


ReadOnly := True;

end

PageFilePanel := TMemo.Create(WizardForm);
with PageFilePanel do begin
Text := ' Файл подкачки';
Parent := WizardForm.UserInfoPage;
Color := clBtnFace;
Left := ScaleX(0); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(185);
Width := ScaleX(106); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.


ReadOnly := True;

ProcessorNamePanel := TMemo.Create(WizardForm);
with ProcessorNamePanel do begin

Text := DelSP(ProcessorName) + ' ' + IntToStr(ProcessorMHZ) + 'MHz'; //новое обработанное значение строки
Parent := WizardForm.UserInfoPage;

Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(77);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := $CCFFCC;

if ProcessorMHZ < 1800 then
begin
ProcessorNamePanel.Color := $ccccff;
StaticText.Caption := 'Не все компоненты удовлетворяют требованиям игры.';
StaticText.font.color:=clRed;
end;

VideoCardNamePanel := TMemo.Create(WizardForm);
with VideoCardNamePanel do begin
Text := ' ' + GetVideoCardName; //+' ОЗУ-'+inttostr(round(GetVidMemLocal/1000000))+' МБ'
Parent := WizardForm.UserInfoPage;
VidrAM := GetVidMemLocal / 1000000;

if VidRam > 127 then
begin
if VidRam < 200 then text := text + ' ОЗУ - 128 МB'
else if VidRam < 300 then text := text + ' ОЗУ - 256 МB'
else if VidRam < 400 then text := text + ' ОЗУ - 384 МB'
else if VidRam > 500 then text := text + ' ОЗУ - 512 МB';
end;

Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(104);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := $CCFFCC;

if GetVidMemLocal < 127000000 then //128 MB
begin
StaticText.Caption := 'Не все компоненты удовлетворяют требованиям игры.';
StaticText.font.color:=clRed;
VideoCardNamePanel.Color := $ccccff;
end;


end
AudioCardNamePanel := TMemo.Create(WizardForm);
with AudioCardNamePanel do begin
Text := ' ' + GetSoundCardName;
Parent := WizardForm.UserInfoPage;
Color := $CCFFCC;
Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(131);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R

ReadOnly := True;

end
RAMTotalPanel := TMemo.Create(WizardForm);
with RAMTotalPanel do begin
Text := ' ' + IntToStr(GetSystemPhys + 1) + ' MB';
Parent := WizardForm.UserInfoPage;
Color := $CCFFCC;

Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(158);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
if GetSystemPhys + 1 < 1024 then
begin
RAMTotalPanel.Color := $ccccff;
StaticText.Caption := 'Не все компоненты удовлетворяют требованиям игры.';
StaticText.font.color:=clRed;
end;
end;

PageFileTotalPanel := TMemo.Create(WizardForm);
with PageFileTotalPanel do begin
Text := ' ' + IntToStr(GetSystemPage) + ' MB';
Parent := WizardForm.UserInfoPage;
Color := $CCFFCC;

Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(185);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
if GetSystemPage < 1247 then
begin
PageFileTotalPanel.Color := $ccccff;
StaticText.Caption := 'Не все компоненты удовлетворяют требованиям игры.';
StaticText.font.color:=clRed;
end;
end;


end

if ExpandConstant('{reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,ProductName|}')='' then
begin

WindowsName := TMemo.Create(WizardForm);
with WindowsName do begin
Text := ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion,ProductName|}')+ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion,CSDVersion|}');
Parent := WizardForm.UserInfoPage;

Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(20);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;
Color := $CCFFCC;
end

end

end;

// Проверка Windows 9x
if ExpandConstant('{reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,ProductName|}')<>'' then
begin
WindowsName := TMemo.Create(WizardForm);
with WindowsName do begin
Text := ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,ProductName|}')+ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,CSDVersion|}');
Parent := WizardForm.UserInfoPage;
Color := $CCFFCC;
Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(20);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;

end

end;


if OS=(WindowsName.Text) then state:=true else
if OS1=(WindowsName.Text) then state:=true else state:=false;

Text := TNewStaticText.Create(WizardForm);
with Text do begin
Left := 0;
Top := 0;
Width := 417;
Height := 14;
if state then
begin
Font.Color:=clGreen;
WindowsName.color:=$CCFFCC;
// SP_Num.color:=$CCFFCC;
Caption := 'Операционная система соответствует требованиям игры.';
end
else
begin
Font.Color:=clREd;
WindowsName.color:=clRed;

WindowsName.Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
WindowsName.Top := ScaleY(20);
WindowsName.Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
WindowsName.Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.
WindowsName.ReadOnly := True;



Caption := 'Операционная система не соответствует требованиям игры.';
end
Parent := WizardForm.UserInfoPage;
end
Text := TNewStaticText.Create(TNewStaticText.Create(WizardForm));
with Text do begin
Left := 0;
Top := 220;
Width := 417;
Height := 14;
Caption := 'Когда Вы будете готовы продолжить установку, нажмите «Далее».';
Parent := WizardForm.UserInfoPage;
end




if not state then
begin
wizardForm.Nextbutton.enabled:=false;
end;
end;
end; в 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;
Text: TNewStaticText;

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 GetLogicalDrives: DWORD;
external 'GetLogicalDrives@kernel32.dll stdcall';

function GetDriveType(nDrive: string): Longint;
external 'GetDriveTypeA@kernel32.dll stdcall';

function DelSp(const s: string): string; //функция удаления табуляции и пробелов в начале строки
var
c, i: integer;
stt, st, st1: string;
begin
c := 0;
st := s;

for i := 1 to Length(st) do
begin

stt := copy(st, i, 1);
if (stt = ' ') and (c >= 1) then
begin
st1 := st1;
c := c + 1;
end
else if (stt = ' ') and (c = 0) then
begin
c := c + 1;
st1 := st1 + stt;
end
else if (stt <> ' ') then
begin
c := 0;
st1 := st1 + stt;
end
end;

Result := st1;
end;

function CheckSystemPage(PreviousPageId: Integer): Integer;
var
Page: TWizardPage;
ProcessorName: string;

Processor, VideoCardPanel, AudioCardPanel, RAMPanel, PageFilePanel, WindowsPanel: TMemo;
ProcessorNamePanel, VideoCardNamePanel, AudioCardNamePanel, RAMTotalPanel, PageFileTotalPanel, WindowsNamePanel: TMemo;

ProcessorMHZ: Cardinal;
StaticText, StaticText2: TNewStaticText;
VidRam: integer;
begin
RegQueryStringValue(HKLM, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0', 'ProcessorNameString', ProcessorName);
RegQueryDWordValue(HKLM, 'HARDWARE\DESCRIPTION\System\CentralProcessor\0', '~MHz', ProcessorMHZ);
GetVidMemLocal;
GetSoundCards;

Page := CreateCustomPage(PreviousPageId, 'Аппаратное Обеспечение', 'Программа установки обнаружила следующие необходимые компоненты');

StaticText := TNewStaticText.Create(Page);
with StaticText do
begin
Parent := Page.Surface;
Caption := 'Все компоненты удовлетворяют требованиям игры.';
Left := 0;
Top := 0;
AutoSize := True;
end;

StaticText2 := TNewStaticText.Create(Page);
with StaticText2 do
begin
Parent := Page.Surface;
Caption := 'Когда Вы будете готовы продолжить установку, нажмите «Далее».';
Left := 0;
Top := 220;
AutoSize := True;
end;

//******************************************* [Начало - Операционная система] ***************************************************//

WindowsPanel := TMemo.Create(Page);
with WindowsPanel do
begin
Text := ' Операц. система';
Parent := Page.Surface;

Left := ScaleX(0);
Top := ScaleY(165);
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;

WindowsNamePanel := TMemo.Create(Page);
with WindowsNamePanel do
begin

if ExpandConstant('{reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,ProductName|}')='' then
begin

WindowsNamePanel := TMemo.Create(Page);
with WindowsNamePanel do
begin
Text := ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion,ProductName|}')+ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion,CSDVersion|}');
Parent := Page.Surface;

Left := ScaleX(110);
Top := ScaleY(165);
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end
end
end;
//дальше не получается


//******************************************* [Конец - Операционная система] ***************************************************//


//******************************************* [Начало - Процессор] ***************************************************//

Processor := TMemo.Create(Page);
with Processor do
begin
Text := ' Процессор';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(0);
Top := ScaleY(30);
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;


ProcessorNamePanel := TMemo.Create(Page);
with ProcessorNamePanel do
begin
Text := DelSP(ProcessorName) + ' ' + IntToStr(ProcessorMHZ) + 'MHz'; //новое обработанное значение строки
//Caption :=ProcessorName+' '+IntToStr(ProcessorMHZ)+'MHz' ;
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(110);
Top := ScaleY(30);
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end;

if ProcessorMHZ < 1800 then //Минимальное количество частоты в MHz
begin
StaticText.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям игры.'#13+'Проверьте соответствие системным требованиям.';
ProcessorNamePanel.Color := $CCCCFF;
end;


//******************************************* [Конец - Процессор] ****************************************************//


//******************************************* [Начало - Видеоадаптер] ************************************************//

VideoCardPanel := TMemo.Create(Page);
with VideoCardPanel do
begin
Text := ' Видеоадаптер';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(0);
Top := Processor.Top + 27;
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;

VideoCardNamePanel := TMemo.Create(Page);
with VideoCardNamePanel do
begin
Text := ' ' + GetVideoCardName; //+' ОЗУ-'+inttostr(round(GetVidMemLocal/1000000))+' МБ';
//Caption:=' ОЗУ-'+inttostr(GetVidMemLocal)+' МБ';
Alignment := taLeftJustify;
Parent := Page.Surface;

VidrAM := GetVidMemLocal / 1000000;

if VidRam > 127 then
begin
if VidRam < 200 then Text := Text + '128 МB'
else if VidRam < 300 then Text := Text + '256 МB'
else if VidRam < 400 then Text := Text + '384 МB'
else if VidRam > 500 then Text := Text + '512 МB';
end;

Left := ScaleX(110);
Top := VideoCardPanel.Top;
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end;

if GetVidMemLocal < 127000000 then //Минимальное объем ОЗУ [в байтах] у видеоадаптера 128 MB
begin
StaticText.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям игры.'#13+'Проверьте соответствие системным требованиям.';
VideoCardNamePanel.Color := $CCCCFF;
end;

//******************************************* [Конец - Видеоадаптер] *************************************************//


//******************************************* [Начало - Звуковая карта] **********************************************//

AudioCardPanel := TMemo.Create(Page);
with AudioCardPanel do
begin
Text := ' Звуковая карта';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(0);
Top := VideoCardPanel.Top + 27;
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;

AudioCardNamePanel := TMemo.Create(Page);
with AudioCardNamePanel do
begin
Text := ' ' + GetSoundCardName;
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(110);
Top := AudioCardPanel.Top;
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end;

if
GetSoundCards = 0 then
begin
StaticText.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям игры.'#13+'Проверьте соответствие системным требованиям.';
AudioCardNamePanel.Color := $CCCCFF;
end;

//******************************************* [Конец - Звуковая карта] ***********************************************//


//******************************************* [Начало - ОЗУ] *********************************************************//

RAMPanel := TMemo.Create(Page);
with RAMPanel do
begin
Text := ' Память';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(0);
Top := AudioCardPanel.Top + 27;
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;

RAMTotalPanel := TMemo.Create(Page);
with RAMTotalPanel do
begin
Text := ' ' + IntToStr(GetSystemPhys + 1) + ' MB';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(110);
Top := RAMPanel.Top;
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end;

if GetSystemPhys + 1 < 1024 then //Минимальное объем ОЗУ 1 Гб или 1024 Мб
begin
StaticText.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям игры.'#13+'Проверьте соответствие системным требованиям.';
RAMTotalPanel.Color := $CCCCFF;
end;

//******************************************* [Конец - ОЗУ] **********************************************************//


//******************************************* [Начало - Файл подкачки] ***********************************************//

PageFilePanel := TMemo.Create(Page);
with PageFilePanel do
begin
Text := ' Файл подкачки';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(0);
Top := RAMPanel.Top + 27;
Width := ScaleX(106);
Height := ScaleY(22);

ReadOnly := True;
Color := clBtnFace;
end;

PageFileTotalPanel := TMemo.Create(Page);
with PageFileTotalPanel do
begin
Text := ' ' + IntToStr(GetSystemPage) + ' MB';
Alignment := taLeftJustify;
Parent := Page.Surface;

Left := ScaleX(110);
Top := PageFilePanel.Top;
Width := ScaleX(304);
Height := ScaleY(22);

ReadOnly := True;
Color := $CCFFCC;
end;

if GetSystemPage < 2048 then //Минимальное объем файла [в мегабайтах] подкачки 1 Гб или 1024 Мб
begin
StaticText.Caption := 'Компоненты, выделенные красным, не удовлетворяют требованиям игры.'#13+'Проверьте соответствие системным требованиям.';
PageFileTotalPanel.Color := $CCCCFF;
end;

Result := Page.ID;
end;

//******************************************* [Конец - Файл подкачки] ************************************************//

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;

procedure InitializeWizard();
var
Page: TWizardPage;
Text: TNewStaticText;
Memo: TMemo;
Path: string;
FreeMB, TotalMB: Cardinal;
drives: DWORD;
i: integer;
begin
CheckSystemPage(wpLicense);

Text := TNewStaticText.Create(WizardForm);
Text.Top := 110;
Text.Width := 332;
Text.Height := 14;
Text.Caption := 'Список жестких дисков и свободного места';
Text.Parent := WizardForm.SelectDirPage;

ListBox := TListBox.Create(WizardForm);
ListBox.Top := 128;
ListBox.Width := 208;
ListBox.Height := ScaleY(84);
ListBox.Parent := WizardForm.SelectDirPage;
ListBox.OnClick := @ListBoxOnClick;
ListBox.Font.Name := 'Courier New';
ListBox.Font.Size := 10;
ListBox.Font.Style := [fsBold];
ListBox.Color := clBtnFace;

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);
if FreeMB>1024 then ListBox.Items.Add(Path + ' ' + IntToStr(round(FreeMB / TotalMB * 100)) + '% ' + floatToStr(round(FreeMB/1024*100)/100) + ' GB')
else ListBox.Items.Add(Path + ' ' + IntToStr(round(FreeMB / TotalMB * 100)) + '% ' + IntToStr(FreeMB) + ' MB');
end;
end;
end;
end;

P.S.
Вы мне помогали со следующим function InitializeSetup: Boolean;
var
path: string;
res: Integer;
begin
Result:= True;
if RegValueExists(HKLM, 'Software\My Program', 'InstallPath') then
if RegQueryStringValue(HKLM, 'Software\My Program', 'InstallPath', path) then
if FileExists(path + '\MyProg.exe') then
if MsgBox('Запустить My Program?', mbConfirmation, MB_YESNO) = IDYES then
begin
Exec(path + '\MyProg.exe', '', '', SW_SHOW, ewWaitUntilTerminated, res);
Result:= False;
end;
end; можно, чтобы при нажатии кнопки "Нет" инсталлятор закрывался, а не начинал установку

S.E.K.T.O.R.
30-09-2009, 03:41
Пример проверки системы, без get_hw_caps.dll » спасибо за пример, но этот вариант у меня есть (Ultimate Test). Мне кажется, что мой вариант намного удобней в использовании.

Serega
01-10-2009, 00:50
Панели я создал (WindowsPanel, WindowsNamePanel), а вот добавить к ним все остальное нужное для проверки ОС не получается »
Я не совсем понял, вы просите добавить проверку ОС, но в первом и во втором скрипте она есть.

1:
http://i011.radikal.ru/0909/cf/1a41258efcfat.jpg (http://radikal.ru/F/i011.radikal.ru/0909/cf/1a41258efcfa.jpg.html)

2:
http://s40.radikal.ru/i090/0909/b5/f334395b83d8t.jpg (http://radikal.ru/F/s40.radikal.ru/i090/0909/b5/f334395b83d8.jpg.html)

Вы мне помогали со следующим »
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.
Compression=lzma/ultra
InternalCompressLevel=ultra
SolidCompression=yes

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

[Files]
Source: compiler:Examples\MyProg.exe; DestDir: {app}; Flags: ignoreversion

[Registry]
Root: HKLM; Subkey: Software\My Program; ValueType: string; ValueName: InstallPath; ValueData: {app}; Flags: uninsdeletekey

[Code]
function InitializeSetup: Boolean;
var
path: string;
res: Integer;
begin
Result:= True;
if RegValueExists(HKLM, 'Software\My Program', 'InstallPath') then
if RegQueryStringValue(HKLM, 'Software\My Program', 'InstallPath', path) then
if FileExists(path + '\MyProg.exe') then
if MsgBox('Запустить My Program?', mbConfirmation, MB_YESNO) = IDYES then
begin
Exec(path + '\MyProg.exe', '', '', SW_SHOW, ewWaitUntilTerminated, res);
Result:= False;
end
else Result:= False;
end;

S.E.K.T.O.R.
01-10-2009, 01:27
Я не совсем понял, вы просите добавить проверку ОС, но в первом и во втором скрипте она есть. »

Serega Вы снова меня не правильно поняли (Вы наверное сам код не посмотрели). В 1-ом скрипте проверка действительно есть, а во 2-ом лишь кусок (посмотрите внимательно код) т.е. надо добавить из первого еще вот procedure CurPageChanged(CurPageID: Integer);
var
Page: TWizardPage;
Text: TNewStaticText;
Memo,Windows,SP,Version,Build,registered,WindowsName,SP_Num,Version_Num,Build_num,registered_name: TMemo;
Os,OS1: string; // строка с названием необходимой ОС
// state: boolean;

OS:=' Microsoft Windows XP Service Pack 2'; //строка является суммой из записей в реестре о Наименовании ОС и сервис-паке
OS1:=' Microsoft Windows 2000 Service Pack 4'; //строка является суммой из записей в реестре о Наименовании ОС и сервис-паке

// Проверка Windows 9x
if ExpandConstant('{reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,ProductName|}')<>'' then
begin
WindowsName := TMemo.Create(WizardForm);
with WindowsName do begin
Text := ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,ProductName|}')+ExpandConstant(' {reg:HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion,CSDVersion|}');
Parent := WizardForm.UserInfoPage;
Color := $CCFFCC;
Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
Top := ScaleY(20);
Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.

ReadOnly := True;

end

end;


if OS=(WindowsName.Text) then state:=true else
if OS1=(WindowsName.Text) then state:=true else state:=false;

Text := TNewStaticText.Create(WizardForm);
with Text do begin
Left := 0;
Top := 0;
Width := 417;
Height := 14;
if state then
begin
Font.Color:=clGreen;
WindowsName.color:=$CCFFCC;
// SP_Num.color:=$CCFFCC;
Caption := 'Операционная система соответствует требованиям игры.';
end
else
begin
Font.Color:=clREd;
WindowsName.color:=clRed;

WindowsName.Left := ScaleX(110); //оригинал S.T.A.L.K.E.R.
WindowsName.Top := ScaleY(20);
WindowsName.Width := ScaleX(304); //оригинал S.T.A.L.K.E.R.
WindowsName.Height := ScaleY(22); //оригинал S.T.A.L.K.E.R.
WindowsName.ReadOnly := True;



Caption := 'Операционная система не соответствует требованиям игры.';
end

P.S. Вы говорили, что навернное нельзя отключить сообщение "Недостаточно места на диске". А может тогда можно его изменить, т.е. сделать таким http://s54.radikal.ru/i146/0909/9f/e59e22e129eat.jpg (http://radikal.ru/F/s54.radikal.ru/i146/0909/9f/e59e22e129ea.jpg.html)
либо дать команду инсталлятору выводить вместо него function NextButtonClick(CurPageID: Integer): Boolean;
var
Path,s: String;
FreeMB, TotalMB: Cardinal;
begin
Result:= True;
if CurPageID = wpSelectDir then
begin
Path:= ExtractFileDrive(WizardForm.DirEdit.Text);
GetSpaceOnDisk(Path, True, FreeMB, TotalMB);
if FreeMB < (NeedSize*1024) then
begin
if FreeMB>1024 then
begin
s:='Для установки приложения необходимо '+ IntTostr(NeedSize)+ ' GB,'#13+'а на выбранном Вами диске доступно только '+ floatToStr(round(FreeMB/1024*100)/100) + ' GB!'
end
else s:='Для установки приложения необходимо '+ IntTostr(NeedSize)+ ' GB,'#13+'а на выбранном Вами диске доступно только '+ + IntToStr(FreeMB)+' MB';
MsgBox(s, mbCriticalError, MB_OK)
Result := False;
end;
end;
end;

Ведь в инсталке Сталкера как-то сделали

A1EXXX
01-10-2009, 15:27
Вышла новая версия ISTool 5.3.0.1 (29.09.2009) (http://sourceforge.net/projects/istool/files/istool-5.3.0.1.exe/download)

Изменения:
Fixed unicode bug

Lancer2404
02-10-2009, 20:48
как сделать чтобы при указании пути инсталлятор не приписывал дефолтную папку.
пример путь С:\Driver (выбираешь через обзор)
а он в конце приписывает (параметр defaultdirname) допустим Новая папка.Как сделать чтоб он вообще ничего не приписывал?Спасибо

serg aka lain
02-10-2009, 22:24
(параметр defaultdirname) допустим Новая папка.Как сделать чтоб он вообще ничего не приписывал? »
[Setup]
AppendDefaultDirName=False

Lancer2404
03-10-2009, 11:52
спасибо.а можете дать список похожих команд.вдруг пригодятся?

[Setup] AppendDefaultDirName=False
ошибку выдает писал в секции [setup]

serg aka lain
03-10-2009, 16:12
ошибку выдает »
Если и так:
AppendDefaultDirName=no
выдаст ошибку, то ...

414895494
03-10-2009, 16:13
Здраствуйте. Я тут новинький. Хочу научится делать красивые инсталяторы.
Можете добрые люди научить меня? Буду очень признателен.

http://clip2net.com/clip/m0/1254568692-clip-140kb.jpg

http://clip2net.com/clip/m0/1254568741-clip-42kb.png

Вот этому можете меня научить?

A1EXXX
03-10-2009, 17:22
414895494, код для растягивания картинки страницы приветствия:
[Files]
Source: C:\fon.bmp; DestDir: {tmp}; Flags: dontcopy

[Code]
var
WelcomeLabel1, WelcomeLabel2: TLabel;
BmpFile: TBitmapImage;

procedure InitializeWizard();
begin
ExtractTemporaryFile('fon.bmp');

BmpFile:= TBitmapImage.Create(WizardForm);
BmpFile.Bitmap.LoadFromFile(ExpandConstant('{tmp}\fon.bmp'));
BmpFile.SetBounds(0, 0, 497, 320);
BmpFile.Stretch:= true
BmpFile.Parent:= WizardForm.WelcomePage;

with WizardForm do
begin
WelcomeLabel1.Hide;
WelcomeLabel2.hide;
end;

WelcomeLabel1:= TLabel.Create(WizardForm);
with WelcomeLabel1 do
begin
WelcomeLabel1.Alignment:=taCenter;
Left:= ScaleX(176);
Top:= ScaleY(66);
Width:= ScaleX(301);
Height:= ScaleY(71);
AutoSize:= false;
Transparent:= true;
WordWrap:= true;
Font.Name:='Tahoma'
Font.Size:= 12;
Font.Color:=ClWhite
Parent:= WizardForm.WelcomePage;
Caption:= WizardForm.WelcomeLabel1.Caption;
end;

WelcomeLabel2:=TLabel.Create(WizardForm);
with WelcomeLabel2 do
begin
WelcomeLabel2.Alignment:=taCenter;
Top:= ScaleY(136);
Left:= ScaleX(176);
Width:= ScaleX(301);
Height:= ScaleY(300);
AutoSize:= false;
WordWrap:= true;
Font.Color:=ClWhite
Font.Name:='Segoe UI'
Transparent:= true;
Parent:= WizardForm.WelcomePage;
Caption:= WizardForm.WelcomeLabel2.Caption;
end;
end;
Картинка в левый нижний угол:
[Files]
Source: C:\logo.bmp; DestDir: {tmp}; Flags: dontcopy

[code]
var
LogoImage:TBitmapImage;
LogoLabel: TLabel;
LogoPanel: TPanel;

procedure LogoOnClick(Sender: TObject);
var ReturnCode: Integer;
begin
ShellExec('open', 'http://сайт.ру', '', '', SW_SHOWNORMAL, ewNoWait, ReturnCode)
end;

procedure InitializeWizard();
begin
ExtractTemporaryFile('logo.bmp');
LogoPanel := TPanel.Create(WizardForm);
with LogoPanel do
begin
Parent := WizardForm;
Left := ScaleX(5);
Top := ScaleY(320);
Width := ScaleX(165);
Height := ScaleY(35);
BevelOuter := bvNone;
end;

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

LogoLabel := TLabel.Create(WizardForm);
with LogoLabel do
begin
Parent := LogoPanel;
Width := LogoPanel.Width;
Height := LogoPanel.Height;
Transparent:=True;
Cursor := crHand;
OnClick:=@LogoOnClick;
end;
end;
Растянуть верхнюю картинку:
[Code]
procedure InitializeWizard();
begin
with WizardForm do begin
with MainPanel do
Height := Height - 1;
with WizardSmallBitmapImage do begin
Left := 0;
Top := 0;
Height := 58; //Размер рисунка
Width := 497; //
end;
with PageNameLabel do begin
Font.Name := 'Tahoma'
Width := Width - 497; //Поставьте здесь значения на 0, если хотите вернуть текст
Left := Left + 497; //
end;
with PageDescriptionLabel do begin
Font.Name := 'Tahoma'
Width := Width - 497; //Поставьте здесь значения на 0, если хотите вернуть текст
Left := Left + 497; //
end;
end;
end;
Для объединения скриптом рекомендую ISS Joiner (как начинающему)
P.S. Всё это не раз обсуждалось, юзай поиск ;)

414895494
03-10-2009, 17:27
A1EXXX,
Спасибо большое.

user_123
03-10-2009, 18:31
Подскажите, как сделать, чтобы выводился запрос на удаление подкаталога {app}\log (по умолчанию не должен удаляться)при деинсталляции приложения?


function <...>(): Boolean;
begin
if MsgBox(''+ ExpandConstant('{cm:removelogs}') +'', mbInformation, mb_YesNo) = idYes then
begin
<...>
end;
end;

Lancer2404
03-10-2009, 19:44
Если и так:
AppendDefaultDirName=no
выдаст ошибку, то ... »

не работает в чем дело?

все решил проблему.А не подскажете какой ключ в реестре отвечает за добавление ярлыков в папку игры на windows vista?

GrizzlyMK
03-10-2009, 19:59
Подскажите
Можно картинку поместить не тольно на стронице приветствия.
А напротежение всей устоновки..
И как можно увеличеть окно инстала.
Зарание спасибо.




© OSzone.net 2001-2012