@echo off

rem Install MinEd

rem Set installation directory
set INSTDIR=%PROGRAMFILES%\MinEd

mkdir "%INSTDIR%\bin"
mkdir "%INSTDIR%\usr\share\locale"

copy mined.txt "%INSTDIR%"
copy minedcyg.txt "%INSTDIR%"

copy mined.exe "%INSTDIR%\bin"
copy cygwin1.dll "%INSTDIR%\bin"
copy mined.hlp "%INSTDIR%\bin"
copy minedmar.bat "%INSTDIR%\bin"
copy mintty.exe "%INSTDIR%\bin"
copy wined.bat "%INSTDIR%\bin"

copy locale.alias "%INSTDIR%\usr\share\locale"

rem Create registry setup script
echo @echo off > "%INSTDIR%\setup.bat"
rem Mind! No space before redirection!
echo set INSTDIR=%INSTDIR%>> "%INSTDIR%\setup.bat"
type setup.b~ >> "%INSTDIR%\setup.bat"

rem Create uninstall script
echo @echo off > "%INSTDIR%\uninst.bat"
rem Mind! No space before redirection!
echo set INSTDIR=%INSTDIR%>> "%INSTDIR%\uninst.bat"
type uninst.b~ >> "%INSTDIR%\uninst.bat"

rem Invoke registry setup
call "%INSTDIR%\setup.bat"

rem End
