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

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

Закрытая тема
Настройки темы
Скрипты Inno Setup. Помощь и советы [часть 5]

Аватара для El Sanchez

Ветеран


Contributor


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


Конфигурация

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


Изменения
Автор: El Sanchez
Дата: 16-02-2015
Внимание! Данная тема предназначена только для обсуждения написания скриптов !
Остальные вопросы, а также последние версии компилятора в теме
Inno Setup. Прочие вопросы.


Показать/скрыть: Справка, руководство, примеры:
Показать/скрыть: Ссылки на примеры скриптов:
Показать/скрыть: Дополнительные программы для Inno Setup:
  • ISTool - неплохой редактор скриптов Inno Setup.
    Последняя версия: 5.3.0.1 [29.09.2009] - Скачать | зеркало;

  • Inno Script Generator - генератор скриптов Inno Setup. Обладает некоторыми полезными функциями, которых нет ни у самого Inno Setup, ни у ISTool.
    Последняя версия: 1.0.3.1 [23.03.2008] - Скачать | зеркало на русифицированную программу;
    Примечание: Родной сайт www.hisoft2000.de более недоступен, поэтому здесь расположены сторонние ссылки.

  • Inno Setup Form Designer - редактор страниц Inno Setup, можно создавать свои страницы.
    Последняя версия: 2.0.8 [12.11.2006] - Скачать;
    Примечание: Родной сайт http://isfd.kaju74.de/index.php?isfd более недоступен, поэтому здесь расположены сторонние ссылки.

  • Inno Setup GameScript Generator - программа генерирует скрипты для Inno Setup . С помощью GameScript Generator и Inno Setup вы сможете быстро создать простенький инсталляционный пакет для любой игры. В инсталлятор можно встроить музыку, слайдшоу и фоновый рисунок. Для специалистов созданный скрипт, возможно, будет неплохой заготовкой для дальнейшей модернизации;

  • ISSkin - Программа для создания и добавления в инсталлятор скинов. Инструкция.
    Последняя версия: 3.0.0.0 [19.01.2010] - Скачать;

  • ISSJoiner - Программа для объединения нескольких скриптов InnoSetup в один.
    Последняя версия: 3.0 [23.07.2009]

  • Converter - Программа конвертирует reg-файлы в формат *.iss (формат скриптов Inno Setup).
    Последняя версия: 0.1.4 [13.03.2010] - Скачать;


Предыдущие ветки обсуждения по ссылкам ниже и в прикреплённых архивах:
Inno Setup [все вопросы] часть 1
Inno Setup [все вопросы] часть 2
Скрипты Inno Setup. Помощь и советы [часть 3]
Скрипты Inno Setup. Помощь и советы [часть 4]

Отправлено: 03:49, 21-05-2012

 

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


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

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


я не понял что ты изменил, но все равно спасибо за помощь!

помогло!

Отправлено: 12:04, 03-09-2012 | #791



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

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


Аватара для Habetdin


Автор проектов


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

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


Цитата spice:
что ты изменил »
читать дальше »
Например:
Код: Выделить весь код
function InitializeSetup(): Boolean;
begin
ExtractTemporaryFile('aqualux.cjstyles');
LoadSkin(ExpandConstant('{tmp}\aqualux.cjstyles'), '');
Result := True;
end;
...
function InitializeSetup:boolean;
begin
  ExtractTemporaryFile('GTA_San_Andreas-GTA_San_Andreas.mp3');
  ExtractTemporaryFile('bass.dll');
  Result:=True;
end;
Стало:
Код: Выделить весь код
function InitializeSetup:boolean;
begin
  ExtractTemporaryFile('GTA_San_Andreas-GTA_San_Andreas.mp3');
  ExtractTemporaryFile('bass.dll');
  ExtractTemporaryFile('aqualux.cjstyles');
  LoadSkin(ExpandConstant('{tmp}\aqualux.cjstyles'), '');
  Result:=True;
end;

P.S.: ISSJoiner из шапки должен помочь в будущем

-------
Рекомендую: $25 на тест виртуального сервера (VPS) за регистрацию по ссылке


Отправлено: 12:22, 03-09-2012 | #792


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


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

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


у меня все эти программы дополнения для inno setup есть но я ими не пользуюсь(не умею) у меня inno ultra.

как ISSJoiner пользоваться не подскажешь?

Отправлено: 12:29, 03-09-2012 | #793


Аватара для Gnom_aka_Lexander

Ветеран


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

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


Цитата spice:
как ISSJoiner пользоваться не подскажешь? »
Небольшое руководство по ипользованию утилиты ISS Joiner.
специально для тех, кто не любит читать, набросал.

-------
Я люблю помогать. Но не путайте: "Помогите мне" и "Сделайте за меня" - это совершенно разные понятия.


Отправлено: 12:44, 03-09-2012 | #794


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


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

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


Спасибо большое! теперь я разобрался!

Отправлено: 12:58, 03-09-2012 | #795


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


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

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


Изображения
Тип файла: png Снимок.PNG
(123.9 Kb, 12 просмотров)

народ помогите плиз! объединил 3 скрипта вроде все правильно сделал, но при компиляции такая ошибка

Отправлено: 17:30, 03-09-2012 | #796


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


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

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


что это значит?

вот скрипт
Код: Выделить весь код
; Ñêðèïò ñîçäàí ÷åðåç Ìàñòåð Inno Setup Script.
; ÈÑÏÎËÜÇÓÉÒÅ ÄÎÊÓÌÅÍÒÀÖÈÞ ÄËß ÏÎÄÐÎÁÍÎÑÒÅÉ ÈÑÏÎËÜÇÎÂÀÍÈß INNO SETUP!

[Setup]
; Ïðèìå÷àíèå: Çíà÷åíèå AppId èäåíòèôèöèðóåò ýòî ïðèëîæåíèå.
; Íå èñïîëüçóéòå îäíî è òîæå çíà÷åíèå â ðàçíûõ óñòàíîâêàõ.
; (Äëÿ ãåíåðàöèè çíà÷åíèÿ GUID, íàæìèòå Èíñòðóìåíòû | Ãåíåðàöèÿ GUID.)
AppId={{401CE660-D285-4327-AE2C-3CFB06643CC9}
AppName=ôîòî
AppVersion=1.5
;AppVerName=ôîòî 1.5
AppPublisher=Ìîÿ êîìïàíèÿ, Inc.
AppPublisherURL=http://www.ñàéò.com/
AppSupportURL=http://www.ñàéò.com/
AppUpdatesURL=http://www.ñàéò.com/
DefaultDirName={pf}\ôîòî
DefaultGroupName=ôîòî
OutputDir=C:\Users\Vadim\Desktop\ISS
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

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

[Name]
Name: russian; Name: compiler:Name\Russian.isl



[CustomMessages]
russian.hour= ÷àñîâ
russian.min= ìèí
russian.sec= ñåê




[Files]
Source: C:\Users\Vadim\Desktop\ISS\ôîòî\innocallback.dll; Flags: dontcopy
Source: C:\Users\Vadim\Desktop\ôîòî\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
; Ïðèìå÷àíèå: Íå èñïîëüçóéòå "Flags: ignoreversion" äëÿ ñèñòåìíûõ ôàéëîâ
Source: C:\Users\Vadim\Desktop\ISS\ôîòî\ISSkin.dll; DestDir: {tmp}; Flags: dontcopy
Source: C:\Users\Vadim\Desktop\ISS\ôîòî\aqualux.cjstyles; DestDir: {tmp}; Flags: dontcopy




[c0de]
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('Vista', SystemVersionPanel.Text) = 0) and // Windows Vista (c ëþáûì SP èëè áåç íåãî)
(Pos('Windows 7', SystemVersionPanel.Text) = 0) then
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 InitializeWizard1();
begin
InfoPage := CreateCustomPage(wpLicense, 'Àïïàðàòíîå è ïðîãðàììíîå îáåñïå÷åíèå',
'Ïðîãðàììà óñòàíîâêè îáíàðóæèëà ñëåäóþùèå íàîáõîäèìûå êîìïîíåíòû.')
CreateCheckForm() // Ñîçäàíèå îáúåêòîâ TMemo, â êîòîðûõ áóäåò âûâîäèòñÿ èíôîðìàöèÿ î ñèñòåìå
UpdateInfo() // Îáíîâëåíèå èíôîðìàöèè î ñèñòåìå
end;

