Jump to content

How to install Windows from USB- WinSetupFromUSB with GUI


Recommended Posts

original 2.lst:

map (hd0) (hd1)
map (hd1) (hd0)
map --hook
ls (0xff)/ && root (0xff)
ls (0xff)/ && chainloader (0xff)/I386/SETUPLDR.BIN
ls (0xff)/ || rootnoverify (hd0)
ls (0xff)/ || chainloader (hd0)+1
boot

becomes:

ls (hd0,0)/laddsbootdvd.tag && map (hd0) (hd1)
ls (hd0,0)/laddsbootdvd.tag && map (hd1) (hd0)
map --hook
ls (0xff)/ && root (0xff)
ls (0xff)/ && chainloader (0xff)/I386/SETUPLDR.BIN
ls (0xff)/ || rootnoverify (hd0)
ls (0xff)/ || chainloader (hd0)+1
boot

original 3.lst:

map (hd0) (hd2)
map (hd1) (hd0)
map (hd2) (hd1)
map --hook
ls (0xff)/ && root (0xff)
ls (0xff)/I386/ && cat --locate=rdisk(1) --replace=rdisk(2) (0xff)/I386/TXTSETUP.SIF
ls (0xff)/AMD64/ && cat --locate=rdisk(1) --replace=rdisk(2) (0xff)/AMD64/TXTSETUP.SIF
ls (0xff)/ && chainloader (0xff)/I386/SETUPLDR.BIN
ls (0xff)/ || rootnoverify (hd0)
ls (0xff)/ || chainloader (hd0)+1
boot

becomes:

ls (hd0,0)/laddsbootdvd.tag && map (hd0) (hd2)
ls (hd0,0)/laddsbootdvd.tag && map (hd1) (hd0)
ls (hd0,0)/laddsbootdvd.tag && map (hd2) (hd1)
map --hook
ls (0xff)/ && root (0xff)
ls (0xff)/I386/ && cat --locate=rdisk(1) --replace=rdisk(2) (0xff)/I386/TXTSETUP.SIF
ls (0xff)/AMD64/ && cat --locate=rdisk(1) --replace=rdisk(2) (0xff)/AMD64/TXTSETUP.SIF
ls (0xff)/ && chainloader (0xff)/I386/SETUPLDR.BIN
ls (0xff)/ || rootnoverify (hd0)
ls (0xff)/ || chainloader (hd0)+1
boot

and so on.

Got it?

Again- wherever in those files, except fd.lst and 1.lst, you see

map (hdX) (hdY)

change to

ls (hd0,0)/laddsbootdvd.tag && map (hdX) (hdY)

X and Y varies, ls (hd0,0)/laddsbootdvd.tag && stays the same.

Link to comment
Share on other sites


Got it?

Yup, trying it now. It's working from CD to USB menu with out the (hd0,0) but I will try your suggestion and maybe it will fix it all the way around. I used iftitle

iftitle [if exist /laddsbootdvd.tag && find --set-root --devices=h /laddsbootusb.tag && call set USB=%@root^%/menu.lst] USB Helper For Vista And 7 Installs From %USB%\nPlease Have Jump Drive Plugged In./nWindows 7 And Vista To Big For DVD./nInstall NT6x From USB/nDoes Not Work For XP (yet)
find --set-root --devices=h /laddsbootusb.tag
echo Loading Menu From %USB%
configfile %USB%

so if a computer is so old and this menu option doesn't show up, them we just load XP from the DVD, but if this menu title show up then I know the USB can be booted and this is why I am trying to figured the XP thing out. We are close, I can smell it! :)

If this is working on my computer which is newer, than this should work on any computer that iftitle shows up on.

ls (hd0,0)/laddsbootdvd.tag && map (hd0) (hd2)

ls (hd0,0)/laddsbootdvd.tag && map (hd1) (hd0)

ls (hd0,0)/laddsbootdvd.tag && map (hd2) (hd1)

