Jump to content











Photo
- - - - -

WIN7 Instal from ISO > semi-automatic IMDISK setup


  • Please log in to reply
28 replies to this topic

#1 davlak

davlak

    Frequent Member

  • Advanced user
  • 224 posts
  •  
    Italy

Posted 01 July 2010 - 11:27 AM

as already described here:

http://www.boot-land...showtopic=10136

hope to give it more visibility ...

I need a batch file!!! :cheers: :cheers:


this is what I've done:

1) created a WIN7 ISO
2) created an imdisk folder containing the imdisk files, the setupimdisk.cmd and the setupcdrom.cmd
3) mounted rw boot.wim e put the imdisk folder inside the \windows\system32 AND the \sources of the wim, committed changes
4) rebuilded win7 iso containing the modified boot.wim

I've succeded to install win7 using the iso and the imdisk method...wonderful

I'm asking if anyone know how to build a cmd or similar to make automatic the second part of the setup, the one after the international settings.

at the moment, once at the prompt, I must do:

pushd imdisk (*)

setupimdisk.cmd

setupcdrom.cmd c:\7.iso (**)

set fullname=c:\7.iso

imdisk -a -f "c:\7.iso" -m #:

x:

setup

(*) note that the imdisk folder is already present into \sources of the boot.wim
(**) note that at this point I've already copied (at the beginning of the pc's setup) the 7.iso in the root of the first primary partition ntfs formatted-active of the HD0, so the path C:\7iso is correct.

the setupimdisk.cmd:

rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 .\imdisk.inf

the setupcdrom.cmd:

Set fullname=%~1

imdisk -a -f "%fullname%" -m #:

I'd like to launch a bat or a cmd or similar, containing all the lines, no needing to type anytithing else inside the prompt.
I know about the installer.cmd > imagexed wim method described here

http://www.boot-land...showtopic=10126

but for some reasons I prefer the ISO way.

Thanks in advance

davide

#2 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 July 2010 - 12:47 PM

You are now running manually these commands?:

pushd imdisk
setupimdisk.cmd
setupcdrom.cmd c:\7.iso
set fullname=c:\7.iso
imdisk -a -f "c:\7.iso" -m #:
x:
setup


and the called batches are:

rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 .\imdisk.inf

and

Set fullname=%~1
imdisk -a -f "%fullname%" -m #:


You want a batch like this?:

@ECHO OFF
IF NOT %1.==. SET FullName=%~dpnx1
PUSHD imdisk
rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 .\imdisk.inf
:Loop
IF NOT DEFINED FullName SET /P Fullname=Please input name of the .iso
Set fullname=%~dpnx1
IF NOT EXIST "%fullname%" (
SET Fullname=
GOTO :Loop
)
imdisk -a -f "%fullname%" -m #:


Obviously needs to be tested.

:cheers:
Wonko

#3 davlak

davlak

    Frequent Member

  • Advanced user
  • 224 posts
  •  
    Italy

Posted 01 July 2010 - 08:03 PM

Thanks Wonko, made a test but it asks

"Please input name of the .iso"

Typed the name.iso, enter and...it repeats Please input name of the .iso and so on.

#4 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 01 July 2010 - 10:21 PM

Typed the name.iso, enter and...it repeats Please input name of the .iso and so on.

Hmm :) the good news are that the LOOP works allright :cheers:.

B)

It was a 2 minutes job done in a hurry, I probably copied "Set fullname=%~dpnx1" instead of cutting it B), this should work:
@ECHO OFF

IF NOT %1.==. SET FullName=%~dpnx1

PUSHD imdisk

rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 .\imdisk.inf

:Loop

IF NOT DEFINED FullName SET /P Fullname=Please input name of the .iso: 

IF NOT EXIST "%fullname%" (

SET Fullname=

GOTO :Loop

)

imdisk -a -f "%fullname%" -m #:

You can also call it from command line, i.e.:
mybatch.cmd C:\mydir\mynice.iso
this way you will not be prompted for the .iso name (unless the actual .iso you passed as parameter is not found)

