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.CallFunction(_SystemFolder.."\\winmm.dll", "PlaySound", "\"SystemExclamation\",0,65536", DLL_RETURN_TYPE_INTEGER, 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