Archive: how to add music throughout the installation program?


how to add music throughout the installation program?
I know how to add music during the splash screen period.

I want to know how to add music during the whole installation process

thanx :)


http://forums.winamp.com/showthread....hreadid=169817


ok how do u convert a .wma or .mp3 file to .mod?


Lots of audio conversion utilities can be found here.


Looking from my corner MCIWndCreate() MCIWndPlay() MCIWndStop() MCIWndDestroy() Win32 API calls via system plugin is a good way too (compare with using bassmod.dll). Some problems with mp3 files on old Windows versions may occur. While NSIS installer uses a set of dialog windows, it would be better to use 'parent' MCI window /MCIWndCreate(NULL,...)/ and hide it if need. This can also play avi files :)
In one of my apps I had to re-write and add compact mp3 decoder for Win95 compatibility - customer request :-((.


ok i was wondering, can i use BASSWMA 2.0 ? As the file i want to play is a .WMA

* my prog will be used on xp systems only


Yes, but you need the original BASS.dll plugin to work, as the BASSWMA.dll plugin is an add-on plugin.


ok im so confused with all that was written on the other topic that i dont know what to do.

cud someone explain to me what n how do i go about playing a mp3, or wma file when the installer is running n what files do i need n where to place them.

or if someone cud zip them all up n give them to me as im not really good at this

I would really appreciate it thanx :)


theres one more thing, I think NSIS has this plug-in already. have a look at this directory : C:\Program Files\NSIS\Contrib\BgImage

read the BgImage.txt or Example.nsi

so does it play music when the installer program is running?

n which part of that code do i exactly have to copy on to my script?

thanx :)


can someone help me with my installer? as im having problems compiling it apart from the music thing as i havent added it to my script yet.

I really need someones help here. If someone would like to help me pls pm me so i can give u my msn id


This forum is not a script writing service, you can post specific questions.


where did u read i asked someone to make a acript for me. All of them were questions and whether someone could tell me how to go about it. I already have the script ready except for the plug-in parts. And get rid of your tone, It sucks.

Can someone tell me whether the BgImage plugin that comes with NSIS has the abilty to play music during the installation process?


Why not read the documentation, I'm sure it covers all your questions. If not search the forum or the archive, I'm sure someone else has done it.

Wouldn't playing music in the background of an install make the install painfully slow and annoying?


I did read the documentation, and i still wasnt sure whether it would do that. That why i asked about it.

how slow wud it make the installation process? I dont think it will be much


I'm now trying to make a .wma example.


Originally posted by anoopparwani
where did u read i asked someone to make a acript for me (..)
I mean that you have to attach script examples of what you have tried and the problems you have.

I'm only trying to keep the forums a bit clean and useful. If you post specific questions in the forum everyone can help and find the results later. That way it also helps other people with similar questions. That is also the reason why you should post in the forum instead of asking people for e-mail addresses etc.

I think you can imagine how much time it takes us to write all this software for free, all we ask in return is that you follow a few basic forum rules.

It's here. As I said, it requires BASS.dll, BASSWMA.dll, and the plugin to call those which is the System plugin. I didn't post a .wma because I only have huge files. The usage is simple, replace "music.wma" with another music file. I put a Sleep command to make the music play for 20 seconds. I activated the looping (see ${BASS_SAMPLE_LOOP}), if you want to disable it, just remove it:


I apologize, sorry :)

well i got the music thing set up now. so thats not a problem.

now what i want to do is add more install options like full, mini, standard, basic which will have different components selected. How do i add them to the script without having to go through the wizard?

whats the difference in quality between a .mod file n the other normal formats like mp3, wma, etc


now what i want to do is add more install options like full, mini, standard, basic which will have different components selected. How do i add them to the script without having to go through the wizard?
For adding install types you can use InstType outside of Functions and Sections. Now about what selections will be selected by each install type, you can use the command SectionIn and put in the parameter insttype_index the indexes of the install types you want the section to be included in (i.e. SectionIn 1 2 3). The indexes are the order of installer types.

[EDITED]
whats the difference in quality between a .mod file n the other normal formats like mp3, wma, etc
MOD music has a reduced size compared to other types. But it has a number of defined pitches (like playing a instrument) limiting the possibilities of making some varieties of songs. The quality is not as good as other types of files also.[/EDITED]