I cannot test it directly, but I quickly tested this "dummy" version:
@ECHO OFF

IF NOT %1.==. SET FullName=%~dpnx1

ECHO PUSHD imdisk

ECHO rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 .\imdisk.inf

:Loop

IF NOT DEFINED FullName SET /P Fullname=Please input name of the .iso: 

Set Fullname

PAUSE

IF NOT EXIST "%fullname%" (

ECHO File doesn't exist

SET Fullname=

GOTO :Loop

)

ECHO imdisk -a -f "%fullname%" -m #:

PAUSE
and it seems like working.

:cheers:
Wonko

#5 mjb

mjb

    Newbie

  • Members
  • 14 posts
  •  
    Malaysia

Posted 03 July 2010 - 12:43 PM

by using this method, the process will be much more simplify:
Tips - Using Grub4Dos boot Windows 7 Installation from USB

#6 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 03 July 2010 - 01:08 PM

by using this method, the process will be much more simplify:
Tips - Using Grub4Dos boot Windows 7 Installation from USB


Step 2: Copy everything in Windows 7 Installation DVD into your USB storage.

Using a DVD it will be even more simplified.

This thread is about booting a .iso, "your" method is the traditional one, with files copied to ROOT of the drive.

:unsure:
Wonko

#7 davlak

davlak

    Frequent Member

  • Advanced user
  • 224 posts
  •  
    Italy

Posted 03 July 2010 - 05:03 PM

@Wonko:

I have a problem with the batch: it seems to mount the iso but nothing happens. I mean that at the end, the setup asks again for a DVD driver, while manual input of the commands works fine.

#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 03 July 2010 - 05:12 PM

Try running the second one (the "dummy") it should produce the command lines (+ a FullName=C:\mydir\mynice.iso which is just the effect of the SET Fullname line).

You can also redirect it's output to a file with the > redirector, like in:

mybatch.cmd "C:\mydir\mynice.iso">C:\commands.txt

and check if it is EXACTLY the same as what you input manually....

It is also possible that there is a timing problem of some kind... :unsure:

:cheers:
Wonko

#9 Lost

Lost
  • Members
  • 8 posts

Posted 02 August 2010 - 01:20 PM

This approach is what I personally prefer. But you may want to make it "fully automatic", this of course involves editing the content of original ISO.

Actually there is a way to make a batch file, that will run automatically as you boot the ISO and then find and mount ISO file with IMDISK all by itself.

First you need to open the second image of boot.wim and put imdisk folder as well your batch file (for example mount.bat) into \windows\system32 as already described in post #1.

Then comes the tricky part. Open the registry inside boot.wim, navigate to HKEY_LOCAL_MACHINE\SYSTEM\Setup\CmdLine and replace winpeshl.exe with mount.bat. After you do so the main shell won't be able to automatically start anymore, but you still can start it from your batch with
start /wait winpeshl.exe command.

Next I will post contents of my mount.bat. This still needs some testing though. Hope I haven't been too messy.

