Old 23rd January 2009, 23:20   #1
Anno-Domini
Junior Member
 
Join Date: Jan 2009
Posts: 1
oninit+after

Hey. First off all, I'm pretty new to this whole nsis script thing. Now...I've been modifying the zip2exe classic script and managed pretty well, it does what it's supposed to but I can't get the cosmetics of the installer to work the way I want. What I want is to have a BMP (with an logo) fade in while music starts playing and then have it fade out while the music continues to play throughout the installer as it'll be a long installation. As it is now the music starts playing and then stops as the BMP fades out...

My code looks like this:
Page license
Page instfiles

XPStyle on
ShowInstDetails hide

BrandingText " "

LicenseText "Before continuing the installation process you must read through and accept this installer's license."
LicenseData "${NSISDIR}\Contrib\lala2.txt"
Icon "${NSISDIR}\contrib\lala1.ico"

Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\sound.wav "${NSISDIR}\Contrib\lala3.wav"

; Play the sound or song
StrCpy $0 "$PLUGINSDIR\sound.wav" ; location of the wav file
IntOp $1 "SND_ASYNC" || 1
System::Call 'winmm::PlaySound(t r0, i 0, i r1) b'

File /oname=$PLUGINSDIR\splash.bmp "${NSISDIR}\Contrib\lala4.bmp"

advsplash::show 1000 600 400 -1 $PLUGINSDIR\splash

FunctionEnd


Tryed everything I can think of, please help.
Anno-Domini is offline   Reply With Quote
Old 23rd January 2009, 23:37   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
this code is insane, what is IntOp $1 "SND_ASYNC" || 1 supposed to do? you would also need SND_FILENAME, but you need to use the actual value, or ${SND_FILENAME} if it exists as a define...

Why would you even want to play a long music file? Think of your poor users

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 23rd January 2009, 23:53   #3
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
both Splash and AdvSplash are hardcoded to call PlaySound(0,0,0); and this will abort the playing file even if you did not give it anything to play, you could file a bug report about this if you really care, for now you must start playing the sound AFTER the splash and the code for that would look something like:

System::Call 'winmm::PlaySound(t "C:\WINDOWS\Media\winSpaceSysStart.wav", i 0,i 0x20001)'

(all parameters hardcoded here, replace path ofcourse)

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump