Jump to content











Photo

Make a multi-install USB Flash drive using grub4dos and Windows ISO files


  • Please log in to reply
106 replies to this topic

#1 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 26 May 2011 - 06:59 AM



Link to Tutorial


This method works with USB Flash drives - if you are using a USB Hard Disk (or USB Flash drives that appears as a 'Local Disk' in Windows Explorer), you will also need a small USB Flash drive or you will need to type a few commands once the Setup utility has booted. See the tutorial link for full details.

It uses some interesting commands available with the latest (chenall) grub4dos version (as used by RMPrepUSB).

 

[Edit]Also see Easy2Boot - boot from any Windows Install ISO (XP-->SVR2012) just by adding the ISO files.[/Edit]

 



#2 Javito

Javito

    Newbie

  • Members
  • 12 posts
  •  
    Venezuela

Posted 08 June 2011 - 04:27 AM

I'm getting an error after the iso is loader on the grub menu, which is from the Windows Boot Manager black screen appears saying that there is an error, the status code is 0xc00000e9 and the info says An unexpected I/O error has occurred, and i cant continue with the setup.

Do you have any idea why is this happening?

#3 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 08 June 2011 - 04:08 PM

Have you checked that you have a good USB drive? If it is a flash drive it could have corrupt sectors. Test with RMPrepUSB Quick Size Test, reformat and then test with H2TESTW - or compare an MD5 checksum with the iso on your hard disk?

#4 Javito

Javito

    Newbie

  • Members
  • 12 posts
  •  
    Venezuela

Posted 08 June 2011 - 06:07 PM

I'll do that, but now im using a diferent iso and it's working altho i dont think is the drive because i also tried on my 8gb flash drive and got the same result. Btw your method works on usb hard drives, last night i install win7sp1 iso from my hard drive using your method and i didnt need to do anything extra like the tutorial said on hard drives :unsure:

#5 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 08 June 2011 - 06:17 PM

Btw your method works on usb hard drives, last night i install win7sp1 iso from my hard drive using your method and i didnt need to do anything extra like the tutorial said on hard drives :unsure:


Does you USB hard drive appear in Windows Explorer as a Removable Drive? The AutoUnattend.xml is only detected on Removable drives?

#6 Javito

Javito

    Newbie

  • Members
  • 12 posts
  •  
    Venezuela

Posted 08 June 2011 - 09:22 PM

My hard drive appears in the Hard Disk list, not as a removable drive, but after trying to figure it out why was one iso working and one not, this is what i discover:

1.- I Slipstreamed SP1 onto my RTM Win7 ISO and your method worked, windows installed without any problems.
2.- After Slipstreamed SP1 i also SlipStreamed the language pack and the setup worked but after the file copy i got this error "could not set the offline locale information. Error Code: 0x80000001".
3.- Without doing the imdisk\loadiso.cmd, the setup shows me all 10 options of windows instalation (starter, premium, profesional etc for x86 and x64) and that should not be happening because i only had 2 Windows Ultimate x86 and x64.
4.- Using the imdisk\loadiso.cmd thingy the setup shows the 2 right options of windows setup i left on my iso and the installation works without any problem.

Now, there is something odd here that i dont understand maybe you can give me a hand here.

#7 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 08 June 2011 - 10:48 PM

Windows Setup on booting, searches all drives (DVD, CD, USB) for a \sources\install.wim file.When testing, you must ensure that no source DVDs are present in the DVD ROM drive - if one is present then Windows Setup will find it and use the install.wim file which contains all the Win 7 SKUs in it and use that. Also, make sure you have no \sources\install.wim present on any hard disk anywhere in the system.

What Windows SKUs are listed in the menu are determined by the ei.cfg file - if Windows Setup detects a DVD (or folder) with this file in it, it will limit the SKU choices to what is in that file. If Setup does not see any ei.cfg file, it will just list all SKUs that are in the install.wim file. In this way MS can make different DVDs for different SKUs just by putting a different ei.cfg file on the DVD.

Any test you do should be done on a system with CLEANed hard disks and nothing in the DVD/CD drives and no other USB media connected except for your USB boot drive.

