Add PreShellConfig docs

Homes32
2025-02-17 21:28:51 -06:00
parent 8a15856ac7
commit c7e7a9627d
3 changed files with 69 additions and 3 deletions

@@ -5,7 +5,7 @@
1. Mount or Extract your Win10/Win11 ISO to a location of your choice. If you dont have a Win10 ISO you may use the 'Download Source ISO' button on the 'Source Config' script to download the most recent version. Be sure to check the [Compatible Source List](https://github.com/PhoenixPE/PhoenixPE/wiki/Source-Compatibility) to make sure your ISO is supported.
1. Using the 'Source Config' script, select the location of your source you provided in Step 1.
1. Select the Source install.wim image. We recommend using the Pro image. Windows S is not supported.
1. Enable the Apps you wish to include in your build. Note that some Apps require additional files or config. Do not blindly enable all apps and expect to get a successful build.
1. Enable the Apps you wish to include in your build. Note that some Apps require additional files or config. **Do not blindly enable all apps and expect to get a successful build**.
1. Tweak any settings you wish.
1. Press the Build button on PEBakerys Main Menu.
1. Grab a snack or a drink. The build process typically takes from 2 to 7 minutes depending on your PC, internet speed, and the scripts you have enabled. The first build will take a bit longer as project files and registry hives are cached and applications are downloaded.
@@ -23,13 +23,13 @@ PhoenixPE can be configured to build using either Boot.wim or WinRE.wim as a bas
Boot.wim is the image used by the Windows setup/installer and includes a basic WinPE environment.
Because Boot.wim is designed to be a lightweight setup environment it does not contain integrated wireless networking or Windows recovery tools by default. PhoenixPE adds support for wireless networking, and other features by coping the required files and registry entries from install.wim; the same method used by legacy projects such as VistaPE, Win7PE, and Win10PE. This method produces an environment very similar to WinRE.
Because Boot.wim is designed to be a lightweight setup environment it does not contain some features such as iSCSI, integrated wireless networking, or Windows recovery tools by default. PhoenixPE adds support for wireless networking, and other features by copying the required files and registry entries from install.wim. This method produces an environment very similar to WinRE.
#### WinRE.wim (Default) ####
WinRE.wim is the Windows Recovery Environment that ships with Windows and is used for diagnostic and troubleshooting. It includes additional packages such as integrated wireless networking support, and the Windows recovery tools.
Beginning with Windows release 20H2, WinRE.wim is not always updated to the latest version and contains binaries and registry entries that are incompatible with the newer binaries present in install.wim. This can cause stability issues or in worst case, BSOD, black screen on boot, etc. In these situations you must build the project using Boot.wim as the base image.
Beginning with Windows release 20H2, WinRE.wim is not always updated to the latest version and contains binaries and registry entries that are incompatible with the newer binaries present in install.wim. This can cause stability issues or in worst case, BSOD or a black screen on boot. In these situations you must build the project using Boot.wim as the base image.
## Advanced Options

@@ -0,0 +1,63 @@
# PhoenixPE Pre-Shell Advanced Customization
PhoenixPE uses a custom build AutoIt3 script during boot which takes care of essential tasks, such as preparing the environment, installing/loading drivers, loading and monitoring the shell, creating shortcuts, starting applications (autorun), starting network services, etc.
## Structure
The PhoenixPE startup process consist of the following stages:
| Stage | Description |
| --- | --- |
| InitPE | Load drivers, configure the display, etc. |
| InitAudio | Initialize audio. |
| PreShellConfig | Configuration changes and application/services that need to be started before the shell is loaded. This includes installing drivers, creating Ramdrives, mounting CD/USB, etc. |
| CreateShortcuts | Create shortcuts on the desktop and in the start menu.|
| InitShell | Start the shell (Explorer.exe, WinXShell, etc.). |
| PostShellConfig | Configuration changes and application/services that can be started after the shell is running. |
| InitNetwork | Load drivers, initialize network adapters, and start network services. |
| Monitor/Run | Monitor the shell. |
## PhoenixPE.au3
PhoenixPE.au3 is the loader script that runs on boot and is responsible for the entire PhoenixPE startup process. A skeleton config file is placed in the `%TargetDir%\System32` directory during build and the script is dynamically modified throughout the build process using PhoenixAPI script commands such as `AddShortcut`, `AddAutoRun`, `AddStartupConfig`, etc. **This base config file is not intended to be modified directly** unless you an experienced developer with very specific needs.
## User Scripts
Advanced users may choose to include user scripts written in either AutoIt3 or PECMD format to be run on startup during the `PreShell` stage. A typical use case would be to create shortcuts, run a program, or add registry entries during the boot process.
By placing a specifically named script in a pre-defined location these scripts will automatically be processed by the PhoenixPE loader.
| Filename | Location | Description |
| --- | --- | --- |
| PhoenixPE-UserConfig.a3x | `%TargetDir%\System32` | Compiled AutoIt3 script packed in boot.wim. |
| PhoenixPE-UserConfig.a3x | `%OutputDir%\PhoenixPE` | Compiled AutoIt3 script included on boot media (CD/USB). |
| PhoenixPE-UserConfig.au3 | `%TargetDir%\PhoenixPE` | AutoIt3 script packed in boot.wim. |
| PhoenixPE-UserConfig.au3 | `%OutputDir%\PhoenixPE` | AutoIt3 script included on boot media (CD/USB). |
| PhoenixPE-UserConfig.ini | `%TargetDir%\System32` | PECMD startup script packed in boot.wim. |
| PhoenixPE-UserConfig.ini | `%OutputDir%\PhoenixPE` | PECMD startup script included on boot media (CD/USB). |
| PhoenixPE-UserConfig.wcs | `%TargetDir%\System32` | PECMD script (may be encrypted) packed in boot.wim. |
| PhoenixPE-UserConfig.wcs | `%OutputDir%\PhoenixPE` | PECMD script (may be encrypted) included on boot media (CD/USB). |
| PhoenixPE-UserConfig.wcz | `%TargetDir%\System32` | Compressed/Encrypted PECMD script packed in boot.wim. |
| PhoenixPE-UserConfig.wcz | `%OutputDir%\PhoenixPE` | Compressed/Encrypted PECMD script included on boot media (CD/USB). |
You may also choose to run AutoIt3 or PECMD scripts directly at different startup phases using the `AddAutoRun` command.
### Example
```
// Autorun a PECMD script during PostConfig
AddAutoRun,PostShell,HideWait,"Running custom PECMD script...","myscript.wcs"
// Autorun an AutoIt3 script after network startup
AddAutoRun,AfterNetwork,HideWait,"Running custom script...",myscript.au3",
```
## History
Prior to the PhoenixPE 2024-01-14 release, the pre-shell operations used PECMD, a command interpreter popular for use in WinPE environments written by Chinese developers Lxl1638(Li Shiting), Yonsm, and DSystem. It was formally open source, but has been closed source since 2012 when DSystem took over development. It worked well enough for simple tasks, but had a number of drawbacks, including arcane syntax, poor documentation, and a number of undocumented "features" that kept popping up an causing some serious bugs and problems with newer versions of Windows. An alternative was needed in order to accelerate development of more advanced features and move PhoenixPE to the next level.
We did not want to go the route of trying to write a PECMD clone, or follow LiveSystemPro or older Win7PE_SE projects and use closed source custom loaders such as `PEInit.exe` or `shortcuts.exe` that limited options and required writing and learning new config files. We wanted something that didn't have to be compiled and was open and easy to use so project developers and advanced users could clearly see what was going on under the hood and further contribute to the WinPE community.
In the end it was decided to use the AutoIt3 scripting language. Autoit as a long history of use on the WinPE scene, is a full featured language with full access to the Win32 API, freely distributibtable, well documented, and has an active development forum. All these lend to an easy learning curve and rapid development.
The result is a fast, open, and efficient loader and tool set that should provide freedom and flexibility for years to come.

@@ -5,6 +5,9 @@
1. [[Security|Security]]
1. [[Frequently Asked Questions (FAQ)|FAQ]]
## Power Users
1. [Pre-Shell Config](https://./PowerUsers/PreShellConfig.md)
## Developers
1. [[PhoenixAPI Commands|PhoenixAPI]]
1. [[Project Variables|ProjectVars]]