# Mabinogiの設置ディレクトリを取得
var MABIDIR
!define MABIDIR $MABIDIR
var MABI_TYPE
!define MABI_TYPE $MABI_TYPE
!macro DETECT_MABIDIR
	Banner::show $(Detect_Mabinogi)
	${IF} ${FileExists} "$INSTDIR\MabiAssist.ini"
		ReadINIStr $MABIDIR "$INSTDIR\MabiAssist.ini" MabiAssist MabinogiDir
	${ELSE}
		; default
		ReadRegStr $MABIDIR HKCU "Software\Nexon\Mabinogi" ""
		${IfNot} $MABIDIR == ""
			StrCpy $MABI_TYPE 'Default'
			goto MABIDIR_OK
		${EndIf}

		; Hangame
		ReadRegStr $MABIDIR HKCU "Software\Nexon\Mabinogi_hangame" ""
		${IfNot} $MABIDIR == ""
			StrCpy $MABI_TYPE 'Hangame'
			goto MABIDIR_OK
		${EndIf}

		; Test
		ReadRegStr $MABIDIR HKCU "Software\Nexon\Mabinogi_test" ""
		${IfNot} $MABIDIR == ""
			StrCpy $MABI_TYPE 'Test'
			goto MABIDIR_OK
		${EndIf}
	${EndIf}

	${If} $MABIDIR == ""
		MessageBox MB_YESNO $(Error_Detect_Mabinogi) IDYES MABIDIR_OK
		Abort
	${EndIf}

	MABIDIR_OK:
	Banner::destroy
!macroend