The locale error is typically when the unattend.xml conflicts with the source image used. You can examine the log files created by Setup to see the error - use SHIFT+F10 and then run Notepad to look at files in C:\Windows\Panther\UnattendGC folder.

#8 Javito

Javito

    Newbie

  • Members
  • 12 posts
  •  
    Venezuela

Posted 09 June 2011 - 02:46 AM

And where is this ei.cfg file located?

#9 Javito

Javito

    Newbie

  • Members
  • 12 posts
  •  
    Venezuela

Posted 09 June 2011 - 03:07 AM

Windows Setup on booting, searches all drives (DVD, CD, USB) for a \sources\install.wim file.When testing, you must ensure that no source DVDs are present in the DVD ROM drive - if one is present then Windows Setup will find it and use the install.wim file which contains all the Win 7 SKUs in it and use that. Also, make sure you have no \sources\install.wim present on any hard disk anywhere in the system.


I have a 5 gb partition on my hard drive that contains the installation files for windows 7, i guess that it was reading that one instead of the dvd one and that's why i was getting the full menu when i wasn't running the imdisk thingy

#10 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 09 June 2011 - 06:37 AM

May be worth you reading https://sites.google...utorials/winiso - ei.cfg is in \sources folder.

#11 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 24 June 2011 - 06:24 PM

'Universal' WIndows Vista and later ISO bootable USB Flash drive now here - just add your ISO files to the \ISO folder. When you choose the gru4dos menu title, grub4dos will list all the ISO files available in the ISO folder and the run the one you type in. No menu.lst to alter or edit ever again!

#12 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 24 June 2011 - 07:21 PM

steve6375

I looked at your #32 Tutorial and found it indeed seriously reworked. Your method at present appears to be the easiest way to install or repair Win OS from unmodified Win install ISO. I will definitely check it again when installing Win 8 shortly to a new partition.

In brief, here are the steps:

- Download original Win Vista/7/8 ISO to \ISO folder on any drive, rename the file shorter, and add empty marker.txt file to that folder. If you don't have enough continuous free space on the drive, use WinContig to defrag the ISO;
- Prepare a bootable USB Thumb with Grub4DOS on it using RMPrepUSB, or use any existing HD with latest Grub4DOS installed;
- Unpack WINISO_IMDISK_32a.ZIP to root of your USB Thumb or HD. If using HD, you will need to manually find using Command Prompt and mount the ISO with ImDisk during Win install - follow Steve's Tutorial;
- Boot from the Thumb and type the name of ISO when prompted. Or point to the ISO in menu.lst, boot from the HD and type mentioned in the Tutorial commands when Win install starts. Reboot to newly installed OS partition a few times using Grub4DOS Menu, when prompted by Win installer;
- You are DONE!

#13 sushil1576

sushil1576

    Member

  • Members
  • 48 posts
  •  
    India

Posted 09 August 2011 - 03:34 AM

Hi,

First of all i would like to thank you for all the wonderful tutorials that you make,which makes it really easy for all of us.I tries to make a multi-install usb flash drive using your tutorials no. 33 and no. 43,i.e, both imdisk and firadisk method.But somehow both doesn't work correctly for me...

Firadisk :
I am getting the following error when i try your default menu.lst

Posted Image

Uploaded with ImageShack.us

The following steps i have used while trying the firadisk method..

1) I am using a USB Hard disk for the above method which has latest grub4dos already installed in the mbr..

2) Extracted the Tut43_FiraIso.zip to the root of the USB Hard disk

3)Put my modified Win732SP1.iso into the ISO folder at the root of the USB HDD.I modified boot.wim file and inserted both "mysetup.cmd" and "winpeshl.ini" into the 2 image of boot.wim.

While experimenting ,i modified your menu.lst as following and it worked perfectly...Though as specified Repair option does not work..Basically i just removed the variable "set mm" and "%mm%" from menu.lst.Otherwise i got the above mentioned error.


color black/cyan blue/cyan red/light-blue red/cyan



write (md)0x220+1 !BAT\necho -n -P:0000 $[0133]                    --- Windows install ---                                    \0

initscript (md)0x220+1



title INSTALL Windows 7 32-bit\n

set MYISO=win732SP1.iso

map --mem (md)0x800+4 (99)

map /ISO/%MYISO% (0xff)

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/ISO/%MYISO%;\n\0

chainloader (0xff)/BOOTMGR || chainloader (0xff)



title REPAIR  Windows 7 32-bit\n

set MYISO=win732SP1.iso

map --mem (md)0x800+4 (99)

map /ISO/%MYISO% (0xff)

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/ISO/%MYISO%;\n\0

chainloader (0xff)/BOOTMGR || chainloader (0xff)





### ADD MORE ISO MENu ENTRIES HERE - DUPLICATE THE TWO ENTRIES ABOVE AND CHANGE THE ISO FILENAME



title

root ()



title Boot from 1st Hard Disk \nBoot from MBR of first hard disk and remove the USB drive

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

chainloader (hd0)+1

rootnoverify (hd0)



title 

root ()





title Choose any iso file...

root ()



title 

root ()



title INSTALL WINDOWS - Boot from any Windows ISO to install Windows\nThis menu allows you to type in the name of any Windows ISO file and boot from it

# find the ISO folder by looking for a marker file

find --set-root /ISO/choose_an_iso

clear

echo

# list all files in the /ISO folder so the user can see them

ls ()/ISO/

echo

# Ask user which iso they want (name is converted to uppercase as $U is specified)

set /p /u ask=Enter iso filename WITH NO .ISO EXTENSION (e.g. Win7Pro32 ) :  

if "%ask%"=="" echo No iso file specified! && configfile /menu.lst

clear

# check if user entered a valid filename with no ISO extension!

ls /ISO/%ask%.iso || echo Cannot find /ISO/%ask%.iso !!! && pause --wait=3 && configfile (bd)/menu.lst

echo Loading /ISO/%ask%.iso - please wait ...

#set root drive to USB stick

find --set-root /Firadisk/loadiso.cmd

map --mem (md)0x800+4 (99)

find --set-root /ISO/%ask%.iso

# run the grub4dos map command and specify the iso file we want to load

map /ISO/%ask%.iso (0xff)

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

# Specify the same iso file for when firadisk runs in winpe

find --set-root /firadisk/loadiso.cmd

write (99) [FiraDisk]\nStartOptions=cdrom,vmem=find:/ISO/%ask%.iso;\n\0

chainloader (0xff)/BOOTMGR || chainloader (0xff)

clear



title REPAIR WINDOWS  - Boot from any Windows ISO to repair Windows\nThis menu allows you to type in the name of any Windows ISO file and boot from it for a repair operation only

# find the ISO folder by looking for a marker file

find --set-root /ISO/choose_an_iso

clear

echo

# list all files in the /ISO folder so the user can see them

ls ()/ISO/

echo

# Ask user which iso they want (name is converted to uppercase as $U is specified)

set /p /u ask=Enter iso filename WITH NO .ISO EXTENSION (e.g. win7pro32 ) :  

if "%ask%"=="" echo No iso file specified! && configfile /menu.lst

clear

# check if user entered a valid filename with no ISO extension!

ls /ISO/%ask%.iso || echo Cannot find /ISO/%ask%.iso !!! && pause --wait=3 && configfile (bd)/menu.lst

echo Loading /ISO/%ask%.iso - please wait ...

map --mem (md)0x800+4 (99)

#set root drive to USB stick

find --set-root /firadisk/loadiso.cmd

find --set-root /ISO/%ask%.iso

# run the grub4dos map command and specify the iso file we want to load

map /ISO/%ask%.iso (0xff)

map (hd0) (hd1)

map (hd1) (hd0)

map --hook

# clear any memory drive contents

find --set-root /firadisk/loadiso.cmd

write (99) DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD\n\0

chainloader (0xff)/BOOTMGR || chainloader (0xff)

clear


Edited by sushil1576, 09 August 2011 - 04:06 AM.


#14 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 09 August 2011 - 08:13 AM

What version of grub4dos are you using? There must be some difference in versions.

With the version I had
map /ISO/%MYISO% (0xff)
did not work, which is why I had to use
set mm=map /ISO/%MUISO% (0xff)
%mm%

strange???

#15 sushil1576

sushil1576

    Member

  • Members
  • 48 posts
  •  
    India

Posted 09 August 2011 - 10:54 AM

I am using Grub4dos 0.4.5b 2011-02-19 version,

