Archive: Play a wav file while setup


Play a wav file while setup
Hy how can I play a .wav file while setup ? I use modern ui Menu


Use the BgImage plugin.
See NSIS\Contrib\BgImage folder.

-Stu


This is possible without plug-in, for example


!define SND_NAME "windows.wav"
InitPluginsDir
SetOutPath $PLUGINSDIR
File "${SND_NAME}"
System::Call 'winmm.dll::PlaySound(t "$PLUGINSDIR\${SND_NAME}", i 0, i 0x0002000b) i .r0'

PlaySound supports wav files, or see attached script sample - this plays mp3 as well.

That example uses System plugin, which contradicts the idea that it works without a plugin.


Oups :)


If I use the BGImage code, I always get an error about the language file. How do I get around that?


Well we need more information (a script) to help you with that. Are you usine !insertmacro MUI_LANGUAGE English after your page declarations (or at all?)

-Stu


I basically built the script I'm using from the wizard in HM NIS Edit 2.0.3 and added in the AdvancedSplash example at the beginning. The AdvSplash example starts with Function .onInit, and so does the BGImage one. When I try to compile the script with both examples in it, it gives me an error that the Function .onInit is already in use.

After the definitions, I'm using the
!insertmacro MUI_PAGE_WELCOME. It was put there from the wizard, and as a new user, I didn't understand enough about how this worked to change anything. So far, I've just added stuff from examples, but I have a better understanding of everything.

I think I've attached my script correctly (maybe not...). Thank you for your help!


I couldn't find any reference to BGImage in that script, but are you using it before or after MUI_LANGUAGE English.

-Stu


Sorry, I had taken out the BGImage part to get it to work right. I had BGImage in front of the MUI_LANGUAGE_ENGLISH.
The file with how I saw to use it is attached now.


Sorry
Correction: Here's the correct file. I made a couple of changes..