procedure CurPageChanged1(CurPageID: Integer);
begin
if CurPageID = InfoPage.ID then UpdateInfo() // Îáíîâëåíèå èíôîðìàöèè î ñèñòåìå
end;

// --- Source: 2.iss ------------------------------------------------------------
type
TTimerProc = procedure(HandleW, Msg, idEvent, TimeSys: LongWord);

var
PercentsTimer: LongWord;
PercentsLabel: TLabel;

function WrapTimerProc(callback: TTimerProc; Paramcount: Integer): longword; external 'wrapcallback@files:innocallback.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): longword; external 'SetTimer@user32';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32 stdcall delayload';

Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.1n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;

Procedure PercentsProc(h, msg, idevent, dwTime: Longword);
Begin
with WizardForm.ProgressGauge do
begin
PercentsLabel.Caption:= 'Âûïîëíåíî ' + NumToStr((Position*100)/Max) + ' %';
end;
End;

procedure DeinitializeSetup2();
begin
KillTimer(0, PercentsTimer);
end;

procedure InitializeWizard2();
begin
PercentsLabel:= TLabel.Create(WizardForm);
with PercentsLabel do
begin
Left:= WizardForm.ProgressGauge.Left;
Top:= WizardForm.ProgressGauge.Top + WizardForm.ProgressGauge.Height + ScaleY(10);
Width:= WizardForm.StatusLabel.Width;
Height:= WizardForm.StatusLabel.Height;
AutoSize:= False;
Transparent := True;
Parent:= WizardForm.InstallingPage;
end;
end;

procedure CurStepChanged2(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
PercentsTimer:= SetTimer(0, 0, 100, WrapTimerProc(@PercentsProc, 4));
end;
end;

// --- Source: 3.iss ------------------------------------------------------------
 type
TTimerProc = procedure(HandleW, Msg, idEvent, TimeSys: LongWord);

var
StartInstall: Integer;
TimeLabel: TLabel;
TimerID: Longword;

function GetTickCount: DWord; external 'GetTickCount@kernel32';
function WrapTimerProc(callback: TTimerProc; Paramcount: Integer): longword; external 'wrapcallback@files:innocallback.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): longword; external 'SetTimer@user32';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32 stdcall delayload';

Function cm(Message: String): String; Begin Result:= ExpandConstant('{cm:'+ Message +'}') End;

Function TicksToTime(Ticks: DWord; h,m,s: String; detail: Boolean): String;
Begin
    if detail then            {hh: mm:ss format}
        Result:= PADZ(IntToStr(Ticks/3600000), 2) +':'+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +':'+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2)
    else if Ticks/3600 >= 1000 then    {more than hour}
        Result:= IntToStr(Ticks/3600000) +h+' '+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +m
    else if Ticks/60 >= 1000 then    {1..60 minutes}
        Result:= IntToStr(Ticks/60000) +m+' '+ IntToStr(Ticks/1000 - Ticks/1000/60*60) +s
    else Result:= Format('%.1n', [Abs(Ticks/1000)]) +s    {less than one minute}
End;

