Jump to content

Installing WinRE to hard disk


Gremo

Recommended Posts

I'm booting into WinRE from and hidden partition. WinRE gets letter "X" assigned to it, and I'm trying to call windows setup in order to perform an unattended windows install, but I have to specify install.wim location (and possibly Unattend.xml location). I know I can put Unattend.xml into WinRE.wim and then use the switch /unatted:X:\Unattend.xml. However the problem is that install.wim should reside in the recovery partition.

X:\sources\setup.exe /installfrom:??

The big problem is that I don't know which letter is assigned to the recovery partition when WinRE boots. Any ideas? Is there anyway to specify install.wim location without dealing with letters or in a more dynamical way? This is the partition layout (and relevant files):


Partition 1 label=Recovery, id=27, active
|_ install.wim
|_ Unattend.xml
|_ Recovery
|_ WindowsRE
|_ WinRE.wim
Partition 2 label=Windows

Thank you very much for helping.

Edited by Tripredacus
Link to comment
Share on other sites


1) Because i resource hacked setup.exe.mui, can windows blame about it?

2) (most important one) What happens if the user (following the setup process) wants to destroy all partitions (e.g. deletes the hidden recovery partition?) I think I should write an unattend.xml that skips the partition process and just formats C:, but i don't know how to do this. Is C: partition always the second one of the first disk 0, right?

Should be quite clean what I mean, isn't it? Again, thanks for helping. :)

1) I do not know why you needed to do a reshack on the file. See now you have two options there....

