Пользователь
Сообщения: 80
Благодарности: 3
|
Профиль
|
Отправить PM
| Цитировать
APTEM2, кнопка Cancel у Вас 2 раза прописана в коде.
Цитата APTEM2:
Ещё вопрос как в свой инстолятор добавить слайд шоу ????????? »
|
Слайдшоу по процентам установки (из справки)
читать дальше »
Код: 
[Setup]
AppName=My Program
AppVerName=My Program
CreateAppDir=No
WindowVisible=Yes
[Files]
Source: innocallback.dll; DestDir: {tmp}; Flags: dontcopy
Source: pic1.bmp; DestDir: {tmp}; Flags: dontcopy
Source: pic2.bmp; DestDir: {tmp}; Flags: dontcopy
Source: pic3.bmp; DestDir: {tmp}; Flags: dontcopy
[Code
type
TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
BackgroundBitmapImage: TBitmapImage;
TimerID: LongWord;
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';
function GetSystemMetrics(nIndex:Integer):Integer;
external 'GetSystemMetrics@user32.dll stdcall';
procedure InitializeWizard();
begin
ExtractTemporaryFile('pic1.bmp')
ExtractTemporaryFile('pic2.bmp')
ExtractTemporaryFile('pic3.bmp')
end;
function PercentProgress(): Integer;
begin
with WizardForm.ProgressGauge do begin
Result:=(Position-Min)/((Max - Min)/100)
end
end;
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
var
percent: integer;
begin
percent:=PercentProgress
with BackgroundBitmapImage do begin
if ((percent>0) and (percent<33) and (Tag<>1)) then begin
Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\pic1.bmp')
Tag:=1
end else
if ((percent>34) and (percent<66) and (Tag<>2)) then begin
Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\pic2.bmp')
Tag:=2
end else
if ((percent>67) and (percent<100) and (Tag<>3)) then begin
Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\pic3.bmp')
Tag:=3
end
end
end;
procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;
Width, Height: Integer;
begin
If CurPageID=wpInstalling
then
begin
pfunc:=WrapTimerProc(@OnTimer, 4)
TimerID:=SetTimer(0, 0, 500, pfunc)
BackgroundBitmapImage:=TBitmapImage.Create(MainForm)
with BackgroundBitmapImage do begin
BackColor:=clBlack
Center:=True
Align:=alClient
Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\pic1.bmp')
Parent:=MainForm
Tag:=1
end
end
if CurPageID=wpFinished
then
begin
BackgroundBitmapImage.Hide
end
end;
procedure DeinitializeSetup();
begin
KillTimer(0, TimerID)
end;
Полноэкранный рисунок на фоновом окне и полноэкранное слайд-шоу по процентам (из справки):
читать дальше »
Код: 
[Setup]
AppName=My Program
AppVerName=My Program
DefaultDirName=My Program
BackColor=0
[Files]
Source: InnoCallback.dll; DestDir: {tmp}; Flags: dontcopy
Source: BackImage.bmp; DestDir: {tmp}; Flags: dontcopy
Source: 1.bmp; DestDir: {tmp}; Flags: dontcopy
Source: 2.bmp; DestDir: {tmp}; Flags: dontcopy
Source: 3.bmp; DestDir: {tmp}; Flags: dontcopy
[Code
type
TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
BackImage, SlideImage: TBitmapImage;
TimerID: LongWord;
s:string;
Width, Height:Integer;
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';
function GetSystemMetrics(nIndex:Integer):Integer;
external 'GetSystemMetrics@user32.dll stdcall';
procedure InitializeWizard();
begin
WizardForm.Position:=poScreenCenter
Width:=GetSystemMetrics(0)
Height:=GetSystemMetrics(1)
MainForm.BORDERSTYLE:=bsNone
MainForm.Left:=0
MainForm.Top:=0
MainForm.Width:=Width
MainForm.Height:=Height
ExtractTemporaryFile('BackImage.bmp')
s:=ExpandConstant('{tmp}')+'\BackImage.bmp '
BackImage:=TBitmapImage.Create(MainForm)
BackImage.Bitmap.LoadFromFile(s)
BackImage.Align:=alClient
BackImage.Parent:=MainForm
BackImage.Stretch:=True
MainForm.Visible:=True
ExtractTemporaryFile('BackImage.bmp')
ExtractTemporaryFile('1.bmp')
ExtractTemporaryFile('2.bmp')
ExtractTemporaryFile('3.bmp')
end;
function PercentProgress(): Integer;
begin
with WizardForm.ProgressGauge do begin
Result:=(Position-Min)/((Max - Min)/100)
end
end;
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
var
percent: integer;
begin
percent:=PercentProgress
with SlideImage do begin
if ((percent>0) and (percent<10) and (Tag<>1)) then begin
Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\1.bmp')
Tag:=1
end else
if ((percent>11) and (percent<20) and (Tag<>2)) then begin
Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\2.bmp')
Tag:=2
end else
if ((percent>21) and (percent<100) and (Tag<>3)) then begin
Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\3.bmp')
Tag:=3
end
end
end;
procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;
Width, Height: Integer;
begin
If CurPageID=wpInstalling
then
begin
pfunc:=WrapTimerProc(@OnTimer, 4)
TimerID:=SetTimer(0, 0, 500, pfunc)
SlideImage:=TBitmapImage.Create(MainForm)
with SlideImage do begin
Stretch:=True
Align:=alClient
Bitmap.LoadFromFile(ExpandConstant('{tmp}') + '\1.bmp')
Parent:=MainForm
Tag:=1
end
end
if CurPageID=wpFinished
then
begin
SlideImage.Hide
end
end;
procedure DeinitializeSetup();
begin
KillTimer(0, TimerID)
end;
Inno Setup Faq. Слайд-шоу в окне инсталляции
читать дальше »
Код: 
#define TIME_FOR_VIEW 10
[Setup]
AppName=My Program
AppVerName=My Program v 1.5
DefaultDirName={pf}\My Program
[Languages]
Name: russian; MessagesFile: compiler:Languages\Russian.isl
[Files]
Source: InnoCallback.dll; Flags: dontcopy noencryption nocompression solidbreak;
Source: .bmp; Flags: dontcopy noencryption nocompression solidbreak;
Source: D:\Games\StarCraft enGB\StarDat.mpq; DestDir: {app}
[Code
const
n=21; ///количество слайдов
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);
TRandNumbers = array[1..N] of byte;
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';
function get_unique_r andom_number(X:byte):TRandNumbers;
var
A,b,c: string;
i,j,k:byte;
begin
For i:=1 to X do A:=A+chr(i);
B:='';
For i:=1 to X do begin
j:=Random(Length(A)-1)+1;
C:='';
B:=B + A[j];
for k:=1 to Length(A) do
if k<>j then C:=C+A[k];
A:=C;
end;
for i:=1 to X do Result[i]:=ord(B[i]);
end;
var
TimerID: LongWord;
currTime: Integer;
SplashImage: TBitmapImage;
StatusMessages: TNewStaticText;
bmp: TRandNumbers;
z:byte;
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
currTime := currTime + 1;
if (currTime mod {#TIME_FOR_VIEW} = 0)
then begin
SplashImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image_'+ inttostr(bmp[currTime/{#TIME_FOR_VIEW}])+'.bmp'));
if (currTime/{#TIME_FOR_VIEW} = N) then currTime:=0;
end;
end;
procedure InitializeWizard;
begin
bmp:=get_unique_random_number(N);
ExtractTemporaryFile('Image_'+inttostr(bmp[1])+'.bmp');
currTime := 0;
WizardForm.ProgressGauge.Parent := WizardForm;
WizardForm.ProgressGauge.Top := WizardForm.CancelButton.Top + ScaleY (12);
WizardForm.ProgressGauge.Left := ScaleX(10);
WizardForm.ProgressGauge.Width := WizardForm.MainPanel.Width - ScaleX(20);
WizardForm.ProgressGauge.Height := 16;
WizardForm.ProgressGauge.Hide;
WizardForm.StatusLabel.Parent := WizardForm;
WizardForm.StatusLabel.Top := WizardForm.ProgressGauge.Top - ScaleY(18);
WizardForm.StatusLabel.Left := ScaleX(10);
WizardForm.StatusLabel.Width := ScaleX(397);
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_'+inttostr(bmp[1])+'.bmp'));
SplashImage.Hide;
end;
procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssInstall then
begin
WizardForm.StatusLabel.Caption := 'Распаковка слайдов ...';
for z:=2 to N do ExtractTemporaryFile('Image_ '+inttostr(bmp[z])+'.bmp');
end;
end;
procedure CurPageChanged(CurPageID: Integer);
var
pfunc: LongWord;
begin
if (CurPageID = wpInstalling) then
begin
pfunc := WrapTimerProc(@OnTimer, 5);
TimerID := SetTimer(0, 0, 1000, pfunc);
WizardForm.PageNameLabel.Visible := False;
WizardForm.PageNameLabel.Visible := False;
WizardForm.InnerNotebook.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.ProgressGauge.Show;
WizardForm.StatusLabel.Show;
SplashImage.Show;
WizardForm.CancelButton.Enabled := True;
WizardForm.CancelButton.Top := WizardForm< /FONT> .Bevel.Top + ScaleY(100);
end else
begin
WizardForm.ProgressGauge.Hide;
SplashImage.Hide;
WizardForm.FileNameLabel.Hide;
WizardForm.StatusLabel.Hide;
if (CurPageID > wpInstalling) and (CurPageID < wpFinished) then
begin
WizardForm.InnerNotebook.Show;
WizardForm.Bevel1.Show;
WizardForm.MainPanel.Show;
WizardForm.PageNameLabel.Show;
WizardForm.PageNameLabel.Show;
end;
If CurPageID = wpFinished then
end;
end;
procedure DeInitializeSetup();
begin
KillTimer(0, TimerID);
end;
nik1967, напоминаю о своей проблеме.
|