@echo off
cls
echo.
echo Installing Diags to drive %1
echo.
echo.

if "%1" == "" goto usage
if NOT EXIST diag.exe goto bad_src

if NOT EXIST \bin\itool.exe goto bad_src
\bin\itool -d %1\diags
if errorlevel 1 md %1\diags
copy *.* %1\diags
if EXIST %1\diags\ata.com del %1\diags\ata.com
if EXIST %1\diags\diag.exe echo Diags installed OK ...
if NOT EXIST %1\diags\diag.exe echo Diags installation failed ...
del %1\diags\install.bat > nul

goto end

:usage
echo.
echo.
echo Usage: INSTALL <target>
echo.
goto end

:bad_src
echo.
echo.
echo Install must be run from the DIAGS directory ...
echo.
goto end

:end