Link to comment
Share on other sites

Thank you, sir

This is working from USB and from DVD when loading USB menu

ls (hd0,0)/laddsbootdvd.tag && map.

I changed all entries in all X.lst to ls (hd0,0)/laddsbootusb.tag && map. ....(changed the tag) and all is well. I am on vaction this week but when I get back to work Monday, I will have tons of PCs to test this method on...so far so good.

Link to comment
Share on other sites

Of course I like to be complicated too! This also works

4.lst:

if exist %XP%/laddsbootusb.tag set USBStick=YES
if "%USBStick%"=="YES" set HD=(hd0,0)/laddsbootusb.tag
echo %HD%



ls %HD% && map (hd0) (hd3)
ls %HD% && map (hd1) (hd0)
ls %HD% && map (hd2) (hd1)
ls %HD% && map (hd3) (hd2)
map --hook
ls (0xff)/ && root (0xff)
ls (0xff)/I386/ && cat --locate=rdisk(1) --replace=rdisk(3) (0xff)/I386/TXTSETUP.SIF
ls (0xff)/AMD64/ && cat --locate=rdisk(1) --replace=rdisk(3) (0xff)/AMD64/TXTSETUP.SIF
ls (0xff)/ && chainloader (0xff)/I386/SETUPLDR.BIN
ls (0xff)/ || rootnoverify (hd0)
ls (0xff)/ || chainloader (hd0)+1
boot

I like BIG CODE! lol

What this accomplishes I can boot to DVD with my USB Stick plugged in, if my computer bios recognizes the USB stick plugged in this command will show up

(iftitle only shows up in grub4dos if the command can be run)

iftitle [if exist /laddsbootdvd.tag && find --set-root --devices=h /laddsbootusb.tag && call set USB=%@root^%/menu.lst] USB Helper For Vista And 7 Installs From %USB%\nPlease Have Jump Drive Plugged In./nWindows 7 And Vista To Big For DVD./nInstall NT6x From USB/nWorking For XP Now
find --set-root --devices=h /laddsbootusb.tag
echo Loading Menu From %USB%
configfile %USB%

don't have to change no settings in bios unless you have to change the bios to boot to CD. Hit enter on the above highlighted command and boom, the USB menu.lst appears and this took all the guess work out of trying to figured how to set the bios on older machines to boot to USB and most likely if the command above doesn't show up, that means the computer didn't recognize the USB and you may need to use PLoP.

Side note, Im using the 12-26-11 grldr which supports auto numbering and comes in handy with iftitles....write 0x8274 0x2001

Just wanted to say thanks again to ilko_t and all the smart folks here at msfn.....THANKS! :thumbup

Edited by laddanator
Link to comment
Share on other sites

Quite useful report, thanks.

Glad to help.

Can you do again, after you load PLoP

read 0x8280
calc *0x475 & 0xFF

as well as

