REM==>Install.bat

@Echo off
cls

Echo.
Echo Please wait!
Echo.
Echo Do NOT close this window!
Echo.
Echo Thank you!

cd C:\

REM==============================>32-bit
REM==> For 32-bit systems. Check if MyComputerDr is installed
if exist "C:\Program Files\MyComputerDr" goto DEL_EXE1
REM==>Not 32-bit so go to the 64-bit routine
if not exist "C:\Program Files\MyComputerDr" goto IS_64BIT

:DEL_EXE1
REM==>See if VB uninstall program exists in the Windows directory
REM==>If it does not exist, notify the user it's can't be found
if not exist "%windir%\st5unst.exe" goto NO_ST5UNST

REM==>See if the uninstall log files exists in the MyComputerDr directory
REM==>If it does not exist, notify the user it's can't be found
if not exist "C:\Program Files\MyComputerDr\st5unst.log" goto NO_UNSTLOG

REM==>Run the VB uninstall program
%windir%\st5unst.exe -n "C:\Program Files\MyComputerDr\st5unst.log" -f -q

REM==>Program is uninstalled.  Now go and delete the backup directory
goto DEL_BACKUP

REM==============================>64-bit
REM==> For 64-bit systems	

:IS_64BIT
if exist "C:\Program Files (x86)\MyComputerDr" goto DEL_EXE2
if not exist "C:\Program Files (x86)\MyComputerDr" goto DEL_BACKUP

:DEL_EXE2
REM==>See if VB uninstall program exists in the Windows directory
REM==>If it does not exist, notify the user it's can't be found
if not exist "%windir%\st5unst.exe" goto NO_ST5UNST

REM==>See if the uninstall log files exists in the MyComputerDr directory
REM==>If it does not exist, notify the user it's can't be found
if not exist "C:\Program Files (x86)\MyComputerDr\st5unst.log" goto NO_UNSTLOG

REM==>Run the VB uninstall program
%windir%\st5unst.exe -n "C:\Program Files (x86)\MyComputerDr\st5unst.log" -f -q

REM==>Program is uninstalled.  Now go and delete the backup directory
goto DEL_BACKUP

:NO_ST5UNST
REM==>If the client calls, copy st5unst.exe from the MyCompDtBackup directory to C:\Windows
REM==>Change the attribute ReadOnly to off after copying
cls
Echo.
Echo The uninstall program file cannot be found!
Echo.
Echo Please call Keith at 303-937-3987
Echo.
Echo Thank you!
Echo.
Pause
goto END

:NO_UNSTLOG
REM==>If the client calls, copy st5unst.log from the MyCompDtBackup directory to C:\Program Files\MyComputerDr
REM==>Change the attribute ReadOnly to off after copying
cls
Echo.
Echo The uninstall log file cannot be found!
Echo.
Echo Please call Keith at 303-937-3987
Echo.
Echo Thank you!
Echo.
Pause
goto END

:DEL_BACKUP
REM==>Delete the MyCompDrBackup files and the directory
REM==>Check if the MyCompDrBackup exists and if it does, delete the files and directory
REM==>If directory does not exist, terminate batch file

if NOT exist "C:\MyCompDrBackup" goto END
del /f /q C:\MyCompDrBackup\*.*
rmdir /s /q C:\MyCompDrBackup
goto DEL_DESKTOP_SHORTCUT

:DEL_DESKTOP_SHORTCUT
if NOT exist "%UserProfile%\Desktop\MyComputerDr.lnk" goto END
del /f /q %UserProfile%\Desktop\MyComputerDr.lnk
goto END

:END
REM Change to the folder where the batch file is (where it was unzipped to)
cd %~dp0%
start "" setup.exe 
exit
