Jump to content











Photo
- - - - -

Installing Windows 7/8 from .iso without unpacking

winpe iso ibs boot usb imdisk impossible:)

  • Please log in to reply
71 replies to this topic

#51 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 29 April 2014 - 12:53 AM

I've no idea what you have came up with so far, but if you are still using WinSetupFromUSB, it would be possible with a bit of cheating to avoid most manual work, if not all.

 

Latest WinSetupFromUSB versions have an advanced option to launch Q-Dir before start of Setup.

You could rename your script to WinPreSetup.exe, use the same switches as WinPreSetup.exe in it, do your stuff to unhide and mount partitions and launch WinPreSetup.exe (Q-Dir.exe) when needed, passing the same parameters.

Next replace Q-Dir.exe with WinPreSetup.exe, the appropriate architecture and use the advanced option to add Q-Dir.

All files are in <WinSetupFromUSB>\files\winsetup\

 

Let me know if you are going this way and need details.

 

I think I know what you mean, thanks. Will test when I'm done with WinNTSetup.

 

So, guys, what would be the best way to create a tutorial here? Create a new thread an link from Tutorials section?



#52 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 29 April 2014 - 07:50 AM

I think I know what you mean, thanks. Will test when I'm done with WinNTSetup.

 

So, guys, what would be the best way to create a tutorial here? Create a new thread an link from Tutorials section?

Actually just starting a new thread IN the Tutorials section, like here:

http://reboot.pro/forum/116-tutorials/

and IF the tutorial is "good enough", Nuno or another Admin/Mod may decide to "pin" (or "stickyfy" it).

 

:duff:

Wonko


  • Gear54rus likes this

#53 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 29 April 2014 - 12:05 PM

Aight, tutorial creation in progress...

 

I've no idea what you have came up with so far, but if you are still using WinSetupFromUSB, it would be possible with a bit of cheating to avoid most manual work, if not all.

 

Latest WinSetupFromUSB versions have an advanced option to launch Q-Dir before start of Setup.

You could rename your script to WinPreSetup.exe, use the same switches as WinPreSetup.exe in it, do your stuff to unhide and mount partitions and launch WinPreSetup.exe (Q-Dir.exe) when needed, passing the same parameters.

Next replace Q-Dir.exe with WinPreSetup.exe, the appropriate architecture and use the advanced option to add Q-Dir.

All files are in <WinSetupFromUSB>\files\winsetup\

 

Let me know if you are going this way and need details.

 

I didn't quite get the part where you want me to convert my script (which is cmd script) to an .exe file somehow. It seems that this has to be done with some sort of compiler like this: http://sourceforge.n...ojects/bat2exe/

 

Is this correct or am I missing something?



#54 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 29 April 2014 - 01:15 PM

Yep, something like this.



#55 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 29 April 2014 - 04:08 PM

Yep, something like this.

 

So as I understood, you wrote the WinSetupFromUSB program? I have a few questions:

  • how does it detect WinPE version (32 or 64 bit)?
  • Is there any way to force installation on logical (non-primary)partition (for purposes of transferring control from bootloader on other partition)?
  • Is there any command line options for it? Like to force Q-Dir to be enabled?

Thank you



#56 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 29 April 2014 - 09:32 PM

how does it detect WinPE version (32 or 64 bit)?

By presence of SysWOW64 in the boot image in boot.wim. Alternatively you could use [1].xml in boot.wim and parse it.
 
 

Is there any way to force installation on logical (non-primary)partition (for purposes of transferring control from bootloader on other partition)?

You mean to transfer the installation files on logical partition? I think not, it would display and use primary partitions only.
 
 

Is there any command line options for it?

Nope.

#57 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 30 April 2014 - 03:22 AM

I've no idea what you have came up with so far, but if you are still using WinSetupFromUSB, it would be possible with a bit of cheating to avoid most manual work, if not all.

 

Latest WinSetupFromUSB versions have an advanced option to launch Q-Dir before start of Setup.

