Playing Sounds

Got a problem you cannot solve? Try here.
Post Reply
norad00
Posts: 8
Joined: Fri May 18, 2007 12:34 pm

Playing Sounds

Post 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.
Alex_Ronquillo
Site Admin
Posts: 364
Joined: Mon Jul 30, 2007 11:51 am
Location: USA
Contact:

Post 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
Alejandro Ronquillo
InstallAware
Home of The Next Generation MSI Installer
Get your free copy today - http://www.installaware.com/
norad00
Posts: 8
Joined: Fri May 18, 2007 12:34 pm

Post 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.
HopXXII
Posts: 1
Joined: Wed Apr 10, 2013 3:51 pm
Location: Czech Republic
Contact:

Re: Playing Sounds

Post 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
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Playing Sounds

Post 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
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply