@echo off

if "%1" == "" goto erd
if "%1" == "c" goto c
if "%1" == "d" goto c
if "%1" == "e" goto c
if "%1" == "f" goto c
if "%1" == "g" goto c
if "%1" == "h" goto c
if "%1" == "i" goto c
if "%1" == "j" goto c
if "%1" == "k" goto c
if "%1" == "l" goto c
if "%1" == "m" goto c
if "%1" == "n" goto c
if "%1" == "o" goto c
if "%1" == "p" goto c
if "%1" == "q" goto c
if "%1" == "r" goto c
if "%1" == "s" goto c
if "%1" == "t" goto c
if "%1" == "u" goto c
if "%1" == "v" goto c
if "%1" == "x" goto c
if "%1" == "y" goto c
if "%1" == "z" goto c
if "%1" == "C" goto c
if "%1" == "D" goto c
if "%1" == "E" goto c
if "%1" == "F" goto c
if "%1" == "G" goto c
if "%1" == "H" goto c
if "%1" == "I" goto c
if "%1" == "J" goto c
if "%1" == "K" goto c
if "%1" == "L" goto c
if "%1" == "M" goto c
if "%1" == "N" goto c
if "%1" == "O" goto c
if "%1" == "P" goto c
if "%1" == "Q" goto c
if "%1" == "R" goto c
if "%1" == "S" goto c
if "%1" == "T" goto c
if "%1" == "U" goto c
if "%1" == "V" goto c
if "%1" == "X" goto c
if "%1" == "Y" goto c
if "%1" == "Z" goto c

:c

if "%2" == "" goto erd
if "%2" == "c" goto cc
if "%2" == "d" goto cc
if "%2" == "e" goto cc
if "%2" == "f" goto cc
if "%2" == "g" goto cc
if "%2" == "h" goto cc
if "%2" == "i" goto cc
if "%2" == "j" goto cc
if "%2" == "k" goto cc
if "%2" == "l" goto cc
if "%2" == "m" goto cc
if "%2" == "n" goto cc
if "%2" == "o" goto cc
if "%2" == "p" goto cc
if "%2" == "q" goto cc
if "%2" == "r" goto cc
if "%2" == "s" goto cc
if "%2" == "t" goto cc
if "%2" == "u" goto cc
if "%2" == "v" goto cc
if "%2" == "x" goto cc
if "%2" == "y" goto cc
if "%2" == "z" goto cc
if "%2" == "C" goto cc
if "%2" == "D" goto cc
if "%2" == "E" goto cc
if "%2" == "F" goto cc
if "%2" == "G" goto cc
if "%2" == "H" goto cc
if "%2" == "I" goto cc
if "%2" == "J" goto cc
if "%2" == "K" goto cc
if "%2" == "L" goto cc
if "%2" == "M" goto cc
if "%2" == "N" goto cc
if "%2" == "O" goto cc
if "%2" == "P" goto cc
if "%2" == "Q" goto cc
if "%2" == "R" goto cc
if "%2" == "S" goto cc
if "%2" == "T" goto cc
if "%2" == "U" goto cc
if "%2" == "V" goto cc
if "%2" == "X" goto cc
if "%2" == "Y" goto cc
if "%2" == "Z" goto cc
                      

:erd
echo Introduceti discurile sursa(de pe care)/destinatie(pe care)
echo se face instalarea (de ex: D C )!
goto end1

:cc
choice /c:dn Exista instalat Internet Explorer 4.x sau mai recent?
if errorlevel 2 goto ie4
if errorlevel 1 goto cont

:ie4
echo ---       
echo Instalati Internet Explorer si apoi reluati BAT-ul...
echo ---       
goto end1

:cont
choice /c:dn Este acesta un sistem Windows 98 SE sau NT?
if errorlevel 2 goto cont1
if errorlevel 1 goto cont2

:cont1
choice /c:dn Pe acest sistem Windows 9.x este DCOM98 instalat?
if errorlevel 2 goto dcom
if errorlevel 1 goto cont2

:dcom
echo ---
echo Urmeaza instalarea DCOM98.
echo Asteptati cu rabdare sfirsitul acestei faze de instalare...
echo Daca doriti sa renuntati la instalare apasati CTRL^C
echo ---
choice /c:dn Doriti sa parcurgeti aceasta faza?
if errorlevel 2 goto cont2
%1:\crms\instal\support\dcom98.exe
if errorlevel 1 goto erdcom


:cont2
echo ---
echo Urmeaza instalarea aplicatiei INSTSERV.
echo Asteptati cu rabdare sfirsitul acestei faze de instalare...
echo Daca doriti sa renuntati la instalare apasati CTRL^C
echo ---
choice /c:dn Doriti sa parcurgeti aceasta faza?
if errorlevel 2 goto cont3

%1:\crms\instal\setup.exe
if errorlevel 1 goto errstp

:cont3
echo ---
echo Urmeaza instalarea MSDE.
echo Asteptati cu rabdare sfirsitul acestei faze de instalare...
echo Daca doriti sa renuntati la instalare apasati CTRL^C
echo ---
choice /c:dn Doriti sa parcurgeti aceasta faza?
if errorlevel 2 goto cont4

%1:\crms\instal\msde\msdex86.exe -a -s -f1 %1:\crms\instal\unatend\unatend%2.iss
if errorlevel 1 goto errmsd


:cont4
goto end

:erdcom
echo Eroare la instalarea DCOM98!
goto end1

:errstp
echo Eroare la instalarea INSTSERV!
goto end1

:errmsd
echo  Eroare la instalarea MSDE!
goto end1

:end
echo Instalarea s-a terminat.
echo Restartati acum sistemul si parcurgeti urmatorii pasi:
echo 1. Din Programs\Msde\Service Manager porniti Serverul SQL;
echo 2. Executati programul Instalare_server_CRM din Programs\Instalare_server_CRM.
:end1
