Tuesday, November 10, 2015

Create a Windows Live (WinPE 10)


Create a Windows Live (based on Windows PE )


With Windows, like Linux, there is the possibility to create and use a "Live" system: eg Live CD or Live USB (or even network boot). 

A Windows Live is a Windows system, often minimalist, that loads in RAM and allows you to run software and access to computer data storage (HDD, SSD, etc ...).

This is particularly handy for example when Windows will not start: you can start a Windows Live for example repair the system, or even back up everything else and reinstall.

Note: this tutorial for creating a simple Windows Live, with few modifications.

The software is available for download at Microsoft:
Download ADK 10 for windows 10 Technical Preview  here
or
 Download Windows ADK 8.0 (formerly called Windows AIK) here

This will allow to generate a Windows Live based on Windows PE 4, or Windows PE 10 depending of choise ADK 10 or ADK 8 ie: Windows 8, Windows 10 

So I'll just call: Live 10.

In terms of license, here is a quote from a part of what can be read by installing the Windows ADK:
As part of this license agreement, you have perpetual rights presented below.
1. Installation and Use Rights. You may install and use any number of copies of the software on your devices only in order to deploy, maintain, evaluate the quality of the system and evaluate your systems and devices in operating systems Windows Server 2003, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows XP, Windows Vista, Windows 7 or Windows 8.


Besides clear: Windows Live (Windows PE) should be used only for deployment, maintenance (maintenance, repair) and evaluation of an existing Windows. 
Under no circumstances Live Windows should be your main Windows.

For installation, I recommend to install only the bare essentials:
- Deployment Tools
- Windows Pre-installation Environment (Windows PE)

Image


Once installation is complete, we will open the tool named "Deployment environment and image creation tools"

It is either in the start menu: All Programs -> Windows Templates -> Windows ADK -> "Environment deployment and imaging tools"

If you have Windows 8 without software that restores the Start menu, it is also present in the home screen.

Please note this is not an easy Prompt commands, like opening directly "cmd.exe"
Indeed, there are several environment variables that are activated to view all utility without specifying the full path.

By installing Windows ADK, actually WIM images are ready for use, we'll just use them and modify them slightly.

We'll put in a folder, start with the Live 8 x64 for example, knowing that with the x86 is practically the same.

And commands start:

Image

copype amd64 C: \ live8x64

It was the confirmation "Success":
Image

And in the C: \ live8x64 there are now three folders:

- Fwfiles (contains the boot sector for BIOS and UEFI)
- Media (Live full, ready to be made into ISO image or to put on a USB key)
- Mount (empty folder at first, can be used as a mount point for the WIM image of Windows Live, for example to change the Live)
Image

Mounting WIM image in the empty folder:
Dism / mount-picture /imagefile:C:\live8x64\media\sources\boot.wim / index: 1 / mountdir: C: \ live8x64 \ mount

Image

In the C: \ live8x64 \ mount seen the files of Live 8, directly accessible and modifiable.

Possible modifications are free, as long as one does not modify the Microsoft binaries; the rest no problem ;)
This will, for example, the local register (beehives in C: \ live8x64 \ mount \ Windows \ System32 \ config) to the startup script "startnet.cmd"found in the System32 folder or the Desktop Background "winpe.jpg" .

By default, the Live 8 was only in English, so the keyboard is QWERTY.

With Windows ADK, there are packs of features and languages ​​that can be added, available in the folder:
"C: \ Program Files (x86) \ Windows Kits \ 8.0 \ Assessment and Deployment Kit \ Windows Pre-Installation Environment \ amd64 \ WinPE_OCs"

There among other support for PowerShell 3, .Net Framework 4, WMI, PPPoE, Remote Storage, Asian fonts, etc ...

And in the subfolder "en-us" there is the language pack "lp.cab" and language packs for each feature that you want to add.

For this tutorial, I chose a basic Live 8, so just with EN support:
Dism / image: C: \ live8x64 \ mount / add-package / packagepath: "C: \ Program Files (x86) \ Windows Kits \ 8.0 \ Assessment and Deployment Kit \ Windows Pre-Installation Environment \ amd64 \ WinPE_OCs \ en-US \ lp .cab "

