This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- how to add mp3 audio and play in background during installation?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
Aug 06, 2010
11:51 PM
how to add mp3 audio and play in background during installation?
I have an mp3 file I want to loop during installation.
how do I add it and make it play after the user selects the installation path?
i'm looking at the installation designer and don't see where
how do I add it and make it play after the user selects the installation path?
i'm looking at the installation designer and don't see where
(1) Reply
Aug 10, 2010
03:43 PM
Hi There,
There's definitely no support for something like this in InstallShield, other than the ability to write custom actions.
If you've got some familiarity with programming, I whipped this up based on some samples for playing media via Visual C++(although you'll want to take this as an Example, since it's not terribly robust):
[CODE]
#include "Mmsystem.h"
#include "Windows.h"
#include "MSI.h"
#include "MsiQuery.h"
unsigned int __stdcall PlayMMFileUntilMSIDone(MSIHANDLE hInstall)
{
CString sVerb;
DWORD nbuffer;
nbuffer = 255;
TCHAR* filepath = new TCHAR[255];
TCHAR* isFinished = new TCHAR[2];
unsigned int retVal;
retVal = MsiGetProperty(hInstall,_T("SOUNDTRACK"),filepath,&nbuffer);
sVerb = _T("open \"") + (CString)filepath;
sVerb = sVerb + _T("\" type mpegvideo alias MediaFile");
mciSendString(sVerb, NULL, 0, 0);
mciSendString(_T("play MediaFile repeat"), NULL, 0, 0);
while((CString)isFinished!=_T("1"))
{
nbuffer = 255;
retVal = MsiGetProperty(hInstall,_T("SoundtrackFinished"),isFinished,&nbuffer);
Sleep(1000);
}
mciSendString(_T("stop MediaFile"), NULL, 0, 0);
return 0;
}[/CODE]
This works by having you set a property, "SOUNDTRACK" to the path of your *.mp3 file, and then having something else set the "SoundtrackFinished" property to "1" when you want the music to stop.
In my test project I basically just used 2 set property custom actions, and stored the *.mp3 file in the Support Files, so the path it set for SOUNDTRACK was:
[SUPPORTDIR]\Frank Sinatra - Girl from Ipanema.mp3
Hope this helps!
Regards,
Cary
There's definitely no support for something like this in InstallShield, other than the ability to write custom actions.
If you've got some familiarity with programming, I whipped this up based on some samples for playing media via Visual C++(although you'll want to take this as an Example, since it's not terribly robust):
[CODE]
#include "Mmsystem.h"
#include "Windows.h"
#include "MSI.h"
#include "MsiQuery.h"
unsigned int __stdcall PlayMMFileUntilMSIDone(MSIHANDLE hInstall)
{
CString sVerb;
DWORD nbuffer;
nbuffer = 255;
TCHAR* filepath = new TCHAR[255];
TCHAR* isFinished = new TCHAR[2];
unsigned int retVal;
retVal = MsiGetProperty(hInstall,_T("SOUNDTRACK"),filepath,&nbuffer);
sVerb = _T("open \"") + (CString)filepath;
sVerb = sVerb + _T("\" type mpegvideo alias MediaFile");
mciSendString(sVerb, NULL, 0, 0);
mciSendString(_T("play MediaFile repeat"), NULL, 0, 0);
while((CString)isFinished!=_T("1"))
{
nbuffer = 255;
retVal = MsiGetProperty(hInstall,_T("SoundtrackFinished"),isFinished,&nbuffer);
Sleep(1000);
}
mciSendString(_T("stop MediaFile"), NULL, 0, 0);
return 0;
}[/CODE]
This works by having you set a property, "SOUNDTRACK" to the path of your *.mp3 file, and then having something else set the "SoundtrackFinished" property to "1" when you want the music to stop.
In my test project I basically just used 2 set property custom actions, and stored the *.mp3 file in the Support Files, so the path it set for SOUNDTRACK was:
[SUPPORTDIR]\Frank Sinatra - Girl from Ipanema.mp3
Hope this helps!
Regards,
Cary