#Define SlideShow
#Define Time = "3000"
#define GameName "Slides"
#define Publisher "Publisher"
#define GameExe "GameExe.exe"
[Setup]
AppName={#GameName}
AppVerName={#GameName}
AppPublisher={#Publisher}
DefaultDirName={pf}\{#GameName}
DefaultGroupName={#GameName}
[Languages]
Name: "default"; MessagesFile: "compiler:Default.isl"
[Icons]
Name: "{commondesktop}\{#GameName}"; Filename: "{app}\{#GameExe}";
[UninstallDelete]
Type: filesandordirs; Name: {app}
[Files]
#ifdef SlideShow
Source: Slides\isSlideShow.dll; DestDir: {tmp}; Flags: dontcopy
Source: Slides\*.jpg; DestDir: {tmp}; Flags: dontcopy
#endif
[ Code]
#ifdef SlideShow
var
TimerID: LongWord;
CurrentPicture:integer;
PicList: TStringlist;
#endif
#ifdef SlideShow
Type
TProc=procedure(HandleW, msg, idEvent, TimeSys: LongWord);
#endif
#ifdef SlideShow
function WrapTimeCallback(Callback:TProc; NumParam:integer): longword; external 'WrapCallback@files:isslideshow.dll stdcall';
function GetSystemMetrics(nIndex:Integer):Integer; external '
[email protected] stdcall';
procedure InitializeSlideShow(Hwnd:Thandle; l,t,w,h:integer;Animate:boolean; Stretch:integer); external 'InitializeSlideShow@files:isslideshow.dll stdcall';
procedure DeinitializeSlideShow; external 'DeinitializeSlideShow@files:isslideshow.dll stdcall';
procedure ShowImage(ipath:PAnsiChar; Effect:integer; SpeedTransition: integer); external 'ShowImage@files:isslideshow.dll stdcall';
function SetTimer(hWnd, nIDEvent, uElapse, lpTimerFunc: LongWord): longword; external '
[email protected] stdcall';
function KillTimer(hWnd, nIDEvent: LongWord): LongWord; external '
[email protected] stdcall';
#endif
#ifdef SlideShow
procedure OnTimer(HandleW, msg, idEvent, TimeSys: LongWord);
begin
CurrentPicture:=CurrentPicture+1;
if CurrentPicture=piclist.count+1 then CurrentPicture:=1;
ShowImage(piclist.strings[CurrentPicture - 1], 2, 1000);
end;
#endif
procedure InitializeWizard();
begin
#ifdef SlideShow
PicList:=tstringlist.Create;
ExtractTemporaryFile('1.jpg');
ExtractTemporaryFile('2.jpg');
ExtractTemporaryFile('3.jpg');
ExtractTemporaryFile('4.jpg');
ExtractTemporaryFile('5.jpg');
piclist.add(ExpandConstant('{tmp}') + '\1.jpg');
piclist.add(ExpandConstant('{tmp}') + '\2.jpg');
piclist.add(ExpandConstant('{tmp}') + '\3.jpg');
piclist.add(ExpandConstant('{tmp}') + '\4.jpg');
piclist.add(ExpandConstant('{tmp}') + '\5.jpg');
#endif
end;
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageID of
wpWelcome:
begin
#ifdef SlideShow
InitializeSlideShow(WizardForm.Handle, 0, 0, WizardForm.ClientWidth, WizardForm.ClientHeight, true, 2);
CurrentPicture:=1;
ShowImage(piclist.strings[CurrentPicture-1], 1, 1000);
TimerID:=SetTimer(0, 0, {#Time}, WrapTimeCallback(@OnTimer, 4));
#endif
end;
wpFinished:
begin
#ifdef SlideShow
KillTimer(0, TimerID);
DeinitializeSlideShow;
#endif
end;
end;
end;
procedure DeinitializeSetup();
begin
#ifdef SlideShow
DeinitializeSlideShow;
KillTimer(0, TimerID);
#endif
end;
procedure CancelButtonClick(CurPageID: Integer;
var Cancel, Confirm: Boolean);
begin
Confirm:=False;
#ifdef SlideShow
DeinitializeSlideShow;
KillTimer(0, TimerID);
#endif
end;