root (

then pressing TAB key on the keyboard?

Without Plop:

grub> read 0x8280
Address 0x8280: Value 0x0

grub> calc *0x475 & 0xFF
1 (HEX:0x1)

grub> root
(fd0,0) Filesystem type is fat, partition type 0x20

grub> root (
Possible disks are: fd0 hd0 rd

grub> find /usbdrive.tag
(fd0,0)
(fd0)

With Plop (output with 5.0.11 and with 5.0.13 is exactly the same):

grub> read 0x8280
Address 0x8280: Value 0x80

grub> calc *0x475 & 0xFF
2 (HEX:0x2)

grub> root
(hd0,0) Filesystem type is fat, partition type 0x0C

grub> root (
Possible disks are: hd0 hd1 rd

grub> find /usbdrive.tag
(hd0,0)

As for the weird behavior- try changing the line in winsetup.lst

map /WINSETUP/XPpSP3.ISO (0xff) || map --mem /WINSETUP/XPpSP3.ISO (0xff)

to only

map --mem /WINSETUP/XPpSP3.ISO (0xff)

This may lead to hangs on some buggy machines, use the solution as in here, maybe as another, backup entry of title First part of Windows ... part of the menu and newer grub4dos version which supports "map --e820cycles" option:

http://reboot.pro/15956/

There are plenty of important changes to be done, new version of the program should be out soon.

It appears if an ISO is mapped not in memory and do a cat --locate=foo --replace=bar /FILE/IN/THE/ISO the file is changed permanently on the disk. map --read-only and map --fake-writes do not help to change the string we need to in txtsetup.sif, Setup sees it as it was before.

Yes, the reason for the mysterious/weird behavior after running /BOOTWS/1.st is that "cat --locate=a --replace=b" modifies TXTSETUP.SIF in the iso file permanently.

Could you also check if latest PLoP boot manager works the same way on this machine- Setup works and grub4dos commands I asked you to type return the same results as the previous PLoP version?

Get just plpbt.bin from here, place it in root of the USB drive and rename it to plp513.bin. Then add these lines at the end of menu.lst:

title Start PLoP boot manager 5.0.13
ls /usbdrive.tag || find --set-root --ignore-cd /usbdrive.tag
kernel /plp513.bin

See above.

When you are saying with PLoP it works how far did you get? Did you install Windows from start to end, until first desktop?

I performed two complete full windows xp installations (one with Plop 5.0.11, other with Plop 5.0.13), both went successfully till the very end (usable windows desktop) without any hiccups.

I used RMPREPUSB 2.1.630, set MS-DOS bootable, FAT32, and no other options set (this means 1 partition, not 2), and install grub4dos to partition boot sector, not to MBR. Because this is the only way I can make USB flash drive bootable on this machine.
The program installs grub4dos MBR, did you select the advanced option "do not check and install grub4dos MBR"?

WinSetupFromUSB installs grub4dos to MBR? I didn't know that. No, I didn't select any advanced options, so this means that grub4dos indeed was installed to MBR. Good to know this. Because earlier (before I knew about WinSetupFromUSB) I was using RMPREPUSB 2.1.630 to make bootable USB flash drive to play with some linux isos, and the only way I was able to make it bootable was to install grub4dos to partition boot sector (PBR), not MBR.

Edited by danafik
Link to comment
Share on other sites

Ok, hit a small bump. I remembered I has an old computer in my shop. Everything I have been testing the new X.lst on has been working. My computer uses 4.lst (3 internal drives)...my other test ones use 3.lst(two internal drives). Here is the bump, my old test computer has 1 hard drive in it so 2.lst was used, got a missing MBR helper so I figured it was the age of the computer. Put the CD in the drive and tried it again, and this time it looped back and booted the CD. So I unhooked everything but one hard drive in the previous test machines mention above that everything was working before and 2.lst starts to load and missing MBR helper pops up. If 3.lst plus is used, no issues

this is my 2.lst

ls (hd0,0)/laddsbootusb.tag && map (hd0) (hd1) 
ls (hd0,0)/laddsbootusb.tag && map (hd1) (hd0)
ls (0xff)/ && root (0xff)
ls (0xff)/ && chainloader (0xff)/I386/SETUPLDR.BIN
ls (0xff)/ || rootnoverify (hd0)
ls (0xff)/ || chainloader (hd0)+1
boot

Ok, I see whats missing map --hook

Edited by laddanator
Link to comment
Share on other sites

You have figured it out, some tired man stole the map --hook line

Yes sir! Up til 2am this morning write and reading code. Got up at 6:30 am and still at it. Bad thing is I am on vacation. The job of a geek at heart is never done! :wacko:

This is my new improved working 2.lst with map --hook

if exist %XP%/laddsbootusb.tag set USBStick=YES
if "%USBStick%"=="YES" set HD=(hd0,0)/laddsbootusb.tag
echo %XP%
echo %HD%
pause --wait=10 Making Sure Paths Exist

ls %HD% && map (hd0) (hd1)
ls %HD% && map (hd1) (hd0)
map --hook
ls (0xff)/ && root (0xff)
ls (0xff)/ && chainloader (0xff)/I386/SETUPLDR.BIN
ls (0xff)/ || rootnoverify (hd0)
ls (0xff)/ || chainloader (hd0)+1
boot

All 8.lst look like the above. I added a pause wait command in case a tech has an issue. I can see which x.lst its loading so if there is a problem, easier to see.

Edited by laddanator
Link to comment
Share on other sites

ilko_t, not sure if you would be interested but I have a method that I use to install Vista, Win7x86, Win7x64 and Win8 from the same partition and the same root of my USB stick. Might be a good add to your already great program. The bcd for each version has to be modded which I have the script for or actually the ones I have that are modded never have to be modded again, so your program could just copy them to the right folder. The only draw back I can see is that each boot.wim has to be mounted (which I made a script that mounts each boot.wim and copies the two files) and two files copied to system32 of mounted wim...set.cmd and winpeshl.ini.

So when its over your root looks like this...

source (folder (with boot1.wim, boot2.wim, boot4.wim and boot4.wim in the source folder)

Win7x86 (folder (with just the install.wim and OEM if you need the OEM folder)

Win7x64 (folder (with just the install.wim and OEM if you need the OEM folder)

Win8 (folder (not need I just use for testing)

Vistax86 (folder (Vista requires all the files from DVD with install.wim as Win7 does not and OEM if you need the OEM folder)

Vistax64 (I do not use x64)

boot (folder (bc1, bc2, bc4, bc6 and boot.sdi

bootmgr (from Win 7 SP1 WAIK.....this will be offset on the fly from the grub4dos menu...see below)

Windows 7 x32 Setup

iftitle [find --set-root --devices=h /laddsbootusb.tag && call set Win7x32=%@root^%] Windows 7 SP1 x32 Setup From %Win7x32%\nNovember 2011.

password --md5 $1$A$hzYlFap3SLNNQ/tA7c3.S.

find --set-root --devices=h /laddsbootusb.tag

clear

set /p /u Answer=ARE YOU SURE YOU WANT TO INSTALL WIN 7 x32...Y or N :

if /i "%Answer%"=="n" echo Back To Main Menu! && configfile %Win7x32%/Menu/vista_7.lst

echo Installing Windows 7 x32 From %Win7x32%

set bootmgr=%Win7x32%/bootmgr

#Windows 7X32

map --mem %bootmgr% (rd)

write --offset=0x105E (rd)+1 \xEB\x08

cat --hex --skip=0x54696 --length=1 --locate=D (rd)+1 && set offset=0x54696

cat --hex --skip=0x54735 --length=1 --locate=D (rd)+1 && set offset=0x54735

write --offset=%offset% (rd)+1 2

chainloader (rd)+1

root ()

Not sure if this would be to much but I think it would make a nice add either way with or without this, the winsetupfromusb still rocks!

Link to comment
Share on other sites

ilko_t, not sure if you would be interested but I have a method that I use to install Vista, Win7x86, Win7x64 and Win8 from the same partition and the same root of my USB stick. Might be a good add to your already great program. The bcd for each version has to be modded which I have the script for or actually the ones I have that are modded never have to be modded again, so your program could just copy them to the right folder. The only draw back I can see is that each boot.wim has to be mounted (which I made a script that mounts each boot.wim and copies the two files) and two files copied to system32 of mounted wim...set.cmd and winpeshl.ini...

...

I've been digging in this direction for a long time without a solution which suits my needs... There are several methods for having multiple Vista/7/2008 in same partition:

1) Edit boot.wim and add whatever script you want to be launched.

2) Edit boot.wim, add Firadisk or WinVBlock

3) Edit install.wim and add include other sources

4) Use changed on-the-fly autounattend.xml in root of a removable USB disk to tell Setup what to do

1,2 and 3 need to mount wim, that's pain in the @$$, need either WAIK or 7 source. I won't force a regular user to download and install 1.7 GBs WAIK. There is no yet free and legally redistributable solution which can mount and edit WIM files, at least I am not aware of such. 7-zip was a good bet, but author is not interested in going too deep into the wims:

http://sourceforge.net/projects/sevenzip/forums/forum/45797/topic/4072972

4 has the limitation that USB disk has to be removable, or Setup won't use autounattend.xml.

Hi ilko,

great work on WinSetupFromUSB thumbsup.gif

small cosmetic fix: http://ayende.com/blog/4360/how-to-opt-out-of-program-compatibility-assistant

Applications with "Setup" in their name need supportedOS entries in their manifest on Windows Vista and later.

cheers.gif

Thanks JFX, appreciate it.
Link to comment
Share on other sites

Setup won't use autounattend.xml.

Solved that problem. Add this line to your setup.cmd that is added to boot.wim

if exist %USBdrive%\%Win7x86%\unattend.xml SET UN=/unattend:%USBdrive%\%Win7x86%\unattend.xml
if exist %USBdrive%\%Win7x86%\OEM\nul SET OEM=/m:%DVDdrive%\%Win7x32%\OEM
%RamPath%\setup.exe %OEM% %UN%

drop your unattended file in the Win7x86 folder on root of your USB drive and no problem. Unattended install is not a problem anymore from USB. I install 7 at least 10 times a day and unattend never fails me.

You don't need WAIK...I have a pretty much stand alone DISM.exe (not sure if using DISM is legal if you don't own Win7)

Now I will agree that if mounting a wim goes wrong, it can be a pain.

Edited by laddanator
Link to comment
Share on other sites

The autounnatend.xml method does not need and wim editing, read this and below for details:

http://reboot.pro/9076/page__view__findpost__p__123792

If there was wim editing involved, there are better methods.

Dism isn't stand-alone, there are several other files involved. One cannot redistribute them freely. Another problem is where to obtain them from- if it's 7 source- one could be using XP 32-bits and has 7 x64 source. Is 32-bit version of the wim drivers included in 7 x64?

What about using XP 32 and modifying Vista x64? There is no Dism, back to imagex plus there are no 32 bit drivers for the wim mounting.

So we are back to WAIK...

Link to comment
Share on other sites

The autounnatend.xml method does not need and wim editing, read this and below for details
:

No, but I rather mount the boot.wim and add two files than rely on friadisk and Imdisk. It takes less than 2minS to mount, copy, commit and unmount. Believe it or not XP mounts and commits wims faster than Vista or 7.

Dism isn't stand-alone, there are several other files involved. One cannot redistribute them freely. Another problem is where to obtain them from- if it's 7 source- one could be using XP 32-bits and has 7 x64 source.

The DISM I use works in XP x32 bit. Your right its not completely stand alone. I made a script to copy the few files and add lines to reg...almost stand alone, kinda. I do not like the friadisk method or ImDisk(nothing against either)...this can fail and you have to hit f10 and locate drivers and way too much(much more than just mounting boot.wim to copy two files). My way, nothing but bcd is really modded. Everything else is natural except for added two files to mount boot.wim. Run this in command prompt use setup.exe from Vista or Win7 folder: setup.exe /? and it tells you how to use the unattended switch to locate the unattended.xml. I have been installing Vista and 7 for 6 months with unattend.xml from USB with no mods (except a somewhat modded bcd) or friadisk. I do know this could get complicated for sure. It's easy to me because I have been doing this a longggggggggg time but someone who is a noobie may have issues.

Let me clear up modded bcd...all this does is change the name of boot.wim to what ever number....boot1.wim for example. Trust me when I tell you its much simpler than friadisk but as from your stand point to add this to your program, it could get messy.

Edited by laddanator
Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...