Попробую тоже вернуться к своему вопросу
Подскажите как объединить вот [more=этот]
#define TIME_FOR_VIEW 15
[Code]
////////////////////////////////////////////////////
{Установка слайдшоу на окне инсталятора}
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
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 InitializeWizard();
begin
///////////////////////////////////////////////////////////
{Изменение окна инсталятора с пермещение прогрессбара}
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;
///////////////////////////////////////////////////////////
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.InnerNotebook.Hide;
WizardForm.Bevel1.Hide;
WizardForm.MainPanel.Hide;
WizardForm.PageNameLabel.Hide;
WizardForm.PageDescriptionLabel.Hide;
WizardForm.ProgressGauge.Show;
SplashImage.Show;
WizardForm.StatusLabel.Show;
WizardForm.CancelButton.Enabled :=True;
end
else
begin
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;
//////////////////////////////////////////////////////////////
end;
[/more] код
с запуском [more=bat-ника]
[Files]
Source: InnoCallback.dll; Flags: dontcopy
Source: test.bat; DestDir: {tmp}; AfterInstall: Unpack(); Flags: ignoreversion
[Code]
type
TProc = procedure(HandleW, msg, idEvent, TimeSys: LongWord);
var
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';
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
with WizardForm.ProgressGauge do
Position:= (Position + 1) mod Max;
end;
procedure Unpack();
var
ResultCode: Integer; pfunc: LongWord;
begin
WizardForm.ProgressGauge.Position:= 0;
WizardForm.ProgressGauge.Max:= 100;
pfunc:= WrapTimerProc(@OnTimer, 4);
TimerID:= SetTimer(0, 0, 50, pfunc);
Exec(ExpandConstant('{tmp}\test.bat'), '', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
[/more], но так, чтобы слайд-шоу после того как начал работать батник не полетело с огромной скоростью, а отрабатывало то время на картинку что ему было задано в первом коде. Понимаю, что что-то надо добавить, но вот что....иль объединить по умному