procedure GetTime(HandleW, Msg, idEvent, TimeSys: LongWord);
var Remaining: Integer;
begin
with WizardForm.ProgressGauge do begin
  if position > 0 then Remaining:= trunc((GetTickCount - StartInstall) * Abs((max - position)/position))
    TimeLabel.Caption:= 'Inoaeinu ' + TicksToTime(Remaining, cm('hour'), cm('min'), cm('sec'), false)
    if (Remaining = 0) then TimeLabel.Caption:= 'Çàâåðøåíèå...'
  end;
end;

procedure InitializeWizard3();
begin
TimeLabel:= TLabel.Create(WizardForm)
TimeLabel.SetBounds(ScaleX(0), ScaleY(80), ScaleX(457), ScaleY(20));
TimeLabel.AutoSize:= False
TimeLabel.Transparent:= True;
TimeLabel.Parent:= WizardForm.InstallingPage;
end;

procedure CurStepChanged3(CurStep: TSetupStep);
begin
If CurStep = ssInstall then
  begin
    StartInstall:= GetTickCount
    TimerID:= SetTimer(0,0, 500, WrapTimerProc(@GetTime, 4))
  end;
end;

procedure DeinitializeSetup3();
begin
KillTimer(0, TimerID)
end;

// --- Dispatching code ------------------------------------------------------------

procedure InitializeWizard();
begin
  InitializeWizard1();
  InitializeWizard2();
  InitializeWizard3();
end;

procedure CurPageChanged(CurPageID: Integer);
begin
  CurPageChanged1(CurPageID);
end;

procedure DeinitializeSetup();
begin
  DeinitializeSetup2();
  DeinitializeSetup3();
end;

procedure CurStepChanged(CurStep: TSetupStep);
begin
  CurStepChanged2(CurStep);
  CurStepChanged3(CurStep);
end;

Отправлено: 17:30, 03-09-2012 | #797


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


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

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


Цитата spice:
spice »
У тебя дублируется функция: TTimerProc. Повтор.

Отправлено: 17:53, 03-09-2012 | #798


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


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

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


блин а как это исправить?

Отправлено: 18:10, 03-09-2012 | #799


Аватара для SatHan

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


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

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


Цитата spice:
блин а как это исправить? »
Может так?

читать дальше »

