


@if not "%~1"=="-n"  (perl install/install_perl_modules_for_mpmasql_windows.pl %*)


set bindir=%cd%\bin
set libdir=%cd%\lib\mpmasql\
set moddir=%cd%\lib\mpmasql\modules



@ECHO OFF
REM usage: append_user_path "path" (permanent for user but not in this cmd session)
SET Key="HKCU\Environment"
FOR /F "usebackq tokens=2*" %%A IN (`REG QUERY %Key% /v PATH`) DO Set CurrPath=%%B
ECHO %CurrPath% > user_path_bak.txt
SETX PATH "%bindir%";"%CurrPath%"

REM set also for this cmd session
@set PATH=%bindir%;%PATH%


@echo @chcp 65001 > %bindir%\mpmasql4.bat
@echo @perl -I %moddir% %libdir%\mpmasql4.pl %%*  >> %bindir%\mpmasql4.bat

@echo @chcp 65001 > %bindir%\mpmasql.bat
@echo @perl -I %moddir% %libdir%\mpmasql4.pl %%*  >> %bindir%\mpmasql.bat

@echo @chcp 65001 > %bindir%\mqlmatrix.bat
@echo @perl -I %moddir% %libdir%\RecheckMatrix.pl %%*  >> %bindir%\mqlmatrix.bat

@echo @chcp 65001 > %bindir%\test_mpmas.bat
@echo @perl -I %moddir% %libdir%\test_mpmas.pl %%*  >> %bindir%\test_mpmas.bat
