@echo off
rem short note: Eltorito cdrom-driver: http://www.nu2.nu/eltorito/
rem short note: Acer/Benq VIDE-CDD.SYS cdrom-driver: http://www.benq.com/drivers/storage_drivers.html ("DOS DRIVER")
rem short note: Mitsumi MTMCDAI.SYS cdrom-driver: http://www.mitsumi.com

:init
IF [%cdrom%] == [] SET PATH=A:\;%PATH%
IF [%cdrom%] == [] CALL A:\FINDCD.BAT
IF [%cdrom%] == [NONE] GOTO nocd
if [%LANG%]==[] SET LANG=EN
SET PATH=%cdrom%\FREEDOS\FDOS\BIN;%cdrom%\FREEDOS\FDOS\BIN\KEY
SET TEMP=A:\
SET TMP=%TEMP%
goto showmenu

:nocd
rem This is really odd, as we only reach here if we started install from CD
echo No drive found with FreeDOS on it.  Installation Aborted!
echo If this is in error, rerun \FREEDOS\AUTORUN\AUTORUN.BAT after setting
echo cdrom environment variable to your cd-rom drive (e.g. SET cdrom=R:)
goto end


:showmenu
CLS
REM ----
ECHO ÿ
ECHO ÿ       1)   FreeDOS Ripcord Beta8 Installation
ECHO ÿ       2)   Run FreeDOS from CD-ROM (return to command prompt)
ECHO ÿ       3)   Create FreeDOS boot floppy (1.44MB)
ECHO ÿ 
if [%pqpart%]==[true]   ECHO ÿ       4)   Partition harddisk(s) using PartitionMagic
if [%pqbackup%]==[true] ECHO ÿ       5)   Backup or Restore harddisk(s)/partition(s) using Drive Image
ECHO ÿ 
if [%oemcmd%]==[true]   ECHO ÿ       o)   OEM tools
ECHO ÿ       x)   Install XOSL boot manager (486+, 4MB+, VESA+)
ECHO ÿ 
ECHO ÿ       v)   View the Install text for using this CD-ROM
ECHO ÿ            (Press ESC key to exit the viewer)
ECHO ÿ 
ECHO ÿ       r)   Reboot
ECHO ÿ
REM ----
choice /N /C:123vrx45o "        "
IF ERRORLEVEL 9 GOTO runOEM
IF ERRORLEVEL 8 GOTO runPQDI
IF ERRORLEVEL 7 GOTO runPQM
IF ERRORLEVEL 6 GOTO runXOSL
IF ERRORLEVEL 5 reboot
IF ERRORLEVEL 4 %cdrom%\FREEDOS\INSTALL\INSTALL.BAT viewinstall
IF ERRORLEVEL 3 %cdrom%\FREEDOS\INSTALL\INSTALL.BAT makebf
IF ERRORLEVEL 2 %cdrom%\FREEDOS\INSTALL\INSTALL.BAT done
%cdrom%\FREEDOS\INSTALL\INSTALL.BAT initfdos
goto end

rem Next VMware detector tool are loaded. Freeware, http://members.tripod.co.jp/chitchat/vmware/
:exiting
if exist %cdrom%\isolinux\vmchk.com %cdrom%\isolinux\vmchk.com
if not errorlevel 1 goto exit2
cls
echo We would appreciate some feedback of your experiences with FreeDOS
echo within VMware. as cdrom-driver we recommend the mitsumi driver
echo called mtmcdai.sys. enjoy FreeDOS, Bernd Blaauw (bblnews@hotmail.com)
echo.
goto exit2
:exit2
echo Bootdisk loading terminated.
echo You have reached the cdrom batchfile.
echo.
echo Good luck!
goto end

:runoem
if NOT [%oemcmd%]==[true]   GOTO showmenu
cls
CD \OEM
ECHO Run OEM tools from here.
ECHO There are presently none bundled with this Distribution.  
ECHO Feel free to add your own!  See %cdrom%\FREEDOS\AUTORUN\AUTORUN.BAT
ECHO and A:\CONFIG\CFG.BAT
pause Press a key to return to FreeDOS menu
goto showmenu

:runxosl
cls
ECHO WARNING! XOSL recommends you run it from a FLOPPY so you can
ECHO backup existing partition information during install!
ECHO Would you like to continue XOSL installation?
choice /N /C:NY "Yes or No [YN]"
IF ERRORLEVEL 2 %cdrom%\FREEDOS\EXTRAS\BOOTMGRS\XOSL\XOSL\INSTALL.EXE
goto showmenu

:runpqdi
if NOT [%pqbackup%]==[true] GOTO showmenu
cls
rem Ramdisk/CTmouse/Copy first
for %%x in ( %cdrom%\*.gho %cdrom%\*.pqi ) do if exist %%x set restfile=%%x
if not [%restfile%]==[] echo If you want to restore your backup, the suggestion is to restore image file %restfile% 
if not [%restfile%]==[] pause 
CD %cdrom%\PQDI
call PQDI.BAT
pause Press a key to return to FreeDOS menu
goto showmenu

:runPQM
if NOT [%pqpart%]==[true]   GOTO showmenu
cls
CD %cdrom%\PQMAGIC
REM PQMAGIC.BAT should call PQMAGIC.EXE with the /pqb=a:\batch.pqb 
REM switch or /pqb=NULL switch where a:\batch.pqb specifies a
REM path that can be written to.  Without this you will get Error 600.
call PQMAGIC.BAT
pause Press a key to return to FreeDOS menu
goto showmenu


:end
