Page 1 of 1

Playing Sounds

Posted: Thu Aug 23, 2007 10:59 am
by norad00
Hi,

As horrible as it is management has required that our setup program play a sound when it first starts. I've looked in the software and on these forums but have not found a way to play WAV files. Is this possible? Thanks.

Posted: Thu Aug 23, 2007 12:55 pm
by Alex_Ronquillo
There is no native way in IA to play sounds. However, here is something you can do:

1.- Add your wav file as a support file
2.- Add winmm.dll also as a support file, (This file may be found in the c:\\windows\\system32 folder)
3.- Now include a "Run DLL Function" command in the MSI code with the following characteristics:

DLL Path: $SUPPORTDIR$winmm.dll
Function Name: PlaySound
Parameters:
Type: allocated string buffer, Value: $SUPPORTDIR$filename.wav (replace filename with the name of your wav file)
Type: Long, Value: 0
Type: Long, Value: 1
Return Type must be bool
Return result in variable: any var of your choice

I hope this helps

Posted: Mon Aug 27, 2007 8:45 am
by norad00
Hi,

Thanks for your help. The method you explained works if I modify the DLL Path parameter as follows:

Code: Select all

Set Variable Sys32Path To
Get Common Folder Location System->System Directory into Sys32Path
Call DLL Function $Sys32Path$winmm.dll->PlaySound (get result into variable played)
Thanks again, it works well.

Re: Playing Sounds

Posted: Mon Apr 15, 2013 2:54 pm
by HopXXII
I am sorry, i know that this is an old topic but can you help me:
As I know, winmm.dll can play mp3 too. Please tell me how to play mp3 in InstallAware (wav files ares so big for songs, of course) :)
Thanks

Re: Playing Sounds

Posted: Tue Apr 16, 2013 7:53 am
by FrancescoT
Dear User,

Unfortunately, PlaySound WINAPI not officially supports MP3 media file. It might work by accident on some systems as it uses DirectShow behind the scenes.

I may suggest you to write an external wrapper, using the development language that you prefer, and then calling it from InstallAware (... it could be an EXE or DLL).

Hope this helps you.

Regrads