Ultimate Boot CD
http://www.ultimatebootcd.com/forums/

ubcd2iso.cmd additions (hiding boot.catalog + add run.bat)
http://www.ultimatebootcd.com/forums/viewtopic.php?f=7&t=1515
Page 1 of 1

Author:  Icecube [ Thu Aug 14, 2008 12:21 am ]
Post subject:  ubcd2iso.cmd additions (hiding boot.catalog + add run.bat)

Change ubcd2iso.cmd to the following (moves boot.catalog to /isolinux/boot.cat and hides it).
Before you rebuild your iso, remove the boot.catalog file from the root (you only have to do this once).
Quote:
@echo off

rem * Create a bootable UBCD ISO image
rem *
rem * Ultimate Boot CD (UBCD): http://www.ultimatebootcd.com/
rem * syslinux: http://syslinux.zytor.com/

@echo on
@if "%debug%"=="" echo off

SET a1=%1
SET a1=###%a1%###
SET a1=%a1:"###=%
SET a1=%a1:###"=%
SET a1=%a1:###=%

SET a2=%2
SET a2=###%a2%###
SET a2=%a2:"###=%
SET a2=%a2:###"=%
SET a2=%a2:###=%

if "%a1%"==":" if not "%a2%"=="" goto %a2%
if "%a1%"=="" goto _help
if "%a2%"=="" goto _help

echo UBCD2ISO: Creating bootable UBCD ISO image ...

if not exist "%~p0\mkisofs.exe" %0 : _error Missing file '%~p0\mkisofs.exe'
if not exist "%a1%\isolinux\isolinux.bin" %0 : _error Missing file '%a1%\isolinux\isolinux.bin'

del "%a1%\isolinux\boot.cat"

pushd "%a1%"
"%~p0\mkisofs.exe" -N -J -joliet-long -D -V "UBCD40" -o "%a2%" -b "isolinux/isolinux.bin" -c "isolinux/boot.cat" -hide "isolinux/boot.cat" -no-emul-boot -boot-load-size 4 -boot-info-table .
popd
if errorlevel 0 goto _success
%0 : _error 'mkisofs.exe' failed

:_success
echo UBCD2ISO: Bootable UBCD ISO image has been created
echo.
"%~p0\wait" 3
if not "%3"=="-Y" if not "%3"=="-y" pause
goto _end

:_help
echo.
echo UBCD2ISO: Create bootable UBCD ISO image
echo.
echo Params: -Y : No pause (for batch-mode)
echo.
echo Usage: UBCD2ISO (UBCD-path) (output-image) [params]
echo.
echo Example: UBCD2ISO c:\ubcd c:\ubcd40.iso
echo (UBCD extracted in dir 'c:\ubcd', ISO image written to 'c:\ubcd40.iso')
echo.
echo Required: W2K/XP/W2K3/Vista and UBCD extracted to local storage
echo.
rem * This pause isn't needed anymore if this file is called from run.bat
rem pause

goto _end

:_error
shift
shift
echo.
echo (ERROR) %1 %2 %3 %4 %5 %6 %7 %8
echo.
rem * This pause isn't needed anymore if this file is called from run.bat
rem pause

goto _end

:_end


Add a file run.cmd (also to ubcd2usb)
run.cmd
Quote:
@echo off

rem * Run ubcd2iso.cmd and afterwards cmd so the user can add the nessecary parameters to the ubcd2iso command

call ubcd2iso.cmd
cmd.exe /c cd "%~p0"
@pause

The user must run now only run.bat (just double click on it). So there should be any problems any more for users to rebuild the iso.

EDIT: corrected run.bat

Author:  as702 [ Thu Aug 14, 2008 1:16 am ]
Post subject: 

Quote:
@echo off

rem * Run ubcd2iso.cmd and afterwards cmd so the user can add the nessecary parameters to the ubcd2iso command

ubcd2iso.cmd
cmd.exe /c cd "%~p0"


change to:

Quote:
@echo off

rem * Run ubcd2iso.cmd and afterwards cmd so the user can add the nessecary parameters to the ubcd2iso command

call ubcd2iso.cmd
cmd.exe /c cd "%~p0"
@pause

Author:  Icecube [ Thu Aug 14, 2008 1:33 am ]
Post subject: 