cool thanx. will try that out :)


Following script (2 lines only) works fine on my W2K server. On installer end, MCI window auto-closes (or use MCIWndDestroy if need). Try to add ShowWindow(HIDE). And MCIWndSetRepeat(true) - please note, this is macro, use SendMessage like I did it with MCIWndPlay(). See MSDN for details.
yo-a-o_(fight_song_of_the_brunnen-g).mp3

!include "MUI.nsh"

!define APP_NAME "sound_test"
Name ${APP_NAME}
OutFile ${APP_NAME}.exe
InstallDir $PROGRAMFILES\${APP_NAME}
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"


;!macro MUI_CUSTOMFUNCTION_GUIINIT
;!macroend

Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\yo-a-o.mp3 yo-a-o.mp3
System::Call 'msvfw32.dll::MCIWndCreate(i 0, i 0,i 0x0070, t "$PLUGINSDIR\yo-a-o.mp3") i .R0'
SendMessage $R0 0x0806 0 0
FunctionEnd

;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy

SectionEnd


Is there a way to cover the taskbar when the installation has an outer background? It leaves the taskbar on top. I would like the installer to cover the taskbar.


how do u go about changing the way u accept the license part of the installer?

and which is the best compression?


ive been having problems compiling the script due to the license page n the language files.

do the text files used for the license page have to have any special header?

this is the error i get when compiling :

NSIS Modern User Interface version 1.69 - © 2002-2004 Joost Verburg (C:\Program Files\NSIS\Contrib\Modern UI\System.nsh:11)
!define: "MUI_VERBOSE"="3"
!include: closed: "C:\Program Files\NSIS\Contrib\Modern UI\System.nsh"
!include: closed: "C:\Program Files\NSIS\Include\MUI.nsh"
!define: "MUI_ABORTWARNING"=""
!insertmacro: MUI_PAGE_WELCOME
!insertmacro: end of MUI_PAGE_WELCOME
!insertmacro: MUI_PAGE_LICENSE
LicenseData: open failed "data\app.txt"
Usage: LicenseData local_file_that_has_license_text | license_lang_string
Error in macro MUI_PAGE_LICENSE on macroline 21
Error in script "stdin" on line 103 -- aborting creation process
I get this lanuguage error when i disable the license page n reaches the language part :

!insertmacro: end of MUI_UNPAGE_INSTFILES
!insertmacro: MUI_LANGUAGE
File: "data\wizard.jpg" -> no files found.
Usage: File [/nonfatal] [/a] ([/r] filespec [...]|/oname=outfile one_file_only)
Error in macro MUI_WELCOMEFINISHPAGE_INIT on macroline 5
Error in macro MUI_GUIINIT on macroline 2
Error in macro MUI_FUNCTION_GUIINIT on macroline 4
Error in macro MUI_INSERT on macroline 11
Error in macro MUI_LANGUAGEFILE_BEGIN on macroline 4
!include: error in script: "C:\Program Files\NSIS\Contrib\Modern UI\Language files\English.nsh" on line 9
Error in macro MUI_LANGUAGE on macroline 5
Error in script "stdin" on line 115 -- aborting creation process
ive attached my .nsi file incase something is wrong with that.

somebody help me plss


Read the error messages:

LicenseData: open failed "data\app.txt"
File: "data\wizard.jpg" -> no files found.

ok thats fixed. i had to keep the license file name "license.txt" it wouldnt work otherwise. and by fixing that, the language errors also disappeared.

now i have a new problem

IfFileExists: "$WINDIR\ServicePackFiles\i386\$R2" ? 0 : upgradefile.next1_400.6
CopyFiles: "$TEMP\SysFiles\$R2" -> "$WINDIR\ServicePackFiles\i386\", size=0KB
IfFileExists: "$SYSDIR\dllcache\$R2" ? 0 : upgradefile.next2_400.6
CopyFiles: "$TEMP\SysFiles\$R2" -> "$SYSDIR\dllcache\", size=0KB
CopyFiles: "$TEMP\SysFiles\$R2" -> "$R1\", size=0KB
Delete: /REBOOTOK "$R1\$R2.SysFile.tmp"
Delete: "$TEMP\SysFiles\$R2"
!undef: "UPGRADEFILE_UNIQUE"
Push: $R0
Push: $R1
Push: $R2
!insertmacro: end of UpgradeFile
SectionEnd
SubSection Misc CPL Files ->(MiscCPL)
Section: "Adobe Gamma" ->(AdobeGamma)
!insertmacro: UpgradeFile
!insertmacro: macro "UpgradeFile" requires 3 parameter(s), passed 4!
Error in script "stdin" on line 412 -- aborting creation process

