Jump to content
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble
Strawberry Orange Banana Lime Leaf Slate Sky Blueberry Grape Watermelon Chocolate Marble

MSFN is made available via donations, subscriptions and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, register and become a site sponsor/subscriber and ads will be disabled automatically. 


Sign in to follow this  
Kelsenellenelvian

Need a 3 choice cmd file

Recommended Posts

I have VERY little knowledge of mkisofs commands so if anyone seees any improvements please let me know so I can call this final!

There is no final answer.

Do you expect plain OS files (OS, SP and security fixes)?

Do you expect custom files with non ASCII chars?

About file system and NT to 2003, to summarize :

core boot setup does read ISO9660 names, only upper case names are found

-iso-level 4 allow lower case names, core boot may fail; -force-uppercase set upppercase names

a NT based bootsector does fail at ISO9660 Level 1, lower restrictions

-iso-level 4 includes -relaxed-filenames, -l and -allow-multidot

2003 SP2 use a long directory name

-boot-load-seg 0x7C0 is a internal default

-boot-load-size defaults to whole file (remember Windows 7 use 2048 byte bootsector)

Rock Ridge is not required at a single NT based boot cd.

Joliet file system is not required at NT based boot cd, ms dosn't use Joliet at NT based boot cd.

Joliet could be useful at custom addons with unicode chars, or at 2003 SP2 with -iso-level 3.

A suggestion: -iso-level 4

If bootable Then
wsh.Run chr(34) & locpath & "\mkisofs.exe" & chr(34) & " -b " & chr(34) & bootsect & chr(34) & _
" -no-emul-boot -hide " & chr(34) & bootsect & chr(34) & " -iso-level 4 -duplicates-once -force-uppercase " & _
"-sysid ""Win32"" -V ""Windows"" -o " & chr(34) & src & ".iso" & chr(34) & " " & chr(34) & src & chr(34)

-duplicates-once -force-uppercase require a special forged version. Not supported since 2004, does work fine for boot cd.

Or -iso-level 3 with Joliet

If bootable Then
wsh.Run chr(34) & locpath & "\mkisofs.exe" & chr(34) & " -b " & chr(34) & bootsect & chr(34) & _
" -no-emul-boot -hide " & chr(34) & bootsect & chr(34) & " -hide-joliet " & chr(34) & bootsect & chr(34) & _
" -hide boot.catalog -hide-joliet boot.catalog -relaxed-filenames -iso-level 3 -D -d -l -N -joliet-long -allow-multidot " & _
"-sysid ""Win32"" -V ""Windows"" -o " & chr(34) & src & ".iso" & chr(34) & " " & chr(34) & src & chr(34)

Use any version.

Share this post


Link to post
Share on other sites

WHO named my name vainly? :w00t:

Sinning is WAY too much fun, I ain't about to give it up :w00t:

-duplicates-once ONLY has a meaning if making a multi-something-in-one AND if the version of mkisofs.exe supports them

Well, I figured it would help for those making multiboot CDs, but those people probably aren't the targeted type of user. It may still help a bit with some duplicate files in different folders (like say, installshield stuff, or others like InstMsiW.exe and what not...) I figured it probably doesn't hurt.

A setting of -iso-level 3 should be "enough" for the intended target. :unsure:

Pfffft. I'd make one that goes to 11 if I could!

I'll leave that choice to Kelsenellenelvian again. He should be able to change the 4 for a 3 himself in the script if he prefers that.

I've also left "-m thumbs.db" as Kelsenellenelvian told me he didn't want any of them things (his previous script merely hid them, this should omit them instead).

Now to translate it to the relevant code. :blink:

That's by far the easiest part

cdob: Good points again (I'm not ignoring them). Like before, I'll leave it up to Kelsenellenelvian to make such decisions as it's his tool (I have no use for it whatsoever, and we're all running on Win 7 anyway)

Finally, here's the code with the new mkisofs args:


Option Explicit
Const bootsect = "bootsect.bin"
Dim fso, wsh, shl, fld, src, locpath, valid, bootable

