@echo off

echo.
echo _______________________________                              
echo.                               
echo      VERTRIX INSTALLATION     
echo _______________________________ 
echo.                              
echo    Syntax  : install [drive]  
echo    Example : install c        
echo _______________________________  

if not exist %1:\nul goto fin 

echo.
echo    Installation on the drive %1: 
goto debut

:debut
echo.
echo    Appuyez sur [1] Avec un fichier Auto-Extractible VXARCHV.EXE.
echo                [2] Si le jeu est d‚j… d‚compress‚.
echo                [3] Annuler l'installation.
echo.
echo           Type [1] With a Self-Extractible-File VXARCHV.EXE.
echo                [2] If the game is already decompressed.
echo                [3] Cancel the installation.
echo.
choice /C:123 /T:1,99 Your choice please : 

if errorlevel 3 goto fin
if errorlevel 2 goto methode2
if errorlevel 1 goto methode1
goto debut

:methode2

if exist %1:\vertrix\nul goto erreur1
md %1:\vertrix 
if not errorlevel 0 goto erreur
copy *.* %1:\vertrix
if not errorlevel 0 goto erreur
cd %1:\vertrix
if not errorlevel 0 goto erreur
%1:
if not errorlevel 0 goto erreur
attrib -r *.*
if not errorlevel 0 goto erreur 
goto ok

:methode1

if exist %1:\vertrix\nul goto erreur1
md %1:\vertrix 
if not errorlevel 0 goto erreur
if not exist .\vxarchv.exe goto erreur2
copy vxarchv.exe %1:\vertrix
if not errorlevel 0 goto erreur
cd %1:\vertrix
if not errorlevel 0 goto erreur
%1:
if not errorlevel 0 goto erreur
%1:\vertrix\vxarchv.exe
if not errorlevel 0 goto erreur
attrib -r %1:\vertrix\vxarchv.exe
if not errorlevel 0 goto erreur
del %1:\vertrix\vxarchv.exe
if not errorlevel 0 goto erreur
goto ok

:ok

echo.
echo  Installation done.
echo.
echo  Now, run Setup.bat
echo.                               
echo _______________________________        
echo.
echo.

goto fin

:erreur
echo.
echo ERROR DURING THE INSTALLATION.
echo.         
goto fin

:erreur1
echo.
echo ERROR : VERTRIX DIRECTORY ALREADY EXISTS !.
echo.         
goto fin


:erreur2
echo.
echo ERROR : I NEED THE FILE VXARCHV.EXE TO INSTALL THE GAME !.
echo.         
goto fin

:fin
