Topic: Some ideas on the subject: how to introduce an application in Winpe  (Read 170 times)

noelBlanc

  • Chef
  • ***
  • Date Registered: Dec 2013
  • Posts: 266
The classic approach to adding an app (not "portable") in Winpe:

        capture changes in files and hives generated by installing this app

Why this approach?
the main reason comes from the use of a "builder" for winpe. It is a construction that follows the same logic of that of the ADK.
A package (whatever the name of this data set) contains all the necessary elements (files, keys, computer processing (like some OC in ADK)) to add to a boot.wim
The "builder" integrates this package into boot.wim according to its specific logic.

Logic can be described as follows:
     In active winpe, capture changes.
     Create the package from the modified and collected items
     create the "builder"-specific treatment
Benefits:
     The package is built only once and made available to all users of the "builder"
     The package becomes one option among others that the end user of the "builder" can select
One drawback:
     you have to redo the package for each new version of the app

My opinion : it's the only one good solution for who use a "builder" like "winbuilder, WiMbuilder2, Pebacker...

But i don't use any builder and i play with Winpe. I think i'm not the only one. And i want to stay "agile".

Question to get out of habits:
In the case of an application that will be used very very rarely and that does not interest many users, it seems to me uneconomical to create such a package that requires a pretty big job sometimes.
     What other solutions are being considered?

I see at least 3 possibilities depending on the needs and desires to discover new approaches

1- "writers filters" as in small PC wyse or competitors (a technology I encountered when I was working on PC virtualization projects)
https://docs.microsoft.com/en-us/windows-hardware/customize/enterprise/unified-write-filter
https://docs.microsoft.com/en-us/windows/win32/search/-search-ifilter-registering-filters
http://woshub.com/using-unified-write-filter-uwf-windows-10/
I don't know if all the developments are available or if they could be adapted for Winpe
"Unified Write Filter on Windows 10" seems to be a good way.

I'll try it if my mind stay agile.

2- a capture (global or targeted) and then an injection into the envelope of an inactive system: certainly possible
capturing all or part of the system is done on the active winpe system
injection will be done later but with the inactive system
it seems to me that it is a long process, but in the case of multiple installations at the same time ...

3- Take advantage of the context "Winpe in Flat mode in a VHD":
it leads to bypass the winpe limitation without becoming outlawed
Note: MS limitation is normal. It's commercial protection. Linux is free and often a good solution. But i play this MSDOS 2.0 since 1984

The method is simple:
     save 2 files when the system is active
     inject these 2 files into the inactive system

an advantage: 3 minutes for a technician

disadvantage: it applies in the unique context following "Winpe Flat mode in a VHD"
          (Flat - NON-RAM according to the new terminology of MS that speaks almost in French!)

the big drawback:
     this manipulation is impossible for a non-technical end user

As i said in an other place, i use this method for injecting a full graphic drivers ( update from devmgr.msc in a winpe and take needed files on a disk), for installing virtualbox 1.6

That's it, I don't have anything to sell, But I don't often see that solution covered.
Only tro share information !

Re: Some ideas on the subject: how to introduce an application in Winpe
« Reply #1 on: December 14, 2020, 04:44:23 PM »

noelBlanc

  • Chef
  • ***
  • Date Registered: Dec 2013
  • Posts: 266
Hi,
Because i put more details in the other site "not good a friend", i pt here the same details for the method .

1- boot on a  VHD-WinpeFlat
   no matter the builder used to build this WINpe FLAT in a VHD
 
2- install VirtualBox 6.1.16
    in my winpe built with my builder : it's OK without error
 
3- create a vm if you want for the test
 
4- save this  two files
     x:\windows\system32\config\system
     x:\windows\system32\config\software

 you can use :
Reg save hklm\system x:\windows\system32\config\system.saved
Reg save hklm\system x:\windows\system32\config\software.saved

5- modify x:\windows\system32\config\system.saved

The 3 basic mofications to do in ...\config\system.
   \system\setup\setuptype = 1
   \system\setup\systemSetupInProgress = 1
   delete or rename \system\mountedDevice (------> this if you change of computer !)
 