You could rename your script to WinPreSetup.exe, use the same switches as WinPreSetup.exe in it, do your stuff to unhide and mount partitions and launch WinPreSetup.exe (Q-Dir.exe) when needed, passing the same parameters.

Next replace Q-Dir.exe with WinPreSetup.exe, the appropriate architecture and use the advanced option to add Q-Dir.

All files are in <WinSetupFromUSB>\files\winsetup\

 

Let me know if you are going this way and need details.

 

So I have tried this suggestion. Here's the script I've come up with: 

@echo off
::set partition number here, partition numbers are 1-based
set partition=2
::========================================================
if [%1]==[] goto:eof
if %1 == /mountiso goto:mount
if %1 == /explorer goto:eof
if %1 == /startsetup goto:setup
:mount
wpeutil > nul 2>&1
if errorlevel 9009 if not errorlevel 9010 (
	goto:start
)
echo Waiting for USB drives to initialize...
wpeutil WaitForRemovableStorage > nul
:start
vmount disks | find /c /v "" > tmp
set /p drives=<tmp
set /a "drives-=1"
for /l %%G in (0,1,%drives%) do (
	vmount mount W: \device\Harddisk%%G\partition%partition% > nul
	if exist W:\nul	(
		if exist W:\%2 (
		    echo USB drive found!
		    goto:end
		)
	)
	vmount umount W: > nul
)
echo Waiting for USB drives to initialize...
sleep.exe 3
goto:start
:end
del tmp
goto:eof
:setup
echo Launching Windows Setup...
start /wait Q-Dir.exe /startsetup

Both Q-Dir versions were replaced with WinPreSetup.exe files. Above script was compiled (vmount and sleep were included) for both architectures and it replaced WinPreSetup.exe files. Q-Dir option was used when working with WinPreSetup.

 

At the stage of Launching Windows Setup which is the last line in Winpeshl.ini it throws a message box with error could not read virtual disk location. Not sure what to make of it since no other errors are displayed in any other places before. 

 

Googling for this error seems to give no results. Do you know if this error is thrown by WinSetupFromUSB? If so, what does it mean?

 

The only virtual disk we have here is boot.wim file but it is surely accessible since the script was run from it in the first place.


Edited by Gear54rus, 30 April 2014 - 03:32 AM.


#58 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 30 April 2014 - 11:26 AM

You'd need to run WinPreSetup.exe with /mountiso="directory/file.iso" parameter first. This will search for this ISO on all available mounted volumes and set location of the imdisk virtual disk created.
On next run of WinPreSetup.exe with /startsetup parameter, this location is read and used.

Are you still going to use an ISO as source or flat file structure? When do you mount the ISO if the former?

#59 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 30 April 2014 - 12:35 PM

Gear54rus, on 30 Apr 2014 - 05:22 AM, said:
if errorlevel 9009 if not errorlevel 9010 (

I am not sure to understand this. :unsure:
Just for the record, the %ERRORLEVEL% varaible is set in NT OS.

Also:

vmount disks | find /c /v "" >tmp
set /p drives=<tmp

There is no need to use the tmp file, you can use a FOR /F loop to set the drives variable.

:duff:
Wonko



#60 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 30 April 2014 - 02:07 PM

You'd need to run WinPreSetup.exe with /mountiso="directory/file.iso" parameter first. This will search for this ISO on all available mounted volumes and set location of the imdisk virtual disk created.
On next run of WinPreSetup.exe with /startsetup parameter, this location is read and used.

Are you still going to use an ISO as source or flat file structure? When do you mount the ISO if the former?

 

Ooooh, I forgot that, sorry. Will test ASAP.

 

I am not sure to understand this. :unsure:
Just for the record, the %ERRORLEVEL% varaible is set in NT OS.

Also:
There is no need to use the tmp file, you can use a FOR /F loop to set the drives variable.

:duff:
Wonko

 

I do not quite understand concept behind errorlevel and %ERRORLEVEL% but those two seem to be different from the reports on the net. And since it did not fail so far, I do not intend to change it.

 

Regarding double ifs - this is to ensure our number is in range between 9009 and 9010 (or maybe even 9009 and 9009  :loleverybody: ) as far as I'm aware.



#61 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 30 April 2014 - 02:28 PM

Well, just in case:
http://www.robvander.../errorlevel.php

 

Mind you everyone has his/her own script writing style, and changing that to the "right" (IMHO) syntax is of course completely optional :).

 