Image

And activation of the language and keyboard QWERTY FR:
Dism / image: C: \ live8x64 \ mount / Set-UILang: en-GB 
Dism / image: C: \ live8x64 \ mount / Set-SysLocale: en-GB 
Dism / image: C: \ live8x64 \ mount / Set-UserLocale: en-GB 
Dism / image: C: \ live8x64 \ mount / Set-InputLocale: en-GB

And if we withdrew the language that does not serve us in the WIM image?

To do this, simply list the packages present in:
Dism / image: C: \ live8x64 \ mount / get-packages
We must get something like:
CODE: SELECT ALL
Identité du package : Microsoft-Windows-WinPE-LanguagePack-Package~31bf3856ad364e35~amd64~en-US~6.2.9200.16384
État : Installation en attente
Type de version : Language Pack


And here we remove the en-US language pack:
Dism / image: C: \ live8x64 \ mount / remove-package /packagename:Microsoft-Windows-WinPE-LanguagePack-Package~31bf3856ad364e35~amd64~en-US~6.2.9200.16384

You can now unmount the image and apply the changes in the WIM file:
Dism / unmount-image / mountdir: C: \ live8x64 \ mount / commit

We must see:
CODE: SELECT ALL
Enregistrement de l'image
[==========================100.0%==========================]
Démontage de l'image
[==========================100.0%==========================]
L'opération a réussi.


The "mount" folder is empty again, it's normal.

In principle, the WIM image file has grown a bit, see the size of this file:
C: \ live8x64 \ media \ sources \ boot.wim

If ever you have added several packages, some deleted etc ... it may be that the WIM image may be reduced slightly, via compression.

I even noticed that the higher up and dismantles the image to some minor changes, the more magnified picture abnormally.

For this I offer a slimming cure, the cure "ImageX" with compression:
imagex / compress maximum / export C: \ live8x64 \ media \ sources \ boot.wim 1 C: \ live8x64 \ media \ sources \ nouveau.wim "Live_8"

This creates a new WIM image "nouveau.wim" next to "boot.wim"
CODE: SELECT ALL
ImageX Tool for Windows
Copyright (C) Microsoft Corp. All rights reserved.
Version: 6.2.9200.16384

Exporting: [C:\live8x64\media\sources\boot.wim, 1] ->
[C:\live8x64\media\sources\nouveau.wim]


[ 100% ] Exporting progress

Successfully exported image #1.


Total elapsed time: 6 sec


We can delete "boot.wim" and rename "nouveau.wim" to "boot.wim."

In my case the image is increased from 199 MB to 176 MB, a slight reduction of 23 MB

There are still 2 places to switch to French, we can realize with the 1st order:
bcdedit / store c: \ live8x64 \ media \ Boot \ BCD

This allows to read the Windows 8 boot catalog, the BCD.

Same UEFI mode there is a second dedicated catalog:
bcdedit / store c: \ live8x64 \ media \ EFI \ Microsoft \ Boot \ BCD

In 2, the "local" bed "en-US" which is to change.

Here are the commands for this:
bcdedit / store c: \ live8x64 \ media \ Boot \ BCD / set {bootmgr} Local fr-FR 
bcdedit / store c: \ live8x64 \ media \ Boot \ BCD / set {default} Local fr-FR 
bcdedit / store c: \ live8x64 \ media \ EFI \ Microsoft \ Boot \ BCD / set {bootmgr} Local fr-FR 
bcdedit / store c: \ live8x64 \ media \ EFI \ Microsoft \ Boot \ BCD / set {default} Local fr-FR

Finally, unlike the old Windows PE by default there is no progress bar when the CD or USB charge (or PXE network boot), which can be annoying if you want to know where is loading Live 8.

For this, some additional commands:

bcdedit / store c: \ live8x64 \ media \ Boot \ BCD / set {default} bootmenupolicy Legacy 
bcdedit / store c: \ live8x64 \ media \ EFI \ Microsoft \ Boot \ BCD / set {default} bootmenupolicy Legacy