2) In a supported environment, running recovery (ah then again I haven't tested custom WinRE.... maybe I will do that today) won't touch other partitions. As far as how your recovery process works, you get an out by saying if the customer runs the program in any fashion not covered in your instructions, the loss of data may occur and the system's warranty will not be covered. However, if you are a System Builder, you are required to provide the edge-to-edge media anyways, so they can still reinstall Windows with that. If you are an OEM, you should follow the direction of your Partner rep.

Threads merged. No need to make a new one.

You can add a file to the "Recovery Partition" and search for it first, like the Vista recovery does. But just put your install.wim in Sources. Setup already knows where that is.

Update - I tested the WinRE with custom partitions however there was a problem. Since the XML is inside of the Ramdisk, it is hardcoded to know where the INSTALL.WIM is, and hardcoded to what partition to install it on. Since I created a second partition in Windows, it mixed up the drive letters in WinRE. That being said, the Data partition got letter D, the OS vol got letter E and the recovery partition got letter F. Normally, the recovery partition should get letter E, and my XML has the InstallFrom to look on E. Since E is not the recovery partition, WinRE gives an error because it can't find INSTALL.WIM. Here-in lies the problem...

Screenshot of system after deployment and setting up the secondary partition:

before.jpg

Diskpart results from after receiving the error in WinRE about the WIM:

DISKPART> list vol

Volume ### Ltr Label Fs Type Size Status Info
---------- --- ----------- ----- ---------- ------- --------- --------
Volume 0 C System NTFS Partition 500 MB Healthy
Volume 1 E LocalDisk NTFS Partition 110 GB Healthy
Volume 2 D Storage NTFS Partition 117 GB Healthy
Volume 3 F Recovery NTFS Partition 6000 MB Healthy Hidden

Update2 - Adding a second hard disk also caused problems with drive letter assignment.

Edited by Tripredacus
Link to comment
Share on other sites

  • 6 months later...

Hi Jayclaz, Tripredacus and Friends

I´m now bussy with my Windows-7 RE-Partition, because i had a look at this page:

http://technet.microsoft.com/en-us/library/dd744280%28WS.10%29.aspx

I saw this line and thought, toooo easy:

C:\Windows\System32\Reagentc.exe /setosimage /path R:\ /target C:\Windows

It worked well, but just for a new Installation with an INSTALL.WIM from the Install-disc

I already copied the C:\Recovery directory to the partition (HarddiskVolume4)

And the BCD is modified well, too.

So i have to use a costum tool with this line:

C:\Windows\System32\Reagentc.exe /setosimage /customtool /target C:\Windows

Here it says:

http://technet.microsoft.com/en-us/library/dd744576%28WS.10%29.aspx

<Recovery>

<FactoryRecoveryTool>

<RelativeFilePath>path_to_exe</RelativeFilePath>

<CommandLineParam>parameter_1 parameter_2</CommandLineParam>

<AdminOnly>access_level</AdminOnly>

</FactoryRecoveryTool>

</Recovery>

P.S.:

But as I read Gremo´s solution with the Auto-Unattended:

<Recovery>

<RecoveryTools>

<RelativeFilePath>..\..\Setup.exe /unattend:X:\unattend.xml</RelativeFilePath>

</RecoveryTools>

</Recovery>

I ASKED MYSELF, IF THIS MAYBE WOULD BE POSSIBLE:

<Recovery>

<RecoveryTools>

<RelativeFilePath>IMAGEX.exe /apply F:\System.wim 1 C:\ </RelativeFilePath>

</RecoveryTools>

</Recovery>

OR

<Recovery>

<RecoveryTools>

<RelativeFilePath>IMAGEX.exe</RelativeFilePath>

<CommandLineParam>/apply F:\System.wim 1 C:\</CommandLineParam>

</RecoveryTools>

</Recovery>

I know, this solution is not the best :blushing: , because if the Windows-Partition isn´t present any more, it would be applyed on another C-Drive :blink: Maybe I´ll try today, but would appreciate a more bonnie solution

P.P.S:

I had a look at this:

But there are 3 problems:

1. What is inside Clean_part.txt

Maybe:

SELECT DISK 0

SELECT PARTITION 2

DELETE PARTITION

CREATE PARTITION PRIMARY

FORMAT FS=NTFS OVERRIDE

2. What is ISA.EXE; Can it replaced with IMAGEX.EXE ?

3. What costum-tool-exec is used? Can i call it with MSHTA.EXE?

P.P.P.S.: Still not my own PC :realmad:

Cheers.... Schiiwa

EDIT:

Another example here:

http://reboot.pro/8729/

But user says, doesn´t work. And whats not clear for me, what executeable "tblo" uses in WinREConfig.xml :wacko:

Edited by Schiiwa
Link to comment
Share on other sites

But as I read Gremo´s solution with the Auto-Unattended:

<Recovery>

<RecoveryTools>

<RelativeFilePath>..\..\Setup.exe /unattend:X:\unattend.xml</RelativeFilePath>

</RecoveryTools>

</Recovery>

I ASKED MYSELF, IF THIS MAYBE WOULD BE POSSIBLE:

<Recovery>

<RecoveryTools>

<RelativeFilePath>IMAGEX.exe /apply F:\System.wim 1 C:\ </RelativeFilePath>

</RecoveryTools>

</Recovery>

Imagex would be faster for sure, but Setup can install a captured WIM as well. That is how I use it. The answer file is likely optional, but even if you have captured an image after using sysprep /unattend switch, Setup ignores that answer file. For example, even if your XML only specified the Locale settings (to hide the language select page of OOBE), after Setup applies the image, you'd still see that page. So if you didn't have any special settings, you don't even need to specify a custom tool or have the answer file. Just overwrite the install.wim with your custom WIM, but it still needs to be called install.wim.

The only reason I needed to come up with this was because I needed the image in the recovery partition to deploy and then boot to the desktop. If the image is supposed to boot to OOBE, I don't use the custom tool option.

Link to comment
Share on other sites

But as I read Gremo´s solution with the Auto-Unattended:

<Recovery>

<RecoveryTools>

<RelativeFilePath>..\..\Setup.exe /unattend:X:\unattend.xml</RelativeFilePath>

</RecoveryTools>

</Recovery>

I ASKED MYSELF, IF THIS MAYBE WOULD BE POSSIBLE:

<Recovery>

<RecoveryTools>

<RelativeFilePath>IMAGEX.exe /apply F:\System.wim 1 C:\ </RelativeFilePath>

</RecoveryTools>

</Recovery>

Imagex would be faster for sure, but Setup can install a captured WIM as well. That is how I use it. The answer file is likely optional, but even if you have captured an image after using sysprep /unattend switch, Setup ignores that answer file. For example, even if your XML only specified the Locale settings (to hide the language select page of OOBE), after Setup applies the image, you'd still see that page. So if you didn't have any special settings, you don't even need to specify a custom tool or have the answer file. Just overwrite the install.wim with your custom WIM, but it still needs to be called install.wim.

The only reason I needed to come up with this was because I needed the image in the recovery partition to deploy and then boot to the desktop. If the image is supposed to boot to OOBE, I don't use the custom tool option.

My experience is another one... I installed Windows 7 without a special ID=27 partition, because i had no time and computer at the moment, to do this job (create a RE-Partition/Image). I should allign my files and folders first, in order to be effective. but as i saw the new command (reagentc.exe), i thought it might be very easy... So after the Installation was complete, i slashed SP1, all later updates and drivers on it. Then i realized, that the WINRE.WIM is already implemented on C:\RECOVERY\d89.......\WINRE.WIM ... so i moved it onto a new partition at the end and adapted the BCD. Also the WIM captured from my ready-installed Windows.

And i was really happy when i saw the new Option when i booted to WINRE at the bottom "Windows neu Installieren/Reinstall Windows" ... but when i klicked on it, there came a window up where i should select the OS i want to install (I think the editions) Unfortunately it was empty except "No Images available" my WIM was already called INSTALL.WIM and in the ROOT... Maybe I´ll try again in \SOURCES folder

EDIT: TRYED and DOND WORK! DOESN´T REALLY MAKE SENSE, BECAUSE THE /SETOSIMAGE-PARAMETER´S PATH WAS SET TO F:\ .... BUT AS U KNOW, WITH MS-SOFT U NEVER KNOW :whistle:

So i tryed putting the INSTALL.WIM from the DVD to F:\ ... that worked and moved my stuff on "C" into "WINDOWS.OLD" in the first seconds and started copying the setupfiles immediately! But i cut off the power :sneaky: and moved my stuff back after taking ownership, cause i do not want to reinstall....again....

because i think i installed Windows (esspecially 95a/b/c/98/98SE) about 1K-times

So it didn´t work. Maybe when I capture it before OOBE after entering AUDIT (or without), it may work!? *not again..*

Can U tell my, how i can start a HTA

The HTA-Package isn´t available at the WinRE-Image yet..... i´ll add it now and come back later :angel *hope i can still add it. Think to remember a DISM-Option to finish the WIM and then no package can be added anymore, when i created the Vista-PE

EDIT: NOPE, it was the /prep command with peimg.exe :whistle:

Maybe thats the way, aha, aha, i like it d-_-b

<Recovery>

<RecoveryTools>

<RelativeFilePath>MSHTA.EXE name-of-hta.hta</RelativeFilePath>

</RecoveryTools>

</Recovery>

OR

<Recovery>

<RecoveryTools>

<RelativeFilePath>MSHTA.EXE</RelativeFilePath>

<CommandLineParam>(/)name-of-hta.hta</CommandLineParam>

</RecoveryTools>

</Recovery>

EDIT: BOTH WON´T work ... Did´t expect that to work, because the ICON for the Recovery Options will be extracted for the executeable. After all, MSHTA.EXE has no ICON :sneaky:

Cheers, Schiiwa

Edited by Schiiwa
Link to comment
Share on other sites

What is your OS, Vista or Win7?

If you mount your winre.wim and look at the structure, you should be able to make a functional WinPE to replace it. Or even you can try to add packages to the mounted winre.wim.

I've not tried to modify a Win7 winre.wim other than adding XML and injecting RAID drivers.

Link to comment
Share on other sites

What is your OS, Vista or Win7?

If you mount your winre.wim and look at the structure, you should be able to make a functional WinPE to replace it. Or even you can try to add packages to the mounted winre.wim.

I've not tried to modify a Win7 winre.wim other than adding XML and injecting RAID drivers.

Hey tripredacus

I already added HTA and SCRIPTING with DISM /image:C:\WINRE\MOUNT /addpackage /packagepath:PATH-TO-PACKAGE

worked well.... but when I boot to this image and run MY-HTA.HTA via CMD it don´t know with which programm the OS should open it (as windows does when the file-type is unknown) ... I could open with EDITOR, but i want to execute it ... maybe i have to open with MSHTA... I´ll try immediately

I do not have the MSXML-Package... Which Packages are nessassary for HTA? Or do I have to completely rebuild a WINRE.WIM and add the MSXML via

PEIMG before i /PREP the image?

or can I download the MSXML-Package.CAB somewhere

Greetings and thx so far....

EDIT:

Maybe i´ll build a new WINRE.WIM, so i simply can add the nessassary packages with PEIMG.EXE, but can´t remember what´s needed. For Vista i think there where 3 Packackes required, but can´t can´t remember and do not know if 7 is the same way...

SORRY, forgot to answer:

OS: Windows 7 SP1

%PROCESSOR_ARCHITECTURE%=x64

AMD64

Edited by Schiiwa
Link to comment
Share on other sites

I managed the MSHTA to work now and also have tryed to compile a exe

With Visual C++ and Quick Batch File Compiler ....

Description and Icon is fine, but it do not want to run. The problem:

The subsystem needed to support the image type is not present      

:realmad:

I guess the reason is the architecture. WinRE is x64 and the created exe is a Win32 application ... but maybe i am wrong

Edited by Schiiwa
Link to comment
Share on other sites

Im asking myself if it would have been possible to install the WIM with windows-setup (without answer-file), if I had set a /FLAG when i took the capture!??? :rolleyes:

Maybe anyone knows ;)

