JFYI
I had a crazy idea:
Make a Wimboot VHD coupled to a WinPE.wim
For this experiment I made a new build of Win10XPE_x64 by ChrisR using the project's new version, used mainly the preselected programs with only one or two changes, all of them selected to run on Ram, and included also into the build a lot of portable programs (144 MB) contained on the root of the boot.wim, on Aplicaciones folder, and just copied the desktop shortcuts from my previous tests of Flat and Compact installations to Win10XPE\Custom\x64\AdditionalFiles\Users\Default\Desktop, also activated the Ramdisk (B:), to load there FireFox Profile Files, but deselected make the ISO, to let me edit certain things on target folders/files, once done I created the ISO, it is 844 MB, and the boot.wim is 818 MB.
Then I applied Wimboot attribute to the WIM file (with wimlib_Property_Switch by Retokener) and it was ready to install on Wimboot mode (used wimlib-clc by Retokener) on a 512 MB VHD, once installed it used about 40 + MB, I made the new entry on BCD (using BootIce) and it was ready for first boot, it loaded fine and I saw the desktop background image, but when it finished making the settings of drivers, registry editions, creation of RamDisk, sorthcuts, etc, there were some problems and a message appeared saying Real SystemRoot is C:\Windows, but it is set to X:\Windows use Dism /Set-TargetPath to fix this, and after acepting with the Intro (no mouse available) it lost the image and nothing was working, Then a black screen with PC, Recicle Bin and Star Icons, appeared, I had the mouse pointer available again, but all I wanted to do, did nothing, I had to use the Reboot button.
I went to read about the info got from the message, and I found this page: DISM Windows PE Servicing Command-Line Options, all there is very clear and well explained, then I mounted the WIM and tried to use the commands, they weren't able to moddify the WIM, even tried as Trusted Installer and same thing.
But I remembered some days ago I was able to read, see and compare the registry SYSTEM hives side by side using offlinereg by erwan.l, see: http://reboot.pro/to...e-5#entry216627
Offlinereg do not care about files permisions so it is the best option to edit protected sections of the Registry.
And I saw on:
HKEY_LOCAL_MACHINE\System\DriverDatabase
SetupStatus 259 REG_DWORD >>> on PE and >>> SetupStatus 0 REG_DWORD on regular windows
SystemRoot X:\Windows REG_SZ >>> on PE and >>> SystemRoot do not exists on regular windows
Then just edited that value to: C:\Windows and saved the SYSTEM hive.
But it was not all, as the Pecmd.ini used in Win10XPE_x64, has some references to X:\xxxxx, then I also edited them to C:\xxxxxx and rebooted again, then no more problems all booted fine, I noticed the 512 MB was too big for the used space and decided to edit on the Win10XPE\Target project the SYSTEM hive and the Pecmd.ini to my needs. Once done and after set the Wimboot attribute, I made a new 300 MB VHD and made a Wimboot mode install with wimlib-clc, as I used same VHD name it was not necessary to edit the BCD again and it booted flawlessly. See attached picture.
After booting used size is 93.5 MB.
No matter the changes done (in the registry and the Pecmd.ini) the PE finally got drive letter X., all the editions were done to let it interact during first booting stages (it was in fact C: at that time).
Latter there is ran an instruction to switch drive letters, (haven't found the source yet), but when we finally are able to look it is already X:
Also there is a little progran LetterSwap.exe, It looks for a tag file on the root of all drives and if found that drive latter is switched to Y:, I really don't know exactly what else LetterSwap.exe does, on his log I can see:
Command Line: LetterSwap.exe/auto /SetLetter Y:\CDUsb.y /Log X:\Windows\TEMP\LetterSwap.log
This is a summary:
- Make a PE build but don't create the WIM file and the ISO.
- Edit on: HKEY_LOCAL_MACHINE\System\DriverDatabase "SystemRoot"="C:\\Windows"
- Edit on Pecmd.ini all instances of X: to C:
- Comment on Pecmd.ini all under [PinUtil] section to avoid creating new shortcuts every boot.
- Create the WIM file and the ISO.
- Add Wimboot attribute to WIM file. (it already contains WimBootCompress.ini).
- Install on Wimboot mode to a VHD.
- Create BCD entries.
- Boot.
alacran