![]() ![]() |
May 29 2007, 12:31 PM
Post
#200
|
|
|
Friend of MSFN Group: Moderator Posts: 980 Joined: 6-December 06 Member No.: 117812
|
The long wait at T-1 is finally fixed, also no need to write-protect the stick during GUI mode, as we are going to rename temporary the 2 folders and txtsetip.sif and rename them back during first logon. Here is the revised guide, tested on XP Pro SP2, both clean and repair install.
With RED color are marked new or changed entries, strikethrouh font is for entries or files no longer needed compared to the old guide. If you are starting from a scratch just skip those entries or files: 1. Format stick using PEtoUSB or any other utility of your choice, which makes it bootable with 2k/XP boot sector 2. Copy NTDETECT.COM, NTLDR to root and create BOOT.INI BOOT.INI CODE [Boot Loader] If you are going to install on another partition/disk amend entries to reflect that.Timeout=15 Default=multi(0)disk(0)rdisk(1)partition(1)\WINDOWS [Operating Systems] c:\grldr="Start GRUB" multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="GUI Setup" /FASTDETECT Make sure you can boot from stick and reach the menu. 3. Get the latest GRUB4DOS and copy GRLDR to the USB root. If you have any issues use the last stable version. Create in USB stick root MENU.LST CODE color black/cyan yellow/cyan timeout 15 default 0 title Phase 1 WinXP Text Mode Setup chainloader (hd0,0)/setupldr.bin 4. Backup your local BOOT.INI and in the XP setup folder \I386 run CODE winnt32 /makelocalsource /noreboot after it's finished restore BOOT.INI you backed up.5. Copy two new folders onto the USB stick root - $WIN_NT$.~BT and $WIN_NT$.~LS 6. In \$WIN_NT$.~BT modify WINNT.SIF QUOTE [data] msdosinitiated="1" floppyless="1" AutoPartition="0" UseSignatures="no" InstallDir="\WINDOWS" winntupgrade="no" win9xupgrade="no" [GuiRunOnce] "%systemdrive%\windows\system32\undoren.cmd" [SetupParams] UserExecute = "%systemdrive%\windows\system32\boot_ren.cmd" and MIGRATE.INF CODE [Version] If you wish to preserve your USB storage drive letter use CDOB's script to create MIGRATE.INF, don't forget to add the above entries :Signature = "$Windows NT$" [Addreg] HKLM,"SYSTEM\MountedDevices",,0x00000010 HKLM,"SYSTEM\ControlSet001\Control\StorageDevicePolicies","WriteProtect",%REG_DWORD%,1 [Strings] ;Handy macro substitutions (non-localizable) REG_SZ = 0x00000000 REG_BINARY = 0x00000001 REG_DWORD = 0x00010001 REG_MULTI_SZ = 0x00010000 REG_SZ_APPEND = 0x00010008 REG_EXPAND_SZ = 0x00020000 MkMigratgeInf.cmd CODE @echo off REM MkMigratgeInf.cmd v0.01 REM created by cdob setlocal EnableExtensions set Drive=%~d1 if %Drive%.==. set Drive=%~d0 set FileName=%~2 if %FileName%.==. set FileName=MIGRATE.INF.TXT set MigrateDrive=U: if not %~d3.==. set MigrateDrive=%~d3 set Value= FOR /F "skip=2 tokens=1-2*" %%a IN ('reg query HKLM\System\MountedDevices /v \DosDevices\%Drive%') DO set Value=%%c if %Value%.==. (echo drive settings %Drive% not found & goto :EOF) set MigrateStr=%Value:~0,2% set count=2 :begin_parse call :exec set MidStr=%%Value:~%count%,2%% if %MidStr%.==. goto :exit_parse set MigrateStr=%MigrateStr%,%MidStr% set /a count+=2 goto begin_parse :exit_parse (echo [Version] echo Signature = "$Windows NT$" echo. echo [Addreg] echo HKLM,"SYSTEM\MountedDevices","\DosDevices\%MigrateDrive%",0x00030001,\ echo %MigrateStr%)>%FileName% goto :EOF :exec %* goto :EOF 7. Create a folder BOOTFILES in USB stick root, and copy NTDETECT.COM, NTLDR and create there your custom BOOT.INI, which will be copied on hard disk later, during the first logon. Set them system, hidden and read-only in advance. BOOT.INI CODE [boot loader] timeout=15 default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS [operating systems] multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="XP Professional 0 1" /noexecute=optin /fastdetect multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="XP Professional 0 2" /noexecute=optin /fastdetect multi(0)disk(0)rdisk(0)partition(3)\WINDOWS="XP Professional 0 3" /noexecute=optin /fastdetect multi(0)disk(0)rdisk(1)partition(1)\WINDOWS="XP Professional 1 1" /noexecute=optin /fastdetect multi(0)disk(0)rdisk(1)partition(2)\WINDOWS="XP Professional 1 2" /noexecute=optin /fastdetect multi(0)disk(0)rdisk(1)partition(3)\WINDOWS="XP Professional 1 3" /noexecute=optin /fastdetect 8. Create: CODE no longer needed ! CODE no longer needed ! BOOT_REN.CMD CODE @echo off SET TAGFILE=\bootfiles FOR %%h IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO IF EXIST "%%h:%TAGFILE%" SET USBDRIVE=%%h: xcopy %USBDRIVE%\bootfiles\*.* %SYSTEMDRIVE%\ /y /h /r /k ren %USBDRIVE%\txtsetup.sif txtsetup.bak ren %USBDRIVE%\$WIN_NT$.~BT WIN_NT.BT ren %USBDRIVE%\$WIN_NT$.~LS WIN_NT.LS exit UndoRen.CMD CODE @echo off SET TAGFILE=\BOOTFILES FOR %%h IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO IF EXIST "%%h:%TAGFILE%" SET USBDRIVE=%%h: ren %USBDRIVE%\txtsetup.bak txtsetup.sif ren %USBDRIVE%\WIN_NT.BT $WIN_NT$.~BT ren %USBDRIVE%\WIN_NT.LS $WIN_NT$.~LS exit and place them in $WIN_NT$.~LS\i386 9. Copy TXTSETUP.SIF and SETUPLDR.BIN from \$WIN_NT$.~BT to root of USB stick and add the following lines to TXTSETUP.SIF QUOTE [SourceDisksFiles]..... ..... undoUSBWP.reg = 100,,,,,,_x,2,0,0 boot_ren.cmd = 100,,,,,,_x,2,0,0 undoren.cmd = 100,,,,,,_x,2,0,0 .... .... [HiveInfs.Fresh] [HiveInfs.Upgrade] -------- Install XP and leave stick plugged in until after the first logon screen. Notes: 1. If you use an answer file when launching WINNT32.EXE make sure you delete the whole [Unattend] section in WINNT.SIF, otherwise you won't be able to use System Restore and SETUP will not prompt on which partition to install. 2. If you use BTS mass storage DP method 2 and repair install then include the following line in \$WIN_NT$.~LS\I386\PRESETUP.CMD CODE DEL /F %systemroot%\system32\setupold.exe or GUI Setup stops at start, complaining about fake setup being executed.3. If during TEXT MODE your usb stick is listed first when SETUP searches for disks , above SATA/SCSI disks, disable in BIOS IDE channels including the ones with CDROM/DVD attached or disconnect them, this should fix the order. Do not continue install if stick is listed first, this will corrupt files and MBR on it. ------------------------------------ The problem described in post #156 turned out to be that the script launched by CMDLINES.TXT was being executed from within $WIN_NT$.~LS, giving "access denied" error, so I have tried to launch same script via WINNT.SIF [SetupParams] section which worked flawlessly. Wait at T-1 is about 1-2 seconds now, this also saved a few files and entries to be written edit1 (15.Jun.07): Undo_Ren.cmd corrected to UndoRen.cmd This post has been edited by ilko_t: Jun 15 2007, 02:57 PM |
|
|
|
May 29 2007, 12:48 PM
Post
#201
|
|
|
Friend of MSFN Group: Moderator Posts: 980 Joined: 6-December 06 Member No.: 117812
|
Another interesting for me thing- I had Bart PE minint folder on the root of the same stick, while testing I have noticed that if txtsetup.sif in root is missing or renamed, Bart PE is launched instead of TEXT mode setup. It might have been already discussed somewhere, but gives a good idea how both may coexist, without having to create second partition for it. I am going to test it further and report results.
@buseeliu- try some random shots to see why your USB stick is so slow: 1. Update your BIOS 2. Check setting in BIOS for USB, make sure USB2.0 is enabled, play a bit with the other settings for USB- legacy support etc. 3. Test the same stick on another motherboard/system, which is known to support faster speeds 4. Test on your motherboard another stick, which is known to be fast 5. Unplug all other USB devices while testing 6. Use one by one the rear USB ports, try do disconnect fron USB ports from motherboard May be jaclaz can help you with some other ideas, hes knowledge about usb sticks is amazing @jaclaz- Have you had a chance to look what was going wrong with MBRs? This post has been edited by ilko_t: May 29 2007, 12:49 PM |
|
|
|
May 30 2007, 03:30 AM
Post
#202
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 385 Joined: 29-September 05 Member No.: 74988
|
@ilko_t
At first glance I dislike renaming $WIN_NT$ folder. Is this reliable? Contrary no long wait at T-1: You confinced me. I like renaming $WIN_NT$ folders. Nice solution, thanks. BOOT_REN.CMD: Can you backup a possible existand boot.ini? Idea, not tested: CODE copy %SYSTEMDRIVE%\boot.ini %SYSTEMDRIVE%\boot.%date%.ini /y xcopy %USBDRIVE%\bootfiles\*.* %SYSTEMDRIVE%\ /y /h /r /k And can you create boot.ini dynamically? Not a fixed \WINDOWS, extract foldername from %SystemRoot% ? About multi boot: Setupldr.bin seek folder minint first, $WIN_NT$.~BT next. Hexedit \$WIN_NT$.~BT\setupldr.bin. Change minint to miniOf. menu.lst chainloader /$WIN_NT$.~BT/setupldr.bin chainloader /minint/setupldr.bin |
|
|
|
May 31 2007, 01:56 AM
Post
#203
|
|
|
Newbie Group: Members Posts: 35 Joined: 26-May 07 Member No.: 140643 OS: XP Home
|
|
|
|
|
May 31 2007, 10:36 AM
Post
#204
|
|
|
MSFN SuperB Group: Software Developers Posts: 5576 Joined: 23-July 04 From: Italy Member No.: 25215 OS: none
|
QUOTE (ilko_t) @jaclaz- Have you had a chance to look what was going wrong with MBRs? @ilko_t Here is what I have found: No differences are found between BootSector_USB_Before.dat and BootSector_USB_After.dat. Both are FAT 16 bootsectors with 63 sectors before and partition length of 3997633 sectors. The stick appears to have a CHS Geometry of 248x255x63. MBR_USB_Before.dat appears to be a MBR written with the "HP" utility, check this thread here for a very recent discover on how and why (maybe) the MBR written by the HP utility is different from the "standard" NT/2K/XP/2003 one: http://www.boot-land.net/forums/index.php?...=2246&st=15 MBR_USB_After.dat is a "standard" NT/2K/XP/2003 (English). MBR_USB_Before.dat has a 0E (FAT 16 LBA) partition ranging from CHS 0/1/1 to 247/254/63 with LBA StartSector of 63 and Numsectors 3997633. MBR_USB_After.dat has a 0E (FAT 16 LBA) partition ranging from CHS 0/1/1 to 247/215/31 with LBA StartSector of 63 and Numsectors 3997633. Now, in CHS->LBA translation, on a "normal" Nx255x63 Geometry, 0/1/1 is sector 63, so the StartSector in BOTH MBR's is correct. On the contrary, both Numsectors appear to be incorrect, 247/254/63 in CHS->LBA translation is sector 3984119 thus Numsectors is 3984057, and 247/215/31 is sector 3981630 thus Numsectors is 3981568. Going the other way round, Numsectors 3997633 correspond to CHS address 248/215/31. (248 is a "wrong" value, as it is one Cylinder more than the total number of Cylinders that range from 0 to 247) So, it appears that the "HP" utility defaults to the Max Cylinder, Max Head and Max Sector (247/254/63) and writes the LBA independently, whilst Windows Setup or whatever wrote the MBR_USB_After.dat gets the right End Head (215) and End Sector (31), and tops the End Cylinder to Max Cyl (247) getting 247/215/31 instead of the "theoretically coorect 248/215/31. Some details of the "queer" way of CHS to LBA conversion and viceversa, and their effects can be found on my page: http://home.graffiti.net/jaclaz:graffiti.n...B/USBstick.html If you get Roadkil's Disk Image: http://www.roadkil.net/DiskImg.html and make an image of the stick, you will most probably find that the image has a size of 2,046,788,096 bytes, i.e. 3997633+63=3997696 sectors x 512 bytes/sector. If you find another size, I would like to know it. Good work with latest tutorial! Just as a reminder, cdob's MkMigratgeInf.cmd (GOOD work) needs (of course) to be run from within a 2K/XP/2003 system. Even if I have NO idea why it could become useful, the data to build MIGRATE.INF.TXT can be found in the MBR of the stick, see here: http://www.911cd.net/forums//index.php?showtopic=19663 If I get it right, with this latest one, since there is no drive "exchange" grub4dos is only needed to chainload setupldr.bin. If you think it might be of use, I could follow cdob's idea and get from the FAT12 bootsector of the first of the install floppies the code for invoking setupldr.bin instead of NTLDR and prepare an easy way to patch any FAT16 or FAT32 bootsector (for NTFS it might prove to be tricky). We could use a NTLDR and add to it an entry to direct chainload such a patched bootsector. Of course the above would limit the amount of (possible) multi-booting capabilities of the stick, but will eliminate the need for GRLDR and menu.lst. Also, I am not sure I have fully (or correctly) understood the need for multiple BOOT.INI entries, pointing to rdisk(0) and rdisk(1) and to partitions 1, 2 and three on them. I am sure we can find a way to generate on-the-spot a correct BOOT.INI. For the record, BOOT.INI has no need to be marked as System, Hidden, Read Only. jaclaz |
|
|
|
May 31 2007, 06:42 PM
Post
#205
|
|
|
Friend of MSFN Group: Moderator Posts: 980 Joined: 6-December 06 Member No.: 117812
|
Can you backup a possible existand boot.ini? Idea, not tested: CODE copy %SYSTEMDRIVE%\boot.ini %SYSTEMDRIVE%\boot.%date%.ini /y xcopy %USBDRIVE%\bootfiles\*.* %SYSTEMDRIVE%\ /y /h /r /k Should work just fine. And can you create boot.ini dynamically? I spent a lot of time searching for a tool, which creates or amends properly BOOT.INI during GUI part with the correct entries, in order to avoid the brute-force way of copying generic one. Had no luck, BOOTFIX doesn't work during GUI part the way it does in Recovery Console, it works the way as in full XP environment. Couldn't find any other suitable tool for the purpose and ended up copying it from stick. Not a fixed \WINDOWS, extract foldername from %SystemRoot% ? If you can get the windows directory and apply it to the generic boot.ini it would make the guide more universal. Actually ATM only boot.ini creation differs the last guide from normal setup. Your ideas about mapping setup floppies via GRUB is nice, hopefully this can be done. About multi boot:... Thanks for tip ---------------- Here is what I have found:.... Perfect as usual Stick was formated by PEtoUSB - MBR_USB_Before.dat Later rewritten by TEXT mode setup- MBR_USB_After.dat, leaving some files unreadable and stick no longer bootable. If I format the same stick from XP with FAT16 or 32 I cannot boot from it. If you get Roadkil's Disk Image: 2,046,820,352 bytes, formated by PEtoUSB as before. The only difference is that ATM I am using Hitachi microfiter driver to keep it as fixed, thus allowing me quickly to image it with Acronis TI. May be that's why it differs form your calculations?http://www.roadkil.net/DiskImg.html and make an image of the stick, you will most probably find that the image has a size of 2,046,788,096 bytes, i.e. 3997633+63=3997696 sectors x 512 bytes/sector. If you find another size, I would like to know it. BTW Roadkil's Disk Image v1.1 always gives me "image creation failed" with all USB sticks I have, formated by various tools, most of the time I can see progress going beyond 100%, i.e. 102, 105 and I completely stopped using it as a backup solution. Just as a reminder, cdob's MkMigratgeInf.cmd (GOOD work) needs (of course) to be run from within a 2K/XP/2003 system. Even if I have NO idea why it could become useful, the data to build MIGRATE.INF.TXT can be found in the MBR of the stick, see here: This would be nice, but is it necessary since all of the preparation is done in 2K/XP/2003 system anyway?http://www.911cd.net/forums//index.php?showtopic=19663 If I get it right, with this latest one, since there is no drive "exchange" grub4dos is only needed to chainload setupldr.bin. Yep, if we find a way to invoke setupldr.bin directly from BOOT.INI GRUB will be no longer needed. At the moment if it is called, result was restart as far as I remember, because stick at that time is initialized as hd1, perhaps newer or HEX edited versions of these files will avoid it, but that's beyond my capabilities. I don't think patching MBR will be of any use at this stage, it should be setupldr.bin or ntdetect.com which cause that reboot. I will redo the tests and will report what may be causing reboots later. Also, I am not sure I have fully (or correctly) understood the need for multiple BOOT.INI entries, pointing to rdisk(0) and rdisk(1) and to partitions 1, 2 and three on them. The idea for multiple entries was to have as much universal BOOT.INI as possible, for example if one installs on different than 1st HD 1st partition. If it can be properly created that would be nice I am sure we can find a way to generate on-the-spot a correct BOOT.INI. For the record, BOOT.INI has no need to be marked as System, Hidden, Read Only. jaclaz The files are meant to be hidden and system exactly as a normal install will make them. There is no need to make them such, but it's good idea to have them, if installing it for non- technical users, which like to delete anything what they don't like or find strange, lets stay on the safe side BTW on Dell Dimension E520 with Intel P965/G965 MB I had BSOD 7B when starting XP SP2 Setup from the same stick, right after loading drivers and showing "windows is starting". Plugging stick in diff. front/rear ports made no difference. The fix was to use Dietmar's modified NTDETECT.COM, no more BSODs. Bart PE, based again on XP SP2 was giving the same 7B, and a full XP on another stick was freezing before loading shell. Modified file fixed them all. |
|
|
|
Jun 1 2007, 03:55 AM
Post
#206
|
|
|
MSFN SuperB Group: Software Developers Posts: 5576 Joined: 23-July 04 From: Italy Member No.: 25215 OS: none
|
@ilko_t
About boot.ini, wouldn't a good old batch file be more than enough? I normally run Win2K, coming with experience on NT4, never used bootfix.bin in my life, just the old way with batches, here are some examples, but of course we need to modify them according to our needs, it won't be difficult once I understand what they are. http://www.msfn.org/board/index.php?showtopic=66101&hl= One could easily search for a "tag file" like a file that is only in %windir% on all drives, and prompt the user to confirm the entry or entries. Just let me know which "features" are required. QUOTE (ilko_t) BTW Roadkil's Disk Image v1.1 always gives me "image creation failed" with all USB sticks I have, formated by various tools, most of the time I can see progress going beyond 100%, i.e. 102, 105 and I completely stopped using it as a backup solution. Yep, that's perfectly normal, as, as seen in the case you posted, the real size of the stick differs from what is "declared" or at least from what Windows can "see". To calculate the percentage of progress, rather obviously the programmer needs to calculate in "real time" the amount of data transferred divided by the total amount of data, the algorithm Roadkil's Disk Image uses is something like (in VERY "pseudo"code): CODE set source=source set dest=dest set SOURCESIZE=getsourcesizeinsectors(source) Set N=1 :loop If exist source\sector(N) do Copy source\sector(N) dest\sector(N) else goto :end display progressbar(N/SOURCESIZE) goto :loop :end So, when N becomes bigger than SOURCESIZE, the number displayed becomes bigger than 100%, and it is probable that there is some check control that throws an error because the program thinks it has copied more data than available. I would be curious about a comparison between image size results coming from the use of Roadkil's, Acronis and with dsfi/dsfo, part of the DSFOK toolkit: http://members.ozemail.com.au/~nulifetv/freezip/freeware/ (command line, but VERY accurate, that, not having the check hypothized above, does not throw any error) 2,046,820,352 should then be the "real" size of the stick, this corresponds to the CHS end address of 248/216/31, this means that maybe, instead of "topping" to MaxCyl, the (wrong) partitioning simply takes 1 off BOTH NumCyl and NumHds. On a different geometry, like Nx128x32, End address of 2,046,820,352 would be exactly CHS 976/0/32, i.e. a "correct" Head boundary one. The maximum "correct" CHS address in a 248x255x63 geometry remains however 247/254/63, which leaves you with 2,046,820,352-2,039,837,184=6,983,168 bytes or 13,639 sectors not accessible/unused. QUOTE (ilko_t) Yep, if we find a way to invoke setupldr.bin directly from BOOT.INI GRUB will be no longer needed. At the moment if it is called, result was restart as far as I remember, because stick at that time is initialized as hd1, perhaps newer or HEX edited versions of these files will avoid it, but that's beyond my capabilities. I don't think patching MBR will be of any use at this stage, it should be setupldr.bin or ntdetect.com which cause that reboot. I will redo the tests and will report what may be causing reboots later. No need to patch the MBR, all the "fun" happens in the bootsector, as cdob pointed out. If I am "allowed" to use dsfi/dsfo above, I can put together a small batch file that: 1) gets the bootsector from the stick and makes a copy of it 2) patches the copy so that it is invoking SETUPLDR.BIN 3) adds an entry in boot.ini directly chainloading the modified bootsector I have used similar batches in the past, they work for both FAT16 and FAT32, using it for NTFS might need some more work, but the USB device is normally FAT16 (or 32) anyway, isn't it? jaclaz |
|
|
|
Jun 1 2007, 10:12 AM
Post
#207
|
|
|
Friend of MSFN Group: Moderator Posts: 980 Joined: 6-December 06 Member No.: 117812
|
@jaclaz - what we need is a way to get the proper ARC path is it would be seen if no USB stick's BOOT.INI is used to call the GUI mode, find in what directory windows was placed in and amend or create a new BOOT.INI.
The issues I can see: - bootcfg.exe doesn't change entries when working in this mode, it works as if run in normal XP environment. So no options to add boot entries. - If GUI setup is called by ntldr/ boot.ini on the stick, hard disk is seen by GUI SETUP and supposedly by any suitable tool for getting ARC path as HD1, instead of HD0. - If Grub mapping is used (hd0->hd1 and hd1->hd0) boot.ini will be created by Setup with the proper ARC path, but with a signature, which we liked to avoid. May be a script can replace the signature part with "multi", resulting in proper boot.ini? Can you do it by script? signature(de33eaf8)disk(0)rdisk(0)partition(1)\WINDOWS ---> multi(0)disk(0)rdisk(0)partition(1)\WINDOWS Menu.lst in this case would be like: CODE map --read-only (hd0) (hd1) restricting us to one hard disk only, if one plans to install it on another, mapping should be modified, which is a bit restricting. Thats why I preferred not to use mapping at all.map --hook root (hd1,0) chainloader (hd1,0)/ntldrstp In summary: with mapping- signature part must be removed and Menu.lst amended if use more than 1 HD. With no mapping- "universal" boot.ini must be used on both USB stick and the one we copy to hard disk. Next few days I will be working on cdob's ideas. BTW you mean bootcfg.exe, not bootfix.bin, right? |
|
|
|
Jun 1 2007, 12:55 PM
Post
#208
|
|
|
MSFN SuperB Group: Software Developers Posts: 5576 Joined: 23-July 04 From: Italy Member No.: 25215 OS: none
|
QUOTE (ilko_t) BTW you mean bootcfg.exe, not bootfix.bin, right? Cannot say, I never used it, WHATEVER it is called Try this: CODE @ECHO OFF ::fix_bini.cmd ::Small batch to make a BOOT.INI ::by jaclaz ::The following might need to be changed: Set drive=C: Set windowsdir=WINDOWS Set rdisk=0 Set partition=1 :Check IF NOT EXIST %drive%\%windowsdir%\explorer.exe GOTO :Error ::WARNING! : ATTRIB -H -S -R %drive%\BOOT.INI IF NOT EXIST %drive%\BOOT.$$$ COPY %drive1%\BOOT.INI %drive%\BOOT.$$$ >NUL ECHO [Boot Loader]> %drive%\BOOT.INI ECHO Timeout=0 >> %drive%\BOOT.INI ECHO [Operating Systems]>> %drive%\BOOT.INI ECHO Default=multi(0)disk(0)rdisk(%rdisk%)partition(%partition%)\%windowsdir%>> %drive%\BOOT.INI ECHO multi(0)disk(0)rdisk(%rdisk%)partition(%partition%)\%windowsdir%="Windows XP Professional" /noexecute=optin /fastdetect>> %drive%\BOOT.INI : REM ATTRIB +H +S +R %drive%\BOOT.INI GOTO :EOF :Error SET Choice= CLS ECHO An installation of Windows was not found on given path %drive%\%windowsdir% ECHO the batch has not performed any action, this could lead to an unbootable system ECHO Do you want to search for an install on another drive letter? SET /P Choice=(Y/N) IF /I NOT %Choice%.==Y. GOTO :Exit :Loopdrive CLS ECHO Please input another drive letter and press Enter: SET /P Drive= IF %Drive%.==. GOTO :Loopdrive Set Drive=%Drive%: GOTO :Check :Exit CLS ECHO An installation of Windows was not found on given path %drive%\%windowsdir% ECHO Exiting... PAUSE The above should have a very minimal error checking, what I would like to know is if it can work in the environment it is supposed to run, which I am not sure has all the features of a normal command prompt. Of course, once we are sure (as we should) that the drive letter is C: and that arcpath is multi(0)disk(0)rdisk(0)partition(1)\WINDOWS this would even be easier CODE ATTRIB -H -S -R C:\BOOT.INI ECHO [Boot Loader]> C:\BOOT.INI ECHO Timeout=0 >> C:\BOOT.INI ECHO [Operating Systems]>> C:\BOOT.INI ECHO Default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS>> C:\BOOT.INI ECHO multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Windows XP Professional" /noexecute=optin /fastdetect>> C:\BOOT.INI ATTRIB +H +S +R C:\BOOT.INI (as said elsewhere, though "substituting" a string is the CORRECT way to go on, the QUICKER one is to rewrite from scratch the entire file, if it's a 5 liner...) jaclaz |
|
|
|
Jun 1 2007, 05:02 PM
Post
#209
|
|
|
Friend of MSFN Group: Moderator Posts: 980 Joined: 6-December 06 Member No.: 117812
|
Looks quiet promising
I have to urgently go abroad for a week or so, as soon as I get back I will join the party. Regards, ILKO |
|
|
|
Jun 1 2007, 08:35 PM
Post
#210
|
|
|
Newbie Group: Members Posts: 35 Joined: 26-May 07 Member No.: 140643 OS: XP Home
|
|
|
|
|
Jun 1 2007, 08:42 PM
Post
#211
|
|
|
Newbie Group: Members Posts: 35 Joined: 26-May 07 Member No.: 140643 OS: XP Home
|
8. Create: BOOT_REN.CMD CODE @echo off SET TAGFILE=\bootfiles FOR %%h IN (C D E F G H I J K L M N O P Q R S T U V W X Y) DO IF EXIST "%%h:%TAGFILE%" SET USBDRIVE=%%h: xcopy %USBDRIVE%\bootfiles\*.* %SYSTEMDRIVE%\ /y /h /r /k ren %USBDRIVE%\txtsetup.sif txtsetup.bak ren %USBDRIVE%\$WIN_NT$.~BT WIN_NT.BT ren %USBDRIVE%\$WIN_NT$.~LS WIN_NT.LS exit In step 8, Undo_Ren.CMD Should change back to undoren.cmd in order to match Step 6 This post has been edited by buseeliu: Jun 1 2007, 08:55 PM |
|
|
|
Jun 2 2007, 08:21 AM
Post
#212
|
|
|
MSFN SuperB Group: Software Developers Posts: 5576 Joined: 23-July 04 From: Italy Member No.: 25215 OS: none
|
@buseeliu
Good find! It's good to have more eyes checking, typos are so easy to go undetected. See you soon ilko_t, be well. jaclaz |
|
|
|
Jun 2 2007, 09:58 PM
Post
#213
|
|
|
Newbie Group: Members Posts: 35 Joined: 26-May 07 Member No.: 140643 OS: XP Home
|
|
|
|
|
Jun 3 2007, 03:50 AM
Post
#214
|
|
|
Newbie Group: Members Posts: 35 Joined: 26-May 07 Member No.: 140643 OS: XP Home
|
Another interesting for me thing- I had Bart PE minint folder on the root of the same stick, while testing I have noticed that if txtsetup.sif in root is missing or renamed, Bart PE is launched instead of TEXT mode setup. It might have been already discussed somewhere, but gives a good idea how both may coexist, without having to create second partition for it. I am going to test it further and report results. @buseeliu- try some random shots to see why your USB stick is so slow: 1. Update your BIOS 2. Check setting in BIOS for USB, make sure USB2.0 is enabled, play a bit with the other settings for USB- legacy support etc. 3. Test the same stick on another motherboard/system, which is known to support faster speeds 4. Test on your motherboard another stick, which is known to be fast 5. Unplug all other USB devices while testing 6. Use one by one the rear USB ports, try do disconnect fron USB ports from motherboard May be jaclaz can help you with some other ideas, hes knowledge about usb sticks is amazing @jaclaz- Have you had a chance to look what was going wrong with MBRs? I think the main problem is my usb 2.0 stick is not fast enough , if i copy file to notebook harddisk through, the speed is very fast. Maybe i need to buy another high speed usb stick later. Thks for your advice. |
|
|
|
Jun 3 2007, 04:01 AM
Post
#215
|
|
|
Newbie Group: Members Posts: 35 Joined: 26-May 07 Member No.: 140643 OS: XP Home
|
Step 6 MIGRATE.INF CODE [Version] Signature = "$Windows NT$" [Addreg] HKLM,"SYSTEM\MountedDevices",,0x00000010 HKLM,"SYSTEM\ControlSet001\Control\StorageDevicePolicies","WriteProtect",%REG_DWORD%,1 [Strings] ;Handy macro substitutions (non-localizable) REG_SZ = 0x00000000 REG_BINARY = 0x00000001 REG_DWORD = 0x00010001 REG_MULTI_SZ = 0x00010000 REG_SZ_APPEND = 0x00010008 REG_EXPAND_SZ = 0x00020000 If you wish to preserve your USB storage drive letter use CDOB's script to create MIGRATE.INF, don't forget to add the above entries : Actually, i have tried to use notebook harddisk to install window xp by using the above method. but it fails. If i use the above code in migrate.inf , i can't not install window xp and there is a warning message that my harddisk c:(should be the drive of the stick) has been damaged. cannot continue setup window anymore, press any key to exit. If i use CDOB's Script, i can continue to setup window even copying temporary file to 3.5" harddisk, however when the PC restarts, there is a warning that ntldr is missing. If i copy ntldr manually to that 3.5" harddisk, i can enter ther screen of installing win xp , however , further warning message is prompt that my setup file is missing. \globalroot\hardiskvolume2\xxxx. How can fix it? I think using notebook hdd to installing xp is faster than using flash drive. Thks for all of your effort again. |
|
|
|
Jun 4 2007, 12:28 AM
Post
#216
|
|
|
Advanced Member Group: Software Developers Posts: 369 Joined: 21-March 07 Member No.: 132150
|
MIGRATE.INF CODE [Version] Signature = "$Windows NT$" [Addreg] HKLM,"SYSTEM\MountedDevices",,0x00000010 HKLM,"SYSTEM\ControlSet001\Control\StorageDevicePolicies","WriteProtect",%REG_DWORD%,1 [Strings] ;Handy macro substitutions (non-localizable) REG_SZ = 0x00000000 REG_BINARY = 0x00000001 REG_DWORD = 0x00010001 REG_MULTI_SZ = 0x00010000 REG_SZ_APPEND = 0x00010008 REG_EXPAND_SZ = 0x00020000 The Renaming of the $WIN_NT$.~BT and $WIN_NT$.~LS folders, and the TXTSETUP.SIF file, using boot_ren.cmd and undoren.cmd is a very nice solution for the long-wait problem at T-1. SetupParams executes from winnt.sif at T-9 minute stage, and is indeed very usefull for the temporary renaming with boot_ren.cmd There are some changes necessary in the MIGRATE.INF file ! Adding the "WriteProtect" registry entry and the [Strings] section in MIGRATE.INF are no longer needed, because we use now Renaming instead of WriteProtection. If the USB-stick is connected when making the LocalSource on harddisk C: , one can simply keep the USB-stick relevant entry for HKLM,"SYSTEM\MountedDevices","\DosDevices\U:",0x00030001,\ in the MIGRATE.INF file produced in the $WIN_NT$.~BT folder, note its drive letter and change the drive letter to U: as proposed in post #129 , instead of using MkMigratgeInf.cmd. With MkMigratgeInf.cmd you are missing in MIGRATE.INF the registry entry HKLM,"SYSTEM\MountedDevices",,0x00000010 This post has been edited by wimb: Jun 4 2007, 03:25 AM |
|
|
|
Jun 4 2007, 02:35 PM
Post
#217
|
|
|
Advanced Member ![]() ![]() ![]() Group: Members Posts: 385 Joined: 29-September 05 Member No.: 74988
|
Adding the "WriteProtect" registry entry and the [Strings] section in MIGRATE.INF are no longer needed, because we use now Renaming instead of WriteProtection. CODE [SetupParams] UserExecute = "%systemdrive%\windows\system32\boot_ren.cmd" Yes, boot_ren.cmd is executed at T-9. http://unattended.msfn.org/unattended.xp/v...19/#setupparams QUOTE The above will execute the quotes command at T-9 during setup. boot_ren.cmd is processed after first reboot. Dosn't setup delete files earlier at textmode? Writeprotect in migrate.inf does prohibit deleting files at textmode. ilko_t remode HiveOEM.inf, because renaming replace this. QUOTE (wimb) With MkMigratgeInf.cmd you are missing in MIGRATE.INF the registry entry True, MkMigratgeInf.cmd dosn't create this line, because this line is not required in migrate.inf.HKLM,"SYSTEM\MountedDevices",,0x00000010 @buseeliu Name your boot.ini. There maybe false settings. Which hardware and partitions do you use? Do you use a SATA hard disk? Short notice about 2003 setupldr.bin RAM loaded idea. I made a false assumption in the past. Booting to recovery console (press F10 at F6 message) list 2003 setupldr.bin drive as C: Grub4dos loaded image is not listed. This is contrary to a 2003 setupldr.bin PE image: drive X: is used. |
|
|
|
Jun 5 2007, 12:28 AM
Post
#218
|
|
|
Advanced Member Group: Software Developers Posts: 369 Joined: 21-March 07 Member No.: 132150
|
Dosn't setup delete files earlier at textmode? Writeprotect in migrate.inf does prohibit deleting files at textmode. The WriteProtect registry entry in MIGRATE.INF is indeed essential ! Without this rule, I lost a lot of setup files from the $WIN_NT$.~LS folder. Thank you cdob for making me aware of its function. I am sorry for the mistake, that I have made. This post has been edited by wimb: Jun 5 2007, 12:36 AM |
|
|
|
Jun 8 2007, 03:10 PM
Post
#219
|
|
|
MSFN SuperB Group: Software Developers Posts: 5576 Joined: 23-July 04 From: Italy Member No.: 25215 OS: none
|
Inspired by one of cdob's hints, I made a small batch file to (maybe) solve the NTLDR/SETUPLDR.BIN renaming problem.
Here: http://www.boot-land.net/forums/index.php?showtopic=2362 jaclaz |
|
|
|
![]() ![]() |
| Lo-Fi Version | Time is now: 9th February 2010 - 12:05 PM |