Set fso = CreateObject("Scripting.FileSystemObject")
Set wsh = WScript.CreateObject("WScript.Shell")
locpath=Left(WScript.ScriptFullName,(Len(WScript.ScriptFullName)-Len(Wscript.ScriptName)))
If Not fso.FileExists(locpath & "mkisofs.exe") Then
MsgBox "mkiofs.exe missing", 16, "Error" 'vbOKOnly=0 vbCritical=16
WScript.Quit(1)
End If
valid=false
bootable=false
If WScript.Arguments.Count = 1 Then
src=WScript.Arguments(0)
ValidateSourcePath()
End If
If Not valid Then
Set shl=CreateObject("Shell.Application")
While Not valid
Set fld=shl.BrowseForFolder(0, "Select source",16,17) '16=BIF_EDITBOX; 17=ssfDRIVES
If fld Is Nothing Then WScript.Quit(1)
src=fld.Self.Path
Set fld=Nothing
ValidateSourcePath()
Wend
Set shl=Nothing
End If
If bootable And Not fso.FileExists(src & "\" & bootsect) Then
If Not fso.FileExists(locpath & "\" & bootsect) Then
MsgBox "Boot sector missing (" & bootsect & ")", 16, "Error"
WScript.Quit(1)
Else
fso.CopyFile locpath & bootsect, src & "\"
End If
End If
If bootable Then
wsh.Run chr(34) & locpath & "\mkisofs.exe" & chr(34) & " -v -iso-level 4 -l -D -d -J -joliet-long -r -volid ""WinXP"" -A MKISOFS " & _
"-sysid ""Win32"" -b bootsect.bin -no-emul-boot -boot-load-size 4 -allow-multidot -hide bootsect.bin -hide boot.catalog " & _
"-duplicates-once -m thumbs.db -o " & chr(34) & src & ".iso" & chr(34) & " " & chr(34) & src & chr(34)
Else
wsh.Run chr(34) & locpath & "\mkisofs.exe" & chr(34) & " -v -iso-level 4 -l -D -d -J -joliet-long -r -volid ""Data Disc"" -A MKISOFS " & _
"-sysid ""Win32"" -allow-multidot -duplicates-once -m thumbs.db -o " & chr(34) & src & ".iso" & chr(34) & " " & chr(34) & src & chr(34)
End If

Sub ValidateSourcePath()
If fso.FileExists(src) Then src=fso.GetParentFolderName(src)
If Not fso.FolderExists(src) Then Exit Sub
If fso.FolderExists(src & "\i386") Then
valid=true
bootable=true
Else
If MsgBox("The specified folder doesn't contain Windows XP" & chr(13) & chr(10) & "Create a data CD instead?", 36, "Warning") = 6 Then 'vbYesNo=4 vbQuestion=32
valid=true
bootable=false
End If
End If
End Sub

I haven't tested the new options to see if the bootable CDs actually work at all (too lazy to fire up a VM)

Share this post


Link to post
Share on other sites

11? LOL

Hey I am testing it on a win2k installation right now with the iso level 4 and so far it is running GOOD!

Thank you guys so much!

Edit: Install went fine! The tool is now pretty much complete. Thank you guys!

Edited by Kelsenellenelvian

Share this post


Link to post
Share on other sites
cdob: Good points again (I'm not ignoring them). Like before, I'll leave it up to Kelsenellenelvian to make such decisions as it's his tool (I have no use for it whatsoever, and we're all running on Win 7 anyway)

Finally, here's the code with the new mkisofs args:

Current args are broken.

A file SETUPLDR.bin is added as SETUPLDR.bin.

Bootector search file SETUPLDR.BIN only, booting fails.

Share this post


Link to post
Share on other sites

Current args are broken.

A file SETUPLDR.bin is added as SETUPLDR.bin.

Bootector search file SETUPLDR.BIN only, booting fails.

That's only the case if your files are named like that on your hard drive, which most of the time wouldn't be the case (having copied from the CD). It definitely didn't do that the time I've tried it. Using -force-uppercase would make everything uppercase which is rather ugly. Again, it's Kelsenellenelvian's decision as it's his tool. If he wants -force-uppercase I'll be happy to add it.

Share this post


Link to post
Share on other sites

I agree UPPERCASE is ugly. Especially on a WPI-style disk where you have dozens of installers and hundreds of files.

I have yet to run into an issue with booting from a disk with the current config.

Share this post


Link to post
Share on other sites

Create a test version:

Use a XP gold or SP1 CD as source. Slipstream SP3.

Installation fails because of a mixed case name win51ip.SP3.

Should be supported a slipstreamed version?

-force-uppercase goes to ISO9660 file system names only.

That's the same case as ISO9660 Level 1 to 3.

Joliet or Rock Ridge names are mixed case still.

Windows display Joliet names, if Joliet is available.

Windows display mixed case names, despide uppercased ISO9660 names.

Which names should be supported?

Can you name some examples?

Is winnt.sif [MassStorageDrivers] used? May a end user use this option?

Share this post


Link to post
Share on other sites
Yeah an end user of this is very likely to use massstorage drivers.

How do they do this?

Massstorage driver are loaded early, case is importand.

Does exist lower case names at hard disk after adding massstorage drivers?

Actual question was: may a end user use \I386\$OEM$\TXTSETUP.OEM ?

$OEM$ has to exist at ISO9660 name. A "$" char is invalid at ISO9660 Level 1.

Which chars does use the "dozens of installers and hundreds of files" ?

Are there any unicode chars?

Are there plain ASCII (7 bit) chars?

Share this post


Link to post
Share on other sites

@ cdob:

I think I am running into the error you speak of with one user.

Would the current config possibly cause this?

http://img198.imageshack.us/img198/3138/errorgr.png

Also is there a way to get it to use the boot sector but not leave a copy of it in the Windows source folder?

Edited by Kelsenellenelvian

Share this post


Link to post
Share on other sites

Also is there a way to get it to use the boot sector but not leave a copy of it in the Windows source folder?

You can feed mkisofs with a "dummy" bootsector and then "dd" the real one from the spcmdcon.sys to the .iso directly.

This can be done with programs like dsfi (part of the DSFOK toolkit):

http://members.ozemail.com.au/~nulifetv/freezip/freeware/

but most probably it can be done from VBS too.

jaclaz

Share this post


Link to post
Share on other sites
I would think that they are unicode on a good number of users.

Can you name examples?

Are there unicode names used inside ISO image?

Are there unicode names at src directory name?

I've no idea to handle unicode names at vbs or cmd.exe.

Even a 8 bit char at src directory name may get unexpected results.

I think I am running into the error you speak of with one user.

Would the current config possibly cause this?

Yes, this is a example.

Most likely this user added a security fix. Security fixes add lowercase file names.

At boot setupldr.bin dosn't find NTKRNMP.exe, despide the ntkrnlmp.exe message.

Also is there a way to get it to use the boot sector but not leave a copy of it in the Windows source folder?
Yes and no. No, boot sector has to be relative to source folder.

However you may collect different source folders.

Create a dummy sub folder and add boot sector

.\mkisofs.exe

.\bootsect\bootsect.bin

Collect files from Windows source folder and dummy sub folder.

If bootable And Not fso.FileExists(locpath & "bootsect\" & bootsect) Then
MsgBox "Boot sector missing (" & bootsect & ")", 16, "Error"
WScript.Quit(1)
End If
If bootable Then
wsh.Run chr(34) & locpath & "\exec.cmd" & chr(34) & _
"mkisofs.exe -iso-level 4 -joliet-long -duplicates-once -force-uppercase" & _
" -no-emul-boot -b " & bootsect & _
" -hide boot.catalog -hide " & bootsect & _
" -hide-joliet boot.catalog -hide-joliet " & bootsect & _
" -sysid ""Win32"" -V ""Windows"" -m thumbs.db" & _
" -o """ & src & ".iso""" & " """ & src & """ """ & locpath & "bootsect"""
Else

exec.cmd

@setlocal EnableExtensions
%*
@IF %ERRORLEVEL% GTR 0 pause

That's a work around to display actual used command line. And to pause at a error.

I need used command line and mkisofs output to debug error conditions.

How to do this within vbs?

By the way: remember name bootsect.bin is case sensitive. bootsect.bin is not BOOTSECT.BIN, nor BootSect.bin.

Another question:

Which ISO file size does create end customers?

Setupldr.bin and ntldr access first 4GB of a ISO9660 media only.

Textmode files and ASMS folder has to be within first 4GB of media.

Mkisofs does sort by name by default.

Simple approach: ask end user to use a name after I386. E.g. add third party setup files at \setup\

This way I386 goes first to media.

Share this post


Link to post
Share on other sites

I need used command line and mkisofs output to debug error conditions.

How to do this within vbs?

There's plenty of ways. The easiest would be to use a plain old MsgBox to display it first (btw, you can hit ctrl+c when a messagebox is displayed to copy all of its text).

You'd replace something like

wsh.Run "all kinds of stuff here"

for something like

Dim someVarName

someVarName = "the exact same stuf you used to pass to wsh.Run goes here"

MsgBox someVarName

wsh.Run someVarName

Although you can very easily debug vbscript compared to batch files. You can run

yourscriptname arg1 arg2 arg3 ... argn //x

i.e. you just add //x at the end of the usual command line. That will make it popup a dialog asking to select a suitable debugger (visual studio works great but there's a bunch of other options including the old script debugger). Then you can step through code, set breakpoints -- including conditional breakpoints (or with hit counts and such) which are invaluable, set watches, evaluate expressions, peek at some object's properties, change the execution path, view the call stack, etc. So there's usually ways to find the infos you need and debug stuff without having to use a lot of "messages" like that (be it MsgBox, WScript.Echo and similar ways). This stuff has been around for a decade ;)

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...