cdob Posted August 4, 2010 Share Posted August 4, 2010 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 namesa NT based bootsector does fail at ISO9660 Level 1, lower restrictions-iso-level 4 includes -relaxed-filenames, -l and -allow-multidot2003 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 4If 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 JolietIf 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. Link to comment Share on other sites More sharing options...
CoffeeFiend Posted August 4, 2010 Share Posted August 4, 2010 WHO named my name vainly? Sinning is WAY too much fun, I ain't about to give it up -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. 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. That's by far the easiest partcdob: 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 ExplicitConst bootsect = "bootsect.bin"Dim fso, wsh, shl, fld, src, locpath, valid, bootableSet 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 Ifvalid=falsebootable=falseIf WScript.Arguments.Count = 1 Then src=WScript.Arguments(0) ValidateSourcePath()End IfIf 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=NothingEnd IfIf 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 IfEnd IfIf bootable Thenwsh.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 IfSub ValidateSourcePath()If fso.FileExists(src) Then src=fso.GetParentFolderName(src)If Not fso.FolderExists(src) Then Exit SubIf 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 IfEnd IfEnd SubI haven't tested the new options to see if the bootable CDs actually work at all (too lazy to fire up a VM) Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted August 5, 2010 Author Share Posted August 5, 2010 (edited) 11? LOLHey 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 August 5, 2010 by Kelsenellenelvian Link to comment Share on other sites More sharing options...
gunsmokingman Posted August 5, 2010 Share Posted August 5, 2010 If I may , using "radio" instead of "CheckBox" would be more "standard"....jaclaz Sure what ever could you do better? Link to comment Share on other sites More sharing options...
cdob Posted August 5, 2010 Share Posted August 5, 2010 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. Link to comment Share on other sites More sharing options...
CoffeeFiend Posted August 5, 2010 Share Posted August 5, 2010 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. Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted August 5, 2010 Author Share Posted August 5, 2010 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. Link to comment Share on other sites More sharing options...
cdob Posted August 5, 2010 Share Posted August 5, 2010 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? Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted August 5, 2010 Author Share Posted August 5, 2010 Yeah an end user of this is very likely to use massstorage drivers. Link to comment Share on other sites More sharing options...
cdob Posted August 5, 2010 Share Posted August 5, 2010 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? Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted August 5, 2010 Author Share Posted August 5, 2010 I would think that they are unicode on a good number of users. Link to comment Share on other sites More sharing options...
Kelsenellenelvian Posted August 6, 2010 Author Share Posted August 6, 2010 (edited) @ 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.pngAlso 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 August 6, 2010 by Kelsenellenelvian Link to comment Share on other sites More sharing options...
jaclaz Posted August 6, 2010 Share Posted August 6, 2010 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 Link to comment Share on other sites More sharing options...
cdob Posted August 6, 2010 Share Posted August 6, 2010 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.binCollect 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 IfIf 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"""Elseexec.cmd@setlocal EnableExtensions%*@IF %ERRORLEVEL% GTR 0 pauseThat'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. Link to comment Share on other sites More sharing options...
CoffeeFiend Posted August 6, 2010 Share Posted August 6, 2010 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 likewsh.Run "all kinds of stuff here"for something likeDim someVarNamesomeVarName = "the exact same stuf you used to pass to wsh.Run goes here" MsgBox someVarNamewsh.Run someVarNameAlthough you can very easily debug vbscript compared to batch files. You can run yourscriptname arg1 arg2 arg3 ... argn //xi.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 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now