R1.31 (now available)
adjusted NwDsk version number (3.42=>3.40)
updated UMBPCI to 3.77
adjusted ramdisk:
- set ramdisk XMSDSK/SHSURDRV sector size from 0(?) to 512 bytes
- replaced XMSDSK with SHSURDRV v1.10
replaced unzip.exe with pkunzip.exe (PKWARE 2.50 for DOS) ~20Kb smaller
- adjusted autoexec.bat, runapp.bat and unpack.bat to refelct change
adjusted /level3 post-processing
- adjusted cd drive detection routine (e.g. no longer dependent on ubcd.ico)
- NwDsk settings can now be supplemented via an .INI file
- relative path(s) of dosapps no longer dependent on UBCD version*
- can now choose to launch CD dosapps as an archive or unpacked as a directory**
- launching CD dosapps is no longer dependent on "dosapp" root directory (NwDsk will find it)**
adjusted UBCD program handling
- automatically finds the program archive/directory regardless of location**
- added archive support to include rar,7z and uha in addition to cab and zip
adjusted saveset.bat in utilz.cab
removed ranish partition manager (already included on CD)
fixed an error in cdrom loader for non-eltorito drives : "_devld not found"
replaced stype.exe with more.exe (~18Kb smaller)
added mdir.exe (consistent DIR command across FD/DR/MS platforms)
fixed other tiny errors
* Feature-ready, but not yet implemented for legacy support
**UBCD 5beta only
Development Notes
All previous versions of NwDsk (R series) relied on a rather cumbersome detection routine for determining UBCD version number which, in turn, was used as a requisite in establishing variables and parameters used for post-processing operations (e.g. menu generation, application handling etc). Previously, this was handled using information from the following file:
Code: Select all
MENU TITLE Ultimate Boot CD V4.1.1 http://www.ultimatebootcd.com
PROMPT 0
ALLOWOPTIONS 0
MENU MARGIN 0
MENU ROWS 20
MENU COLOR BORDER 37;44 #40000000 #00000000 std
MENU COLOR TITLE 1;33;44 #c00090f0 #00000000 std
MENU COLOR SCROLLBAR 37;44 #40000000 #00000000 std
Code: Select all
MENU TITLE Ultimate Boot CD V5.0B4 http://www.ultimatebootcd.com
MENU MARGIN 0
MENU ROWS -9
MENU TABMSG
MENU TABMSGROW -3
MENU CMDLINEROW -3
MENU HELPMSGROW -4
MENU HELPMSGENDROW -1
MENU COLOR SCREEN 37;40
MENU COLOR BORDER 34;40
MENU COLOR TITLE 1;33;40
MENU COLOR SCROLLBAR 34;46
MENU COLOR SEL 30;47
MENU COLOR UNSEL 36;40
MENU COLOR CMDMARK 30;40
MENU COLOR CMDLINE 30;40
MENU COLOR TABMSG 37;40
MENU COLOR DISABLED 37;40
MENU COLOR HELP 32;40
Put simply, this method was arse and has since been been scrapped. Instead, the version number is now determined via 2 available methods...
1) CD VolumeID
For version 4.1.1, this should be set to "UBCD411" (for version 5.0b, "UBCD50bx" where x=1..4)
2) Optional .INI file
Alternatively, use an INI file to supplement the correct version ID...
Two version will be supplied in the download (one for 4.1.1 and the other for 5beta). This can be placed
anywhere on the CD and named anything you want provided it retains the *.INI suffix.
"That's nice, but how do I customise the location of my "dosapps" folder?"
Good question, chief. In previous builds, this proved almost impossible. For instance, suppose you wanted to relocate your "dosapp" programs from...
to
NwDsk would return errors complaining about not being able to find the program folder. So, there are now 2 methods one can use to set the default program path...
1) From the NwDsk itself...
:: Ramdrive Letter (UpperCase!)
set ramltr=Q:
:: Ramdrive size (KB), put 0 to disable
set ramsz=16384
:: ScrollBackBuffer size (KB), put 0 to disable
set persz=512
:: TimeZone (optional)
set tz=GMT+1
:: Cache (KB)
set cachesz=6144
:: Cdrom Cache on FreeDOS (KB), put 0 to disable
set cachecd=1024
:: Uncomment to disable Diskette caching on FreeDOS
rem set tickle=0
:: Uncomment for Verbose Extracting
rem set xtrct=verbose
:: Uncomment to set "dosapps" Directories - [main;user]
rem set appdir=\ubcd\dosapps;\ubcd\dosapps\custom
rem set appdir=\dosapps;\dosapps\custom
2) Optional .INI file...
[Settings]
MainPrograms = \ubcd\dosapps
UserPrograms = \ubcd\dosapps\custom
Use either method as you see fit.
DEMO:
Note, if the program archive is not found in the given dosapp directories, the script will scan the entire CD to try and locate the archive dynamically (UBCD 5 only).
The two main scripts used to accomplish all this...
UBCD.BAT (WIP)
Code: Select all
@if "%debug%"=="" echo off
if "%1"==":" if not "%2"=="" goto %2
::
for %%i in (xgrep.com concat.exe stow.exe varset.com var.bat) do if not exist %ramdrv%\bin\%%i %0 : _err missing %%i (check utilz.%arcext%)
for %%i in (wbat.com tfind.com lmod.com) do if not exist %ramdrv%\bin\%%i %0 : _err missing %%i (check utils.%arcext%)
:_start
if not "%cddrv%"=="" goto _init
if not exist %ramdrv%\bin\bcdw.com goto _nobcdw
bcdw.com CheckForBCDW
bcdw.com FindBootableCDLetter
bcdw.com GetBootImageCommandLine
if "%ubcdcmd%"=="" set ubcdcmd=%BCDW_CL%
:_bcdw
for %%i in (%cd1% %BCDW_CDROM%: %ramdrv% A:) do if "%cddrv%"=="" call %0 : _testdrv %%i
if not "%cddrv%"=="" goto _init
:_nobcdw
for %%i in (C D E F G H) do if "%cddrv%"=="" call %0 : _testdrv %%i:
for %%i in (I J K L M N) do if "%cddrv%"=="" call %0 : _testdrv %%i:
for %%i in (O P Q R S T) do if "%cddrv%"=="" call %0 : _testdrv %%i:
for %%i in (U V W X Y Z) do if "%cddrv%"=="" call %0 : _testdrv %%i:
if "%cddrv%"=="" goto _nocd
goto _init
:_testdrv
shift
shift
if "%1"=="" goto _eof
if "%1"==":" goto _eof
call drd.bat %1 -$
if errorlevel 255 goto _eof
if errorlevel 100 goto _eof
set | xgrep -shy ^[:u]?initrd[:p]?= | lmod /s=/ [$!] | stow _i >%tmp%\nul
mdir /s /b /o %1\ >%tmp%\_ubcd.bak
type %tmp%\_ubcd.bak | xgrep -shy %_i%$ >%tmp%\nul
if errorlevel 1 goto _nodrv
set cddrv=%1
copy %tmp%\_ubcd.bak %djdir%\index.dat /y >%tmp%\nul
:_nodrv
set _i=
goto _eof
:_info
echo.
if not "%ubcd_ver%"=="" echo UBCD %ubcd_ver% [%ubcd_ts%]
if not "%ubcd_url%"=="" echo %ubcd_url%
if "%ubcd_url%"=="" echo http:\\www.ultimatebootcd.com\
echo.
if "%os%"=="fd" date /t | lmod [$4:$5]
if "%os%"=="fd" time /t | lmod [$4:$5]
:_drives
echo ЪДДДДДДДДДДДДДДДДДДДДДї
echo і BOOTDRV: %srcdrv% і
echo і RAMDRV: %ramdrv% і
if not "%cddrv%"=="" echo і CDDRV: %cddrv% і
echo АДДДДДДДДДДДДДДДДДДДДДЩ
goto _eof
::
:_init
call readset UBCD
if not "%ubcd_ver%"=="" goto _chkcmd
:_getini
xgrep -shy [:p]\ini$ %djdir%\index.dat >%tmp%\_ubcd.tmp
for %%e in (1 2 255) do if errorlevel %%e goto _noini
call var set _o=lines %tmp%\_ubcd.tmp
set _i=0
if exist %tmp%\_ubcd.bak del %_delq% %tmp%\_ubcd.bak
:_lp_ini
call var set _i=(%_i%+1)
linex %_i% <%tmp%\_ubcd.tmp | stow _f >%tmp%\nul
xgrep -shy [$]?"Ubcd"[$]$ %_f% >%tmp%\nul
if errorlevel 1 goto _skip_ini
xgrep -syv ^; %_f% >%tmp%\_ubcd.bak
call %0 : _ts %_f%
set _f=
:_skip_ini
if exist %tmp%\_ubcd.bak goto _end_ini
if "%_i%"=="%_o%" goto _end_ini
goto _lp_ini
:_end_ini
@rem pause
for %%i in (_i _n _o) do set %%i=
if exist %tmp%\_ubcd.bak call %0 : _inird
:_noini
call %0 : _getver
for %%e in (255 1) do if errorlevel %%e goto _nover
if "%ver%"=="4" goto _oldver
if "%ver%"=="5" goto _oldver
goto _mkhlp
:_ts
shift
shift
echo UBCD: Scanning "%1"
call var set _d=date %1
call var set _t=time %1
set ubcd_ts=%_d% %_t%
for %%i in (d t) do set _%%i=
goto _eof
:_inird
:_iniver
inifile %tmp%\_ubcd.bak [Version] | lmod /l* /s [$2:$!]>%tmp%\_ubcd.tmp
xgrep -shy ^[:a]?Version[:s]?= %tmp%\_ubcd.tmp | lmod /s= @set ubcd_ver=[$2]>%tmp%\_ubcd.bat
xgrep -shy ^[:a]?Url[:s]?= %tmp%\_ubcd.tmp | lmod /s= @set ubcd_url=[$2] >>%tmp%\_ubcd.bat
inifile %tmp%\_ubcd.bak [Settings] | lmod /l* /s [$2:$!]>%tmp%\_ubcd.tmp
xgrep -shy ^[:a]?Menu[:s]?= %tmp%\_ubcd.tmp | lmod /s= @set _mkbat=[$2]>>%tmp%\_ubcd.bat
if not "%appdir%"=="" goto _inifin
xgrep -sry ^[:a]?MainPrograms[:s]?= %tmp%\_ubcd.tmp | lmod /s= %cddrv%[$2] | stow appdir >%tmp%\nul
xgrep -sry ^[:a]?UserPrograms[:s]?= %tmp%\_ubcd.tmp | lmod /s= @set appdir=%appdir%;%cddrv%[$2]>>%tmp%\_ubcd.bat
:_inifin
call %tmp%\_ubcd.bat
for %%d in (Version Settings) do inifile %tmp%\_ubcd.bak [%%d] /remove
type %tmp%\_ubcd.bak | xgrep -syv ^; >%djdir%\programs.cfg
call saveset UBCD -$
goto _eof
:_getver
if not "%ubcd_ver%"=="" goto _chkver
varset n=vol %cddrv% | lmod /b= [$2] | xgrep -shy ^[:a:d]?UBCD >%tmp%\_ubcd.tmp
if errorlevel 1 goto _nover
lmod /sD [$2]<%tmp%\_ubcd.tmp | stow ubcd_ver>%tmp%\nul
call saveset UBCD -$
:_chkver
echo %ubcd_ver% | lmod /s. [$1][$2]>%tmp%\_ubcd.tmp
lmod /s set _v=[1,2]<%tmp%\_ubcd.tmp >>%tmp%\_ubcd.bat
call %tmp%\_ubcd.bat
call var set _v=(%_v%+1)
for %%e in (255 1) do if errorlevel %%e goto _eof
if "%_v%"=="51" set ver=5
if "%_v%"=="42" set ver=4
if "%_v%"=="11" set ver=?
set _v=
if "%ver%"=="" el! 1
goto _eof
:_nover
goto _eof
:_mkhlp
xgrep -sy ^[[][:a:d:s]*[]]$ %djdir%\programs.cfg >%tmp%\_ubcd.tmp
if errorlevel 1 goto _chkcmd
lmod /l* /s[] [$1:$!]<%tmp%\_ubcd.tmp >%tmp%\_ubcd.bak
xgrep -syv ^[[][:a:d:s]*[]]$ %djdir%\programs.cfg >%tmp%\_ubcd.tmp
lmod /s; /l* [$4:$!]<%tmp%\_ubcd.tmp >%tmp%\_ubcd.tm#
lmod /s; /l* [$1]<%tmp%\_ubcd.tmp >%tmp%\_ubcd.tm$
concat %tmp%\_ubcd.tm$ %tmp%\_ubcd.tm# /f9 >%ramdrv%\help\ubcd.hlp
echo ubcd Ultimate Boot CD>>%ramdrv%\help\ubcd.hlp
echo.>>%ramdrv%\help\ubcd.hlp
:_mkbat
set _i=0
set _j=0
call var set _m=lines %tmp%\_ubcd.bak
mkdir %tmp%\~bin
:_loop_i
call var set _i=(%_i%+1)
linex %_i% <%tmp%\_ubcd.bak | stow _cat >%tmp%\nul
inifile %djdir%\programs.cfg [%_cat%] | lmod /l* /s [$2:$!]>%tmp%\_ubcd.dat
call var set _n=lines %tmp%\_ubcd.dat
@rem pause
:_loop_j
call var set _j=(%_j%+1)
lmod /l%_j% /s; @set _app=[$4:$!][+]@set _appcmd=[$2][+]@set _apparc=[$1][+]@set _appmnu=[$3]<%tmp%\_ubcd.dat >%tmp%\~bin\_ubcd.bat
call %tmp%\~bin\_ubcd.bat
ren %tmp%\~bin\_ubcd.bat %_apparc%.bat
@rem pause
if "%_j%"=="%_n%" goto _end_j
goto _loop_j
:_end_j
for %%i in (_j _n) do set %%i=
if "%_i%"=="%_m%" goto _end_i
goto _loop_i
:_end_i
for %%d in (%tmp%\~bin\*.bat) do echo @runapp.bat >>%%d
for %%i in (_i _m _cat) do set %%i=
set | xgrep -shy ^_app | lmod /l* /b= set [$1]=>%tmp%\_ubcd.bat
call %tmp%\_ubcd.bat
:_movbat
xcopy %tmp%\~bin\*.bat %ramdrv%\bin /q /r /s /y /n >%tmp%\_ubcd.tmp
type %tmp%\_ubcd.tmp | lmod [$1] program(s) found
deltree /y %tmp%\~bin >%tmp%\nul
goto _chkcmd
::
:_oldver
if exist %tmp%\_ubcd.bak del %_delq% %tmp%\_ubcd.bak
if "%appdir%"=="" if "%ver%"=="5" set appdir=%cddrv%\ubcd\dosapps
if "%appdir%"=="" if "%ver%"=="4" set appdir=%cddrv%\dosapps
echo %appdir% | lmod /s; set _dir1=[$1][+]set _dir2=[$2]>%tmp%\_ubcd.bat
call %tmp%\_ubcd.bat
if "%_dir1%"=="%_dir2%" set _dir2=
set _i=0
set _lim=2
:_lp_dir
call var set _i=(%_i%+1)
echo _dir | lmod set _dir=[~37][]%_i%[~37]>%tmp%\_ubcd.bat
call %tmp%\_ubcd.bat
varset x=string %_dir% >%tmp%\nul
if "%_dir%"=="" goto _skip_dir
tfind /f1,%errorlevel% "%_dir%" %djdir%\index.dat>>%tmp%\_ubcd.bak
@rem pause
:_skip_dir
if "%_i%"=="%_lim%" goto _end_dir
goto _lp_dir
:_end_dir
@rem pause
for %%i in (_i _dir _lim) do set %%i=
for %%i in (2 1) do set _dir%%i=
call var set _x=lines %tmp%\_ubcd.bak
if "%_x%"=="0" el! 1
set _x=
if errorlevel 1 goto _npath
mkdir %tmp%\~main
xgrep -shy startup[:p]?.bat$ %tmp%\_ubcd.bak >%tmp%\_ubcd.tmp
if errorlevel 1 goto _npath
for %%i in (4 5) do if "%ver%"=="%%i" goto _ver%%i
:_ver5
type %tmp%\_ubcd.tmp | lmod /s\ /l* copy [] %tmp%\~main\[$!-1].bat /Y [~62]%tmp%\nul >%tmp%\_ubcd.bat
call %tmp%\_ubcd.bat
if exist %ramdrv%\bin\attrib.com attrib +a -rhs %tmp%\~main\*.bat /s >%tmp%\nul
call %0 : _oldmenu APPNAME=
mkdir %ramdrv%\MAIN
xcopy %tmp%\~main\*.bat %ramdrv%\main /q /r /s /y /n >%tmp%\_ubcd.tmp
type %tmp%\_ubcd.tmp | lmod [$1] program(s) found
deltree /y %tmp%\~main >%tmp%\nul
set path=%path%;%ramdrv%\main
goto _chkcmd
:_oldmenu
shift
shift
if exist %tmp%\_ubcd.* del %_delq% %tmp%\_ubcd.*
xgrep -shxy %1 %tmp%\~main\*.bat >%tmp%\_ubcd.tmp
lmod /l* /b= [$2]~%ramdrv%\main\<%tmp%\_ubcd.tmp >>%tmp%\_ubcd.bak
lmod /l* /b= [$2]<%tmp%\_ubcd.tmp >>%tmp%\_ubcd.tm$
mdir /o /b %tmp%\~main\*.bat | lmod /l* []>%tmp%\_ubcd.tmp
lmod /s. /l* [$1,l]<%tmp%\_ubcd.tmp >%tmp%\_ubcd.tm#
if not exist %ramdrv%\help\nul mkdir %ramdrv%\help
concat %tmp%\_ubcd.tm# %tmp%\_ubcd.tm$ /f9 >%ramdrv%\help\ubcd.hlp
concat %tmp%\_ubcd.bak %tmp%\_ubcd.tmp >%djdir%\ubcd.mnu
echo ubcd Ultimate Boot CD>>%ramdrv%\help\ubcd.hlp
echo.>>%ramdrv%\help\ubcd.hlp
goto _eof
:_ver4
xgrep -shy startup[:p]?.bat$ %tmp%\_ubcd.bak >%tmp%\_ubcd.tmp
type %tmp%\_ubcd.tmp | lmod /s\ /l* echo %cddrv% [~62]%tmp%\~main\[$!-1,l].bat >%tmp%\_ubcd.bat
xgrep -shxy "%cddrv%" <%tmp%\_ubcd.tmp | lmod /s\ /l* type [] [~62][~62]%tmp%\~main\[$!-1,l].bat >>%tmp%\_ubcd.bat
call %tmp%\_ubcd.bat
if exist %ramdrv%\bin\attrib.com attrib +a -rhs %tmp%\~main\*.bat /s >%tmp%\nul
mdir /o /b %tmp%\~main\*.bat | lmod /s. /l* [$1]~%ramdrv%\main\[$1].bat >%djdir%\ubcd.mnu
if exist %tmp%\~main\vc.bat del %_delq% %tmp%\~main\vc.bat
mkdir %ramdrv%\MAIN
xcopy %tmp%\~main\*.bat %ramdrv%\main /q /r /s /y /n >%tmp%\_ubcd.tmp
type %tmp%\_ubcd.tmp | lmod [$1] program(s) found
deltree /y %tmp%\~main >%tmp%\nul
set ubcddrv=%cddrv%
goto _chkcmd
:_npath
:: to be done...
::
:_nocd
echo UBCD: Warning! could not set version (cd-rom disabled)
goto _chkcmd
:_chkcmd
set ubcd_off=
if "%ubcdcmd%"=="" goto _runcmd
if exist %ramdrv%\main\%ubcdcmd%.bat goto _runcmd
if exist %ramdrv%\bin\%ubcdcmd%.bat goto _runcmd
echo UBCD: Error!!! missing %ubcdcmd%.bat (check CD)
echo.
set ubcdcmd=
@pause
:_runcmd
if "%1"==":" call %0 : _info
%ramdrv%
cd \
if not "%ubcdcmd%"=="" call %ubcdcmd%
set ubcdcmd=
if "%ubcd_off%"=="1" goto _ubcdend
:_ubcd
if "%w_but%"=="" set w_but=1
for %%i in (%tmp%\_ubcd.*) do if exist %%i del %_delq% %%i>%tmp%\nul
if "%ubcd_ti%"=="" set ubcd_ti=0
echo :w_msg "Ultimate Boot CD %ubcd_ver%" [x]>%tmp%\_ubcd.tmp
echo (~press any key~: #? sec.)>>%tmp%\_ubcd.tmp
echo.>>%tmp%\_ubcd.tmp
echo [ Launch ] CD applications >>%tmp%\_ubcd.tmp
echo.>>%tmp%\_ubcd.tmp
echo [ System ] Drivers/network/system tools >>%tmp%\_ubcd.tmp
echo.>>%tmp%\_ubcd.tmp
echo [ Help ] List available commands >>%tmp%\_ubcd.tmp
echo.>>%tmp%\_ubcd.tmp
echo [ Browse ] File browser (lfn support) >>%tmp%\_ubcd.tmp
echo.>>%tmp%\_ubcd.tmp
echo If you experience a problem when >>%tmp%\_ubcd.tmp
echo running a program, try enabling >>%tmp%\_ubcd.tmp
echo an alternate boot mode. >>%tmp%\_ubcd.tmp
echo.>>%tmp%\_ubcd.tmp
echo [ About ] [? Exit ] >>%tmp%\_ubcd.tmp
call w.bat box @%tmp%\_ubcd.tmp:w_msg #%w_but%,%ubcd_ti%
if errorlevel 100 goto _ubcdend
if errorlevel 6 goto _ubcdend
if errorlevel 5 goto _about
if errorlevel 4 goto _vc
if errorlevel 3 goto _cmd
if errorlevel 2 goto _nwdsk
if exist %djdir%\ubcd.mnu goto _dosold
goto _dos
:_ubcdend
echo UBCD: Type "ubcd" to return to main menu
echo.
goto _end
:_nwdsk
set w_but=2
if not exist %ramdrv%\bin\menu.bat %0 : _err missing menu.bat (check menu.%arcext%)
call menu.bat :
goto _ubcd
:_cmd
set w_but=3
if not exist %ramdrv%\bin\help.bat %0 : _err missing help.bat (check help.%arcext%)
call help.bat :
goto _ubcd
:_vc
set w_but=4
if not exist %ramdrv%\bin\vc.bat %0 : _err missing vc.bat (check vc.%arcext%)
if exist %ramdrv%\bin\lfn.bat if "%lfn%"=="N" call lfn -e
call %ramdrv%\bin\vc.bat
if "%ubcd_ver%"=="4.1.1" if "%lfn%"=="Y" call lfn -d
goto _ubcd
:_about
set w_but=5
if not exist %ramdrv%\bin\about.bat %0 : _err missing about.bat (check modboot.%arcext%)
call about.bat :
goto _ubcd
:_dos2
set w_but=1
if not "%cddrv%"=="" goto _dos3
echo UBCD: Aborted! Cd-rom support disabled (type "cdrom" to enable)
echo.
@pause
goto _ubcd
:_dos
set w_but=1
if not "%cddrv%"=="" goto _dosok
echo UBCD: Aborted! Cd-rom support disabled (type "cdrom" to enable)
echo.
@pause
goto _ubcd
:_dosok
%ramdrv%
:_loop_l
for %%i in (%tmp%\_ubcd.*) do del %_delq% %%i
echo :w_ubcd " CD Applications " [x]>%tmp%\_ubcd.bak
xgrep -sy ^[[][:a:d:s]*[]]$ %djdir%\programs.cfg | lmod /l* /s[] [$1:$!] >>%tmp%\_ubcd.bak
call w.bat list @%tmp%\_ubcd.bak:w_ubcd
if "%wbat%"=="" goto _ubcd
echo :w_ubcd " CD Applications - %wbat% " [x]>%tmp%\_ubcd.tmp
inifile %djdir%\programs.cfg [%wbat%] | lmod /l* /s; [$5:$!]>>%tmp%\_ubcd.tmp
:_loop_m
if "%ubcd_off%"=="1" goto _ubcdend
call w.bat list @%tmp%\_ubcd.tmp:w_ubcd
if "%wbat%"=="" goto _loop_l
type %djdir%\programs.cfg | tfind "%wbat%" | lmod /s; %ramdrv%\bin\[$1].bat | stow wbat >%tmp%\nul
if "%wbat%"=="" goto _ubcd
call %wbat%
goto _loop_m
:_dosold
set w_but=1
if not "%cddrv%"=="" goto _dosoldok
echo UBCD: Aborted! Cd-rom support disabled (type "cdrom" to enable)
echo.
@pause
goto _ubcd
:_dosoldok
%ramdrv%
:_loop_k
if "%ubcd_off%"=="1" goto _ubcdend
for %%i in (%tmp%\_ubcd.*) do del %_delq% %%i
echo :w_ubcd " Ultimate Boot CD %ubcd_ver% " [x]>%tmp%\_ubcd.bak
type %home%\ubcd.mnu>>%tmp%\_ubcd.tmp
type %tmp%\_ubcd.tmp | lmod /L* /B~ echo [$1][~62][~62]%tmp%\_ubcd.bak>%tmp%\_ubcd.bat
call %tmp%\_ubcd.bat
call w.bat list @%tmp%\_ubcd.bak:w_ubcd
if "%wbat%"=="" goto _ubcd
type %tmp%\_ubcd.tmp | tfind "%wbat%" | lmod /B~ set wbat=[$2] [$3]>%tmp%\_ubcd.bat
call %tmp%\_ubcd.bat
if "%wbat%"=="" goto _ubcd
call %wbat%
set wbat=
goto _loop_k
:_warn
shift
shift
if errorlevel 255 goto _eof
echo UBCD: Warning! %1 %2 %3 %4 %5 %6 %7 %8
echo.
el! 255
goto _eof
:_err
shift
shift
echo UBCD: Error!!! %1 %2 %3 %4 %5 %6 %7 %8
echo.
goto _end
:_abort
shift
shift
echo UBCD: Aborted!
echo.
goto _end
:_end
set ?=
set | tfind /f1,2 "W_" >%tmp%\_ubcd.tmp
set | tfind /f1,5 "ubcd_" >>%tmp%\_ubcd.tmp
set | tfind /f1,5 "_ubcd" >>%tmp%\_ubcd.tmp
set | tfind /f1,5 "bcdw_" >>%tmp%\_ubcd.tmp
type %tmp%\_ubcd.tmp | lmod /L* /B= set [$1]=>%tmp%\_ubcd.bat
call %tmp%\_ubcd.bat
set wbat=
set wrb=
for %%i in (1 2 3 4 5 6 7 8 9) do set wcb%%i=
if exist %tmp%\_ubcd.* del %_delq% %tmp%\_ubcd.*
::
:_eof
RUNAPP.BAT
Code: Select all
@if "%debug%"=="" echo off
if "%1"==":" if not "%2"=="" goto %2
::
for %%i in (varset.com var.bat stow.exe) do if not exist %ramdrv%\bin\%%i %0 : _err missing %%i (check utilz.%arcext%)
for %%i in (wbat.com tfind.com lmod.com) do if not exist %ramdrv%\bin\%%i %0 : _err missing %%i (check utils.%arcext%)
:_init
if "%cddrv%"=="" goto _abort
for %%i in (name code exe) do if "%app%%i%"=="" goto _initok
set _app=%appname%
set _appcmd=%appexe%
set _apparc=%appcode%
for %%i in (appname appcode appexe) do set %%i=
for %%i in (_app _appcmd _apparc) do if "%%%i%"=="" goto _end
:_initok
set _appdir=%_apparc%
if exist %djdir%\index.dat goto _initbin
mdir /s /b /o %cddrv%\ >%djdir%\index.dat
:_initbin
echo %_appcmd% | lmod [$1] | stow _appbin >%tmp%\nul
if "%_appbin%"=="callver" goto _getbin1
goto _start
:_getbin1
echo %_appcmd% | lmod [$3] | stow _appbin >%tmp%\nul
:_start
echo UBCD: Searching...
:_start2
if exist %tmp%\_runa.* del %_delq% %tmp%\_runa.*
set _$dest=%ramdrv%\usr\%_appdir%
if exist %_$dest%\%_appbin% goto _unpok2
if "%appdir%"=="" goto _scan
echo %appdir% | lmod /s; @set _appsrc1=[$1][+]@set _appsrc2=[$2]>%tmp%\_runa.bat
call %tmp%\_runa.bat
:_scan
for %%f in (cab zip uha rar 7z) do call %0 : _getarc %%f
if "%_$arcext%"=="" goto _getdir
for %%f in (cab zip uha rar 7z) do xgrep -shy [:p].?%%f$ %tmp%\_runa.bak >>%tmp%\_runa.tmp
call var set _$dupl=lines %tmp%\_runa.tmp
if "%_$dupl%"=="0" goto _auto
if "%_$dupl%"=="1" goto _getarcok
goto _duplex
:_getarcok
set _$dupl=
lmod []<%tmp%\_runa.tmp | stow _$archive >%tmp%\nul
call %0 : _getpath %_$archive%
call %0 : _app%_$arcext% %_$archive% %_appbin%
if errorlevel 1 goto _getdir
goto _arcok
:_getarc
shift
shift
set _$lim=2
if "%_appsrc1%"=="%_appsrc2%" set _$lim=1
set _i=0
:_lp_src
call var set _i=(%_i%+1)
if "%appdir%"=="" goto _auto_src
echo _appsrc | lmod set _$src=[~37][]%_i%[~37]>%tmp%\_runa.bat
call %tmp%\_runa.bat
xgrep -shy ^%_$src%\%_apparc%.%1$ %djdir%\index.dat >>%tmp%\_runa.bak
if errorlevel 1 goto _nxt_src
set _$arcext=%1
goto _nxt_src
:_auto_src
xgrep -shy [:a:d]?%_apparc%[:p].?%1$ %djdir%\index.dat >>%tmp%\_runa.bak
if errorlevel 1 goto _end_src
set _$arcext=%1
goto _end_src
:_nxt_src
if "%_i%"=="%_$lim%" goto _end_src
goto _lp_src
:_end_src
for %%i in (lim src) do set _$%%i=
set _i=
goto _eof
:_duplex
set _i=0
:_lp_dup
call var set _i=(%_i%+1)
lmod /l%_i% /s. set _$arcext=[$2,l][+]set _$archive=[]<%tmp%\_runa.tmp >%tmp%\_runa.bat
call %tmp%\_runa.bat
call %0 : _app%_$arcext% %_$archive% %_appbin%
if errorlevel 1 goto _nxt_dup
goto _end_dup
:_nxt_dup
el! 255
if "%_i%"=="%_$dupl%" goto _end_dup
goto _lp_dup
:_end_dup
set _$dupl=
set _i=
if errorlevel 255 goto _getdir
echo UBCD: Found! Installing %_app%
goto _enufdisc
:_getdir
xgrep -shy \\%_appdir%[:a:d:p]*%_appbin%$ %djdir%\index.dat >%tmp%\_runa.bak
if errorlevel 1 goto _apperr
lmod /l1 []<%tmp%\_runa.bak | stow _$src >%tmp%\nul
call %0 : _getpath %_$src%
goto _runcd
:_apperr
if "%appdir%"=="" %0 : _err missing archive/directory (%_appdir%.?)
echo %appdir% >%tmp%\_appdir.set
set | tfind /f1,2 "_$" >%tmp%\_runa.tmp
set | tfind /f1,6 "appdir" >%tmp%\_runa.tmp
type %tmp%\_runa.tmp | lmod /L* /B= set [$1]=>%tmp%\_runa.bat
call %tmp%\_runa.bat
if exist %tmp%\_runa.* del %_delq% %tmp%\_runa.*
goto _start2
:_getpath
shift
shift
varset x=string %1 >%tmp%\nul
set _$char=%_$char%~%errorlevel%
call var set n=ext %1
varset x=string %n% >%tmp%\nul
set _$char=%_$char%~%errorlevel%
echo %1 | lmod /s.\ [$!-1] | stow n >%tmp%\nul
varset x=string %n% >%tmp%\nul
set _$char=%_$char%~%errorlevel%
echo %_$char% | lmod /s~ call var set n=([$1]-([$2]+[$3]+2)[+]set _$char=>%tmp%\_runa.bat
call %tmp%\_runa.bat
echo %1 | lmod [1,%n%] | stow _$src >%tmp%\nul
set n=
goto _eof
::
:_arcok
echo UBCD: Found! Installing %_app%
echo %_appbin% | lmod [l] | stow _appbin >%tmp%\nul
for %%d in (_apparc _appdir) do echo %%%d% | lmod /l* [l] | stow %%d >%tmp%\nul
for %%d in (cab zip uha rar 7z) do if "%_$arcext%"=="%%d" call %0 : _app%%d %_$archive% %_appbin%
if errorlevel 1 %0 : _err missing %_appbin% (check %_apparc%.%_$arcext%)
goto _enufdisc
:_appcab
shift
shift
if not exist %ramdrv%\bin\extract.exe %0 : _err missing extract.exe (check %srcdrv%\bin)
extract.exe %1 /D | lmod /l* [l] >%tmp%\_runa.tm$
tfind /f1 "%2" <%tmp%\_runa.tm$ >%tmp%\nul
if errorlevel 1 goto _eof
tfind /f1 " bytes" <%tmp%\_runa.tm$ | lmod /s /l* [$!-1] >%tmp%\_runa.tm$
lmod /s, /l* [$1][$2][$3][$4][$5][$6][$7][$8]<%tmp%\_runa.tm$ | stow _appsz >%tmp%\nul
goto _eof
:_appzip
shift
shift
:: if not exist %ramdrv%\bin\unzip.exe %0 : _err missing unzip.exe (check %srcdrv%\bin)
:: unzip.exe -l %1 | lmod /l* [l] >%tmp%\_runa.tm$
if not exist %ramdrv%\bin\pkunzip.exe %0 : _err missing pkunzip.exe (check %srcdrv%\bin)
pkunzip.exe -v %1 | lmod /l* [l] >%tmp%\_runa.tm$
tfind /f1 "%2" <%tmp%\_runa.tm$ >%tmp%\nul
if errorlevel 1 goto _eof
call var set _n=lines %tmp%\_runa.tm$
:: lmod /l%_n% [$1]<%tmp%\_runa.tm$ | stow _appsz >%tmp%\nul
lmod /l%_n% [$2]<%tmp%\_runa.tm$ | stow _appsz >%tmp%\nul
set _n=
goto _eof
:_appuha
shift
shift
if not exist %ramdrv%\bin\uharcd.exe %0 : _err missing uharcd.exe (check %srcdrv%\bin)
uharcd.exe l -y+ -o+ %1 >%tmp%\_runa.tm$
tfind /f1 "%2" <%tmp%\_runa.tm$ >%tmp%\nul
if errorlevel 1 goto _eof
call var set _n=lines %tmp%\_runa.tm$
call var set _n=(%_n%-1)
for %%e in (255 1) do if errorlevel %%e %0 : _err arithmetic (uha)
lmod /l%_n% [$!]<%tmp%\_runa.tm$ | stow _appsz >%tmp%\nul
set _n=
goto _eof
:_apprar
shift
shift
if not exist %ramdrv%\bin\unrar.exe %0 : _err missing unrar.exe (check %srcdrv%\bin)
unrar.exe vt %1 >%tmp%\_runa.tm$
tfind /f1 "%2" <%tmp%\_runa.tm$ >%tmp%\nul
if errorlevel 1 goto _eof
call var set _n=lines %tmp%\_runa.tm$
call var set _n=(%_n%-1)
for %%e in (255 1) do if errorlevel %%e %0 : _err arithmetic (uha)
lmod /l%_n% [$2]<%tmp%\_runa.tm$ | stow _appsz >%tmp%\nul
set _n=
goto _eof
:_app7z
shift
shift
if not exist %ramdrv%\bin\7za.exe %0 : _err missing 7za.exe (check %srcdrv%\bin)
7za.exe l %1 >%tmp%\_runa.tm$
tfind /f1 "%2" <%tmp%\_runa.tm$ >%tmp%\nul
if errorlevel 1 goto _eof
call var set _n=lines %tmp%\_runa.tm$
lmod /l%_n% [$1]<%tmp%\_runa.tm$ | stow _appsz >%tmp%\nul
set _n=
goto _eof
::
:_enufdisc
call var set _appsz=(%_appsz%/1024)
call var set _appszt=(3072+%_appsz%)
dir %ramdrv% | tfind " bytes free" >%tmp%\_runa.bak
lmod /s /l* [$!-2]<%tmp%\_runa.bak >%tmp%\_runa.tmp
lmod /s, /l* [$1][$2][$3][$4][$5][$6][$7][$8]<%tmp%\_runa.tmp | stow _appenuf >%tmp%\nul
call var set _appenuf=(%_appenuf%/1024)
call var set _appdiff=(%_appenuf%-%_appszt%)
if errorlevel 255 %0 : _abort
if errorlevel 1 goto _noenuf
:_unpack
echo %_appdir% | lmod [u] | stow _appdir >%tmp%\nul
if not exist %ramdrv%\usr\nul mkdir %ramdrv%\usr
if not exist %ramdrv%\usr\%_appdir%\nul mkdir %ramdrv%\usr\%_appdir%
for %%d in (_apparc _appdir) do call var set %%d=string %%%d% /u
echo UNPACK: Extracting "%_$archive%"
for %%d in (cab zip uha rar 7z) do if "%_$arcext%"=="%%d" goto _un%%d
:_uncab
extract.exe /Y /E /L %_$dest% %_$archive% >%tmp%\extract.out
goto _unpok
:_unzip
pkunzip.exe -o -d %_$archive% %_$dest% >%tmp%\extract.out
goto _unpok
:_unzip2
unzip.exe -o -C -qq %_$archive% -d %_$dest% >%tmp%\extract.out
goto _unpok
:_unuha
uharcd.exe x -y+ -o+ -t%_$dest% %_$archive% >%tmp%\extract.out
goto _unpok
:_unrar
unrar.exe x -c- -o+ -y %_$archive% %_$dest% >%tmp%\extract.out
goto _unpok
:_un7z
7za.exe x -bd -o%_$dest% %_$archive% >%tmp%\extract.out
:_unpok
if errorlevel 1 %0 : _err
if exist %ramdrv%\bin\attrib.com attrib +r -hsa %ramdrv%\usr\%_appdir%\*.* /s >%tmp%\nul
:_unpok2
%ramdrv%
dir /s /b /o %ramdrv%\usr\%_appdir% >%tmp%\_runa.bak
xgrep -shy %_appdir%[:a:d:p]*%_appbin%$ %tmp%\_runa.bak >%tmp%\_runa.tmp
lmod /l1 []<%tmp%\_runa.tmp | stow _$src >%tmp%\nul
call %0 : _getpath %_$src%
goto _run
:_runcd
%cddrv%
:_run
cd \
cd %_$src%
set | tfind /f1,2 "_$" >%tmp%\_runa.tmp
for %%i in (_appdir _appsz _appsrc _appbin _apparc _appenuf _appdiff) do call %0 : _preclr %%i
type %tmp%\_runa.tmp | lmod /L* /B= set [$1]=>%tmp%\_runa.bat
echo set _app=>>%tmp%\_runa.bat
call %tmp%\_runa.bat
if exist %tmp%\_runa.* del %_delq% %tmp%\_runa.*
if exist autorun.bat goto _runauto
call %_appcmd%
goto _endapp
:_runauto
call autorun.bat
:_endapp
if "%_appmnu%"=="-" goto _end
if "%_appmnu%"=="-p" pause
if "%_appmnu%"=="-o" set ubcd_off=1
goto _end
::
:_noenuf
if "%_appclr%"=="1" %0 : _err Ramdisk full (try increasing size of ramdisk)
echo :w_config "Ramdisk is full" [x]>%tmp%\_runa.tmp
echo (~press any key~: #? sec.)>>%tmp%\_runa.tmp
echo.>>%tmp%\_runa.tmp
echo !! Warning !! >>%tmp%\_runa.tmp
echo.>>%tmp%\_runa.tmp
echo There is not enough free space >>%tmp%\_runa.tmp
echo to extract "%_apparc%.%_$arcext%" >>%tmp%\_runa.tmp
echo.>>%tmp%\_runa.tmp
echo [$ _appsz,9] Kb required >>%tmp%\_runa.tmp
echo [$ _appszt,9] Kb required (total) >>%tmp%\_runa.tmp
echo [$ _appenuf,9 ] Kb available (%ramdrv%\) >>%tmp%\_runa.tmp
echo.>>%tmp%\_runa.tmp
echo Delete previous installation(s)>>%tmp%\_runa.tmp
echo to free up available memory?>>%tmp%\_runa.tmp
echo.>>%tmp%\_runa.tmp
echo.>>%tmp%\_runa.tmp
echo [ Ok ] [? Cancel ] >>%tmp%\_runa.tmp
call w.bat box @%tmp%\_runa.tmp:w_config #4,30
if errorlevel 2 %0 : _err Ramdisk full (not enough free space)
echo UBCD: Deleting contents "%ramdrv%\usr\.."
%ramdrv%
cd \
set _appclr=1
dir /b %ramdrv%\usr | tfind /v /f1,2 "VC" | lmod /s /l* deltree /y %ramdrv%\usr\[$1][~62]%tmp%\nul>%tmp%\_runa.bat
call %tmp%\_runa.bat
goto _enufdisc
::
:_err
shift
shift
if not exist %tmp%\extract.out goto _err2
type %tmp%\extract.out
@pause
goto _end
echo UNPACK: Error while unpacking "%_apparc%.%_$arcext%"
:_err2
echo UBCD: Error!!! %1 %2 %3 %4 %5 %6 %7 %8
echo.
@pause
goto _end
:_abort
shift
shift
echo UBCD: Aborted
:_preclr
shift
shift
varset x=string %1 >%tmp%\nul
set | tfind /f1,%errorlevel% "%1">>%tmp%\_runa.tmp
goto _eof
:_end
set ?=
if not exist %tmp%\_appdir.set goto _end2
lmod []<%tmp%\_appdir.set | stow appdir >%tmp%\nul
:_end2
set | tfind /f1,2 "W_" >%tmp%\_runa.tmp
set | tfind /f1,2 "_$" >>%tmp%\_runa.tmp
set | tfind /f1,5 "_app" >>%tmp%\_runa.tmp
type %tmp%\_runa.tmp | lmod /L* /B= set [$1]=>%tmp%\_runa.bat
call %tmp%\_runa.bat
set wbat=
set wrb=
for %%i in (1 2 3 4 5 6 7 8 9) do set wcb%%i=
for %%i in (%tmp%\_runa.* %tmp%\extract.out) do if exist %%i del %_delq% %%i
::
:_eof
"So, what else is new?"
Namely, this
viewtopic.php?t=1422&start=29
The feature is available (UBCD4.11 and UBCD 5) but not activated by default (Victor is working on formalising the format for the next UBCD release). If you intend to use, it, simply populate the INI file with the dosapp programs in question and place it anywhere in the ISO.
There's other aspects that have been significantly improved but I'd like to finish this release before outlining their function.