you can use ( if i don't write error because i write "in the fly" ):
reg load HKU\system-saved x:\windows\system32\config\system.saved
reg add HKU\system-saved\setup /v SetupType /d 1 /f
reg add HKU\system-saved\setup /v SystemSetupInProgress  /d 1 /f
reg delete HKU\system-saved\setup\mountedDevice
reg unload HKU\system-saved
 
6- Stop Winpe properly
 
You don't have to restart on the first winpe because you will lose the result of the installation
 
7- Restart using another image of a winpe.

8- step "copy new files" : warning

So, in this second winpe :
- mount the vhd of the first winpe
- go to the config directory in this first winpe : I don't know if I'm understandable
- replace system by system.saved and software by software.saved
- You can also save the original files before the copy

you can use :
copy <the letter for the VHD mounted>\windows\system32\config\system.saved <the letter for the VHD mounted>\windows\system32\config\system
copy <the letter for the VHD mounted>\windows\system32\config\software.saved <the letter for the VHD mounted>\windows\system32\config\software
 
9- unmount the VHD
 
10- boot on the first Winpe VHD (on the same computer for the first test)

If i don't make error in the sequence, and if you don't make error, you retrieve your virtualbox installed (and your VM in you create one)
I'm sure if i make error, you can correct.

 because i was sure that all technicien know this method, i didn't write details here before.

If someone tests this, i beg his pardon if he is meeting some error. But before he beats me with a stick it would be possible to discuss.

 ps : discussing the method was the goal I was pursuing


Re: Some ideas on the subject: how to introduce an application in Winpe
« Reply #2 on: December 20, 2020, 08:05:14 PM »

noelBlanc

  • Chef
  • ***
  • Date Registered: Dec 2013
  • Posts: 266
Hi,
On the same way.... Can we install HyperV in Winpe using "optionalFeature.exe"?

A subject of study for this winter... and maybe for the next ones.

In the "Winpe FullFlat" environment, you can add a feature with "optionalFeature.exe".
Some features don't require reboot.
But those that require a reboot are a good subject of study for this winter.
Randomly, I'm going to opt for HyperV.

Yes, I know, there are Linux or Virtual Box, and many other solutions like Server-Core or nano-server
https://docs.microsoft.com/fr-fr/windows-server/administration/server-core/what-is-server-core
https://docs.microsoft.com/fr-fr/windows-server/get-started/nano-server-quick-start
https://hub.docker.com/_/microsoft-windows-servercore
https://docs.microsoft.com/fr-fr/virtualization/windowscontainers/about/

I have no need to use HyperV in winpe.
But I have to take care of it this winter.

1 - I've already done a first try to activate HyperV in "Winpe FullFlat".
This test is positive because "Winpe FullFlat" contains all the necessary elements.
The sequence unfolds like this:
  A first phase of updates is launched.
  A reboot is triggered.
  Then a second phase of update would finish the installation of this feature.

But System and Software hives are not backed up in Winpe. It is therefore impossible to get a proper installation.
The complexity is to be able to intercept the modifications of the hives after the first phase of the update and before the reboot.
For now I have no leads for this capture.

During this first test, I was able to follow the activity of the "trustedInstaller" service, "tiWorker.exe", "poqexec.exe".
But I don't understand everything.
The first step in the study would be to identify the components involved in this addition.
A much more complex second step would be to understand how to launch a program to capture hives in the very particular context of system updates.
A third step will be to inject this capture into winpe.

2 - This week, I did another test in Winpe: make "optionalFeatures.exe" operational.
It is a long work to build the environment and identify all the useful elements.
But I now get the ability to install and uninstall "Telnet.client."
Yes, useless if you think "telnet" but useful to master logic.
This requires a large volume of files, of course. But in a VHD, this is not the major concern.

Conlusion
On the one hand, the playful aspect remains for me the most important.
On the other hand, I think this solution can give beginners greater freedom:
   install all apps without waiting for a third party to create a plugging/script
But its drawback is important:
   a longer time to create the VHD file when compared with creating a simple boot.wim

In a word, the beginner becomes a little more autonomous.
Certainly it needs a very special winpe.
But it is/will be possible to adapt Slore's wimBuilder2 for example for this.
« Last Edit: December 20, 2020, 10:00:44 PM by noelBlanc »

 

Powered by EzPortal