Writing to a temporary file to set a variable :w00t: when it is possible to avoid it, is instead (stiil IMHO) foolish :w00t: :ph34r:.

 

:duff:

Wonko



#62 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 30 April 2014 - 02:54 PM

Well, just in case:
http://www.robvander.../errorlevel.php

 

Mind you everyone has his/her own script writing style, and changing that to the "right" (IMHO) syntax is of course completely optional :).

 

Writing to a temporary file to set a variable :w00t: when it is possible to avoid it, is instead (stiil IMHO) foolish :w00t: :ph34r:.

 

:duff:

Wonko

 

Couldn't agree more, but still, abusing for isn't any better I think. I'll try to convert, but daym, such a simple task takes that amount of workarounds.

 

Y, CMD, Y U DO DIS? Looks like cmd needs some bash in it.


Edited by Gear54rus, 30 April 2014 - 03:01 PM.


#63 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 30 April 2014 - 03:10 PM

You'd need to run WinPreSetup.exe with /mountiso="directory/file.iso" parameter first. This will search for this ISO on all available mounted volumes and set location of the imdisk virtual disk created.
On next run of WinPreSetup.exe with /startsetup parameter, this location is read and used.

Are you still going to use an ISO as source or flat file structure? When do you mount the ISO if the former?

 

By the way, I don't mind using source files but it does not seem to be possible.

 

Windows installer wants to see it all on the root partition doesn't it?

 

You can see me mounting iso in the first part of script.


Edited by Gear54rus, 30 April 2014 - 03:10 PM.


#64 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 30 April 2014 - 03:34 PM

I think Setup cares mostly about the "sources" folder.

#65 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 30 April 2014 - 03:41 PM

You'd need to run WinPreSetup.exe with /mountiso="directory/file.iso" parameter first. This will search for this ISO on all available mounted volumes and set location of the imdisk virtual disk created.
On next run of WinPreSetup.exe with /startsetup parameter, this location is read and used.

Are you still going to use an ISO as source or flat file structure? When do you mount the ISO if the former?

 

Did that, Works fine.

 

The only issue seems to be that there's a black window of CMD now displayed behind setup.exe. Only option seems to be to make my bat invisible when compiling..



#66 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 30 April 2014 - 03:48 PM

Maybe you could call WinPreSetup.exe /startsetup without the wait parameter and exit the script.

#67 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 30 April 2014 - 03:50 PM

Maybe you could call WinPreSetup.exe /startsetup without the wait parameter and exit the script.

 

In that case PE Shell (which is the parent process for everyone in this case) will say: Hmm.. Installation (my script) has finished. ITS REBOOT TIME  :happy_dance:

 

Will test that tho.


Edited by Gear54rus, 30 April 2014 - 03:51 PM.


#68 Wonko the Sane

Wonko the Sane

    The Finder

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

Posted 30 April 2014 - 04:04 PM

I don't know. :dubbio:

 

Converting:

 

vmount disks | find /c /v "" > tmp
set /p drives=<tmp
set /a "drives-=1"

to:

SET /A drives=-1
FOR /F %%? IN ('vmount disks') DO SET /A drives+=1

does not look to me "abusing" anything. :unsure:

 

:duff:

Wonko



#69 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 30 April 2014 - 04:12 PM

I don't know. :dubbio:

 

Converting:

 

to:

SET /A drives=-1
FOR /F %%? IN ('vmount disks') DO SET /A drives+=1

