!include "MUI.nsh"

!define APP_NAME "sound_test"
!define SND_NAME "Blues.wma"



Name ${APP_NAME}
OutFile ${APP_NAME}.exe
InstallDir $PROGRAMFILES\${APP_NAME}

SetCompressor lzma
!define MUI_ABORTWARNING
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "English"

; another way
;!define SND_FILENAME    0x00020000
;!define SND_ASYNC           0x0001
;!define SND_LOOP            0x0008
;!define SND_NODEFAULT       0x0002
;System::Call 'winmm.dll::PlaySoundA(t "$PLUGINSDIR\${SND_NAME}", i 0, i SND_FILENAME|SND_NODEFAULT|SND_LOOP|SND_ASYNC) i .R0'

Function .onInit
InitPluginsDir
SetOutPath $PLUGINSDIR
File "${SND_NAME}"
System::Call 'msvfw32.dll::MCIWndCreate(i 0, i 0,i 0x0070, t "$PLUGINSDIR\${SND_NAME}") i .R0'
SendMessage $R0 0x0806 0 0
SendMessage $R0 0x0872 0 1
;System::Call 'user32.dll::ShowWindow(i $R0, i 0)' ; if you want hide mci window
FunctionEnd


;--------------------------------
;Installer Sections
Section "Dummy Section" SecDummy

SectionEnd
