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

Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » [архив] Inno Setup .:[все вопросы]:.

Закрытая тема
Настройки темы
[архив] Inno Setup .:[все вопросы]:.

Новый участник


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

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


Изменения
Автор: volk1234
Дата: 27-08-2009
Описание: перевел в архив
Лимит страниц.
Тема закрыта.
продолжаем тут:

Inno Setup. Обсуждение установщика

Скрипты Inno Setup. Помощь и советы



Полезные ресурсы:
Официальный сайт| Inno Setup 5.2.3 RU
Русская справка |Зеракало 1| Зеракало 2
ISTool 5.30 |Русификатор
Русификатор ISTool |Зеркало 1|Зеркало 2
Inno Setup Script Generator |Зеркало 1
Unpaker 2.1 от 21.04.2009 - распаковывает инсталляторы, созданные с помощью Inno Setup, начиная с версии 2.0.18 по 5.2.4.
InnoUnpaker 2.6b3 [от valeron87]- можнет просмотривать содержание CompiledCode.bin
Unpaker 0.23 - расширенная китайская версия 2008-08-08 ( модификация)
Unpacker 0.24 | Зеркало 1 | Зеркало 2 - Inno Setup Unpacker (innounp plus) - расширенная версия распаковщика инсталляторов Inno Setup начиная с версии 2.0.8 по 5.3.0 Beta. Поддерживаются версии Unicode. Русифицирована. Последний релиз: 0.24 [23.05.2009]
Набор Restools
Restools - расширенная версия Inno Setup от китайских разработчиков, добавляет вашему инсталлятору новые возможности по оформлению, а также более удобный редактор скриптов (требуется наличие установленного Preprocessor'а).
Последние версии разработок от Restools:
InnoCompiler090319_English - в него входят файлы: Compil32.exe и Templates.dat;
Inno_ISCmplr_Setup090302 - в него входят файлы, лучше из папки InnoSetup_FullVCL: setup.e32, ISCmplr.dls, ISCmplr.dll и SetupLdr.e32.
InnoCompiler090319_Russian - Русский перевод (80%) от tem000 - NEW !

QuickStart Pack - Inno Setup + Preprocessor (последняя версия ispack-5.2.4-dev)
"Всё в одном" от unikum111
читать дальше »

Цитата unikum111:
В сборку входят следующие компоненты:
Inno Setup compiler 5.2.2 русская версия;
ISTool 5.2.1 русская версия;
Inno Script Generator английская версия;
Inno Setup Unpacker Explorer 1.0 аглийская версия;
Примечание: в Inno Setup Unpacker Explorer 1.0 заменён innounp.exe на тестовую версию 2.0, так что распаковывает инсталляторы вплоть до версии 5.2.2.
Есть возможность выбора компонентов.
Скачать: ifolder, RapidShare, iBox (Размер: 5.34 Mb).»



Полезные мелочи для Inno Setup:

- Converter v.0.1.2 - конвертор REG- файлов в формат скриптов Inno от Serega_ -новая версия
- Как убрать страницу приветствия (wpWelcome) в мастере установки приложения:
- Примеры скриптов на паскале
- Inno Setup Addon 0.07 For Total Commander
- Параметры командной строки инсталляторов InnoSetup:

Код: Выделить весь код
/SP-
Отключает страницу "Эта программа установит... Вы хотите продолжить?" инсталятора. 
Выполнится только если DisableStartupPrompt секции [Setup] равна yes. 

/SILENT, /VERYSILENT  
Установка в ускоренном или очень ускоренном режиме. При установке в ускоренном режиме 
окно мастера и фоновое окно мастера не отображаются, отображается только окно прогресса. 
При очень ускоренной установке окно прогресса тоже не отображается. Остальная установка 
проходит как обычно - отображаются сообщения об ошибках в ходе установки, страница 
приветствия (если ее отображение не отменено директивой DisableStartupPrompt или 
параметром '/SP-' командной строки).

Если после установки необходима перезагрузка, команды '/NORESTART' не дано и установка 
проходит в ускоренном режиме, появится сообщение "Перезагрузить компьютер?". Если режим 
установки очень ускоренный, система перезагрузится не спрашивая.

/LOG 
Указывает инсталятору создать log-файл в папке TEMP для подробного отчета о действиях 
и событиях в секции [Run], предпринятых в ходе установки. Применяется при отслеживании 
ошибок. Например, если вы подозреваете, что файл не был удален, хотя должен был, 
log-файл сообщит, что файл былдействительно пропущен и почему. 

log-файлу присваивается уникальное имя на базе текущей даты. (Существующие файлы не 
перезаписываются и не дополняются). 
Информация, содержащаяся в log-файле, техническая и поэтому не может быть понята 
пользователем. 

/LOG="filename" 
Параметр похож на /LOG, но в отличие от него позволяет указать фиксированный
путь/имя файла для log-файла. Если файл с указанным именем уже существует, он будет 
заменен. Если файл не может быть создан, установка прервется и выдаст сообщение 
об ошибке.

/NOCANCEL  
Не дает пользователю прервать установку, отключая кнопку Отменить и игнорируя клики на 
кнопке Закрыть. Используется в комбинации с '/SILENT' или '/VERYSILENT'. 

/NORESTART 
Указывает инсталятору не перезагружать компьютер даже если это необходимо. 

/RESTARTEXITCODE=exit code  
Задает инсталятору код, который он должен возвратить, если необходима перезагрузка. 
Используется с '/NORESTART'.
См. также Коды выхода инсталятора. (кому интерестно, могу выложить или же доступно в хелпе)

/LOADINF="filename" 
Указывает инсталятору загрузить параметры установки из указанного файла после проверки 
командной строки. Этот файл может быть подготовлен с помощью '/SAVEINF='command.
Не забудьте ставить кавычки при использовании имен, содержащих пробелы. 

/SAVEINF="filename" 
Указывает инсталятору сохранять параметры установки в указанный файл.
Не забудьте ставить кавычки при использовании имен, содержащих пробелы. 

/LANG=language 
Задает используемый язык. language задает имя языка, заданного в параметре секции 
[Languages]. При использовании параметра /LANG появляется диалог Выбор языка установки.

/DIR="x:\dirname" 
Меняет имя папки, заданное по умолчанию, на странице Выбор папки назначения. 
Должен быть задан полный путь. 

/GROUP="folder name" 
Меняет имя папки на странице Выбор папки меню Пуск. Если директива 
DisableProgramGroupPage секции [Setup] равна yes, этот параметр командной строки 
игнорируется. 

/NOICONS 
Указывает инсталятору проверять, выбрана ли команда Не создавать значков на странице 
Выбор папки меню Пуск. 

/COMPONENTS="comma separated list of component names" 
Меняет выбраные по умолчанию компоненты. В этом случае параметр командной строки 
указывает инсталятору менять тип установки на Выборочный. 

/PASSWORD=password  Задает пароль. Если не указана директива Password секции [Setup], 
этот параметр игнорируется. Если введен неправильный пароль, параметр 
также игнорируется.

Отправлено: 21:42, 17-03-2005

 

Аватара для tem000

Пользователь


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

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


Serega_, Подскажи пожалуйста, как можно сделать чтобы при выборе компонентов, какой то один пункт был отмечен и его нельзя было оключить (т.е чекбокс был бы не активным). И еще как сделать чтобы по умолчанию дерево компонентов было раскрыто или закрыто. Заранее спасибо...
читать дальше »
"примерно так"

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



Для отключения данного рекламного блока вам необходимо зарегистрироваться или войти с учетной записью социальной сети.

Если же вы забыли свой пароль на форуме, то воспользуйтесь данной ссылкой для восстановления пароля.


Ветеран


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

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


Цитата tem000:
при выборе компонентов, какой то один пункт был отмечен и его нельзя было оключить »
используйте флаг fixed
Цитата tem000:
как сделать чтобы по умолчанию дерево компонентов было раскрыто или закрыто »
по умолчанию список компонентов всегда развёрнут, а если необходимо чтоб он был свёрнут, надо использовать флаг collapsed.

Вопрос по скриншоту:
Снизу окна компонентов выводится их описание, а что выводится справа?

-------
Книги нужны, чтобы напоминать человеку, что его оригинальные мысли не так уж новы... Авраам Линкольн.


Отправлено: 15:50, 14-04-2009 | #612


Аватара для tem000

Пользователь


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

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


Цитата Serega_:
Снизу окна компонентов выводится их описание, а что выводится справа? »
Там отображаются маленькие превью, при выборе допустим какого нибудь скина отображается его маленькая картинка, или можно посмотреть какие иконки ставить и т.д. Прога называется AIMP2 MegaPack 2.51 Build 330.7 (сборка не моя скачал из инета) инсталятор сделан в Inno Setup, там в него много чего напихано распаковывается легко, скрипт очень большой единственное там по ходу в секции CODE много чего прописано на сколько я понял в том числе эта фишка с картинками.
читать дальше »
"читать дальше"


P.S Serega_, спасибо за быстрый ответ
Это сообщение посчитали полезным следующие участники:

Отправлено: 16:32, 14-04-2009 | #613


Ветеран


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

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


Цитата tem000:
единственное там по ходу в секции CODE много чего прописано на сколько я понял в том числе эта фишка с картинками »
на этой странице практически всё (90%) прописывается в секции Code.

-------
Книги нужны, чтобы напоминать человеку, что его оригинальные мысли не так уж новы... Авраам Линкольн.


Отправлено: 17:02, 14-04-2009 | #614


Аватара для Drongo

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


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

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


Ребятки, вот нужно сделать такой инсталлятор, я сделаю, не вопрос, но есть один нюанс, нужно, чтобы у него было, во время установки, на выбор:
1. Или во время установки, в окне 800х600 (или любой другой оптимальный размер. На весь экран, крайний случай.) менялись картинки, как у игр, когда устанавливаешь игры, показываются некоторые фрагменты игровых моментов.
2. Или если первый вариант невозможен, то чтобы в окне самого инсталятора (можно размер самого окна инсталятора увеличить?), как в комментарии 463, и вот рядом нашёл в комменте 466 менялись картинки скриншотов, не одна была фиксировано, а менялись, скажем, после каждых пяти процентов установленной игры? Или как должно быть правильно? (Мне второй вариант понравился больше, можно как-то его прикрутить?)

P.S. Я никогда не делал такие инсталы, поэтому если не сложно, поясните на пальцах, куда скриншоты класть, и где что прописывать для отображения?

-------
Правильная постановка вопроса свидетельствует о некотором знакомстве с делом.
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:14, 14-04-2009 | #615


Аватара для 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


Ветеран


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

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


Drongo, по первому вопросу, лучше воспользоваться GameScript Generator, а по второму пример, названия картинок и путь до них, нужно поправить в секции [Files], там единственное идёт показ по времени, где-то у меня был пример по процентам, поищу...

Цитата Drongo:
Undeclared identifier TIME_FOR_VIEW »
надо добавить в самое начало скрипта:
#define TIME_FOR_VIEW 1

-------
Книги нужны, чтобы напоминать человеку, что его оригинальные мысли не так уж новы... Авраам Линкольн.


Последний раз редактировалось Serega, 14-04-2009 в 21:15.

Это сообщение посчитали полезным следующие участники:

Отправлено: 21:05, 14-04-2009 | #617


Аватара для Drongo

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


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

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


Цитата Serega_:
там единственное идёт показ по времени »
Это нормально, так как установка около 3.66 ГБ, будет сжата по максимуму, так что нормально, но если будет время поискать по процентам, не откажусь опробовать и такой вариант.
В принципе всё получилось и инсталятор рабочий! Только три нюанса портят всю красоту...

Три нюанса

1. Диалог установки



2. Картинка вверху, во время выбора куда устанавливать, нужны ли ярлыки



3. Финиш установки


Подскажите, что и где нужно подправить? Я бы хотел вместо этих стандартных, втулить свои, пользовательские картинки. Какой нужен размер?

Скрипт предложенный Serega_, на нём я остановился.
Скрипт
Код: Выделить весь код
; 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"
#define TIME_FOR_VIEW 1

[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=none
SolidCompression=yes

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

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

[Files]
Source: compiler:Libraries\InnoCallback.dll; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_2.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_3.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_4.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_5.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_6.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_7.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_8.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_9.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_10.bmp; Flags: dontcopy

;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
  WelcomeLabel1,WelcomeLabel2,FinishedHeadingLabel,RunLabel,
  FinishedLabel,PageNameLabel,PageDescriptionLabel:TLabel;
  RunMyProg: TCheckBox;
  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;

procedure RLabelOnClick(Sender: TObject);
begin
  if RunMyProg.Checked=false then
  begin
    RunMyProg.Checked := true;
  end else
    RunMyProg.Checked := false;
end;

// функция для запуска программы если отмечен чебокс
procedure CurStepChanged(CurStep: TSetupStep);
var
  ErrorCode: Integer;
begin
if CurStep = ssDone then
  begin
    if RunMyProg.Checked then
    Exec(ExpandConstant('{app}\MyProg.exe'), '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
  end;
end;

procedure InitializeWizard();
begin
  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.WelcomeLabel1.Hide;
      WizardForm.WelcomeLabel2.Hide;
      WizardForm.PageNameLabel.Hide;
      WizardForm.PageDescriptionLabel.Hide;
      WizardForm.FinishedHeadingLabel.Hide;
      WizardForm.FinishedLabel.Hide;
    // низнаю почему, но Hide не действует. Поэтому просто уменьшил размер
      WizardForm.RunList.Height := 0;
      WizardForm.RunList.Width := 0;
      WizardForm.FilenameLabel.Hide;

  WizardForm.StatusLabel.Parent := WizardForm;
  WizardForm.StatusLabel.Top := ScaleY(315);
  WizardForm.StatusLabel.Left := ScaleX(10);
  WizardForm.StatusLabel.Width := ScaleX(200);
  WizardForm.StatusLabel.Hide;

      WizardForm.ProgressGauge.Parent := WizardForm;
      WizardForm.ProgressGauge.Top := ScaleY(330);
      WizardForm.ProgressGauge.Left := ScaleX(10);
      WizardForm.ProgressGauge.Width := ScaleX(380);
      WizardForm.ProgressGauge.Height := ScaleX(18);
      WizardForm.ProgressGauge.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_7.bmp'));
  SplashImage.Hide;

      WizardForm.WizardBitmapImage.Align:=true;
      WizardForm.WizardBitmapImage2.Align:=true;
      WizardForm.WizardSmallBitmapImage.Align:=true;

  WelcomeLabel1:=TLabel.Create(WizardForm);
  WelcomeLabel1.Left:=ScaleX(150);
  WelcomeLabel1.Top := ScaleY(15);
  WelcomeLabel1.Width := ScaleX(320);
  WelcomeLabel1.Height := ScaleY(75);
  WelcomeLabel1.AutoSize := False;
  WelcomeLabel1.WordWrap := True;
  WelcomeLabel1.Font.Color := clBlack;
// здесь можно поиграть шрифтом
//  WelcomeLabel1.Font.Style := [fsBold];
//  WelcomeLabel1.Font.Name:='MS Sans Serif';
  WelcomeLabel1.Font.Size := 14;
  WelcomeLabel1.Transparent := True;
  WelcomeLabel1.Parent := WizardForm.WelcomePage;

      WelcomeLabel2:=TLabel.Create(WizardForm);
      WelcomeLabel2.Left := ScaleX(150);
      WelcomeLabel2.Top := ScaleY(90);
      WelcomeLabel2.Width := ScaleX(320);
      WelcomeLabel2.Height := ScaleY(200);
      WelcomeLabel2.AutoSize := False;
      WelcomeLabel2.WordWrap := True;
      WelcomeLabel2.Font.Color := clBlack;
      WelcomeLabel2.Font.Size := 8;
      WelcomeLabel2.Transparent := True;
      WelcomeLabel2.Parent := WizardForm.WelcomePage;

  PageNameLabel := TLabel.Create(WizardForm);
  PageNameLabel.Left := ScaleX(25);
  PageNameLabel.Top := ScaleY(10);
  PageNameLabel.Width := ScaleX(300);
  PageNameLabel.Height := ScaleY(14);
  PageNameLabel.AutoSize := False;
  PageNameLabel.WordWrap := True;
  PageNameLabel.Font.Color := clBlack;
  PageNameLabel.Font.Style := [fsBold];
  PageNameLabel.Transparent := True;
  PageNameLabel.Parent := WizardForm.MainPanel;

      PageDescriptionLabel := TLabel.Create(WizardForm);
      PageDescriptionLabel.Left := ScaleX(40);
      PageDescriptionLabel.Top := ScaleY(25);
      PageDescriptionLabel.Width := ScaleX(475);
      PageDescriptionLabel.Height := ScaleY(30);
      PageDescriptionLabel.AutoSize := False;
      PageDescriptionLabel.WordWrap := True;
      PageDescriptionLabel.Font.Color := clBlack;
      PageDescriptionLabel.Transparent := True;
      PageDescriptionLabel.Parent := WizardForm.MainPanel;

  FinishedHeadingLabel:=TLabel.Create(WizardForm);
  FinishedHeadingLabel.Left := ScaleX(150);
  FinishedHeadingLabel.Top := ScaleY(15);
  FinishedHeadingLabel.Width := ScaleX(320);
  FinishedHeadingLabel.Height := ScaleY(75);
  FinishedHeadingLabel.AutoSize := False;
  FinishedHeadingLabel.WordWrap := True;
  FinishedHeadingLabel.Font.Color := clBlack;
// здесь тоже можно поиграть шрифтом
//  FinishedHeadingLabel.Font.Style := [fsBold];
//  FinishedHeadingLabel.Font.Name:='MS Sans Serif';
  FinishedHeadingLabel.Font.Size := 14;
  FinishedHeadingLabel.Transparent := True;
  FinishedHeadingLabel.Parent := WizardForm.FinishedPage;

      FinishedLabel:=TLabel.Create(WizardForm);
      FinishedLabel.Left := ScaleX(150);
      FinishedLabel.Top := ScaleY(90);
      FinishedLabel.Width := ScaleX(320);
      FinishedLabel.Height := ScaleY(200);
      FinishedLabel.AutoSize := False;
      FinishedLabel.WordWrap := True;
      FinishedLabel.Font.Color := clBlack;
      FinishedLabel.Font.Size := 8;
      FinishedLabel.Transparent := True;
      FinishedLabel.Parent := WizardForm.FinishedPage;

  RunMyProg := TCheckBox.Create(WizardForm);
  RunMyProg.Parent := WizardForm.FinishedPage;
  RunMyProg.Left := ScaleX(150);
  RunMyProg.Top := ScaleY(152);
  RunMyProg.Width := ScaleX(14);
  RunMyProg.Height := ScaleX(14);
//  RunMyProg.Checked := true; // чтоб чебокс был отмечен, раскоментируй строку

      RunLabel:=TLabel.Create(WizardForm);
      RunLabel.Left := ScaleX(170);
      RunLabel.Top := ScaleY(150);
      RunLabel.Width := ScaleX(200);
      RunLabel.Height := ScaleY(20);
      RunLabel.AutoSize := False;
      RunLabel.WordWrap := True;
      RunLabel.Font.Color := clBlack;
      RunLabel.Font.Size := 10;
      RunLabel.OnClick := @RLabelOnClick;
      RunLabel.Transparent := True;
      RunLabel.Parent := WizardForm.FinishedPage;
end;

procedure CurPageChanged(CurPageID: Integer);
var
  pfunc: LongWord;

begin
  WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
  WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
  PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
  PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
  FinishedHeadingLabel.Caption := WizardForm.FinishedHeadingLabel.Caption;
  FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
// здесь придётся вручную вводить требуемый текст
  RunLabel.Caption := 'Запустить программу';

  if (CurPageID = wpInstalling) then
    begin
      pfunc := WrapTimerProc(@OnTimer, 4);
      TimerID := SetTimer(0, 0, 1000, pfunc);

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

      WizardForm.ProgressGauge.Show;
      WizardForm.StatusLabel.Show;
      SplashImage.Show;
    end
  else
    begin
      WizardForm.ProgressGauge.Hide;
      WizardForm.StatusLabel.Hide;
      SplashImage.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;
end;

procedure DeinitializeSetup();
begin
  KillTimer(0, TimerID);
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


Последний раз редактировалось Drongo, 15-04-2009 в 19:27. Причина: Соответственно требованиям раздела


Отправлено: 12:24, 15-04-2009 | #618


Аватара для tem000

Пользователь


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

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


Цитата Drongo:
Подскажите, что и где нужно подправить? Я бы хотел вместо этих стандартных, втулить свои, пользовательские картинки. Какой нужен размер? »
Drongo, Вот скрипт с секцией CODE написаный Serega_, сам им пользуюсь, в первое окно ставлю картинку размером 500х313, а узкий сверху 500х60, картинки кидай в папку
embedded.

читать дальше »
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
OutputDir=.

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

[code]
var
WelcomeLabel1,WelcomeLabel2,FinishedHeadingLabel,RunLabel,
FinishedLabel,PageNameLabel,PageDescriptionLabel:TLabel;
RunMyProg: TCheckBox;

procedure RLabelOnClick(Sender: TObject);
begin
if RunMyProg.Checked=false then
begin
RunMyProg.Checked := true;
end else
RunMyProg.Checked := false;
end;

// функция для запуска программы если отмечен чебокс
procedure CurStepChanged(CurStep: TSetupStep);
var
ErrorCode: Integer;
begin
if CurStep = ssDone then
begin
if RunMyProg.Checked then
Exec(ExpandConstant('{app}\MyProg.exe'), '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
end;
end;

procedure InitializeWizard();
begin
WizardForm.WelcomeLabel1.Hide;
WizardForm.WelcomeLabel2.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.FinishedHeadingLabel.Hide;
WizardForm.FinishedLabel.Hide;
// низнаю почему, но Hide не действует. Поэтому просто уменьшил размер
WizardForm.RunList.Height := 0;
WizardForm.RunList.Width := 0;

WizardForm.WizardBitmapImage.Align:=true;
WizardForm.WizardBitmapImage2.Align:=true;
WizardForm.WizardSmallBitmapImage.Align:=true;

WelcomeLabel1:=TLabel.Create(WizardForm);
WelcomeLabel1.Left:=ScaleX(150);
WelcomeLabel1.Top := ScaleY(15);
WelcomeLabel1.Width := ScaleX(320);
WelcomeLabel1.Height := ScaleY(75);
WelcomeLabel1.AutoSize := False;
WelcomeLabel1.WordWrap := True;
WelcomeLabel1.Font.Color := clBlack;
// здесь можно поиграть шрифтом
// WelcomeLabel1.Font.Style := [fsBold];
// WelcomeLabel1.Font.Name:='MS Sans Serif';
WelcomeLabel1.Font.Size := 14;
WelcomeLabel1.Transparent := True;
WelcomeLabel1.Parent := WizardForm.WelcomePage;

WelcomeLabel2:=TLabel.Create(WizardForm);
WelcomeLabel2.Left := ScaleX(150);
WelcomeLabel2.Top := ScaleY(90);
WelcomeLabel2.Width := ScaleX(320);
WelcomeLabel2.Height := ScaleY(200);
WelcomeLabel2.AutoSize := False;
WelcomeLabel2.WordWrap := True;
WelcomeLabel2.Font.Color := clBlack;
WelcomeLabel2.Font.Size := 8;
WelcomeLabel2.Transparent := True;
WelcomeLabel2.Parent := WizardForm.WelcomePage;

PageNameLabel := TLabel.Create(WizardForm);
PageNameLabel.Left := ScaleX(25);
PageNameLabel.Top := ScaleY(10);
PageNameLabel.Width := ScaleX(300);
PageNameLabel.Height := ScaleY(14);
PageNameLabel.AutoSize := False;
PageNameLabel.WordWrap := True;
PageNameLabel.Font.Color := clBlack;
PageNameLabel.Font.Style := [fsBold];
PageNameLabel.Transparent := True;
PageNameLabel.Parent := WizardForm.MainPanel;

PageDescriptionLabel := TLabel.Create(WizardForm);
PageDescriptionLabel.Left := ScaleX(40);
PageDescriptionLabel.Top := ScaleY(25);
PageDescriptionLabel.Width := ScaleX(475);
PageDescriptionLabel.Height := ScaleY(30);
PageDescriptionLabel.AutoSize := False;
PageDescriptionLabel.WordWrap := True;
PageDescriptionLabel.Font.Color := clBlack;
PageDescriptionLabel.Transparent := True;
PageDescriptionLabel.Parent := WizardForm.MainPanel;

FinishedHeadingLabel:=TLabel.Create(WizardForm);
FinishedHeadingLabel.Left := ScaleX(150);
FinishedHeadingLabel.Top := ScaleY(15);
FinishedHeadingLabel.Width := ScaleX(320);
FinishedHeadingLabel.Height := ScaleY(75);
FinishedHeadingLabel.AutoSize := False;
FinishedHeadingLabel.WordWrap := True;
FinishedHeadingLabel.Font.Color := clBlack;
// здесь тоже можно поиграть шрифтом
// FinishedHeadingLabel.Font.Style := [fsBold];
// FinishedHeadingLabel.Font.Name:='MS Sans Serif';
FinishedHeadingLabel.Font.Size := 14;
FinishedHeadingLabel.Transparent := True;
FinishedHeadingLabel.Parent := WizardForm.FinishedPage;

FinishedLabel:=TLabel.Create(WizardForm);
FinishedLabel.Left := ScaleX(150);
FinishedLabel.Top := ScaleY(90);
FinishedLabel.Width := ScaleX(320);
FinishedLabel.Height := ScaleY(200);
FinishedLabel.AutoSize := False;
FinishedLabel.WordWrap := True;
FinishedLabel.Font.Color := clBlack;
FinishedLabel.Font.Size := 8;
FinishedLabel.Transparent := True;
FinishedLabel.Parent := WizardForm.FinishedPage;

RunMyProg := TCheckBox.Create(WizardForm);
RunMyProg.Parent := WizardForm.FinishedPage;
RunMyProg.Left := ScaleX(150);
RunMyProg.Top := ScaleY(152);
RunMyProg.Width := ScaleX(14);
RunMyProg.Height := ScaleX(14);
// RunMyProg.Checked := true; // чтоб чебокс был отмечен, раскоментируй строку

RunLabel:=TLabel.Create(WizardForm);
RunLabel.Left := ScaleX(170);
RunLabel.Top := ScaleY(150);
RunLabel.Width := ScaleX(200);
RunLabel.Height := ScaleY(20);
RunLabel.AutoSize := False;
RunLabel.WordWrap := True;
RunLabel.Font.Color := clBlack;
RunLabel.Font.Size := 10;
RunLabel.OnClick := @RLabelOnClick;
RunLabel.Transparent := True;
RunLabel.Parent := WizardForm.FinishedPage;
end;

procedure CurPageChanged(CurPageID: Integer);
begin
WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
FinishedHeadingLabel.Caption := WizardForm.FinishedHeadingLabel.Caption;
FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
// здесь придётся вручную вводить требуемый текст
RunLabel.Caption := 'Запустить программу';
end;
Это сообщение посчитали полезным следующие участники:

Отправлено: 13:37, 15-04-2009 | #619


Аватара для Drongo

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


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

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


tem000, Спасибо, в принципе уже разобрался.
Цитата tem000:
размером 500х313, а узкий сверху 500х60 »
За точные размеры - спасибо.
Осталось только Объеденить код с проверкой параметров системы и текущий код с показом картинок. Немогу. Не разбираюсь в языке... Возможно ли эти два кода объеденить в один?

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

#define MyAppName "Need for Speed Most Wanted"
#define MyAppVerName "Need for Speed Most Wanted"
#define MyAppPublisher "My Company, Inc."
#define MyAppURL "http://www.example.com/"
#define MyAppExeName "StyleBuilder.exe"
#define TIME_FOR_VIEW 1

[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=none
SolidCompression=yes

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

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

[Files]
Source: compiler:Libraries\InnoCallback.dll; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_2.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_3.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_4.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_5.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_6.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_7.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_8.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_9.bmp; Flags: dontcopy
Source: D:\Programms\Я_Автоустановка\BartPE\Image\Image_10.bmp; Flags: dontcopy

;Source: "D:\Контроль\TGTSoft\StyleBuilder\StyleBuilder.exe"; DestDir: "{app}"; Flags: ignoreversion
Source: "D:\Контроль\Диск-А\*"; 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
  WelcomeLabel1,WelcomeLabel2,FinishedHeadingLabel,RunLabel,
  FinishedLabel,PageNameLabel,PageDescriptionLabel:TLabel;
  RunMyProg: TCheckBox;
  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;

procedure RLabelOnClick(Sender: TObject);
begin
  if RunMyProg.Checked=false then
  begin
    RunMyProg.Checked := true;
  end else
    RunMyProg.Checked := false;
end;

// функция для запуска программы если отмечен чебокс
procedure CurStepChanged(CurStep: TSetupStep);
var
  ErrorCode: Integer;
begin
if CurStep = ssDone then
  begin
    if RunMyProg.Checked then
    Exec(ExpandConstant('{app}\MyProg.exe'), '', '', SW_SHOWNORMAL, ewNoWait, ErrorCode);
  end;
end;

procedure InitializeWizard();
begin
  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.WelcomeLabel1.Hide;
      WizardForm.WelcomeLabel2.Hide;
      WizardForm.PageNameLabel.Hide;
      WizardForm.PageDescriptionLabel.Hide;
      WizardForm.FinishedHeadingLabel.Hide;
      WizardForm.FinishedLabel.Hide;
    // низнаю почему, но Hide не действует. Поэтому просто уменьшил размер
      WizardForm.RunList.Height := 0;
      WizardForm.RunList.Width := 0;
      WizardForm.FilenameLabel.Hide;

  WizardForm.StatusLabel.Parent := WizardForm;
  WizardForm.StatusLabel.Top := ScaleY(315);
  WizardForm.StatusLabel.Left := ScaleX(10);
  WizardForm.StatusLabel.Width := ScaleX(200);
  WizardForm.StatusLabel.Hide;

      WizardForm.ProgressGauge.Parent := WizardForm;
      WizardForm.ProgressGauge.Top := ScaleY(330);
      WizardForm.ProgressGauge.Left := ScaleX(10);
      WizardForm.ProgressGauge.Width := ScaleX(380);
      WizardForm.ProgressGauge.Height := ScaleX(18);
      WizardForm.ProgressGauge.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_7.bmp'));
  SplashImage.Hide;

      WizardForm.WizardBitmapImage.Align:=true;
      WizardForm.WizardBitmapImage2.Align:=true;
      WizardForm.WizardSmallBitmapImage.Align:=true;

  WelcomeLabel1:=TLabel.Create(WizardForm);
  WelcomeLabel1.Left:=ScaleX(10);
  WelcomeLabel1.Top := ScaleY(10);
  WelcomeLabel1.Width := ScaleX(350);
  WelcomeLabel1.Height := ScaleY(75);
  WelcomeLabel1.AutoSize := False;
  WelcomeLabel1.WordWrap := True;
  WelcomeLabel1.Font.Color := clGreen;
// здесь можно поиграть шрифтом
//  WelcomeLabel1.Font.Style := [fsBold];
//  WelcomeLabel1.Font.Name:='MS Sans Serif';
  WelcomeLabel1.Font.Size := 14;
  WelcomeLabel1.Transparent := True;
  WelcomeLabel1.Parent := WizardForm.WelcomePage;

      WelcomeLabel2:=TLabel.Create(WizardForm);
      WelcomeLabel2.Left := ScaleX(10);
      WelcomeLabel2.Top := ScaleY(70);
      WelcomeLabel2.Width := ScaleX(200);
      WelcomeLabel2.Height := ScaleY(300);
      WelcomeLabel2.AutoSize := False;
      WelcomeLabel2.WordWrap := True;
      WelcomeLabel2.Font.Color := clGreen;
      WelcomeLabel2.Font.Style := [fsBold];
      WelcomeLabel2.Font.Size := 10;
      WelcomeLabel2.Transparent := True;
      WelcomeLabel2.Parent := WizardForm.WelcomePage;

  PageNameLabel := TLabel.Create(WizardForm);
  PageNameLabel.Left := ScaleX(25);
  PageNameLabel.Top := ScaleY(10);
  PageNameLabel.Width := ScaleX(300);
  PageNameLabel.Height := ScaleY(14);
  PageNameLabel.AutoSize := False;
  PageNameLabel.WordWrap := True;
  PageNameLabel.Font.Color := clRed;
  PageNameLabel.Font.Style := [fsBold];
  PageNameLabel.Transparent := True;
  PageNameLabel.Parent := WizardForm.MainPanel;

      PageDescriptionLabel := TLabel.Create(WizardForm);
      PageDescriptionLabel.Left := ScaleX(40);
      PageDescriptionLabel.Top := ScaleY(25);
      PageDescriptionLabel.Width := ScaleX(475);
      PageDescriptionLabel.Height := ScaleY(30);
      PageDescriptionLabel.AutoSize := False;
      PageDescriptionLabel.WordWrap := True;
      PageDescriptionLabel.Font.Color := clRed;
      PageDescriptionLabel.Transparent := True;
      PageDescriptionLabel.Parent := WizardForm.MainPanel;

  FinishedHeadingLabel:=TLabel.Create(WizardForm);
  FinishedHeadingLabel.Left := ScaleX(10);
  FinishedHeadingLabel.Top := ScaleY(10);
  FinishedHeadingLabel.Width := ScaleX(320);
  FinishedHeadingLabel.Height := ScaleY(75);
  FinishedHeadingLabel.AutoSize := False;
  FinishedHeadingLabel.WordWrap := True;
  FinishedHeadingLabel.Font.Color := clBlue;
// здесь тоже можно поиграть шрифтом
//  FinishedHeadingLabel.Font.Style := [fsBold];
//  FinishedHeadingLabel.Font.Name:='MS Sans Serif';
  FinishedHeadingLabel.Font.Size := 14;
  FinishedHeadingLabel.Transparent := True;
  FinishedHeadingLabel.Parent := WizardForm.FinishedPage;

      FinishedLabel:=TLabel.Create(WizardForm);
      FinishedLabel.Left := ScaleX(10);
      FinishedLabel.Top := ScaleY(70);
      FinishedLabel.Width := ScaleX(220);
      FinishedLabel.Height := ScaleY(300);
      FinishedLabel.AutoSize := False;
      FinishedLabel.WordWrap := True;
      FinishedLabel.Font.Color := clRed;
      FinishedLabel.Font.Size := 10;
      FinishedLabel.Transparent := True;
      FinishedLabel.Parent := WizardForm.FinishedPage;

  RunMyProg := TCheckBox.Create(WizardForm);
  RunMyProg.Parent := WizardForm.FinishedPage;
  RunMyProg.Left := ScaleX(10);
  RunMyProg.Top := ScaleY(270);
  RunMyProg.Width := ScaleX(13);
  RunMyProg.Height := ScaleX(13);
  //RunMyProg.Checked := true; // чтоб чебокс был отмечен, раскоментируй строку

      RunLabel:=TLabel.Create(WizardForm);
      RunLabel.Left := ScaleX(30);
      RunLabel.Top := ScaleY(270);
      RunLabel.Width := ScaleX(200);
      RunLabel.Height := ScaleY(20);
      RunLabel.AutoSize := False;
      RunLabel.WordWrap := True;
      RunLabel.Font.Color := clGreen;
      RunLabel.Font.Style := [fsBold];
      RunLabel.Font.Size := 10;
      RunLabel.OnClick := @RLabelOnClick;
      RunLabel.Transparent := True;
      RunLabel.Parent := WizardForm.FinishedPage;
end;

procedure CurPageChanged(CurPageID: Integer);
var
  pfunc: LongWord;

begin
  WelcomeLabel1.Caption := WizardForm.WelcomeLabel1.Caption;
  WelcomeLabel2.Caption := WizardForm.WelcomeLabel2.Caption;
  PageNameLabel.Caption := WizardForm.PageNameLabel.Caption;
  PageDescriptionLabel.Caption := WizardForm.PageDescriptionLabel.Caption;
  FinishedHeadingLabel.Caption := WizardForm.FinishedHeadingLabel.Caption;
  FinishedLabel.Caption := WizardForm.FinishedLabel.Caption;
// здесь придётся вручную вводить требуемый текст
  RunLabel.Caption := 'Запустить программу';

  if (CurPageID = wpInstalling) then
    begin
      pfunc := WrapTimerProc(@OnTimer, 4);
      TimerID := SetTimer(0, 0, 1000, pfunc);

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

      WizardForm.ProgressGauge.Show;
      WizardForm.StatusLabel.Show;
      SplashImage.Show;
    end
  else
    begin
      WizardForm.ProgressGauge.Hide;
      WizardForm.StatusLabel.Hide;
      SplashImage.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;
end;

procedure DeinitializeSetup();
begin
  KillTimer(0, TimerID);
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


Код с проверкой кофигурации
Код: Выделить весь код
[Сode]
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;

-------
Правильная постановка вопроса свидетельствует о некотором знакомстве с делом.
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


Отправлено: 14:08, 15-04-2009 | #620



Компьютерный форум OSzone.net » Автоматическая установка Windows » Автоматическая установка приложений » [архив] Inno Setup .:[все вопросы]:.

Участник сейчас на форуме Участник сейчас на форуме Участник вне форума Участник вне форума Автор темы Автор темы Шапка темы Сообщение прикреплено

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
Inno Setup. Прочие вопросы El Sanchez Автоматическая установка приложений 653 09-01-2023 20:13
Утилиты - [addon] Inno Setup CrOsP Наборы обновлений для Windows XP/2003/Windows 7 33 11-05-2011 16:03
Inno Setup 5.3.6 OSZone Software Новости программного обеспечения 0 15-11-2009 17:30
[Архив] Твики реестра .: [все вопросы] :. Vadikan Автоматическая установка Windows 2000/XP/2003 1431 26-01-2008 08:51
Inno Setup tradeukraine Вебмастеру 3 13-06-2006 20:39




 
Переход