Код: Выделить весь код
[Setup]
AppId={{401CE660-D285-4327-AE2C-3CFB06643CC9}
AppName=oioi
AppVersion=1.5
;AppVerName=oioi 1.5
AppPublisher=Iiy eiiiaiey, Inc.
AppPublisherURL=http://www.naeo.com/
AppSupportURL=http://www.naeo.com/
AppUpdatesURL=http://www.naeo.com/
DefaultDirName={pf}\oioi
DefaultGroupName=oioi
OutputDir=C:\Users\Vadim\Desktop\ISS
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes

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

[Name]
Name: russian; Name: compiler:Name\Russian.isl

[CustomMessages]
russian.hour= Часы
russian.min= Минуты
russian.sec= Секунды


[Files]
Source: C:\Users\Vadim\Desktop\ISS\oioi\innocallback.dll; Flags: dontcopy
Source: C:\Users\Vadim\Desktop\oioi\*; DestDir: {app}; Flags: ignoreversion recursesubdirs createallsubdirs
;
Source: C:\Users\Vadim\Desktop\ISS\oioi\ISSkin.dll; DestDir: {tmp}; Flags: dontcopy
Source: C:\Users\Vadim\Desktop\ISS\oioi\aqualux.cjstyles; DestDir: {tmp}; Flags: dontcopy


[#code]
type
TTimerProc = procedure(HandleW, Msg, idEvent, TimeSys: LongWord);
//
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;

// I?iaa?ea aa?nee 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';

// Aiiieieou ?enei ai e?aoiiai Multiple
function ToMultiple(Bytes, Multiple: Integer): Integer;
begin
if Abs(Bytes/Multiple) > Bytes/Multiple then
Result := (Bytes/Multiple + 1)*Multiple
else
Result := Bytes
end;

// Ia?aaia ?enea a cia?aiea Ao/Ea/Ia/Aa/Oa (ai 3o ciaeia iinea caiyoie)
function ByteOrTB(Bytes: Extended; noMB: Boolean): String;
begin
if not noMB then
Result := FloatToStr(Int(Bytes)) + ' Ia'
else
if Bytes < 1024 then
Result := FloatToStr(Int(Bytes)) + ' Ao'
else
if Bytes/1024 < 1024 then
Result := FloatToStr(round((Bytes/1024)*10)/10) + ' Ea'
else
if Bytes/oneMB < 1024 then
Result := FloatToStr(round(Bytes/oneMB*100)/100) + ' Ia'
else
if Bytes/oneMB/1000 < 1024 then
Result := FloatToStr(round(Bytes/oneMB/1024*1000)/1000) + ' Aa'
else
Result := FloatToStr(round(Bytes/oneMB/oneMB*1000)/1000) + ' Oa'
StringChange(Result, ',', '.')
end;

// Oaaeaiea ia?aeuiuo, eiia?iuo e iiaoi?iuo i?iaaeia
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) // Eiee?anoai yaa?
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('Ioeaea ooieoee:' + #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 := 'Eiaaa Au aoaaoa aioiau i?iaie?eou onoaiiaeo, ia?ieoa «Aaeaa».'
Font.Color := clBlack
Left := 0
Top := 200
AutoSize := True
end

SystemPanel := TMemo.Create(InfoPage)
with SystemPanel do
begin
Text := 'Nenoaia'
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 := 'I?ioanni?'
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 := 'Aeaaiaaaioa?'
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 := 'Caoeiaay ea?oa'
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 := 'Iau?i iaiyoe'
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 := 'Oaee iiaea?ee'
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)

// Iia?aoeiiiay nenoaia:
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 + ' nai?ea ' + 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('Vista', SystemVersionPanel.Text) = 0) and // Windows Vista (c e?aui SP eee aac iaai)
(Pos('Windows 7', SystemVersionPanel.Text) = 0) then
begin
SystemVersionPanel.Color := $CCCCFF
ChangeText := True
end

// I?ioanni?:
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 := 'I?ioanni?u' // + ' (' + IntToStr(GetArrayLength(Keys)) + ')'

// Aeaaiea?oa:
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) // Ee?? a?aeaa?a iieo?aai ec 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 := ' A?aeaa? ono?ienoaa ia iaia?o?ai'
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)'

// Caoeiaay ea?oa:
AudioNamePanel.Color := $CCFFCC

// for errCode := 0 to 1 do // Auaia iniiaiiai caoeiaiai ono?ienoaa
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 := 'Caoeiaua ea?ou'
// AudioPanel.Text := 'Caoeiaua ea?ou (' + 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 := ' A?aeaa? ono?ienoaa ia iaia?o?ai'
AudioNamePanel.Color := $CCCCFF
ChangeText := True
end
else
AudioNamePanel.Text := Keys[0]
if Pos(NeedSoundCard, AudioNamePanel.Text) = 0 then
AudioNamePanel.Text := AudioNamePanel.Text + ' (?aeiiaiaoaony ' + NeedSoundCard + ')'

// Iau?i iaiyoe:
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) + ' anaai, ' +
ByteOrTB(ToMultiple(trunc(Size64(MemoryEx.HiTotalPhys, MemoryEx.LoTotalPhys)/oneMB), 16) -
Size64(MemoryEx.HiAvailPhys, MemoryEx.LoAvailPhys)/oneMB, False) + ' eniieucoaony, ' +
ByteOrTB(Size64(MemoryEx.HiAvailPhys, MemoryEx.LoAvailPhys)/oneMB, False) + ' naiaiaii'

