Skip to content
⌘ NSIS Forum Archive

How can i play a wav.file durning Installation

12 posts

Mic84#

How can i play a wav.file durning Installation

Hi All,

I have a question!
I want to play a wav.file (or other sound file) durning the installation process of my programm

Is this possible?

Thanks!

Mic84
Mic84#
It doesn´t work so good with advsplash!

Can somebody do an example of playing a wav file durning the installation for me ???

Thanks to all!
evilO#
Hi Mic84, and welcome to the forums 🙂

Hum, did you check the AdvSplash readme (Contrib\AdvSplash\advsplash.txt)? There is the following code in it, did you try it?

Function .onInit
SetOutPath $TEMP
File /oname=spltmp.bmp "my_splash.bmp"

; optional
; File /oname=spltmp.wav "my_splashshit.wav"

advsplash::show 1000 600 400 -1 $TEMP\spltmp

Pop $0 ; $0 has '1' if the user closed the splash screen early,
; '0' if everything closed normal, and '-1' if some error occured.

Delete $TEMP\spltmp.bmp
; Delete $TEMP\spltmp.wav
FunctionEnd

evilO/Olive

PS: SummerJam Rocks 😁
Mic84#
Yes i have checked it!

But when i use the version with advsplash there appers a window (with the bmp you choose before) and after that the installation start!

I want that the a wav file plays until the installion is finished!

Thanks all!
Mic84
evilO#
Ooooops, it seems that at the end of the working week I can't even read properly, sorry about that 😛

Well, then to play some music during the whole installation, check the plugin 'BgImage', there is a .txt and a nice example in 'Contrib\BgImage' ..

Hope you'll make it 🙂

evilO/Olive
Takhir#
I did this for anoopparwani 🙂
On XP/2K this should also play mp3.

Are you a developer who uses NSIS to distribute your application? Are you a Winamp plug-in developer who wants to use NSIS to distribute your plug-in? Have suggestions for other people like you? This is the place.


BTW splash plugin not works properly on my comps - no sound at all 🙁
deguix#
I did this for anoopparwani
On XP/2K this should also play mp3.
Hmmmm.... I don't trust much the Windows API's for that purpose. I think it's better using a plugin, like BASS which was said on that thread you linked.

BTW splash plugin not works properly on my comps - no sound at all
You should say your NSIS, Windows versions first. You only need to attach the script if you think it's a script problem, because it should work.

Sincerely, someone should create a Archive page of this issue of playing music. I don't create one because I don't like the Archive at all.
Takhir#
Originally posted by deguix
Hmmmm.... I don't trust much the Windows API's for that purpose. I think it's better using a plugin, like BASS which was said on that thread you linked.

You should say your NSIS, Windows versions first. You only need to attach the script if you think it's a script problem, because it should work.
Looking from my corner Video for Windows Win API is good enough for WAVE files, MSDN declares it's support beginning Win95 🙂

Windows NT: Requires version 3.1 or later.
Windows: Requires Windows 95 or later.
Windows CE: Requires version 2.0 or later.
Header: Declared in mmsystem.h.
Import Library: Use winmm.lib.

mp3 files - this depends... 🙂

Problems with splash plugin were on Win98 SE. Bitmap OK, sound 🙁 And I guess any case plugin for wav file increases installation size only. I tested my script on Win98/W2K/XP and it worked fine. The only problem was with sound file extraction to plugins dir on Win98 (file /oname, cannot open file for write error), but after I did it in 2 lines with SetOutPath this is OK. Regards.
Mic84#
Thank for all evilO!

It works fine with the BgImage!
All i had to do was put this code in the .onInit function:

InitPluginsDir
BgImage::Sound /NOUNLOAD /LOOP "path of the wav file"




PS: Does anybody knows how to remove the label "Nullsoft Install System v2.0" on the bottom of each installation window ???
Is this allowed to do?

Thanks all
Mic84
VegetaSan#
This is the code for it:


BrandingText /TRIMRIGHT "WHAT YOU WANT HERE"
you can also replace /TRIMRIGHT to /TRIMLEFT or /TRIMCENTER