Change ubcd2iso.cmd to the following (moves boot.catalog to /isolinux/boot.cat and hides it + add the cmd command inside ubcd2iso.cmd (run.bat isn't needed anymore)).

Before you rebuild your iso, remove the boot.catalog file from the root (you only have to do this once).

The VOLUME ID (label) had the wrong name (still UBCD40). I added an extra variable at the beginning so that it is easier to change it when UBCD501 comes out
Quote:
@echo off

rem * Create a bootable UBCD ISO image
rem *
rem * Ultimate Boot CD (UBCD): http://www.ultimatebootcd.com/
rem * syslinux: http://syslinux.zytor.com/

@echo on
@if "%debug%"=="" echo off

rem * Set VOLUME ID (label) which will be displayed in explorer when the cd is mounted
SET VOLUME_ID="UBCD500"


SET a1=%1
SET a1=###%a1%###
SET a1=%a1:"###=%
SET a1=%a1:###"=%
SET a1=%a1:###=%

SET a2=%2
SET a2=###%a2%###
SET a2=%a2:"###=%
SET a2=%a2:###"=%
SET a2=%a2:###=%

if "%a1%"==":" if not "%a2%"=="" goto %a2%
if "%a1%"=="" goto _help
if "%a2%"=="" goto _help

echo UBCD2ISO: Creating bootable UBCD ISO image ...

if not exist "%~p0\mkisofs.exe" %0 : _error Missing file '%~p0\mkisofs.exe'
if not exist "%a1%\isolinux\isolinux.bin" %0 : _error Missing file '%a1%\isolinux\isolinux.bin'

del "%a1%\isolinux\boot.cat" > %tmp%\nul

pushd "%a1%"
"%~p0\mkisofs.exe" -N -J -joliet-long -D -V %VOLUME_ID% -o "%a2%" -b "isolinux/isolinux.bin" -c "isolinux/boot.cat" -hide "isolinux/boot.cat" -no-emul-boot -boot-load-size 4 -boot-info-table .
popd
if errorlevel 0 goto _success
%0 : _error 'mkisofs.exe' failed

:_success
echo UBCD2ISO: Bootable UBCD ISO image has been created
echo.
"%~p0\wait" 3
if not "%3"=="-Y" if not "%3"=="-y" pause
goto _end

:_help
echo.
echo UBCD2ISO: Create bootable UBCD ISO image
echo.
echo Params: -Y : No pause (for batch-mode)
echo.
echo Usage: UBCD2ISO (UBCD-path) (output-image) [params]
echo.
echo Example: UBCD2ISO c:\ubcd c:\ubcd40.iso
echo (UBCD extracted in dir 'c:\ubcd', ISO image written to 'c:\ubcd40.iso')
echo.
echo Required: W2K/XP/W2K3/Vista and UBCD extracted to local storage
echo.
rem * This pause isn't needed anymore
rem pause
cmd.exe /c cd "%~p0"
@pause

goto _end

:_error
shift
shift
echo.
echo (ERROR) %1 %2 %3 %4 %5 %6 %7 %8
echo.
rem * This pause isn't needed anymore
rem pause

goto _end

:_end

Author:  as702 [ Thu Aug 14, 2008 1:37 am ]
Post subject: 

Even better (works fine in win32).

Author:  JMFM [ Mon Aug 25, 2008 8:03 am ]
Post subject: 

Hi I've changed the ubcd2iso.bat, and changed it's extension to cmd, don't know if that makes any difference.
When I run the file a command opens and the message
"UBCD2ISO: Creating bootable UBCD ISO image ... "
appears many times, and then the command window closes and the file isn't created.
any suggestion??

Author:  as702 [ Mon Aug 25, 2008 9:47 am ]
Post subject: 

JMFM wrote:
Hi I've changed the ubcd2iso.bat, and changed it's extension to cmd, don't know if that makes any difference.
When I run the file a command opens and the message
"UBCD2ISO: Creating bootable UBCD ISO image ... "
appears many times, and then the command window closes and the file isn't created.
any suggestion??

What OS are you using?

Author:  JMFM [ Wed Aug 27, 2008 2:29 am ]
Post subject: 

I'm using winxp

Author:  Icecube [ Wed Aug 27, 2008 2:34 am ]
Post subject: 

Have you copied the .cmd file to C:\ubcd\tools\ubcd2iso\ ?

Author:  Victor Chew [ Sat Aug 30, 2008 7:14 am ]
Post subject: 

Methinks "run.cmd" should look like this:

Quote:
@echo off
call ubcd2iso.cmd
cmd.exe /k cd "%~p0"


since the idea is to want the Command Prompt to remain opened after the "cd" command?

The "@pause" doesn't seem to be necessary, since the Command Prompt is sitting there already, so the user can immediately type in the desired command.

The updated "ubcd2iso.cmd" will look like this:

Quote:
@echo off

rem * Create a bootable UBCD ISO image
rem *
rem * Ultimate Boot CD (UBCD): http://www.ultimatebootcd.com/
rem * syslinux: http://syslinux.zytor.com/

@echo on
@if "%debug%"=="" echo off

...

echo UBCD2ISO: Creating bootable UBCD ISO image ...

if not exist "%~p0\mkisofs.exe" %0 : _error Missing file '%~p0\mkisofs.exe'
if not exist "%a1%\isolinux\isolinux.bin" %0 : _error Missing file '%a1%\isolinux\isolinux.bin'

del "%a1%\isolinux\boot.catalog" 2> NUL

pushd "%a1%"
"%~p0\mkisofs.exe" -N -J -joliet-long -D -V "UBCD40" -o "%a2%" -b "isolinux/isolinux.bin" -c "isolinux/boot.catalog" -hide "isolinux/boot.catalog" -no-emul-boot -boot-load-size 4 -boot-info-table .
popd
if errorlevel 0 goto _success
%0 : _error 'mkisofs.exe' failed

...

:_help
echo.
echo UBCD2ISO: Create bootable UBCD ISO image
echo.
echo Params: -Y : No pause (for batch-mode)
echo.
echo Usage: UBCD2ISO (UBCD-path) (output-image) [params]
echo.
echo Example: UBCD2ISO "c:\ubcd" "c:\ubcd.iso"
echo (UBCD extracted in dir 'c:\ubcd', ISO image written to 'c:\ubcd.iso')
echo.
echo Required: W2K/XP/W2K3/Vista and UBCD extracted to local storage
echo.
goto _end

:_error
shift
shift
echo.
echo (ERROR) %1 %2 %3 %4 %5 %6 %7 %8
echo.
goto _end

:_end


@as702: Correct me if I am wrong. I think your intention is to suppress any error messages from the "del" command? But the error message is printed to stderr, so one needs to use a "2>" instead of the usual ">". Also, a single "NUL" symbol should suffice.

@Icecube: Contrary to my earlier PM to you, I think with this enhancement, we shouldn't need the "Step-by-step guide" anymore, so I have taken it out.

I will also be removing the "-Y" param from both scripts, since I think that is no longer applicable.

Author:  Icecube [ Tue Sep 02, 2008 5:07 am ]
Post subject: 

Victor Chew wrote:
Methinks "run.cmd" should look like this:
Quote:
@echo off
call ubcd2iso.cmd
cmd.exe /k cd "%~p0"
since the idea is to want the Command Prompt to remain opened after the "cd" command?

I found on the web that you could use /c or /k (/c looks nicer to me, but it was probably wrong). I don't have windows installed myself, so I couldn't test it myself.

Wouldn't it be better to include the line
Code:
cmd.exe [b]/k[/b] cd "%~p0"

into ubcd2iso.cmd itself (see my post above)?

Victor Chew wrote:
The "@pause" doesn't seem to be necessary, since the Command Prompt is sitting there already, so the user can immediately type in the desired command.

I didn't include it originally because I thought that it wasn't nessary but as702 tested it and says that it didn't work correctly without it. Probalby because the /c command was wrong!?
Victor Chew wrote:
@as702: Correct me if I am wrong. I think your intention is to suppress any error messages from the "del" command? But the error message is printed to stderr, so one needs to use a "2>" instead of the usual ">". Also, a single "NUL" symbol should suffice.

I chose ">" instead of "2>" because I didn't want to show the user that the isolinux/boot.cat file will be deleted (not very interesting to display and it maybe can frighten users when they see that the script deletes files without there permission). as702 told me that redirecting the output to NUL doesn't work if the current directory is readonly, at least in dos this is the case. Redirecting to %tmp%/NULL will always work.
Victor Chew wrote:
@Icecube: Contrary to my earlier PM to you, I think with this enhancement, we shouldn't need the "Step-by-step guide" anymore, so I have taken it out.

I will also be removing the "-Y" param from both scripts, since I think that is no longer applicable.

This is good thing.

I didn't download the new UBCD5 beta but have you included the SET VOLUME_ID="UBCD500" in the script, so that you only have to edit this line to change the label of the CD instead of changing it in the mkisofs command?

Author:  Icecube [ Tue Sep 02, 2008 2:36 pm ]
Post subject: 

Quote:
@echo off
rem * Create a bootable UBCD ISO image
rem *
rem * Ultimate Boot CD (UBCD): http://www.ultimatebootcd.com/
rem * syslinux: http://syslinux.zytor.com/

@echo on
@if "%debug%"=="" echo off

SET VOLUME_ID="UBCD50B5"

SET a1=%1
SET a1=###%a1%###
SET a1=%a1:"###=%
SET a1=%a1:###"=%
SET a1=%a1:###=%

SET a2=%2
SET a2=###%a2%###
SET a2=%a2:"###=%
SET a2=%a2:###"=%
SET a2=%a2:###=%

if "%a1%"==":" if not "%a2%"=="" goto %a2%
if "%a1%"=="" goto _help
if "%a2%"=="" goto _help

echo UBCD2ISO: Creating bootable UBCD ISO image ...

if not exist "%~p0\mkisofs.exe" %0 : _error Missing file '%~p0\mkisofs.exe'

if not exist "%a1%\isolinux\isolinux.bin" %0 : _error Missing file '%a1%\isolinux\isolinux.bin'

del "%a1%\isolinux\boot.catalog" > NUL

pushd "%a1%"

"%~p0\mkisofs.exe" -N -J -joliet-long -D -V %VOLUME_ID% -o "%a2%" -b "isolinux/isolinux.bin" -c "isolinux/boot.catalog" -hide "isolinux/boot.catalog" -no-emul-boot -boot-load-size 4 -boot-info-table .

popd

if errorlevel 0 goto _success
%0 : _error 'mkisofs.exe' failed

:_success
echo UBCD2ISO: Bootable UBCD ISO image has been created
echo.
rem * The following isn't needed, I think. You can also use pause > NUL
rem "%~p0\wait" 3

goto _end

:_help
echo.
echo UBCD2ISO: Create bootable UBCD ISO image
echo.
echo Usage: UBCD2ISO (UBCD-path) (output-image) [params]
echo.
echo Example: UBCD2ISO "c:\ubcd" "c:\ubcd.iso"
echo (UBCD extracted in dir 'c:\ubcd', ISO image written to 'c:\ubcd.iso')
echo.
echo Required: W2K/XP/W2K3/Vista and UBCD extracted to local storage
echo.
cmd.exe /k cd "%~p0"
goto _end

:_error
shift
shift
echo.
echo (ERROR) %1 %2 %3 %4 %5 %6 %7 %8
echo.
goto _end

:_end


If you really want a run.cmd:
Quote:
@echo off
call ubcd2iso.cmd ../../../ ubcd50b5-custom.iso

This let you preserve the original ubcd50b5.iso, so in case that you ruined the extracted folder, you still have the original iso to start over again.

Author:  as702 [ Tue Sep 02, 2008 3:32 pm ]
Post subject: 

Code:
@echo off
call ubcd2iso.cmd ../../../ ubcd50b5-custom.iso


I'm not to keen on this. NwDsk still requires a valid volume ID when using UBCD4.1.1 (it's purely cosmetic for UBCD5.0b5, thus, a non-issue). It would be best to set the volume ID as a constant, one which is designated according to distribution (e.g. UBCD411 or UBCD50b5). In principle, the more variables you introduce only makes it that much harder to develop for later down the line (potentially at least).

Why not simply create a new folder and place the remastered ISO in there? You could also retrieve a valid volume ID (??) and/or allow users to input a choice on runtime...

Select ISO to build:
1. UBCD4.1.1
2. UBCD5.0b5

meh...

Author:  Victor Chew [ Wed Sep 03, 2008 3:14 am ]
Post subject: 

Quote:
I chose ">" instead of "2>" because I didn't want to show the user that the isolinux/boot.cat file will be deleted


When deleting a single file, no message will be displayed, so we are safe. The 2> will get rid of any "File not found" error message.

Quote:
I didn't download the new UBCD5 beta but have you included the SET VOLUME_ID="UBCD500"


Ah, one of those things I missed. I have added it to the script now. Also added the same thing to ubcd2usb.

I have also removed the wait and added "cmd.exe /k cd "%~p0", so run.cmd has been removed.

Quote:
If you really want a run.cmd:


If we create an ISO file within the UBCD folder, it is quite likely that the user run ubcd2iso again without deleting the ISO file, hence the newly created ISO file will include the previous ISO file (if it works at all).

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/