Ok,..This time in another experiment i integrated firadisk driver v0.0.1.30 into the boot.wim image with "DISM.exe".I didn't integrate the "winpeshl.ini" and "mysetup.cmd" into the boot.wim image.I thought maybe with this method,the setup will see the commands for creating a virtual cd rom from grub4dos ram drive that we have given in the menu.lst.

But it didn't create any Virtual CD ROM..and expectedly it didn't find setup.exe.

I then used Shift+F10 for command prompt and ran the "loadiso.cmd"...This way it created the CD rom and mounted the Windows 7 iso and found install.wim ...So when i started the setup again without restating,I got both the repair option as well as the install option working...

So i think the trick here for making both the install option and repair option to work is to somehow launch the "loadiso.cmd",..after the setup.exe from boot.wim doesn't find the install.wim.Or may be we should just put "mysetup.cmd" and "winpeshl.ini" and just create a virtual CD rom and mount the windows 7 iso without actually starting the setup.exe...

I know all these are vague ideas and maybe it will not be possible,..But somehow with your knowledge steve,you may make it work :whistling:

#16 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 09 August 2011 - 11:00 AM

Sure, that is the problem. As soon as you try to automate the loadiso/firadisk loading, you lose the Repair option.Posted Image

#17 sushil1576

sushil1576

    Member

  • Members
  • 48 posts
  •  
    India

Posted 09 August 2011 - 11:08 AM

Well i got both the option working after executing the "loadiso.cmd" from command promt after the default setup.exe failed to find the install.wim..I got this working only after i integrated firadisk driver into boot.wim with dism.exe

Is it not possible to create a virtual cd rom and mount the windows 7 iso in it and then start the setup.exe from the default,..i.e, from booted pe..this way i think the repair option will also be available..

Edited by sushil1576, 09 August 2011 - 11:09 AM.


#18 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 09 August 2011 - 11:17 AM

The repair option is easy, just don't modify the boot.wim. The problem comes when you want a single ISO that offers both the repair option and the install option without having to type anything in (i.e. use SHIFT+F10).
What I did not try in the tutorial is instead of adding winpeshl.ini and mysetup.cmd, actually just edit startnet.cmd - if you do this you may get the repair option (i.e. don't run Setup from within startnet, just load the ramdrive).

So add to startnet.cmd the line

call mysetup.cmd

and edit mysetup.cmd to add in a goto :EOF


REM Reboot
goto :EOF
)

goto :EOF


and delete winpeshl.ini.

#19 sushil1576

sushil1576

    Member

  • Members
  • 48 posts
  •  
    India

Posted 09 August 2011 - 11:39 AM

ok i will try out your suggestions later..can you please tell me what exactly to put into mysetup.cmd....i am not very good at coding...

#20 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 09 August 2011 - 11:43 AM

ok i will try out your suggestions later..can you please tell me what exactly to put into mysetup.cmd....i am not very good at coding...


I just did ! Just add one line shown in bold type above.

#21 sushil1576

sushil1576

    Member

  • Members
  • 48 posts
  •  
    India

Posted 09 August 2011 - 12:02 PM

ok...thanks.i will try it out later today,..right now i am not on my pc.

#22 sushil1576

sushil1576

    Member

  • Members
  • 48 posts
  •  
    India

Posted 09 August 2011 - 06:35 PM

Well i tried your suggestion and modified "startnet.cmd" in the 2 image in boot.wim...But still the setup does not starts as it cannot find setup.exe as virtual cd rom is not created.When i manually execute "startnet.cmd",it executes "loadiso.cmd" and shows that it found the setup.exe and install.wim but reboots immediately...

Well maybe startnet.cmd is not executed while booting of boot.wim image...

Edited by sushil1576, 09 August 2011 - 06:35 PM.


#23 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 09 August 2011 - 07:17 PM

Well i tried your suggestion and modified "startnet.cmd" in the 2 image in boot.wim...But still the setup does not starts as it cannot find setup.exe as virtual cd rom is not created.When i manually execute "startnet.cmd",it executes "loadiso.cmd" and shows that it found the setup.exe and install.wim but reboots immediately...

Well maybe startnet.cmd is not executed while booting of boot.wim image...



Found this on another post on ReBoot

