Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to have an installer with a background image slideshow with an infinite music track playback, you can do e.g. the following: </p> <ul> <li>get the recent version of the <a href="http://www.sherlocksoftware.org/page.php?id=55" rel="nofollow noreferrer"><code>InnoCallback</code></a> library for slideshow timer implementation</li> <li>for music playback get e.g. most recent copy of the <a href="http://code.google.com/p/inno-media-player/wiki/Introduction?tm=6" rel="nofollow noreferrer"><code>Inno Media Player</code></a> for Unicode Inno Setup</li> </ul> <p>Write a script similar to following, or <a href="http://code.google.com/p/projects-stackoverflow-tlama/downloads/detail?name=14615631.ZIP" rel="nofollow noreferrer"><code>download the complete project</code></a>, which includes all necessary files used in the next script code. So the only thing you'd need to do, is to build it in the recent version of Unicode Inno Setup.</p> <p><strong><em>Please note, that Inno Media Player is a Unicode library, and so you can use it only with Unicode versions of Inno Setup, not with ANSI ones! There is no support for ANSI versions of Inno Setup...!</em></strong></p> <pre class="lang-pascal prettyprint-override"><code>[Setup] AppName=My Program AppVersion=1.5 DefaultDirName={pf}\My Program OutputDir=userdocs:Inno Setup Examples Output BackColor=clLime BackColor2=clYellow WindowVisible=yes [Files] Source: "Image1.bmp"; Flags: dontcopy Source: "Image2.bmp"; Flags: dontcopy Source: "AudioFile.mp3"; Flags: dontcopy Source: "MediaPlayer.dll"; Flags: dontcopy Source: "InnoCallback.dll"; Flags: dontcopy [Code] var TimerID: Integer; SlideID: Integer; BackImage: TBitmapImage; const EC_COMPLETE = $01; type TTimerProc = procedure(Wnd: HWND; Msg: UINT; TimerID: UINT_PTR; SysTime: DWORD); TDirectShowEventProc = procedure(EventCode, Param1, Param2: Integer); function WrapTimerProc(Callback: TTimerProc; ParamCount: Integer): LongWord; external 'wrapcallback@files:InnoCallback.dll stdcall'; function SetTimer(hWnd: HWND; nIDEvent, uElapse: UINT; lpTimerFunc: UINT): UINT; external 'SetTimer@user32.dll stdcall'; function KillTimer(hWnd: HWND; uIDEvent: UINT): BOOL; external 'KillTimer@user32.dll stdcall'; function DSGetLastError(var ErrorText: WideString): HRESULT; external 'DSGetLastError@files:mediaplayer.dll stdcall'; function DSPlayMediaFile: Boolean; external 'DSPlayMediaFile@files:mediaplayer.dll stdcall'; function DSStopMediaPlay: Boolean; external 'DSStopMediaPlay@files:mediaplayer.dll stdcall'; function DSSetVolume(Value: LongInt): Boolean; external 'DSSetVolume@files:mediaplayer.dll stdcall'; function DSInitializeAudioFile(FileName: WideString; CallbackProc: TDirectShowEventProc): Boolean; external 'DSInitializeAudioFile@files:mediaplayer.dll stdcall'; procedure OnMediaPlayerEvent(EventCode, Param1, Param2: Integer); begin if EventCode = EC_COMPLETE then begin if DSInitializeAudioFile(ExpandConstant('{tmp}\AudioFile.mp3'), @OnMediaPlayerEvent) then begin DSSetVolume(-2500); DSPlayMediaFile; end; end; end; procedure OnSlideTimer(Wnd: HWND; Msg: UINT; TimerID: UINT_PTR; SysTime: DWORD); begin case SlideID of 0: SlideID := 1; 1: SlideID := 0; end; BackImage.Bitmap.LoadFromFile( ExpandConstant('{tmp}\Image' + IntToStr(SlideID + 1) + '.bmp')); end; procedure StartSlideTimer; var TimerCallback: LongWord; begin TimerCallback := WrapTimerProc(@OnSlideTimer, 4); { third parameter here is the timer's timeout value in milliseconds } TimerID := SetTimer(0, 0, 5000, TimerCallback); end; procedure KillSlideTimer; begin if TimerID &lt;&gt; 0 then begin if KillTimer(0, TimerID) then TimerID := 0; end; end; procedure InitializeWizard; var ErrorCode: HRESULT; ErrorText: WideString; begin TimerID := 0; SlideID := 0; ExtractTemporaryFile('Image1.bmp'); ExtractTemporaryFile('Image2.bmp'); BackImage := TBitmapImage.Create(MainForm); BackImage.Parent := MainForm; BackImage.Top := 70; BackImage.Left := 10; BackImage.AutoSize := True; BackImage.Bitmap.LoadFromFile(ExpandConstant('{tmp}\Image1.bmp')); StartSlideTimer; ExtractTemporaryFile('AudioFile.mp3'); if DSInitializeAudioFile(ExpandConstant('{tmp}\AudioFile.mp3'), @OnMediaPlayerEvent) then begin DSSetVolume(-2500); DSPlayMediaFile; end else begin ErrorCode := DSGetLastError(ErrorText); MsgBox('TDirectShowPlayer error: ' + IntToStr(ErrorCode) + '; ' + ErrorText, mbError, MB_OK); end; end; procedure DeinitializeSetup; begin KillSlideTimer; DSStopMediaPlay; end; </code></pre> <p><strong><em>Further resources:</em></strong></p> <ul> <li><a href="https://stackoverflow.com/q/10130184/960757"><code>How to make a slideshow in InnoSetup ?</code></a></li> <li><a href="https://stackoverflow.com/q/12359859/960757"><code>How to play a sound during InnoSetup installation process ?</code></a></li> </ul>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload