• Announcements

    • xper

      MSFN Sponsorship and AdBlockers!   07/10/2016

      Dear members, MSFN is made available via subscriptions, donations and advertising revenue. The use of ad-blocking software hurts the site. Please disable ad-blocking software or set an exception for MSFN. Alternatively, become a site sponsor and ads will be disabled automatically and by subscribing you get other sponsor benefits.
ilko_t

How to install Windows from USB- WinSetupFromUSB with GUI

2,139 posts in this topic

Thanks for the info.

I did try changing the BIOS from AHCI to IDE before asking for help, but it didn't work. But this time, it did. It might have to do with the fact that I booted a Linux USB keydrive to reduce the size of the first partition to something smaller, but I'm not positive.

Although XP won't boot if I set the BIOS back to AHCI, I can live with that.

Thanks for the help. WSFU is a very useful tool.

Edit : Not a good idea, as this is a test host and images I did previously in AHCI mode with Clonezilla won't start (at least Windows7 won' t start.

Looks like I'll have to learn how to add the SATA driver in the XP ISO.

Edited by Winfried
0

Share this post


Link to post
Share on other sites

I cannot get the F6 disk integration work with x64, will this be possible in future releases?

0

Share this post


Link to post
Share on other sites

What do you mean by "cannot get it to work"?

0

Share this post


Link to post
Share on other sites

Windows XP SP3, preconfigured wIth nLite and DriverPacks:

I got this error message window when Part 2 setup began (GUI mode), just before extracting the DriverPacks.

Windows : No disk

Clicking the "Cancel" button for 3 times, it went on OK.

The message appeared again during the RunOnceEx phase for 2 times. It continued to run after clicking Cancel button. And the resulting Windows OS was OK.

Actually , I did the Windows setup 2 times, the error message problem were exactly the same.

Edited by ykchanaed
0

Share this post


Link to post
Share on other sites

Do you have a card reader?

What drive letter did the USB disk get during setup?

The error shows up when presetup.cmd script is searching for OEM folder in each drive letter accessing the empty card reader slots, same must be happening with another script run by RunOnceEx.

Disconnect the card reader, ignore the errors, or amend the scripts as in setup.cmd, drive letters where USB disk is most likely to be found go first:


...
FOR %%h IN (U V W X C D E F G H I J K L M N O P Q R S T Y) DO (
...

0

Share this post


Link to post
Share on other sites

Do you have a card reader?

What drive letter did the USB disk get during setup?

The error shows up when presetup.cmd script is searching for OEM folder in each drive letter accessing the empty card reader slots, same must be happening with another script run by RunOnceEx.

Disconnect the card reader, ignore the errors, or amend the scripts as in setup.cmd, drive letters where USB disk is most likely to be found go first:


...
FOR %%h IN (U V W X C D E F G H I J K L M N O P Q R S T Y) DO (
...

Ilko, cannot say if it applies specifically, but do check these:

jaclaz

0

Share this post


Link to post
Share on other sites

Hi Jaclaz, been a while : )

Thanks for reminder, actually, a bigger portion from setup.cmd:


...
if exist mountvol.exe (
for /f "tokens=1 delims=: " %%? in ('mountvol.exe ^|find ":\"') do (
dir %%?:%TAGFILE% > nul 2>&1 && set CDDRIVE=%%?:
if defined CDDRIVE goto :CDDRIVE_found
)
) else (
FOR %%h IN (U V W X C D E F G H I J K L M N O P Q R S T Y) DO (
IF EXIST "%%h:%TAGFILE%" (
SET CDDRIVE=%%h:
goto :CDDRIVE_found
)
)
)
...

As far as I remember mountvol.exe wasn't present on some systems or versions, hence the check above), and since I've started generating migrate.inf with the updated procedure, USB disk was reliably getting U V W or X drive letters, hence the previous post.

0

Share this post


Link to post
Share on other sites

As far as I remember mountvol.exe wasn't present on some systems or versions, hence the check above), and since I've started generating migrate.inf with the updated procedure, USB disk was reliably getting U V W or X drive letters, hence the previous post.

I see. :)

BUT the cdob's version needs not the mountvol.exe:

MOUNTVOL is actually used ONLY to limit the number of loops, but since all in all 26-2=24 can be categorized if not as "a few", at least as "not that many" ;).

Try this (let's call it "findTAG.cmd") ;):

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
SET Tagfile=test.txt
FOR %%D IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
SET mymessage=Looking for "%%D:\%Tagfile%" .... Not found.
DIR "%%D:\%Tagfile%"> nul 2>&1 && SET mymessage=!mymessage:Not found.=FOUND.!
ECHO !mymessage!
)