Read the error message.


!insertmacro: macro "UpgradeFile" requires 3 parameter(s), passed 4!

i dont understnd it :confused:

I didnt even understand the previous one where the .txt file name had to be named license.txt n no other. All it said was "open failed "data\app.txt"

but as i was trying with different file names n named it license.txt. surprisingly, it worked


It says it needs 3 parameters and that you've passed 4. Go to the line mentioned, make it 3 parameters.

As for the previous error, it said it couldn't open data\app.txt. That usually means it can't find the file.


whats a parameter?

this is the part in the script :

Section "Adobe Gamma" AdobeGamma
!insertmacro UpgradeFile "files\cpl\optional" adobe gamma.cpl "$ProgramFiles\Common Files\Adobe\Calibration"
SectionEnd


!insertmacro UpgradeFile "files\cpl\optional" adobe gamma.cpl "$ProgramFiles\Common Files\Adobe\Calibration"
^ command ^ macro ^ 1st parameter ^ 2nd ^ 3rd ^ 4th

damn.. that file is named as "adobe gamma.cpl" if i remove the space between it, it wont have any effect on the users comp when its installed. The file name has to be"adobe gamma.cpl"

how do i solve this problem?


The fourth parameter, which should be the thrid, also has spaces. To avoid it being treated as two parameters, you've quoted it. Do the same for the second parameter.


is this how it should be ?

!insertmacro UpgradeFile "files\cpl\optional\adobe gamma.cpl" "$ProgramFiles\Common Files\Adobe\Calibration"

Have you tried compiling it?

Now you have just 2 parameters. It still needs 3.

You should read the UpgradeDLL documentation again. Even after the parameters separation will be sorted out, the parameters' values will not be right.


so trying to add this file is useless?


No, that's not what I said. I said you should read UpgradeDLL's documentation again because the parameters are wrong.


ok will read that.

I have a few more questions

how do i make the components page have the description window at the bottom?

and how do i make the installer page have the "check box" agree style?

n my installer has come out to be 92 MB without the adobegamma.cpl

how do i make it compress more? i really need to compress this as low as possible. I know the installer has quite a few methods of compression. which is the best? and how do i make it use it?


All of your questions can be answered by a short forum search. The first and third questions were just recently discussed. The second questions was probably discussed sometime ago, and if not, there is always the documentation.


Archive: how to add music throughout the installation program?


i still havent found .wma/.mp3 to .mod/.xm converter

ive tried cdmaster from the link posted above. but that just converts .mod to mp3/wav

I need one that does the opposite.

anyone know of one?


is there no such converter??


What does this have to do with NSIS?


I don't know what converter u need for wma file.
1. Load attached script sound.nsi
2. Change wma file name in !define SND_NAME "Blues.wma"
3. Compile script
4. Run sound_test.exe
5. Update your script
6. Have fun


Originally posted by anoopparwani
is there no such converter??
no. next time try google, as this is nsis unrelated.

ive tried google. the reason y i want that is im using music in my installer n the script uses .mod\.xm etc type files.

i need help on this last thing :
ive added a custom page with this code :

PageEx license
Caption "Readme"
LicenseData "files\extra\readme.txt"
LicenseText "Read Me File" "Next >"
LicenseForceSelection off
PageExEnd
now the thing with this is, the header and sub header shows the license agreement header n sub header.

how do i change the header n sub header with the code ive used.

these commands dont work with it :



!define MUI_PAGE_HEADER_TEXT "Read Me"
!define MUI_PAGE_HEADER_SUBTEXT "Please review the Read Me before proceeding.

Now I can catch it, you're saying about converting that script that Takhir gave you to be .mod playable. There was an example on that older thread about .mod music some script examples which played .mod/.xm music. Give a search and you'll find what you want.


lol no. i want a real music format .mp3/.wav to .mod/.xm conveter/encoder.

and anyone know the header n sub header command for the custom page script ive used ?