PDA

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


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

saurn
20-05-2014, 15:35
Irenis, компилятор дает описание ошибки, его нужно прикрепить к сообщению, а еще лучше, как сказали выше, прикрепить к сообщению скрипт с минимальным набором файлов. Ибо гадать на пальцах, почему в вашем скрипте происходит ошибка в обратном вызове можно до бесконечности.

Irenis
20-05-2014, 17:39
Скрипт покажите »
Скрипт (http://files.mail.ru/F2687845E49541938EC808C6E37FB721).
Залила. А какие еще файлы нужно выложить? Всю игру?
Я делаю игру Panzar. Сделала из нее .arc архив. И пытаюсь как то совместить этот архив и установщик.

saurn
20-05-2014, 17:48
Irenis, найдите в коде секцию типов type и замените первую строку в ней на вот эту:

TCallback = function ( Pct: integer; CurrentFile: AnsiString ): longword;

А какие еще файлы нужно выложить? Всю игру? »
Нет) Только файлы необходимые для работы установщика, как, то - библиотеки, изображения и т.д.

vint56
20-05-2014, 17:55
Irenis лутше используй версию ISDone0.6final потому как есть SrepInside и PrecompInside а не ISDone 4 она очень старая там этого нету
вот сылка http://rghost.ru/55431699
Вот для сжатия Precomp+Srep+Arc и Srep+Arc и так далее все в архиве для сжатия
http://rghost.ru/55431917

Shift85
20-05-2014, 17:56
Irenis,

Irenis
20-05-2014, 18:48
Irenis, найдите в коде секцию типов type и замените первую строку в ней на вот эту: »
Спасибо, действительно помогло :up
Компиляция прошла успешно!

Irenis,
Вложения
skript panzar.7z
(3.0 Kb, 0 просмотров) »
Тут, я так понимаю, тоже заменили строку или еще что то? Вам тоже большое спасибо :)

Единственное, все вроде хорошо, все скомпилировалось и игра даже установилась и запустилась :yahoo: , только при распаковке не отображается, что именно распаковывается. То есть идет строка распаковки, а ниже написано "Распаковка файлов:????????????????"
В общем много знаков вопросов. В принципе, это не столь важно, но все равно лучше было бы, если бы там отображалось то, что должно.

лутше используй версию ISDone0.6final »
Спасибо за ссылочки :) Посмотрю.

Кстати, меня вот еще что интересует. Как сделать так, чтобы по завершению установки игры, автоматически открывалась страница в браузере по той ссылке, которую я укажу? Это, я так понимаю, нужен какой то скрипт или код? Может кто подскажет, где взять такое? Пока нашла только код, в котором можно прописать необходимую ссылку и в процессе установки в нижней части установщика будет отображаться кликабельная ссылка. Но хотелось бы именно, чтоб эта ссылка открывалась автоматически по завершению установки :)

saurn
20-05-2014, 19:12
То есть идет строка распаковки, а ниже написано "Распаковка файлов:????????????????" »
Пробуйте
[Code]
var
LabelPct,LabelCurrFileName: TLabel;
ISDoneProgressBar: TNewProgressBar;
MyCancelButton: TButton;
OveralPct,Cancel:integer;
CallBack:longword;
MyError:boolean;

type
TCallback = function (Pct: integer;CurrentFile:string): longword;
TMessage = record hWnd: HWND; msg, wParam: Word; lParam: LongWord; Time: TFileTime; pt: TPoint; end;

function PeekMessage(var lpMsg: TMessage; hWnd: HWND; wMsgFilterMin, wMsgFilterMax, wRemoveMsg: UINT): BOOL; external 'PeekMessageA@user32.dll stdcall';
function TranslateMessage(const lpMsg: TMessage): BOOL; external 'TranslateMessage@user32.dll stdcall';
function DispatchMessage(const lpMsg: TMessage): Longint; external 'DispatchMessageA@user32.dll stdcall';

function WrapMyCallback(callback:TCallback; paramcount:integer):longword;external 'wrapcallback@files:innocallback.dll stdcall';

function ISArcExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password, CfgFile, WorkPath: AnsiString):BOOL; external 'ISArcExtract@files:ISDone.dll stdcall';
function IS7ZipExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password: AnsiString):BOOL; external 'IS7zipExtract@files:ISDone.dll stdcall';
function ISRarExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutPath: AnsiString; DeleteInFile:boolean; callback: longword; Password: AnsiString):BOOL; external 'ISRarExtract@files:ISDone.dll stdcall';
function ISPrecompExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISPrecompExtract@files:ISDone.dll stdcall';
function ISSRepExtract(CurComponent:longword; var OveralPct:integer; PctOfTotal:double; InName, OutFile, IdxFile: AnsiString; DeleteInFile:boolean; callback: longword):BOOL; external 'ISSrepExtract@files:ISDone.dll stdcall';
function ShowChangeDiskWindow(Text, DefaultPath, SearchFile:AnsiString):BOOL; external 'ShowChangeDiskWindow@files:ISDone.dll stdcall';
function StartRecord(RecordFileName:AnsiString; AllComponents:longword):BOOL; external 'StartRecord@files:ISDone.dll stdcall';
function CheckPoint(CurComponent:Integer):BOOL; external 'CheckPoint@files:ISDone.dll stdcall';
function StopRecord:BOOL; external 'StopRecord@files:ISDone.dll stdcall';

function ProgressCallback(Pct: integer; CurrentFile:String): longword;
var Msg: TMessage;
begin
if Pct<=ISDoneProgressBar.Max then
ISDoneProgressBar.Position := Pct;
LabelPct.Caption := IntToStr(Pct div 10)+'.'+chr(48 + Pct mod 10)+'%';
LabelCurrFileName.Caption :=ExpandConstant('{cm:ExtractedFile} ')+CurrentFile;
while PeekMessage(Msg, 0, 0, 0, 1) do begin
TranslateMessage(Msg);
DispatchMessage(Msg);
end;
Result := Cancel;
end;

procedure CancelButtonOnClick(Sender: TObject);
begin
if MsgBox(SetupMessage(msgExitSetupMessage), mbConfirmation, MB_YESNO) = IDYES then Cancel:=1;
end;

procedure InitializeWizard();
begin
ISDoneProgressBar := TNewProgressBar.Create(WizardForm);
with ISDoneProgressBar do begin
Left := ScaleX(0);
Top := ScaleY(40);
Width := ScaleX(417);
Max := 1000;
Height := WizardForm.ProgressGauge.Height;
Parent := WizardForm.InstallingPage;
end;
LabelPct := TLabel.Create(WizardForm);
with LabelPct do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Top := WizardForm.ProgressGauge.Top + ScaleY(40);
Alignment := taCenter;
Caption := '';
end;
LabelCurrFileName := TLabel.Create(WizardForm);
with LabelCurrFileName do begin
Parent := WizardForm.InstallingPage;
AutoSize := False;
Width := WizardForm.ProgressGauge.Width;
Left := ScaleX(0);
Top := WizardForm.ProgressGauge.Top + ScaleY(25);
Caption := '';
end;
end;

Procedure CurPageChanged(CurPageID: Integer);
Begin
if (CurPageID = wpFinished) and MyError then
begin
WizardForm.Caption:= ExpandConstant('{cm:Error}');
WizardForm.FinishedLabel.Font.Color:= clRed;
WizardForm.FinishedLabel.Caption:= SetupMessage(msgSetupAborted) ;
end;
end;

procedure CurStepChanged(CurStep: TSetupStep);
var ChComp, TmpValue:longword;
n:integer;
begin
if CurStep = ssInstall then begin //Если необходимо, можно переделать на ssPostInstall
WizardForm.ProgressGauge.Hide;
WizardForm.CancelButton.Visible:=false;
MyCancelButton:=TButton.Create(WizardForm);
with MyCancelButton do begin
Parent:=WizardForm;
Width:=ScaleX(135);
Caption:=ExpandConstant('{cm:CancelButton}');
Left:=ScaleX(360);
Top:=WizardForm.cancelbutton.top;
OnClick:=@CancelButtonOnClick;
end;
CallBack:=WrapMyCallback(@ProgressCallback,2);
Cancel:=0;
OveralPct:=0;