// Ae?ooaeuiay iaiyou:
PageFileTotalPanel.Color := $CCFFCC
PageFileTotalPanel.Text := ' ' + ByteOrTB(Size64(MemoryEx.HiTotalPageFile, MemoryEx.LoTotalPageFile)/oneMB, False) + ' anaai, ' +
ByteOrTB((Size64(MemoryEx.HiTotalPageFile, MemoryEx.LoTotalPageFile) -
Size64(MemoryEx.HiAvailPageFile, MemoryEx.LoAvailPageFile))/oneMB, False) + ' caiyoi nenoaiiui eyoai'
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 := 'Ia ana eiiiiiaiou oaiaeaoai?y?o ieieiaeuiui o?aaiaaieyi ea?u.' #13
'Ii?aeoenoa, i?iaa?uoa iiceoee, auaaeaiiua e?aniui oaaoii.'
TopText.Font.Color := clRed
// WizardForm.NextButton.Enabled := False
end
else
begin
TopText.Caption := 'Ana eiiiiiaiou niioaaonoao?o ieieiaeuiui o?aaiaaieyi ea?u.'
TopText.Font.Color := clGreen
TopText.Top := 8
// WizardForm.NextButton.Enabled := True
end
end;



procedure CurPageChanged(CurPageID: Integer);
begin
if CurPageID = InfoPage.ID then UpdateInfo() // Iaiiaeaiea eioi?iaoee i nenoaia
end;

// --- Source: 2.iss ------------------------------------------------------------

var
PercentsTimer: LongWord;
PercentsLabel: TLabel;

function WrapTimerProc(callback: TTimerProc; Paramcount: Integer): longword; external 'wrapcallback@files:innocallback.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): longword; external 'SetTimer@user32';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external 'KillTimer@user32 stdcall delayload';

Function NumToStr(Float: Extended): String;
Begin
Result:= Format('%.1n', [Float]); StringChange(Result, ',', '.');
while ((Result[Length(Result)] = '0') or (Result[Length(Result)] = '.')) and (Pos('.', Result) > 0) do
SetLength(Result, Length(Result)-1);
End;

Procedure PercentsProc(h, msg, idevent, dwTime: Longword);
Begin
with WizardForm.ProgressGauge do
begin
PercentsLabel.Caption:= 'Auiieiaii ' + NumToStr((Position*100)/Max) + ' %';
end;
End;


// --- Source: 3.iss ------------------------------------------------------------

var
StartInstall: Integer;
TimeLabel: TLabel;
TimerID: Longword;

function GetTickCount: DWord; external 'GetTickCount@kernel32';

Function cm(Message: String): String; Begin Result:= ExpandConstant('{cm:'+ Message +'}') End;

Function TicksToTime(Ticks: DWord; h,m,s: String; detail: Boolean): String;
Begin
    if detail then            {hh: mm:ss format}
        Result:= PADZ(IntToStr(Ticks/3600000), 2) +':'+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +':'+ PADZ(IntToStr(Ticks/1000 - Ticks/1000/60*60), 2)
    else if Ticks/3600 >= 1000 then    {more than hour}
        Result:= IntToStr(Ticks/3600000) +h+' '+ PADZ(IntToStr((Ticks/1000 - Ticks/1000/3600*3600)/60), 2) +m
    else if Ticks/60 >= 1000 then    {1..60 minutes}
        Result:= IntToStr(Ticks/60000) +m+' '+ IntToStr(Ticks/1000 - Ticks/1000/60*60) +s
    else Result:= Format('%.1n', [Abs(Ticks/1000)]) +s    {less than one minute}
End;

procedure GetTime(HandleW, Msg, idEvent, TimeSys: LongWord);
var Remaining: Integer;
begin
with WizardForm.ProgressGauge do begin
  if position > 0 then Remaining:= trunc((GetTickCount - StartInstall) * Abs((max - position)/position))
    TimeLabel.Caption:= 'Inoaeinu ' + TicksToTime(Remaining, cm('hour'), cm('min'), cm('sec'), false)
    if (Remaining = 0) then TimeLabel.Caption:= 'Caaa?oaiea...'
  end;
end;