or this (let's call it ListEdrives.cmd):

@ECHO OFF
SETLOCAL ENABLEDELAYEDEXPANSION
FOR %%D IN (C D E F G H I J K L M N O P Q R S T U V W X Y Z) DO (
SET mymessage=Looking for drive %%D: .... Not Existing.
DIR %%D:\> nul 2>&1 && SET mymessage=!mymessage:Not Existing.=EXISTING.!
ECHO !mymessage!
)

And yes, in Explorer I have:

C: <--hard disk

D: <--hard disk

E: <- CD-ROM (no media in it)

F: <- Card reader drive letter #1

G:<- Card reader drive letter #2

H:<- Card reader drive letter #3

I:<- Card reader drive letter #4

J: <- Virtual disk (BUT with only hidden and system reserved folders/files)

K: <- USB stick

Output of ListEdrives.cmd:

C:\batches>ListEdrives.cmd
Looking for drive C: .... EXISTING.
Looking for drive D: .... EXISTING.
Looking for drive E: .... Not Existing.
Looking for drive F: .... Not Existing.
Looking for drive G: .... Not Existing.
Looking for drive H: .... Not Existing.
Looking for drive I: .... Not Existing.
Looking for drive J: .... Not Existing.
Looking for drive K: .... EXISTING.
Looking for drive L: .... Not Existing.
Looking for drive M: .... Not Existing.
Looking for drive N: .... Not Existing.
Looking for drive O: .... Not Existing.
Looking for drive P: .... Not Existing.
Looking for drive Q: .... Not Existing.
Looking for drive R: .... Not Existing.
Looking for drive S: .... Not Existing.
Looking for drive T: .... Not Existing.
Looking for drive U: .... Not Existing.
Looking for drive V: .... Not Existing.
Looking for drive W: .... Not Existing.
Looking for drive X: .... Not Existing.
Looking for drive Y: .... Not Existing.
Looking for drive Z: .... Not Existing.

jaclaz

Edited by jaclaz
0

Share this post


Link to post
Share on other sites

Thanks for all you guys contributions!

@ilko_t answered my problem!

My physical machine does have crad reader.

And the USB was W:

The error during RunOnceEx phase were also caused by the same " find drive" cmd script.

However , the same "find drive" script inside RunOnceEx.cmd during T-12 phase lined in cmdlines.txt did NOT have this error!

Edited by ykchanaed
0

Share this post


Link to post
Share on other sites

It is an historical day, Windows 8 goes RTM and is available to pros in its final state in MSDN

I confirm WinSetupFromUsb 1.0 beta8 worked here for installing Windows 8 Pro (x64) through an eSATA flash drive

No problems at all, thanks again MSFN and ilko and good bye MS aero :thumbup

Edited by class101
0

Share this post


Link to post
Share on other sites

That's good to know, thanks for the feedback.

0

Share this post


Link to post
Share on other sites

With the new method used to install Windows XP from USB in the 1.0 versions why do we still need to use setup.cmd to configure Windows XP setup?

Would it not be better to make the registry changes directly to the source files so we no longer have to use a fake setup.exe?

It would also be nice to have a solution where you could just have one source to use for both cd/dvd and usb disks.

If you use enumerating of drive letters just to find out the drive letter your script is run from you can use magic variables to get the information (%d0, %dp0, ...).

0

Share this post


Link to post
Share on other sites

It's not only registry changes, and it's not enumerating internal disk drive letters, but USB ones, which may not be present at all and script takes care in those cases too.

What is does:

1) Searches for USB source disk drive letter

2) If not found, mounts \device\harddiskX\partitionY one by one until the needed USB disk is found

3) When disk/partition is found these values are put in $winnt$.inf from where Setup in GUI mode reads where the source is

4) Makes the relevant registry changes if Windows is to be prepared for USB boot or USB disks are still missing as happens on some rare machines

If it was possible I'd gladly get rid of that part, but for now, it's still needed.

0

Share this post


Link to post
Share on other sites

Hi ilko,

I'm trying to use WinSetupFromUSB in an unconventional way.... and I thought you might be able to answer some of my questions.

Basically I have two different goals, but both relate to the very same problem.

1/ I would like to install XP/Vista/W7 to a virtual disk.

When the OS doesn't natively support booting from virtual disk, this can be achieved with third-party drivers, e.g. WinVBlock or FiraDisk

The only problem is that when booting from USB, this target IMG has to be mapped as a HDD in Grub4Dos, before the usual WinSetupFromUSB procedure starts.

