Announcement

Collapse
No announcement yet.

How to play a sound in Setup Factory?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to play a sound in Setup Factory?

    Question
    How can I play a system sound to get the user's attention?

    Answer
    You can use the PlaySound function, found in winmm.dll, to play the configured system sounds.

    To play the "Exclamation" sound when displaying a certain screen in your installer, you can use Lua code like this in the On Preload script:
    Code:
    DLL[COLOR="#FF0000"].[/COLOR]CallFunction(_SystemFolder[COLOR="#FF0000"]..[/COLOR][COLOR="#800080"]"[COLOR="#800080"]\\[/COLOR]winmm.dll"[/COLOR][COLOR="#FF0000"],[/COLOR] [COLOR="#800080"]"PlaySound"[/COLOR][COLOR="#FF0000"],[/COLOR] [COLOR="#800080"]"[COLOR="#800080"]\"[/COLOR]SystemExclamation[COLOR="#800080"]\"[/COLOR],0,65536"[/COLOR][COLOR="#FF0000"],[/COLOR] DLL_RETURN_TYPE_INTEGER[COLOR="#FF0000"],[/COLOR] DLL_CALL_STDCALL);
    The attached sample project for Setup Factory 9 shows how to play a system sound.

    Click image for larger version

Name:	SNAP-2011-05-30-01.png
Views:	1
Size:	66.5 KB
ID:	288124
    Last edited by Ulrich; 05-30-2011, 02:29 PM.
Working...
X