does not look to me "abusing" anything. :unsure:

 

:duff:

Wonko

 

Well FOR isn't really FOR this kind of thing, is it?  :) Neither is it for splitting strings (unless you're in Assembly   :book: ). Looks pretty same to me, even more so considering we are in RAM disk  :hi: I'll change that, thank you for posting it.

 

@ilko:

 

As expected, it went all reboot-sky without /wait.

 

Regarding your awesome program, I have feedback:

  • Option for installing on ANY available volume (be it primary partition or not) would be nice.
  • BCD editing should happen (imho) at the end of copying all files (since if copying wont succeed - you wont be able to use the already-created menu entry anyway), not at the start. As a design suggestion :yammer:

It seems that we're pretty much done here. Tutorial incoming.


Edited by Gear54rus, 30 April 2014 - 04:53 PM.


#70 ilko

ilko

    Silver Member

  • Advanced user
  • 500 posts
  •  
    Bulgaria

Posted 30 April 2014 - 05:16 PM

Option for installing on ANY available volume (be it primary partition or not) would be nice.

 

I could easily change the advanced option "show all disks regardless interface" or add a new one to show all volumes, on logical partitions as well.

Just have to figure out what to do with the main boot files, where to place them, rather than dumping everything on the selected volume leave it to the user how that will be started, something I don't quite like. On the question "how and why do I use that" I have no answer yet, maybe you could help. Ditto for installing from a hidden partition, WinPreSetup could be easily modified to mount all partitions before searching for the ISO file, but I still don't understand what could be the practical use of that in order to spend time on implementing it.

 

 

 

BCD editing should happen (imho) at the end of copying all files (since if copying wont succeed - you wont be able to use the already-created menu entry anyway), not at the start.

Copying files is the trivial part of the whole process, problems are not expected there, nor ever had any, but are when preparing the source, and editing menu files is at the very end of that preparation.

 

It seems that we're pretty much done here

 

Glad you got it going.



#71 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 01 May 2014 - 01:50 AM

I could easily change the advanced option "show all disks regardless interface" or add a new one to show all volumes, on logical partitions as well.
Just have to figure out what to do with the main boot files, where to place them, rather than dumping everything on the selected volume leave it to the user how that will be started, something I don't quite like. On the question "how and why do I use that" I have no answer yet, maybe you could help. Ditto for installing from a hidden partition, WinPreSetup could be easily modified to mount all partitions before searching for the ISO file, but I still don't understand what could be the practical use of that in order to spend time on implementing it.


Copying files is the trivial part of the whole process, problems are not expected there, nor ever had any, but are when preparing the source, and editing menu files is at the very end of that preparation.

Glad you got it going.


Well regarding the first option it would be useful in a situation like mine: when people want to integrate what your utility has to offer (windows installation from .iso) into an existing boot environment (SYSLINUX with YUMI in my case) but do not want to mess with ImDisk and such stuff.

Regarding the second - this is purely a safeguard. So that anyone who gets passed this flash drive would not blindly copy trash files onto the boot partition (it will simply be not there) but rather do that with first Storage partition. Also, if this partition gets virus infection or anything like that, boot partition will still work.

Boot volume serves only 1 purpose - booting. It should not be used anywhere else (yes I do realize that under Linux nobody will probably give a daym about the hidden flag and it will still show up)

Hope that helps :good:

@Wonko

I got rid of any kind of variables for disks altogether. Just stuffed in all inside the loop you posted.

And %ERRORLEVEL% was introduced too.

Edited by Gear54rus, 01 May 2014 - 02:25 AM.


#72 Gear54rus

Gear54rus

    Member

  • Advanced user
  • 48 posts
  •  
    Russian Federation

Posted 02 May 2014 - 09:52 AM

Well here it is. Questions? Comments? Suggestions? :crazy:







Also tagged with one or more of these keywords: winpe, iso, ibs, boot, usb, imdisk, impossible:)

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users