FOR %%G 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 (dir %%G:\*.iso /B|Find "windows_7_x64.iso"IF NOT ERRORLEVEL 1 (cd /D %~dp0imdiskrundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 .\imdisk.infimdisk -a -f "%%G:\windows_7_x64.iso" -m #:goto:end)):endstart /wait winpeshl.exe


#10 L A M A

L A M A

    Silver Member

  • Advanced user
  • 540 posts
  •  
    United Nations

Posted 25 January 2011 - 07:43 AM

Hmm :rofl: the good news are that the LOOP works allright :rofl:.

:rofl:

....
:rofl:
Wonko


:happy_dance:

#11 daddy_fizz

daddy_fizz
  • Members
  • 8 posts

Posted 11 March 2011 - 09:08 PM

This approach is what I personally prefer. But you may want to make it "fully automatic", this of course involves editing the content of original ISO.

Actually there is a way to make a batch file, that will run automatically as you boot the ISO and then find and mount ISO file with IMDISK all by itself.

First you need to open the second image of boot.wim and put imdisk folder as well your batch file (for example mount.bat) into \windows\system32 as already described in post #1.

Then comes the tricky part. Open the registry inside boot.wim, navigate to HKEY_LOCAL_MACHINE\SYSTEM\Setup\CmdLine and replace winpeshl.exe with mount.bat. After you do so the main shell won't be able to automatically start anymore, but you still can start it from your batch with
start /wait winpeshl.exe command.

Next I will post contents of my mount.bat. This still needs some testing though. Hope I haven't been too messy.

FOR %%G 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 (dir %%G:\*.iso /B|Find "windows_7_x64.iso"IF NOT ERRORLEVEL 1 (cd /D %~dp0imdiskrundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 .\imdisk.infimdisk -a -f "%%G:\windows_7_x64.iso" -m #:goto:end)):endstart /wait winpeshl.exe


Thanks for these instructions... with some modifications for path and a few other tweaks I have this working for my win7 setup disk!

#12 sara - pmedia

sara - pmedia

    Frequent Member

  • Lady
  • 184 posts
  • Location:tel aviv
  •  
    Israel

Posted 14 March 2011 - 06:52 PM

@davlak

After Wonko tips , Can you please post the exact steps required to succeed?

Let's say my iso cald win7.iso places on first partition on my usb drive , How should the .bat be?
where to put the .bat?

#13 davlak

davlak

    Frequent Member

  • Advanced user
  • 224 posts
  •  
    Italy

Posted 14 March 2011 - 08:23 PM

@sara

may I suggest you to read the following threads?

http://reboot.pro/13967
http://reboot.pro/13968
http://reboot.pro/90...mistery__st__90

'cause the present one, at this point, is outdated :devil:

#14 ngoclinhdtdd

ngoclinhdtdd
  • Members
  • 1 posts
  •  
    Vietnam

Posted 22 October 2011 - 04:54 AM

Thanks for these instructions... with some modifications for path and a few other tweaks I have this working for my win7 setup disk!

Can you share for me your mount.bat code.Thank you

#15 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 October 2011 - 09:07 AM

Can you share for me your mount.bat code.Thank you

What do you think the contents of the code box represent? :dubbio:

Next I will post contents of my mount.bat. This still needs some testing though. Hope I haven't been too messy.

FOR %%G 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 (

dir %%G:*.iso /B|Find "windows_7_x64.iso"

IF NOT ERRORLEVEL 1 (

cd /D %~dp0imdisk

rundll32.exe setupapi.dll,InstallHinfSection DefaultInstall 132 .imdisk.inf

imdisk -a -f "%%G:windows_7_x64.iso" -m #:

goto:end

)

)

:end

start /wait winpeshl.exe



As posted by davlak there are evolutions of this (the post JUST above yours):

first two mentioned threads must have been merged/moved/whatever, but the last one is still where it should be:
http://reboot.pro/9076/

:cheers:
Wonko

#16 sebus

sebus

    Frequent Member

  • Advanced user
  • 363 posts

Posted 22 December 2014 - 02:05 PM

I know it is rather very old topic.

But I can not get this one working on WinPE4 x64

imdisk driver will install, but can not mount anything (iso in my case)

 

sebus



#17 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 22 December 2014 - 05:08 PM

I know it is rather very old topic.
But I can not get this one working on WinPE4 x64
imdisk driver will install, but can not mount anything (iso in my case)

Hmmm. :unsure:

How (EXACTLY) do you know that it installed succesfully?
Which (EXACT) imdisk.exe command are you executing?
What (EXACT) error/feedback (if any) do you get when you run that command?
Have you ALREADY checked the mentioned topic?:
http://reboot.pro/to...required-cddvd/


:duff:
Wonko

#18 sebus

sebus

    Frequent Member

  • Advanced user
  • 363 posts

Posted 22 December 2014 - 10:17 PM

1. Because install runs fine without any output error

2. imdisk -a -f isoehere -m letter:

3. Success

4. I do not think that relates in any way, I have no issue with booting full iso (in whatever way), but that is not what I need here (WinPE boot, mount iso, run install)

 

Upto W7/Server 2008 R2 I could boot from Win7x64 based WinPE & use OsrVirtualCdAndDisk ,which did not work - (not really surprising) while booted from WinPE 5

 

So I hoped that imdisk would work for that

 

sebus



#19 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 23 December 2014 - 09:22 AM

Is it possible that *somehow* the actual WinPE environment you are running is missing some component?

I mean, have you tried mounting *something else* with imdisk (like a floppy image or another .iso)?

On the other thread also firadisk is used if I recall correctly, and all in all the approach is not that much different, the idea there is to boot from the .iso a form of PE and in it use IMDISK (or Firadisk) to mount the .iso.

 

:duff:

Wonko



#20 sebus

sebus

    Frequent Member

  • Advanced user
  • 363 posts

Posted 25 December 2014 - 06:09 PM

Would prefer to use imdisk, due to:

 

 

Test-signed 64-bit driver is included. If you want to test it in Windows Vista or Windows 7 64-bit, you must enable TESTSIGNING Boot Configuration Option before you install this driver.
If you don't want to be warned about unknown publisher, you may install my self-signed test-signing root certificate before you install this driver. TestSignRootCA.reg ( 4.78K )

 

Yes, it is possible, that something is missing from basic WinPE x64 that I used, would be great to know what (which I do not so far)

 

But imdisk should work from WinPE, as it is used in Easy2Boot

 

Google "imdisk winpe" returns many same questions, with no single solution answer



#21 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 26 December 2014 - 11:04 AM

Why don't you try building quickly ;) a QuickPE and see if in it IMDISK works?

http://reboot.pro/fi...le/340-quickpe/

 

You have to understand why you found so many "same questions" in google (which BTW I am failing to find, and being The Finder this is preoccupying :w00t: :ph34r:), generally speaking a lot of people - just like you are doing in this case - do three things:

  1. build a WinPE in some new, strange way
  2. fail to provide any meaningful info on how the build was made
  3. ask "in my WinPE imdisk does not work"

and the relatively few people that may be at the same time willing to help and actually capable of doing so simply cannot help because they have no wy to know how excactly the "my WinPE" was created.

 

 

:duff:

Wonko



#22 sebus

sebus

    Frequent Member

  • Advanced user
  • 363 posts

Posted 27 December 2014 - 01:17 PM

Bacause I did NOT build any "strange" image. It is the default WinPE x64 that comes with WAIK for Win 7

As it is all that is needed for this exercise (boot PE, mount iso, run setup). And also very easy to replicate (as nothing needs to be done really, it simply is there when WAIK is installed)

 

sebus



#23 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 December 2014 - 02:18 PM

Bacause I did NOT build any "strange" image. It is the default WinPE x64 that comes with WAIK for Win 7

As it is all that is needed for this exercise (boot PE, mount iso, run setup). And also very easy to replicate (as nothing needs to be done really, it simply is there when WAIK is installed)

 

sebus

Good.

So we have evidence that the "most common" PE around (which is the one in the boot.wim on *any* Windows 7 DVD and that boots the setup or the recovery) has IMDISK working fine, BUT that a "default" PE created from WAIK has it not.

Now you know what to compare to find the *whatever* is missing/different, I believed till now that a built WinPE from the WAIK was like 99.99% the same as the one on the Widnows 7 DVD used fo install/setup, but it is well possible that noone noticed this difference.

 

:duff:

Wonko. 



#24 cdob

cdob

    Gold Member

  • Expert
  • 1469 posts

Posted 27 December 2014 - 07:55 PM

But I can not get this one working on WinPE4 x64
imdisk driver will install, but can not mount anything (iso in my case)


It is the default WinPE x64 that comes with WAIK for Win 7

Using the default f3_winpe.wim:
The imdisk driver will install and can mount a windows_7_x64.iso in my case.

Which iso file do you like to mount?

#25 sebus

sebus

    Frequent Member

  • Advanced user
  • 363 posts

Posted 29 December 2014 - 07:23 PM

Yes, it does on local iso, I could not get it to work from network mounted share. Will need to re-test when back at work to see if that is the case or if it was user error (which always is a possibility)

 

sebus






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users