Bye and have a nice week-end!

Edited by Schiiwa
Link to comment
Share on other sites

Im asking myself if it would have been possible to install the WIM with windows-setup (without answer-file), if I had set a /FLAG when i took the capture!??? :rolleyes:

Setup can install it, but if your captured image used /unattend switch with sysprep, the answer file is ignored. Your image (after setup) will boot to OOBE and all settings that would normally be done during sysprep first boot (Specialize, oobeSystem) are ignored.

Link to comment
Share on other sites

OK.... i didn't understand the /unattend-switch for sysprep till now :thumbup

But want to use my EXE-->HTA-->CMD anyway....

Worked fine and had 4 successful recoverys in my test-procedure, yet !

But now ReAgent makes trouble and do not want to run! Can´t ENABLE/DISABLE/SET-A-SETTING. Also the suddenly appearing directory:

Z:\Recovery\System32\Recovery

Confuses me. It Contains the ReAgent.xml, which is normaly located at C:\Windows\System32\Recovery! But If I change any value in any of any ReAgent.xml, it doesn´t have affect on the output of:

"Re-Agentc.exe /info"

So where does ReAgentC.exe get the information which u can see with added /INFO - parameter?

I can´t exacly say, what caused this behaviour. Maybe the ID=27 was no good idea, as the partition is not in front of the system's one. I've read all the documentations month ago, but I wanted to force a hidden recovery-partition :angel Or maybe the fact, that I didn´t compress my WinRE-Image, which had over 500 MB, caused the problem. I think to remember that there is a limitation of the size of winre.wim. But I was on good spirits as everything went just perfectly, that I've had no doubts to change a few things at a time. Of course THEN the DOOM was happening :ph34r: (Maybe it's important to say, that I DIDN´T RUN THE RECOVERY at this time!!

