Имя пользователя:
Пароль:  
Помощь | Регистрация | Забыли пароль?  

Показать сообщение отдельно

Аватара для Drongo

Будем жить, Маэстро...


Сообщения: 6694
Благодарности: 1393

Профиль | Сайт | Отправить PM | Цитировать


Решил поэкспериментировать со вторым вариантом, но тут пишет ошибку Undeclared identifier TIME_FOR_VIEW



Участок кода

Код: Выделить весь код
...
begin
   currTime := currTime + 1;
   case currTime of
   {#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_2.bmp')) end;
   2*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_3.bmp')) end;
   3*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_4.bmp')) end;
   4*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_5.bmp')) end;
   5*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_6.bmp')) end;
   6*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_7.bmp')) end;
   7*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_8.bmp')) end;
   8*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_9.bmp')) end;
   9*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_10.bmp'))end;
   end;
   if CurrTime = 9*{#TIME_FOR_VIEW} then CurrTime := -1;
end;
...

Или весь код
Код: Выделить весь код
; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "My Program"
#define MyAppVerName "My Program 1.5"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "StyleBuilder.exe"

[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
; (To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{337AE44F-3DF6-4C55-AFCA-AAA9A6436F0E}
AppName={#MyAppName}
AppVerName={#MyAppVerName}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputDir=E:\
OutputBaseFilename=setup
Compression=no
SolidCompression=yes

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

[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked

[Files]
;Source: "D:\Контроль\TGTSoft\StyleBuilder\StyleBuilder.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Programms\Я_Автоустановка\BartPE\*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
; NOTE: Don't use "Flags: ignoreversion" on any shared system files

[Сode]
////////////////////////////////////////////////////
{Установка слайдшоу на окне инсталятора}
type
  TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);

var
  URLLabel: TNewStaticText;
  TimerID: LongWord;
  currTime: Integer;
  SplashImage: TBitmapImage;

function WrapTimerProc(callback:TProc; paramcount:integer):longword;
  external 'wrapcallback@files:InnoCallback.dll stdcall';

function SetTimer(hWnd: LongWord; nIDEvent, uElapse: LongWord; lpTimerFunc: LongWord): LongWord;
  external 'SetTimer@user32.dll stdcall';

function KillTimer(hWnd: LongWord; nIDEvent: LongWord): LongWord;
  external 'KillTimer@user32.dll stdcall';

procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
   currTime := currTime + 1;
   case currTime of
   {#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_2.bmp')) end;
   2*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_3.bmp')) end;
   3*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_4.bmp')) end;
   4*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_5.bmp')) end;
   5*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_6.bmp')) end;
   6*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_7.bmp')) end;
   7*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_8.bmp')) end;
   8*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_9.bmp')) end;
   9*{#TIME_FOR_VIEW}: begin SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_10.bmp'))end;
   end;
   if CurrTime = 9*{#TIME_FOR_VIEW} then CurrTime := -1;
end;
///////////////////////////////////////////////////
const
  BASS_SAMPLE_LOOP        = 4;   //повторение

type
  HSTREAM = DWORD;      //тип звукового потока

function BASS_Init(device: Integer; freq, flags: DWORD; win: hwnd; CLSID: Integer): Boolean;
external 'BASS_Init@files:BASS.dll stdcall delayload';

function BASS_StreamCreateFile(mem: BOOL; f: PChar; offset: DWORD; length: DWORD; flags: DWORD): HSTREAM;
external 'BASS_StreamCreateFile@files:BASS.dll stdcall delayload';

function BASS_Start(): Boolean;
external 'BASS_Start@files:BASS.dll stdcall delayload';

function BASS_ChannelPlay(handle: DWORD; restart: BOOL): Boolean;
external 'BASS_ChannelPlay@files:BASS.dll stdcall delayload';

function  BASS_Stop(): Boolean;
external 'BASS_Stop@files:BASS.dll stdcall delayload';

function  BASS_Free(): Boolean;
external 'BASS_Free@files:BASS.dll stdcall delayload';
///////////////////////////////
var
  state, soft: boolean;
  Image1, Image2: TBitmapImage;
const
  NeedSize = 6;
  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;

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 URLLabelOnClick(Sender: TObject);
var
  ErrorCode: Integer;
begin
  ShellExec('open', 'http://game-torrent.info', '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
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
  Name1: string;
  i: Integer;
  Text: TNewStaticText;
  Path: string;
  FreeMB, TotalMB: Cardinal;
  drives: DWORD;

begin
   ExtractTemporaryFile('BASS.dll');
     ExtractTemporaryFile('my.mp3');
  if BASS_Init(-1, 44100, 0, 0, 0) then
begin
  BASS_Start();
   Name1:=ExpandConstant('{tmp}\my.mp3');
    i:=BASS_StreamCreateFile(FALSE, PChar(Name1), 0, 0, 4);
  if i <> 0 then
	begin
  BASS_ChannelPlay(i, True);
end
end

///////////////////////////////////////////////////////////
{Изменение окна инсталятора с пермещение прогрессбара}
  ExtractTemporaryFile('Image_1.bmp');
  ExtractTemporaryFile('Image_2.bmp');
  ExtractTemporaryFile('Image_3.bmp');
  ExtractTemporaryFile('Image_4.bmp');
  ExtractTemporaryFile('Image_5.bmp');
  ExtractTemporaryFile('Image_6.bmp');
  ExtractTemporaryFile('Image_7.bmp');
  ExtractTemporaryFile('Image_8.bmp');
  ExtractTemporaryFile('Image_9.bmp');
  ExtractTemporaryFile('Image_10.bmp');

  currTime := 0;

  WizardForm.ProgressGauge.Parent := WizardForm;
  WizardForm.ProgressGauge.Top := WizardForm.CancelButton.Top + 10;
  WizardForm.ProgressGauge.Left := ScaleX(10);
  WizardForm.ProgressGauge.Width := WizardForm.Width - WizardForm.CancelButton.Width - ScaleX(40);
  WizardForm.ProgressGauge.Height := 12;
  WizardForm.ProgressGauge.Hide;
  WizardForm.StatusLabel.Parent := WizardForm;
  WizardForm.StatusLabel.Left := ScaleX(10);
  WizardForm.StatusLabel.Width := WizardForm.ProgressGauge.Width;
  WizardForm.StatusLabel.Top := WizardForm.ProgressGauge.Top - ScaleY(18);
  WizardForm.StatusLabel.Hide;

  SplashImage := TBitmapImage.Create(WizardForm);
  SplashImage.Top := 0;
  SplashImage.Left := 0;
  SplashImage.Width := WizardForm.MainPanel.Width;
  SplashImage.Height := WizardForm.Bevel.Top;
  SplashImage.Parent := WizardForm.InnerPage;
  SplashImage.Stretch := True;
  SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_1.bmp'));
  SplashImage.Hide;
///////////////////////////////////////////////////////////

  URLLabel := TNewStaticText.Create(WizardForm);
  URLLabel.Caption := 'Special for Game-Torrent.info';
  URLLabel.Cursor := crHand;
  URLLabel.OnClick := @URLLabelOnClick;
  URLLabel.Parent := WizardForm;
  { Alter Font *after* setting Parent so the correct defaults are inherited first }
  URLLabel.Font.Style := URLLabel.Font.Style + [fsUnderline];
  URLLabel.Font.Color := clBlue;
  URLLabel.Top :=  330;
  URLLabel.Left := 30;

  ExtractTemporaryFile('Welcome.bmp')
  ExtractTemporaryFile('Finish.bmp')
  WizardForm.WizardSmallBitmapImage.Top:=0
  WizardForm.WizardSmallBitmapImage.Left:=0
  WizardForm.WizardSmallBitmapImage.Width:=498
  WizardForm.WizardSmallBitmapImage.Height:=58
  WizardForm.PageNameLabel.Visible:=false
  WizardForm.PageDescriptionLabel.Visible:=false
  WizardForm.FinishedLabel.Visible:=False
  WizardForm.FinishedHeadingLabel.Visible:=False
  WizardForm.WelcomeLabel1.Visible:=False
  WizardForm.WelcomeLabel2.Visible:=False
  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,z: 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;
////////////////////////////////
begin
if CurPageID = wpUserInfo then
begin
Result:=true;
if not state
or not soft
then
begin
z:='Не все компоненты удовлетворяют требованиям игры.' #13+#13 'Вы действительно хотите продолжить установку?'
if MsgBox(z, mbInformation, MB_YESNO)=idNo
then Result:=false;
end
end
end
end;

procedure CurPageChanged(CurPageID: Integer);
var
  Text: TNewStaticText;
  Windows,WindowsName: TMemo;
  Os,OS1,OS2,OS3,OS4,OS5,OS6,OS7,OS8,OS9,OS10,HARD: string; // строка с названием необходимой ОС
  ProcessorName: string;
  Processor, VideoCardPanel, AudioCardPanel, RAMPanel, PageFilePanel: TMemo;
  ProcessorNamePanel, VideoCardNamePanel, AudioCardNamePanel, RAMTotalPanel, PageFileTotalPanel: TMemo;
  ProcessorMHZ: Cardinal;
  StaticText: TNewStaticText;
  VidRam: integer;
  pfunc: LongWord;
begin
/////////////////////////////////////////
{Здесь код показа на странице Инсталл измененного прогрессбара}
if (CurPageID = wpInstalling) then
     begin
      pfunc := WrapTimerProc(@OnTimer, 5);
      TimerID := SetTimer(0, 0, 1000, pfunc);

      WizardForm.InnerNotebook.Hide;
      WizardForm.Bevel1.Hide;
      WizardForm.MainPanel.Hide;
      WizardForm.PageNameLabel.Hide;
      WizardForm.PageDescriptionLabel.Hide;
      URLLabel.Hide;

      WizardForm.ProgressGauge.Show;
      SplashImage.Show;
      WizardForm.StatusLabel.Show;

      WizardForm.CancelButton.Enabled :=True;
     end
  else
    begin
    URLLabel.Show;
    WizardForm.ProgressGauge.Hide;
    SplashImage.Hide;
    WizardForm.StatusLabel.Hide;
    //WizardForm.FilenameLabel.Hide;

    if (CurPageID > wpInstalling) and (CurPageID < wpFinished) then
     begin
      WizardForm.InnerNotebook.Show;
      WizardForm.Bevel1.Show;
      WizardForm.MainPanel.Show;
      WizardForm.PageNameLabel.Show;
      WizardForm.PageDescriptionLabel.Show;
     end;

    end;
//////////////////////////////////////////////////////////////
If CurPageID=wpFinished then
  begin
   Image2:=TBitmapImage.Create(WizardForm)
 with Image2 do begin
   Left:=0
   Top:=0
   Width:=497
   Height:=313
   Parent:=WizardForm.FinishedPage
   Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Finish.bmp')
  end
  WizardForm.NextButton.Left:=380;
  WizardForm.NextButton.Top:=325;
 end
 //////////////////////////////
 If CurPageID=wpWelcome then
 begin
  If WizardForm.FindComponent('NextButton') is TButton
then
  TButton(WizardForm.FindComponent('NextButton')).Caption:='Начать>';
  end
  begin
   Image1:=TBitmapImage.Create(WizardForm)
 with Image1 do begin
   Left:=0
   Top:=0
   Width:=497
   Height:=313
   Parent:=WizardForm.WelcomePage
   Bitmap.LoadFromFile(ExpandConstant('{tmp}')+'\Welcome.bmp')
  end
  end
  if CurPageID=wpSelectTasks then
 begin
  If WizardForm.FindComponent('NextButton') is TButton
then
  TButton(WizardForm.FindComponent('NextButton')).Caption:='Установка';
  If WizardForm.FindComponent('CancelButton') is TButton
then
  TButton(WizardForm.FindComponent('CancelButton')).Caption:='Выход';
  end
 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';
  OS10:=' Microsoft Windows XP Service Pack 3'; //строка является записью из реестра
  OS1:=' Microsoft Windows 2000 Service Pack 4'; //строка является записью из реестра
  OS2:=' Windows Vista (TM) Ultimate ';
  OS3:=' Windows Vista (TM) Home Basic ';
  OS4:=' Windows Vista (TM) Home Premium ';
  OS5:=' Windows Vista (TM) Business ';
  OS6:=' Windows Vista (TM) Ultimate Service Pack 1'
  OS7:=' Windows Vista (TM) Home Basic Service Pack 1';
  OS8:=' Windows Vista (TM) Home Premium Service Pack 1';
  OS9:=' Windows Vista (TM) Business Service Pack 1';
  HARD:='Все компоненты удовлетворяют требованиям игры.';
  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 < 2800 then
  begin
    ProcessorNamePanel.Color := $ccccff;
    StaticText.Caption := 'Не все компоненты удовлетворяют требованиям игры.';
    StaticText.font.color:=clRed;
  end;

  VideoCardNamePanel := TMemo.Create(WizardForm);
  with VideoCardNamePanel do begin
    Text :=  ' ' + GetVideoCardName + 'MB'; //+'    ОЗУ-'+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 < 255000000 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 OS2=(WindowsName.Text) then state:=true else
  if OS3=(WindowsName.Text) then state:=true else
  if OS4=(WindowsName.Text) then state:=true else
  if OS5=(WindowsName.Text) then state:=true else
  if OS6=(WindowsName.Text) then state:=true else
  if OS7=(WindowsName.Text) then state:=true else
  if OS8=(WindowsName.Text) then state:=true else
  if OS9=(WindowsName.Text) then state:=true else
  if OS10=(WindowsName.Text) then state:=true else
  if OS1=(WindowsName.Text) then state:=true else state:=false;

////////////////////////////////////////////////////////////////////////
{условие проверки оборудования}
  if HARD=(StaticText.Caption) then soft:=true else soft:=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

 end;
end;

procedure DeInitializeSetup();
begin
 KillTimer(0, TimerID);
 BASS_Stop(); //нужно для остановки проигрывания
 BASS_Free(); //нужно для быстрой выгрузки библиотеки вместе с муз. файлом
end;

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

[Icons]
Name: "{group}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon

;[Run]
;Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#MyAppName}}"; Flags: nowait postinstall skipifsilent


Что и где объявить?

-------
Правильная постановка вопроса свидетельствует о некотором знакомстве с делом.
3нание бывает двух видов. Мы сами знаем предмет — или же знаем, где найти о нём сведения.
[Quick Killer 3.0 Final [OSZone.net]] | [Quick Killer 3.0 Final [SafeZone.cc]] | [Парсер логов Gmer] | [Парсер логов AVZ]

http://tools.oszone.net/Drongo/Userbar/SafeZone_cc.gif


Отправлено: 20:37, 14-04-2009 | #616