procedure InitializeWizard();
begin
PercentsLabel:= TLabel.Create(WizardForm);
with PercentsLabel do
begin
Left:= WizardForm.ProgressGauge.Left;
Top:= WizardForm.ProgressGauge.Top + WizardForm.ProgressGauge.Height + ScaleY(10);
Width:= WizardForm.StatusLabel.Width;
Height:= WizardForm.StatusLabel.Height;
AutoSize:= False;
Transparent := True;
Parent:= WizardForm.InstallingPage;
end;

//procedure InitializeWizard1();
begin
InfoPage := CreateCustomPage(wpLicense, 'Aiia?aoiia e i?ia?aiiiia iaania?aiea',
'I?ia?aiia onoaiiaee iaia?o?eea neaao?uea iaiaoiaeiua eiiiiiaiou.')
CreateCheckForm() // Nicaaiea iauaeoia TMemo, a eioi?uo aoaao auaiaeony eioi?iaoey i nenoaia
UpdateInfo() // Iaiiaeaiea eioi?iaoee i nenoaia
end;

//procedure InitializeWizard3();
begin
TimeLabel:= TLabel.Create(WizardForm)
TimeLabel.SetBounds(ScaleX(0), ScaleY(80), ScaleX(457), ScaleY(20));
TimeLabel.AutoSize:= False
TimeLabel.Transparent:= True;
TimeLabel.Parent:= WizardForm.InstallingPage;
end;
end;


procedure CurStepChanged(CurStep: TSetupStep);
begin
If CurStep = ssInstall then
  begin
    StartInstall:= GetTickCount
    TimerID:= SetTimer(0,0, 500, WrapTimerProc(@GetTime, 4))
    PercentsTimer:= SetTimer(0, 0, 100, WrapTimerProc(@PercentsProc, 4));
  end;
end;


//procedure CurStepChanged2(CurStep: TSetupStep);
//begin
//if CurStep = ssInstall then
//begin
//PercentsTimer:= SetTimer(0, 0, 100, WrapTimerProc(@PercentsProc, 4));
//end;
//end;



procedure DeinitializeSetup();
begin
KillTimer(0, TimerID)
KillTimer(0, PercentsTimer);
end;

//procedure DeinitializeSetup2();
//begin
//KillTimer(0, PercentsTimer);
//end;


// --- Dispatching code ------------------------------------------------------------

//procedure InitializeWizard();
//begin
//  InitializeWizard1();
//  InitializeWizard2();
//  InitializeWizard3();
//end;

//procedure CurPageChanged(CurPageID: Integer);
//begin
//  CurPageChanged1(CurPageID);
//end;

//procedure DeinitializeSetup();
//begin
//  DeinitializeSetup2();
//  DeinitializeSetup3();
//end;

//procedure CurStepChanged(CurStep: TSetupStep);
//begin
//  CurStepChanged2(CurStep);
//  CurStepChanged3(CurStep);
//end;


В следующий раз для вставки сюда своего кода, открывай свой скрипт в блокноте (например Notepad++) и копипасть от туда сюда, а то ведь не дело видеть иероглифы подобны этим [Ia ana eiiiiiaiou oaiaeaoai?y?o ieieiaeuiui o?aaiaaieyi ea?u.'].
Это сообщение посчитали полезным следующие участники:

Отправлено: 01:03, 04-09-2012 | #800



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

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

Похожие темы
Название темы Автор Информация о форуме Ответов Последнее сообщение
Скрипты Inno Setup. Помощь и советы [часть 4] El Sanchez Автоматическая установка приложений 2099 22-05-2012 23:16
Скрипты Inno Setup. Помощь и советы [часть 3] Serega Автоматическая установка приложений 3755 26-10-2011 17:58
[архив] Скрипты Inno Setup. Помощь и советы [часть 2] Serega Автоматическая установка приложений 2651 08-11-2010 18:34
Скрипты Inno Setup Compiler QAZAK Автоматическая установка приложений 7 15-01-2007 17:59
Inno Setup tradeukraine Вебмастеру 3 13-06-2006 20:39




 
Переход