This conflicts with most of the winsetup.lst entries which start with something like "map --unmap=0:0xff && map --unhook && map --rehook"

I'm not entirely sure what the purpose of this command is, but I have no doubt it's there for a good reason. I have tried deleting them all, and it just works.... but is that a satisfying solution ? What would be a nice and clean solution ?

2/ My second goal is kind of the counter-part of the first one, i.e. I would like to install XP/Vista/W7 from a virtual disk.

As explained in your first post, WinSetupFromUSB supports Vista/Windows 7/Server 2008 setup to different primary partitions, which is therefore not possible on removable media (USB sticks). In order to work around the problem, I have tried the following: create a virtual HDD image, mount it with MS virtual storage driver (ImDisk not suitable), then (multi) partition-it, format it, and install whatever I want with WinSetupFromUSB , using the advanced options and the "display drives on all interfaces, not only USB" checkbox.

This IMG can now be physically located on a USB stick, so it would in principle be possible to have Vista/Windows 7/Server 2008 setup (indirectly) on removable media.

In the end the problem is still the same: this source IMG has to be mapped as a HDD in Grub4Dos before the usual WinSetupFromUSB procedure starts, which conflicts with most of the winsetup.lst entries, etc. etc...

So same question again (which may or may not have the same answer as in #1) : What would be a nice and clean solution ?

Using virtual source disk has (I think) many beneficial side effects:

- When running WinSetupFromUSB, the virtual disk can be physically located on the internal HDD, which is a lot faster than on any USB stick. Transfering the IMG to the USB stick then doesn't take long (one big files, as opposed to thousands of small files)

- The IMG can be transferred from USB stick to USB stick very easily. Presumably, WinSetupFromUSB has appropriate means (migrate.inf perhaps ?) to assign a given letter to the setup disk. I guess it wouldn't work to copy all the flat files on a different stick, (at least if it has a different signature). But it should work to copy the IMG (which contains it own signature !)

Does it all make sense ?

Edited by Doodoo
0

Share this post


Link to post
Share on other sites

The error shows up when presetup.cmd script is searching for OEM folder in each drive letter accessing the empty card reader slots, same must be happening with another script run by RunOnceEx.

By the way this is a DriverPacks problem and should have been fixed long ago.... perhaps in the near future ?

0

Share this post


Link to post
Share on other sites

I would also like an option in WinSetupFromUSB to build a migrate.inf file without copying all files.

The file copying part of WinSetupFromUSB is at the moment very slow. I prefer to manually copy the source files.

Can you help me with that?

0

Share this post


Link to post
Share on other sites

Hey ilko I have more Windows 8 infos

at home, installation of Windows 8 with eSATA key worked

at work, installation of Windows 8 with USB failed (same key in usb mode), it complains right after I click Install it does not find a driver, with FAT32 partitioned key, no advanced options

but I don't really know which driver is it about, my key does not need a specific driver to work in usb mode, I will try in NTFS mode and a few of your advanced options and let you know

//Edit: Same in NTFS with advanced option #3

//Edit2: Tried DriverPacks Mass Storage and Chipsets but couldnt find one working for the problem, Intel SATA AHCI and USB drivers are shown in list but when I select it and continue it comes back to the driver selection, will look if someone in thread as got same problem

//Edit3: Have tried numerous of drivers without sucess, the "Windows 7 USB DVD Download Tool" also failed to recongize my usb stick, I will try another approach by using bootsect.exe to make usb bootable and XCOPY windows files, its explained on MSDN blog here

//Edit4: Looks like machine specific problem rather than a usb key problem because now I'm back at home, the same key works in USB mode, the only difference I notice is that on my home machine(where it works for both eSATA+USB) I see the grub4dos menu you have customized with a Green background, and on my work machine (where it fails in USB) booting on the key does never show the grub4dos green menu, instead there is a blackscreen for 10sec. (seen physically and also in Qemu) then the Windows installation starts and fails later (asking for an unknown driver after hitting Install), very weird bug, I'm stuck, I will try to look the long list of replies to see if someone experienced the same trouble

//Edit5: Finally method in Edit3's link worked with diskpart.exe, bootsect.exe and xcopy.exe invocations on my work computer, it looks like a winsetupfromusb with win8+usb problem, unfortunelly it is not a complete solution for you ilko but at least from my edits you can easly spot there is something wrong with winsetupfromusb with win8+usb but not with esata

Edited by class101
0

Share this post


Link to post
Share on other sites

Hi ilko,

I'm trying to use WinSetupFromUSB in an unconventional way.... and I thought you might be able to answer some of my questions.

Basically I have two different goals, but both relate to the very same problem.

1/ I would like to install XP/Vista/W7 to a virtual disk....

...

Hi,

1) About the "map --unmap=0:0xff && map --unhook && map --rehook" - they are put to make sure all grub4dos map slots are empty and available, 8 in total, as in case of more internal disks all will might be needed.