This is what I certainly did before:

- exchanged the WinRE.wim
- removed the letter and set ID to 27 (on partition 4 )

I have the reasonable suspicion, that I can´t avoid a Re-Install :lol:

Edited by Schiiwa
Link to comment
Share on other sites

What version of Windows 7 are you using?

Windows 7 x64 SP1 (with all updates)

Yea... I ran it from windows also and it returns the following:


C:\Windows\system32>reagentc /info
Erweiterte Konfiguration für die Wiederherstellungsumgebung

Windows RE aktiviert: 1
Windows RE bereitgestellt: 1
Setup aktiviert: 1
Benutzerdefiniertes Wiederherstellungstool: 1
WinRE.WIM-Verzeichnis:
Wiederherstellungsumgebung:
BCD-ID: fbf3595f-fce2-11e0-811f-a6936763aab2
Setupdateien:
Wiederherstellungsvorgang: 4
Vorgangsparameter:
Boot Startschlüssel-Abfragecode 0x8500
REAGENTC.EXE: Vorgang erfolgreich ausgeführt

But where does it get the information from?? If i change any value in any ReAgent.xml....


C:\Windows\System32\Recovery\ReAgent.xml
C:\Recovery\System32\Recovery\ReAgent.xml
Z:\Recovery\System32\Recovery\ReAgent.xml

It does not change the output of this command mentioned above! Here is some more output:

C:\Windows\system32>reagentc /enable
REAGENTC.EXE: Vorgang fehlgeschlagen: 57

C:\Windows\system32>reagentc /disable
REAGENTC.EXE: Vorgang fehlgeschlagen: 2
Das System kann die angegebene Datei nicht finden.

C:\Windows\system32>reagentc /setreimage /path Z:\Recovery\Winre\Winre.wim /target C:\Windows
REAGENTC.EXE: Vorgang fehlgeschlagen: b7
Eine Datei kann nicht erstellt werden, wenn sie bereits vorhanden ist.


Edited by Schiiwa
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...