cd n2pkvld
del .\lib\i386\n2pkvld.sys
build -c
if not exist .\lib\i386\n2pkvld.sys goto error
copy .\lib\i386\n2pkvld.sys "..\CurrentVersion"

cd ..\n2pkv5vld
del .\lib\i386\n2pkv5vld.sys
build -c
if not exist .\lib\i386\n2pkv5vld.sys goto error
copy .\lib\i386\n2pkv5vld.sys "..\CurrentVersion"

cd ..\n2pkv5vld500
del .\lib\i386\n2pkv5vld500.sys
build -c
if not exist .\lib\i386\n2pkv5vld500.sys goto error
copy .\lib\i386\n2pkv5vld500.sys "..\CurrentVersion"

cd ..\n2pkvld500
del .\lib\i386\n2pkvld500.sys
build -c
if not exist .\lib\i386\n2pkvld500.sys goto error
copy .\lib\i386\n2pkvld500.sys "..\CurrentVersion"
cd ..

del catalog\n2pkvld.cat
del catalog\n2pkv5vld.cat
del catalog\n2pkv5vld500.cat
del catalog\n2pkvld500.cat
cd catalog
call makecat.bat
cd ..
if not exist .\catalog\n2pkvld.cat goto error
if not exist .\catalog\n2pkv5vld.cat goto error
if not exist .\catalog\n2pkv5vld500.cat goto error
if not exist .\catalog\n2pkvld500.cat goto error
copy catalog\n2pkvld.cat ".\CurrentVersion"
copy catalog\n2pkv5vld.cat ".\CurrentVersion"
copy catalog\n2pkv5vld500.cat ".\CurrentVersion"
copy catalog\n2pkvld500.cat ".\CurrentVersion"
echo build succeeded
goto end
:error
echo build failed
:end