Some copuld be occupied by previous user attempt, unsuccessful boot etc. etc. Should be relatively safe to delete those lines.

2) Ditto, just delete the lines in question.

By the way- how do you make the virtual disk visible for Windows Setup? Do you integrate a custom driver- firadisk, winvblock..., how?

In case of a virtual disk I am not quite sure that migrate.inf would work reliably, it may depends how the virtual disk is mounted during Setup. And just to remind- it is not used in Vista and above setups.

Here is how migrate.inf is generated, the important part is ParrentID prefix:

The error shows up when presetup.cmd script is searching for OEM folder in each drive letter accessing the empty card reader slots, same must be happening with another script run by RunOnceEx.

By the way this is a DriverPacks problem and should have been fixed long ago.... perhaps in the near future ?

Thanks for the report in DP forum, hopefully will be fixed soon.

0

Share this post


Link to post
Share on other sites

I would also like an option in WinSetupFromUSB to build a migrate.inf file without copying all files.

The file copying part of WinSetupFromUSB is at the moment very slow. I prefer to manually copy the source files.

Can you help me with that?

It would be quite tricky to break functionality in parts. Plus preparing source is not only about migrate.inf, there is a small ISO file with customized txtsetup.sif in it, modified for each setup setup.cmd, a custom setup.exe which launches setup.cmd and so on. How do I break all this in steps?

File copying was made as fast as possible in beta8, also ensuring the GUI does not freeze when copying large files such as install.wim, which is AutoIt limitation when using default file copy commands.

I've tested excessively all file copy methods available in AutoIt and the one used in beta8 seems to be the fastest one available.

0

Share this post


Link to post
Share on other sites

Hey ilko I have more Windows 8 infos

at home, installation of Windows 8 with eSATA key worked

at work, installation of Windows 8 with USB failed (same key in usb mode), it complains right after I click Install it does not find a driver, with FAT32 partitioned key, no advanced options

but I don't really know which driver is it about, my key does not need a specific driver to work in usb mode, I will try in NTFS mode and a few of your advanced options and let you know

//Edit: Same in NTFS with advanced option #3

//Edit2: Tried DriverPacks Mass Storage and Chipsets but couldnt find one working for the problem, Intel SATA AHCI and USB drivers are shown in list but when I select it and continue it comes back to the driver selection, will look if someone in thread as got same problem

//Edit3: Have tried numerous of drivers without sucess, the "Windows 7 USB DVD Download Tool" also failed to recongize my usb stick, I will try another approach by using bootsect.exe to make usb bootable and XCOPY windows files, its explained on MSDN blog here

//Edit4: Looks like machine specific problem rather than a usb key problem because now I'm back at home, the same key works in USB mode, the only difference I notice is that on my home machine(where it works for both eSATA+USB) I see the grub4dos menu you have customized with a Green background, and on my work machine (where it fails in USB) booting on the key does never show the grub4dos green menu, instead there is a blackscreen for 10sec. (seen physically and also in Qemu) then the Windows installation starts and fails later (asking for an unknown driver after hitting Install), very weird bug, I'm stuck, I will try to look the long list of replies to see if someone experienced the same trouble

//Edit5: Finally method in Edit3's link worked with diskpart.exe, bootsect.exe and xcopy.exe invocations on my work computer, it looks like a winsetupfromusb with win8+usb problem, unfortunelly it is not a complete solution for you ilko but at least from my edits you can easly spot there is something wrong with winsetupfromusb with win8+usb but not with esata

Can you give some more details about the machine at work? If laptop- brand, model, if desktop- motherboard model?

Do you have an option in BIOS how USB mass storage devices are emulated- USB-FDD, USB-ZIP, USB-HDD etc. ?

What is the USB disk, brand, model? Is it a pen drive or USB/eSata hard disk in enclosure? What's its disk space?

It's rather how BIOS recognizes the USB disk/flash drive, probably in different way depending how its formatted, hence the different results. Contents of USB disk should be the same no matter what you have used, above Vista it's simply copying the whole source as it is, the only difference are the steps before bootmgr is launched, i.e. what MBR is, how bootmgr is launched- chainloaded by grub4dos, invoked by the bootsector etc.

WinSetupFromUSB only adds a few extra debug boot options for Vista/7/8 Setup for some rare machines where Setup may fail at very early stage, or for cases when Setup is confused where to place boot files and USB and internal disks must be swapped.