// Распаковка всех необходимых файлов в папку {tmp}. Это необходимо для того, чтобы
//выполнять установку в момент ssInstall, и секция [Run] выполнялась после установки.
#ifdef records
ExtractTemporaryFile('records.inf');
#endif
#ifdef precomp04
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp04.exe');
#endif
#ifdef precomp038
ExtractTemporaryFile('packjpg_dll.dll');
ExtractTemporaryFile('RTconsole.exe');
ExtractTemporaryFile('precomp038.exe');
ExtractTemporaryFile('zlib1.dll');
#endif
#ifdef unrar
ExtractTemporaryFile('Unrar.dll');
#endif

// Подготавливаем переменную, содержащую всю информацию о выделенных компонентах для ISDone.dll
ChComp:=0;
#ifdef Components
TmpValue:=1;
if IsComponentSelected('text\rus') then ChComp:=ChComp+TmpValue; //компонент 1
TmpValue:=TmpValue*2;
if IsComponentSelected('text\eng') then ChComp:=ChComp+TmpValue; //компонент 2
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\rus') then ChComp:=ChComp+TmpValue; //компонент 3
TmpValue:=TmpValue*2;
if IsComponentSelected('voice\eng') then ChComp:=ChComp+TmpValue; //компонент 4
#endif

StartRecord(ExpandConstant('{src}\records.inf'),ChComp);
repeat
MyError:=true;
//if not ISRarExtract ( 0, OveralPct, 0, ExpandConstant('{src}\aaa.rar'), ExpandConstant('{app}'), false,CallBack, '' ) then break;
if not ISArcExtract ( 0, OveralPct, 0, ExpandConstant('{src}\Panzar.arc'), ExpandConstant('{app}\'), false,CallBack, '', '', '') then break;
//if not ISSRepExtract ( 0, OveralPct, 0, ExpandConstant('{app}\data1\CODMW2.srep'), ExpandConstant('{app}\data1\CODMW2.pcf'), '', true, CallBack ) then break;
//if not ISPrecompExtract( 0, OveralPct, 0, ExpandConstant('{app}\data1\CODMW2.pcf'), ExpandConstant('{app}\data1\CODMW2.7z'), true, CallBack ) then break;
//if not IS7ZipExtract ( 0, OveralPct, 0, ExpandConstant('{app}\data1\CODMW2.7z'), ExpandConstant('{app}\data1'), true, CallBack, '' ) then break;
//if not ShowChangeDiskWindow('Пожалуйста, вставьте диск 2 и дождитесь его инициализации.', ExpandConstant('{src}'),'CODMW2_Disk2.arc' ) then break;
//if not ISArcExtract ( 1, OveralPct, 0, ExpandConstant('{src}\rustext.arc'), ExpandConstant('{app}'), false,CallBack, '', '', '') then break;
//if not ISArcExtract ( 2, OveralPct, 0, ExpandConstant('{src}\engtext.arc'), ExpandConstant('{app}'), false,CallBack, '', '', '') then break;
//if not ISArcExtract ( 3, OveralPct, 0, ExpandConstant('{src}\rusvoice.arc'),ExpandConstant('{app}'), false,CallBack, '', '', '') then break;
//if not ISArcExtract ( 4, OveralPct, 0, ExpandConstant('{src}\engvoice.arc'),ExpandConstant('{app}'), false,CallBack, '', '', '') then break;
MyError:=false;
until true;
StopRecord;

MyCancelButton.Visible:=false;
WizardForm.CancelButton.Visible:=true;
end;
if (CurStep=ssPostInstall) and MyError then
Exec(ExpandConstant('{uninstallexe}'), '/SILENT','', sw_Hide, ewWaitUntilTerminated, n);
end;

Dodakaedr
20-05-2014, 19:20
автоматически открывалась страница в браузере по той ссылке, которую я укажу? »

[Run]
Filename: "http://forum.oszone.net"; Flags: shellexec

Kashtan007
20-05-2014, 19:23
Всем доброго времени суток!
На картинке видно, что когда наводишь на компонент то появляется картинка и описание к ней в окошках.
http://rghost.ru/55435602/image.png
Как реализовать данное чудо? И можно будет как-то расширить эти окошки?
Заранее спасибо!

Dodakaedr
20-05-2014, 19:28
Как реализовать данное чудо? »
[Setup]
AppName=Моя программа
AppVersion=1.5
DefaultDirName={pf}\Моя программа

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

[CustomMessages]
RU.CompName1=Компонент 1
RU.CompName2=Компонент 2
RU.ComponentsInfo=Наведите курсор мыши на компонент, чтобы прочитать его описание.
RU.ComponentsImgInfo=Наведите курсор мыши на компонент, чтобы посмотреть его превью.
RU.CompDesc1=Описание первого компонента
RU.CompDesc2=Описание второго компонента

[Files]
Source: "compiler:WizModernImage.bmp"; DestName: "CompDescImg1.bmp"; Flags: dontcopy
Source: "compiler:WizModernImage-IS.bmp"; DestName: "CompDescImg2.bmp"; Flags: dontcopy

[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: comp1; Description: "{cm:CompName1}"; Types: full
Name: comp2; Description: "{cm:CompName2}"; Types: full

[ Code]
type
TComponentDesc = record
Description: String;
ImageName: String;
Index: Integer;
end;

var
CompDescs: array of TComponentDesc;
CompDescPanel, CompDescImgPanel: TPanel;
CompDescText: array[1..2] of TLabel;
CompIndex, LastIndex: Integer;
CompDescImg: TBitmapImage;

procedure ShowCompDescription(Sender: TObject; X, Y, Index: Integer; Area: TItemArea);
var
i: Integer;
begin
if Index = LastIndex then Exit;
CompIndex := -1;
for i := 0 to GetArrayLength(CompDescs) -1 do
begin
if (CompDescs[i].Index = Index) then
begin
CompIndex := i;
Break;
end;
end;
if (CompIndex >= 0) and (Area = iaItem) then
begin
if not FileExists(ExpandConstant('{tmp}\') + CompDescs[CompIndex].ImageName) then
ExtractTemporaryFile(CompDescs[CompIndex].ImageName);
CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\') + CompDescs[CompIndex].ImageName);
CompDescImg.Show;

CompDescText[2].Caption := CompDescs[CompIndex].Description;
CompDescText[2].Enabled := True;
end else
begin
CompDescText[2].Caption := CustomMessage('ComponentsInfo');
CompDescText[2].Enabled := False;
CompDescImg.Hide;
end;
LastIndex := Index;
end;

procedure CompListMouseLeave(Sender: TObject);
begin
CompDescImg.Hide;
CompDescText[2].Caption := CustomMessage('ComponentsInfo');
CompDescText[2].Enabled := False;
LastIndex := -1;
end;

procedure AddCompDescription(AIndex: Integer; ADescription: String; AImageName: String);
var
i: Integer;
begin
i := GetArrayLength(CompDescs);
SetArrayLength(CompDescs, i + 1);
CompDescs[i].Description := ADescription;
CompDescs[i].ImageName := AImageName;
CompDescs[i].Index := AIndex - 1
end;

procedure InitializeWizard();
begin
WizardForm.SelectComponentsLabel.Hide;
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(0), ScaleX(184), ScaleY(205));
WizardForm.ComponentsList.OnItemMouseMove:= @ShowCompDescription;
WizardForm.ComponentsList.OnMouseLeave := @CompListMouseLeave;

CompDescImgPanel := TPanel.Create(WizardForm);
with CompDescImgPanel do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(192), ScaleY(0), ScaleX(225), ScaleY(120));
BevelInner := bvLowered;
end;

CompDescText[1] := TLabel.Create(WizardForm);
with CompDescText[1] do
begin
Parent := CompDescImgPanel;
SetBounds(ScaleX(5), ScaleY(5), CompDescImgPanel.Width - ScaleX(10), CompDescImgPanel.Height - ScaleY(10));
AutoSize := False;
WordWrap := True;
Enabled := False;
Caption := CustomMessage('ComponentsImgInfo');
end;

CompDescImg := TBitmapImage.Create(WizardForm);
with CompDescImg do
begin
Parent := CompDescImgPanel;
SetBounds(ScaleX(5), ScaleY(5), CompDescImgPanel.Width - ScaleX(10), CompDescImgPanel.Height - ScaleY(10));
Stretch := True;
Hide;
end;

CompDescPanel := TPanel.Create(WizardForm);
with CompDescPanel do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(192), ScaleY(125), ScaleX(225), ScaleY(80));
BevelInner := bvLowered;
end;

CompDescText[2] := TLabel.Create(WizardForm);
with CompDescText[2] do
begin
Parent := CompDescPanel;
SetBounds(ScaleX(5), ScaleY(5), CompDescPanel.Width - ScaleX(10), CompDescPanel.Height - ScaleY(10));
AutoSize := False;
WordWrap := True;
Enabled := False;
Caption := CustomMessage('ComponentsInfo');
end;

AddCompDescription(1, CustomMessage('CompDesc1'), 'CompDescImg1.bmp');
AddCompDescription(2, CustomMessage('CompDesc2'), 'CompDescImg2.bmp');
end;

Kashtan007
20-05-2014, 19:38
Dodakaedr, спасибо все работает!

Как место этих серых окон поставить фон? Т.е. мне нужно, чтобы место серого окна было изображение (фон)!


http://higgs.rghost.ru/55436382/image.png

Kashtan007
20-05-2014, 20:10
Dodakaedr, если на компонент не наводишь, то там блок с надписью наведите на компонент и появится картинка. Возможно ли сделать так, чтобы изначально там стола картинка, а уже при наведении на компонент она заменялась на картинку компонента.
Пробовал ставить через редактор форм (BitmapImage), но тогда картинку просто закрывает, окно для картинок компонентов.
Есть какой-то другой способ?

Хотелось бы что-бы выглядело вот так. А уже соответственно при наведении на компонент фон менялся на картинку компонента.
http://rghost.ru/55438920/image.png

Возможно есть способ, чтобы там изначально стояла картинка?

Заранее спасибо!

Shift85
21-05-2014, 07:01
Возможно есть способ, чтобы там изначально стояла картинка? »
Kashtan007, А вот так не лутше.

diman_21Ru
21-05-2014, 09:47
Dodakaedr, А если уже есть картинки на модах,можно лишь только на текст скрипт а то можно запутаться там у меня )

Dodakaedr
21-05-2014, 12:33
А если уже есть картинки на модах,можно лишь только на текст скрипт а то можно запутаться там у меня ) »
Как-то так:
[Setup]
AppName=Моя программа
AppVersion=1.5
DefaultDirName={pf}\Моя программа

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

[CustomMessages]
RU.CompName1=Компонент 1
RU.CompName2=Компонент 2
RU.ComponentsInfo=Наведите курсор мыши на компонент, чтобы прочитать его описание.
RU.CompDesc1=Описание первого компонента
RU.CompDesc2=Описание второго компонента

[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: comp1; Description: "{cm:CompName1}"; Types: full
Name: comp2; Description: "{cm:CompName2}"; Types: full

[ Code]
type
TComponentDesc = record
Description: String;
Index: Integer;
end;

var
CompDescs: array of TComponentDesc;
CompDescPanel: TPanel;
CompDescText: array[1..2] of TLabel;
CompIndex, LastIndex: Integer;


procedure ShowCompDescription(Sender: TObject; X, Y, Index: Integer; Area: TItemArea);
var
i: Integer;
begin
if Index = LastIndex then Exit;
CompIndex := -1;
for i := 0 to GetArrayLength(CompDescs) -1 do
begin
if (CompDescs[i].Index = Index) then
begin
CompIndex := i;
Break;
end;
end;
if (CompIndex >= 0) and (Area = iaItem) then
begin
CompDescText[2].Caption := CompDescs[CompIndex].Description;
CompDescText[2].Enabled := True;
end else
begin
CompDescText[2].Caption := CustomMessage('ComponentsInfo');
CompDescText[2].Enabled := False;
end;
LastIndex := Index;
end;

procedure CompListMouseLeave(Sender: TObject);
begin
CompDescText[2].Caption := CustomMessage('ComponentsInfo');
CompDescText[2].Enabled := False;
LastIndex := -1;
end;

procedure AddCompDescription(AIndex: Integer; ADescription: String; AImageName: String);
var
i: Integer;
begin
i := GetArrayLength(CompDescs);
SetArrayLength(CompDescs, i + 1);
CompDescs[i].Description := ADescription;
CompDescs[i].Index := AIndex - 1
end;

procedure InitializeWizard();
begin
WizardForm.SelectComponentsLabel.Hide;
WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(0), ScaleX(184), ScaleY(205));
WizardForm.ComponentsList.OnItemMouseMove:= @ShowCompDescription;
WizardForm.ComponentsList.OnMouseLeave := @CompListMouseLeave;

CompDescPanel := TPanel.Create(WizardForm);
with CompDescPanel do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(192), ScaleY(125), ScaleX(225), ScaleY(80));
BevelInner := bvLowered;
end;

CompDescText[2] := TLabel.Create(WizardForm);
with CompDescText[2] do
begin
Parent := CompDescPanel;
SetBounds(ScaleX(5), ScaleY(5), CompDescPanel.Width - ScaleX(10), CompDescPanel.Height - ScaleY(10));
AutoSize := False;
WordWrap := True;
Enabled := False;
Caption := CustomMessage('ComponentsInfo');
end;

AddCompDescription(1, CustomMessage('CompDesc1'), 'False');
AddCompDescription(2, CustomMessage('CompDesc2'), 'False');
end;

Возможно ли сделать так, чтобы изначально там стола картинка, а уже при наведении на компонент она заменялась на картинку компонента.
Пробовал ставить через редактор форм (BitmapImage), но тогда картинку просто закрывает, окно для картинок компонентов.
Есть какой-то другой способ? »
Вот так:
[Setup]
AppName=Моя программа
AppVersion=1.5
DefaultDirName={pf}\Моя программа

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

[CustomMessages]
RU.CompName1=Компонент 1
RU.CompName2=Компонент 2
RU.ComponentsInfo=Наведите курсор мыши на компонент, чтобы прочитать его описание.
RU.CompDesc1=Описание первого компонента
RU.CompDesc2=Описание второго компонента

