@ECHO OFF
SETLOCAL EnableDelayedExpansion
:PrepFolders
MKDIR "%PROGRAMFILES%\Evolution Tools"
COPY %~dp0\ndsExt.dll "%PROGRAMFILES%\Evolution Tools\"
:FixRegistry
SET _Continue=no
CLS
ECHO.
ECHO Adding information to the Registry
ECHO.
ECHO This will remove then add some entries relating to .NDS files into your
ECHO Registry. It should be safe as none of the values are system-critical,
ECHO but modifying the registry always carries some risk.
ECHO.
SET /P _Continue=Type "OK" to continue:
IF /I NOT %_Continue%==OK GOTO FixRegistry
%~dp0\ndsExt.reg
:FindEmulators
CLS
ECHO.
ECHO Searching for Emulators, please wait...
ECHO.
ECHO Note: Removable drives can cause an error message to pop up.
ECHO If this happens, simply choose Continue or Ignore to proceede.
SET _Count=0
FOR %%d IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
ÂÂIF EXIST %%d: (
ÂÂÂÂFOR /F "Tokens=* Delims=" %%I IN ('DIR /B /S "%%d:no$gba.exe" 2^>NUL') DO (
ÂÂÂÂÂÂSET /A _Count+=1
ÂÂÂÂÂÂSET _F!_Count!=%%I
ÂÂÂÂÂÂ)
ÂÂÂÂFOR /F "Tokens=* Delims=" %%I IN ('DIR /B /S "%%d:no$zoomer.exe" 2^>NUL') DO (
ÂÂÂÂÂÂSET /A _Count+=1
ÂÂÂÂÂÂSET _F!_Count!=%%I
ÂÂÂÂÂÂ)
ÂÂÂÂFOR /F "Tokens=* Delims=" %%I IN ('DIR /B /S "%%d:desmume.exe" 2^>NUL') DO (
ÂÂÂÂÂÂSET /A _Count+=1
ÂÂÂÂÂÂSET _F!_Count!=%%I
ÂÂÂÂÂÂ)
ÂÂÂÂ)
ÂÂ)
:SelectEmulator
CLS
ECHO.
IF %_Count%==0 ECHO No emulators found.&GOTO ProgramEnd
FOR /L %%I IN (1,1,%_Count%) DO ECHO %%I. !_F%%I!
SET /P _Choice=Please select an Emulator to open NDS files (Press Enter or 0 to exit):
IF "%_Choice%"=="" GOTO SelectEmulator
IF %_Choice%==0 GOTO ProgramEnd
IF %_Choice% GTR %_Count% ECHO Please enter a number between 1 and %_Count%&GOTO SelectEmulator
SET _FileName=!_F%_Choice%!
REG ADD "HKEY_CLASSES_ROOT\CycloEVO.nds\shell\Open\command" /D "\"%_FileName%\" \"%%1\"" /F
:ProgramEnd
ENDLOCAL
PAUSE