0

Share this post


Link to post
Share on other sites

1) About the "map --unmap=0:0xff && map --unhook && map --rehook" - (...) - Should be relatively safe to delete those lines.

In fact I've managed to work around the problem, with a solution which I find suitable (but others might see problems that I haven't seen), and which doesn't require deleting these lines.

Initially I carry out the procedure described above, i.e. create a virtual disk, and run WinSetupFromUSB , using the advanced options and the "display drives on all interfaces, not only USB" checkbox.

The next step is fairly simple: everything that does does not need to be in the virtual disk is deleted from there and moved to the physical USB stick (as it would be in the normal WinSetupFromUSB procedure).

This includes the DPMS and the WinSetup/OEM folders (if present), and everything at the root of the virtual drive except shifthd.bat and usbdrive.tag

Therefore, all the initial boot procedure is entirely happening on the physical disk, and the unmap & unhook do not interfere.

Now, to complete the changes, all is needed is to modify the winmenu.lst, to map the virtual disk, at the right time. Just before:


ls /shifthd.bat > nul || find --set-root --devices=hf /shifthd.bat

I now add the following:


map /WinSetup.img (hd2)
map --hook

(twice, in the two main winmenu.lst entries). I'm hardcoding (hd2) but that may have to be changed depending on your hardware config,

By the way- how do you make the virtual disk visible for Windows Setup? Do you integrate a custom driver- firadisk, winvblock..., how?

Yep, i'm using WinVBlock.

Yesterday I carried out a simple experiment, just using the WinSetupFromUSB feature where you can specify a F6 floppy (use the WinVBLock.ima included in Wim'b latest XP_IMG package). That worked ok, and install was successful (TXT-mode at least, didn't go further).

However last night I tried something slightly more refined, where no floppy is needed, but where the WinVBlock is integrated into the XP source directly (with other mass-storage drivers). I think this is a great option, as it kills two birds with one stone, and allows installing XP from a virtual disk, but also to a virtual disk.

Initially I tried to use MSSTMake but there seem to be an incompatibility with WinVBlock and it just doesn't like it. I could be just an INF file problem, but this is way beyond anything I can resolve myself... but if anyone is up for the challenge .... :whistle:

So I moved to a different tool: IntegrateDrv which I discovered here: http://reboot.pro/8168/page__st__400#entry148258

This one can integrate WinVBlock properly, but it has been designed to operate on the temporary Windows Installation directories ('$WIN_NT$.~BT' and '$WINT_NT$.~LS). I tried using it directly on the plain XP source (I386 directory) and it did complete without moaning.... But now when I try to install XP, at the very end of TXT-mode setup when "Windows Starts", I get a BSOD 7E. In QEMU because setup is pretty slow, I can clearly see the WinVBlock driver being loaded, but somehow something seems to be not working.... Anyone cares to try and reproduce ?

In case of a virtual disk I am not quite sure that migrate.inf would work reliably, it may depends how the virtual disk is mounted during Setup

Yep, I appreciate that things might be a little more tricky than I thought. However if the disk is mounted properly, migrate.inf should do the job, I can't see any reason why the virtual disk signature wouldn't be recognised ok.

By the way, when shifting drives to make the USB disk last.... is it really the virtual disk that should be made last, or the physical one ? Can you quickly explain why ?

0

Share this post


Link to post
Share on other sites
I'm hardcoding (hd2) but that may have to be changed depending on your hardware config
You may try

map /WinSetup.img (hd)
map --hook

If you have 2 disks- hd0 and hd1, (hd) will be hd2:

http://reboot.pro/12449/#entry109030

By the way, when shifting drives to make the USB disk last.... is it really the virtual disk that should be made last, or the physical one ? Can you quickly explain why ?
It's about properly generating boot.ini by Setup at the end of Text mode.

The idea is to shift disk order making the internal disks first, and USB and virtual ones in your case last, just as if Setup was started from CD and in BIOS boot order internal disks are next.

Real world example- start Setup from USB disk, it is first in BIOS boot order, that's hd0 in grub4dos, or disk(0) as ARC path. Internal disk, the destination one is hd1, disk(1). Boot.ini will be generated with a path to Windows directory on disk(1).

When you remove the USB disk, the internal one becomes disk(0), but boot.ini still points to disk(1). NTLDR can't find Windows directory on disk(1)partition(X) and in case of XP throws HAL.DLL is missing or corrupt or same error for NTOSKRNL.EXE in case of 2003.

0

Share this post


Link to post
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.