Note: as with Windows 8, it also reactivates the "F8" menu startup, if you need ;)


Creating the ISO (if the USB key will be seen too)


Via the utility provided OSCDIMG, we will be able to create a bootable ISO image Live 8, with or without UEFI support.

1st option: boot BIOS support only:
oscdimg -u2 -h -m -o -l "Live_8" -b "C: \ live8x64 \ fwfiles \ etfsboot.com" "C: \ live8x64 \ media" "C: \ live8x64 \ Live8_bios.iso"

2nd possibility: boot support UEFI Only:
oscdimg -u2 -h -m -o -l "Live_8" -b "C: \ live8x64 \ fwfiles \ Efisys.bin" "C: \ live8x64 \ media" "C: \ live8x64 \ Live8_efi.iso"

3rd possibility: hybrid boot BIOS and UEFI support:
oscdimg -u2 -h -m -o -l "Live_8" -bootdata: # 2 p 0, e, b "C: \ live8x64 \ fwfiles \ etfsboot.com" # pEF, e, b "C: \ live8x64 \ fwfiles \ Efisys.bin "" C: \ live8x64 \ media "" C: \ live8x64 \ Live8_bios_efi.iso "

According machinery encountered, one of the 3 cases could serve well ;)


Creation of USB

If the USB key is a bit special (for a hard drive or SSD that would be like, but I do not recommend it, because Windows does not see the same way):

Indeed there is the issue of file system (File System) ...

By formatting the USB drive to NTFS, it would work very well in BIOS mode, because the BIOS is not interested in the FS used: it reads a few sectors, and starts the requested file: BOOTMGR (Windows bootloader).

Nevertheless, with the UEFI, the selected FS is very important because UEFI will explore the USB key, and see if it finds the following file (with EFI x64):
\ EFI \ Boot \ BOOTX64.EFI

In EFI x86 (32-bit), it would be: \ EFI \ Boot \ bootia32.efi

I consider all of UEFI now are 64-bit, which is mostly the case, except for older Macs (no problem on PCs apparently) or certain tablets based on Intel Atom Z.
Microsoft seems to have chosen this way: = UEFI x64 Windows x64 only.

Also, it is good to know that most of the UEFI can only read FAT or FAT32, but do not know the NTFS.

Farewell to start the NTFS on a recent system, and hello to ... FAT32.

Note: Besides a Windows 8 installed on a UEFI system adds a special partition FAT32, to boot.

I'll start with the most common cases: the USB drive is erased to set everything up.

A ride with "diskpart" at the command line:
diskpart

Then to list the connected storage:
list disk

I read on a USB stick 4 GB:
CODE: SELECT ALL
Disque 1 En ligne 3824 M


Choose this storage (adjust the number to your use):
select disk 1

Complete cleaning (removes any partition):
clean

Create a primary partition (main), not a UEFI BIOS, otherwise the old systems could not start it:
create partition primary

Select this partition:
select partition 1

Format FAT32 fast mode (label choice):
Format FS = FAT32 LABEL = "LIVE_8" QUICK

Making the "active" partition (for BIOS mode):
active

Then exit the software:
exit

Image Summary:
Image

Now copy the entire contents of the file "C: \ live8x64 \ media" to USB.

UEFI is already running, but for the BIOS boot remains a command to tell the MBR is desired download the file "BOOTMGR" (adjust the letter that your USB drive):
bootsect / nt60 E: / force / mbr

We can then read something like:
CODE: SELECT ALL
Les volumes cibles seront mis à jour avec un code de démarrage compatible BOOTMGR.

E: (\\?\Volume{28463d11-3619-11e2-be9e-000c29b6a9ea})

Mise à jour du code de démarrage du système de fichiers FAT32 réussie.

\??\PhysicalDrive1
Mise à jour du code de démarrage de disque réussie.

Le code de démarrage a été mis à jour sur tous les volumes ciblés.


And after testing, the USB starts well from the BIOS and UEFI since.


Here, we have created a Live 8 basic.

Overview of the Live 8 started:
Image

To Custom The WinPE 10 after creation flow this tutorial

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.