home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
terabyteunlimited.com
/
2014.06.terabyteunlimited.com.tar
/
terabyteunlimited.com
/
ifdsetup.zip
/
setupifd.bat
< prev
Wrap
DOS Batch File
|
2012-02-19
|
6KB
|
213 lines
@echo off
:: SETUPIFD.BAT
:: version 1.1
:: -------------
::
:: TargetDir must be set to a drive letter located on boot drive (HD0)
::
set TARGETDIR=C:\TBOS
::
:: IFDDIR is where the Image for DOS files can be found
:: If not set, the default installation path will be used.
::
set IFDDIR=
::
:: IFDPK is your Image for DOS or BootIt BM Product Key (used if no existing
:: ifd.ini or bootitbm.ini file found)
::
set IFDPK=XXXX-XXXX-XXXX
::
:: IFDLN is your BootIt BM Licensed Name (used if no existing ifd.ini or
:: bootitbm.ini file found and you are using your BootIt BM Product Key)
:: Leave IFDLN blank if using your Image for DOS product key
::
set IFDLN=
::
:: IFDCMD is the Image for DOS command line to use.
::
:: +=====================================================================+
:: + Note that a DOS program can only receive the first 126 characters +
:: + of the command line parameters provided to it. This limit includes +
:: + the space between the program name and parameters. All characters +
:: + beyond the 126th are truncated by DOS. This means you need to use +
:: + short file paths and/or short file names to ensure the command +
:: + operates as expected +
:: +=====================================================================+
::
set IFDCMD=image.exe /log:0
::
:: IFDBIN is the IFD container name to use (without the extension)
::
set IFDBIN=ifd
::-----------------------------------------------------------------------------
::-----------------------------------------------------------------------------
::
:: Setup name of windows version of TBOSDT (to support older releases)
::
set TBOSDT=tbosdtw.exe
if not exist ..\win\%TBOSDT% set TBOSDT=tbosdt.exe
::
:: Set default IFD files path, if necessary
::
if "%ifddir:~0,1%"==" " set IFDDIR=
if "%ifddir%"=="" if "%PROCESSOR_ARCHITECTURE%"=="AMD64" set IFDDIR=C:\Program Files (x86)\TeraByte Unlimited\Image for Windows\V2\IFD
if "%ifddir%"=="" set IFDDIR=C:\Program Files\TeraByte Unlimited\Image for Windows\V2\IFD
::
:: verify directory and files
::
for %%i in (setupifd.bat bootfile.exe ..\win\tbossys.exe ..\win\bootfile.exe ..\win\%TBOSDT%) do if not exist %%i goto baddir
for %%i in ("%ifddir%\image.exe" "%ifddir%\cdboot.f35" "%ifddir%\cdboot.ins") do if not exist %%i goto badifddir
::
:: create the new virtual drive file
::
if exist "%ifdbin%.bin" del "%ifdbin%.bin" >nul
echo add virtdrv "%ifdbin%.bin" 2 TBOS /b > crtvdrv.run
..\win\%TBOSDT% crtvdrv.run
if errorlevel 1 goto badvcrt
::
:: Setup the check files debug script
::
echo set textline chkfiles.txt "Boot file: %ifdbin%.bin" > chkfiles.run
echo set textline chkfiles.txt " " >> chkfiles.run
echo type chkfiles.txt >> chkfiles.run
echo del chkfiles.txt /q >> chkfiles.run
echo mount 0: "%ifdbin%.bin" >> chkfiles.run
echo dir 0: >> chkfiles.run
echo umount 0: >> chkfiles.run
::
:: Create cdboot.f35 extraction script
::
echo mount 0: "%ifddir%\cdboot.f35" >extractcdboot.run
echo copy 0:\ifd.dat ifdfiles\ifd.dat >>extractcdboot.run
echo copy 0:\mouse.com ifdfiles\mouse.com >>extractcdboot.run
echo umount 0: >>extractcdboot.run
::
:: sys the virtual drive and copy in the files
::
md ifdfiles > nul
copy "%ifddir%\image.exe" ifdfiles >nul
copy "%ifddir%\cdboot.ins" ifdfiles >nul
copy "%ifddir%\cdboot.f35" ifdfiles >nul
:: extract files from cdboot.f35 (ifd.dat & mouse.com -- GUI ver)
..\win\%TBOSDT% extractcdboot.run >nul
:: copy INI file
if exist ifd.ini copy ifd.ini ifdfiles >nul
if exist ifdfiles\ifd.ini goto dosys
if exist bootitbm.ini copy bootitbm.ini ifdfiles\ifd.ini >nul
if exist ifdfiles\ifd.ini goto dosys
if exist "%ifddir%\ifd.ini" copy "%ifddir%\ifd.ini" ifdfiles >nul
if exist ifdfiles\ifd.ini goto dosys
if exist "%ifddir%\bootitbm.ini" copy "%ifddir%\bootitbm.ini" ifdfiles\ifd.ini >nul
if exist ifdfiles\ifd.ini goto dosys
echo [RESTORE_DEFAULTS] > ifdfiles\ifd.ini
echo SaveLog=0 >> ifdfiles\ifd.ini
echo [License] >> ifdfiles\ifd.ini
echo ProductKey=%IFDPK% >> ifdfiles\ifd.ini
if not "%IFDLN%"=="" echo User=%IFDLN% >> ifdfiles\ifd.ini
if exist ifdfiles\ifd.dat echo [Video] >> ifdfiles\ifd.ini
if exist ifdfiles\ifd.dat echo Method=1 >> ifdfiles\ifd.ini
if exist ifdfiles\ifd.dat echo Mode=36 >> ifdfiles\ifd.ini
:dosys
::
:: create the tbos.str file & create boot file
::
echo bootfile.exe /restore > tbos.str
if exist ifdfiles\mouse.com echo MOUSE.COM >> tbos.str
echo %IFDCMD% >> tbos.str
echo bootfile.exe /reboot >> tbos.str
set IFDINI=
if exist ifdfiles\ifd.ini set IFDINI=ifdfiles\ifd.ini
set IFDDAT=
if exist ifdfiles\ifd.dat set IFDDAT=ifdfiles\ifd.dat
set IFDMOUSE=
if exist ifdfiles\mouse.com set IFDMOUSE=ifdfiles\mouse.com
..\win\tbossys /f "%ifdbin%.bin" bootfile.exe tbos.str ifdfiles\image.exe ifdfiles\cdboot.ins ifdfiles\cdboot.f35 %IFDINI% %IFDDAT% %IFDMOUSE%
if errorlevel 1 goto badsys
::
:: setup target directory
::
if exist %targetdir%\. goto skipmd
md %targetdir% > nul
if not exist %targetdir%\. goto badmd
:skipmd
copy "%ifdbin%.bin" %targetdir% >nul
copy ..\win\bootfile.exe %targetdir% >nul
echo %targetdir%\bootfile "%targetdir%\%ifdbin%.bin" > "%targetdir%\run_%ifdbin%.bat"
start %targetdir%
goto end
::
:: report errors
::
:badmd
echo Unable to create target directory %targetdir%
pause
goto end
:badvcrt
echo Error Creating Virtual Partition
pause
goto end
:badsys
echo Error During Setup of Virtual Partition
pause
goto end
:baddir
echo This batch file must be launched from the tbos_dos folder.
pause
goto end
:badifddir
echo Unable to find the required Image for DOS files.
echo Please check the IFDDIR variable.
pause
goto end
:end
:
: remove files and folders created
:
if exist crtvdrv.run del crtvdrv.run
if exist tbos.str del tbos.str >nul
if not exist ifdfiles\. goto nord
del ifdfiles\image.exe >nul
del ifdfiles\ifd.ini >nul
del ifdfiles\cdboot.ins >nul
del ifdfiles\cdboot.f35 >nul
if exist ifdfiles\ifd.dat del ifdfiles\ifd.dat >nul
if exist ifdfiles\mouse.com del ifdfiles\mouse.com >nul
del extractcdboot.run >nul
rd ifdfiles >nul
:nord
set IFDINI=
set IFDDAT=
set IFDMOUSE=
set IFDPK=
set IFDLN=
set IFDDIR=
set TARGETDIR=
set TBOSDT=