[Files]
Source: "WizModernImage.bmp"; DestName: "CompDescImg1.bmp"; Flags: dontcopy
Source: "WizModernImage-IS.bmp"; DestName: "CompDescImg2.bmp"; Flags: dontcopy
Source: "11.bmp"; DestName: "CompDescImg3.bmp"; Flags: dontcopy

[Types]
Name: full; Description: Full installation; Flags: iscustom

[Components]
Name: comp1; Description: "{cm:CompName1}"; Types: full
Name: comp2; Description: "{cm:CompName2}"; Types: full

[ Code]
type
TComponentDesc = record
Description: String;
ImageName: String;
Index: Integer;
end;

var
CompDescs: array of TComponentDesc;
CompDescPanel, CompDescImgPanel: TPanel;
CompDescText: TLabel;
CompIndex, LastIndex: Integer;
CompDescImg, BitmapImage: TBitmapImage;

procedure ShowCompDescription(Sender: TObject; X, Y, Index: Integer; Area: TItemArea);
var
i: Integer;
begin
if Index = LastIndex then Exit;
CompIndex := -1;
for i := 0 to GetArrayLength(CompDescs) -1 do
begin
if (CompDescs[i].Index = Index) then
begin
CompIndex := i;
Break;
end;
end;
if (CompIndex >= 0) and (Area = iaItem) then
begin
if not FileExists(ExpandConstant('{tmp}\') + CompDescs[CompIndex].ImageName) then
ExtractTemporaryFile(CompDescs[CompIndex].ImageName);
CompDescImg.Bitmap.LoadFromFile(ExpandConstant('{tmp}\') + CompDescs[CompIndex].ImageName);
CompDescImg.Show;
BitmapImage.Hide;
CompDescText.Caption := CompDescs[CompIndex].Description;
CompDescText.Enabled := True;
end else
begin
CompDescText.Caption := CustomMessage('ComponentsInfo');
CompDescText.Enabled := False;
CompDescImg.Hide;
BitmapImage.Show;
end;
LastIndex := Index;

end;

procedure CompListMouseLeave(Sender: TObject);
begin
CompDescImg.Hide;
CompDescText.Caption := CustomMessage('ComponentsInfo');
CompDescText.Enabled := False;
LastIndex := -1;
BitmapImage.Show;
end;

procedure AddCompDescription(AIndex: Integer; ADescription: String; AImageName: String);
var
i: Integer;
begin
i := GetArrayLength(CompDescs);
SetArrayLength(CompDescs, i + 1);
CompDescs[i].Description := ADescription;
CompDescs[i].ImageName := AImageName;
CompDescs[i].Index := AIndex - 1
end;

procedure InitializeWizard();
begin
WizardForm.SelectComponentsLabel.Hide;
WizardForm.TypesCombo.Hide;
WizardForm.ComponentsList.SetBounds(ScaleX(0), ScaleY(0), ScaleX(184), ScaleY(205));
WizardForm.ComponentsList.OnItemMouseMove:= @ShowCompDescription;
WizardForm.ComponentsList.OnMouseLeave := @CompListMouseLeave;

CompDescImgPanel := TPanel.Create(WizardForm);
with CompDescImgPanel do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(192), ScaleY(0), ScaleX(225), ScaleY(120));
BevelInner := bvLowered;
end;

BitmapImage := TBitmapImage.Create(WizardForm);
with BitmapImage do
begin
Parent := CompDescImgPanel;
SetBounds(ScaleX(5), ScaleY(5), CompDescImgPanel.Width - ScaleX(10), CompDescImgPanel.Height - ScaleY(10));
ExtractTemporaryFile('CompDescImg3.bmp');
Bitmap.LoadFromFile(ExpandConstant('{tmp}\CompDescImg3.bmp'));
end;

CompDescImg := TBitmapImage.Create(WizardForm);
with CompDescImg do
begin
Parent := CompDescImgPanel;
SetBounds(ScaleX(5), ScaleY(5), CompDescImgPanel.Width - ScaleX(10), CompDescImgPanel.Height - ScaleY(10));
Stretch := True;
Hide;
end;

CompDescPanel := TPanel.Create(WizardForm);
with CompDescPanel do
begin
Parent := WizardForm.SelectComponentsPage;
SetBounds(ScaleX(192), ScaleY(125), ScaleX(225), ScaleY(80));
BevelInner := bvLowered;
end;

CompDescText := TLabel.Create(WizardForm);
with CompDescText do
begin
Parent := CompDescPanel;
SetBounds(ScaleX(5), ScaleY(5), CompDescPanel.Width - ScaleX(10), CompDescPanel.Height - ScaleY(10));
AutoSize := False;
WordWrap := True;
Enabled := False;
Caption := CustomMessage('ComponentsInfo');
end;

AddCompDescription(1, CustomMessage('CompDesc1'), 'CompDescImg1.bmp');
AddCompDescription(2, CustomMessage('CompDesc2'), 'CompDescImg2.bmp');
end;

Kashtan007
21-05-2014, 14:47
Shift85 и Dodakaedr, спасибо за помощь!)

P.S. Ребята выше писал, но так и не получилось сделать.

Как место серых окон (Inner Notebook и Inner Page) на страницах установщика поставить изображение (фон)?
Буду благодарен за помощь!

Dodakaedr
21-05-2014, 15:56
Как место серых окон (Inner Notebook и Inner Page) на страницах установщика поставить изображение (фон)? »
Для этого вам, наверное, придется полностью скрипт менять....Sample.rar (http://dodakaedr.spaces.ru/files/?r=main%2Fview&Li=690572&Lii=49983951&Link_id=1527333&Lt=1&Read=49983951&Sn=1&sid=::sid::)

Kashtan007
21-05-2014, 16:27
Dodakaedr, спасибо.
А легче способа нету? Вот нашел выглядеть должно примерно так.
http://s019.radikal.ru/i600/1405/c0/85f4546d78c5.png

Dodakaedr
21-05-2014, 18:12
А легче способа нету? »
Я не знаю.

Антон_Мураткин@vk
21-05-2014, 21:45
Доброе время суток! Подскажите в чём ошибка. Это ошибка на музыку появляется. Когда вкл установку игры.

На скрине показывается ошибка. Этот файл есть который на скрине

http://i64.fastpic.ru/big/2014/0521/4e/add14a1f8abf9d7b63640228f444074e.png




© OSzone.net 2001-2012