... Winpeshl.exe will launch %SYSTEMDRIVE%\sources\setup.exe if it exists, otherwise it looks for an application specified in %SYSTEMROOT%\system32\winpeshl.ini. If no application is specified, Winpeshl.exe will execute cmd /k %SYSTEMROOT%\system32\startnet.cmd. By default, Windows PE contains a Startnet.cmd file which will launch Wpeinit.exe. Wpeinit.exe loads network resources and coordinates with networking components like DHCP.


So MySetup.cmd runs setup from the Ramdrive and so this should be the same as Winpeshl.exe does (unless the setup on the X:\sources\setup.exe is the one that should be run)


so try using winpeshl.ini again and editing MySetup.cmd as follows:




REM Reboot


goto :EOF


)



GOTO :TRY1

echo looking for setup.exe in \sources on DVD ISO


If exist %RAMdrive%\sources\setup.exe (


%RAMdrive%


REM setup will use its path to find the install.wim


echo Launching %RAMdrive%\sources\setup.exe


%RAMdrive%\sources\setup.exe


goto :RBT


)






echo looking for setup in root of DVD ISO


If exist %RAMdrive%\setup.exe (


%RAMdrive%


REM setup will use its path to find the install.wim


%RAMdrive%\setup.exe


goto :RBT


)





:TRY1

REM if not then just call setup in root of boot.wim and point it at install.wim




if exist X:\sources\Setup.exe X:\sources\setup.exe /installfrom:%RAMdrive%\sources\install.wim


if exist X:\Setup.exe X:\setup.exe /installfrom:%RAMdrive%\sources\install.wim


goto :RBT










#24 sushil1576

sushil1576

    Member

  • Members
  • 48 posts
  •  
    India

Posted 10 August 2011 - 04:02 AM

Hi,

Got Both the repair option as well as Install option working,..But for this i had to edit "mysetup.cmd" as below...Basically i removed /installfrom option and we have to run setup.exe from X:\Setup.exe first to get the repair option.If we run X:\Sources\Setup.exe then we directly get the main setup bypassing the repair option... :cheers:


@echo off



TITLE MYSETUP.CMD

REM run wpeinit after loading ISO file



cmd /q /c  "FOR %%i IN (C D E F G H I J K L N M O P Q R S T U V W X Y Z) DO IF EXIST %%i:\FIRADISK\LOADISO.CMD  cmd /k %%i:\FIRADISK\LOADISO.cmd"



TITLE MYSETUP.CMD

REM find RAMDRIVE with ISO contents

for %%I 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 if exist %%I:\sources\install.wim set RAMdrive=%%I:

If NOT "%RAMdrive%"=="" echo Found Install.wim at %RAMdrive%\sources\install.wim

IF "%RAMdrive%"=="" (

echo ERROR - COULD NOT FIND INSTALL.WIM!

pause

pause

REM Reboot

goto :EOF

)



goto :TRY1



echo looking for setup.exe in \sources on DVD ISO

If exist %RAMdrive%\sources\setup.exe  (

%RAMdrive%

REM setup will use its path to find the install.wim

echo Launching %RAMdrive%\sources\setup.exe

%RAMdrive%\sources\setup.exe

goto :RBT

)





echo looking for setup in root of DVD ISO

If exist %RAMdrive%\setup.exe  (

%RAMdrive%

REM setup will use its path to find the install.wim

%RAMdrive%\setup.exe

goto :RBT

)



:TRY1



REM if not then just call setup in root of boot.wim and point it at install.wim



if exist X:\Setup.exe X:\setup.exe

if exist X:\sources\Setup.exe X:\sources\setup.exe

goto :RBT





:BAD

dir X:\ /b

echo Cannot find X:\Setup.exe !

@echo Press a key to reboot now...

pause



:RBT

wpeutil reboot

pause





#25 steve6375

steve6375

    Platinum Member

  • Developer
  • 7566 posts
  • Location:UK
  • Interests:computers, programming (masm,vb6,C,vbs), photography,TV,films
  •  
    United Kingdom

Posted 10 August 2011 - 10:16 AM

As Wonko TS says 'Giving up is not an option!' Posted Image Well Done!

I will try this out and update the tutorialPosted Image




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users