From 711341516df777695f7767e12e7ff0dcd01e3e22 Mon Sep 17 00:00:00 2001 From: Homes32 Date: Sat, 14 May 2022 07:56:52 -0500 Subject: [PATCH] API and ProjectVars.md --- PhoenixAPI.md | 40 +++++++++++++++++++++++ ProjectVars.md | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 128 insertions(+) create mode 100644 PhoenixAPI.md create mode 100644 ProjectVars.md diff --git a/PhoenixAPI.md b/PhoenixAPI.md new file mode 100644 index 0000000..73e6cf2 --- /dev/null +++ b/PhoenixAPI.md @@ -0,0 +1,40 @@ +# PhoenixAPI Macros + +## Categories + +Click on a Command below for more information. + +| Command | Description | +| --- | --- | +| RegLoadHives | Mount Source and Build registry hives. | +| RegUnloadHives | UnMount Source and Build registry hives. | +| RegCopyDriver | Copy the driver entries from the INSTALL.WIM driver database to the target registry driver database. | +| RequireDriver | Copy the driver support files and driver entries from the INSTALL.WIM driver database to the target registry driver database. | +| DISM | Execute DISM with the provided arguments. | +| 7z | Execute 7zip with the provided arguments. | +| Innounp | Execute Innounp (Inno Setup Unpacker) with the provided arguments. | +| MSIExtract | Extract files from an .msi installer. | +| InnoExtract | Extract files from an Inno Setup installer. | +| WixExtract | Extract files from an Windows Installer XML Toolset (WiX) installer. | +| ConvertImage | Convert an image to the specified format. | +| Associate | Associate a file extension with a program. | +| SetFileACL | Give full control for "Everyone" on a file or directory. | +| SetRegACL | Take ownership and grant full control for "Everyone" on a registry key. | +| FileCopyEx | Copy a single file and it's .mui's (if they exist) from a specified directory. | +| RequireFile | Extract a single file and it's .mui's (if they exist) from Install.wim | +| RequireFileEx | Extract files and their .mui's (if they exist) from Install.wim | +| AddAutoRun | Run a program when the PE Environment starts. | +| AddShortcut | Create Shortcuts for programs in PE. | +| PinShortcut | Pin a shortcut to the taskbar or start menu. | +| AddPostProcess | Configure a section to process during Build Post-Process | +| RunFromRam | Choose to redirect the programs folder to Boot.wim | +| DirDeleteEx | Delete a directory if it exists. | +| FileDeleteEx | Delete a file if it exists. | +| ApplyBitMask | Apply a bitmask to a hex value in a binary string. | +| BitClear | Clear a specific bit in a binary string. | +| BitSet | Set a specific bit in a binary string. | +| BitToggle | Set/Clear a specific bit in a binary string. | +| XMLDelete | Delete an XML path/value. | +| XMLAdd | Add a new element/text/attribute to an XML file. | +| XMLRename | Rename a value in an XML file. | +| XMLUpdate | Update the value of an existing Attribute/Element | diff --git a/ProjectVars.md b/ProjectVars.md new file mode 100644 index 0000000..d3a64d0 --- /dev/null +++ b/ProjectVars.md @@ -0,0 +1,88 @@ +# PhoenixPE Global Variables + +This is a list of PhoenixPE Global variables and their function. + +Unless specified, they should not be modified, however you may reference them in your build. + +## Project Global Variables + +Project variables define the build "environment" for PhonenixPE. + +| Variable | Description | +| --- | --- | +| %Workbench%| Workbench is the directory were the majority of the build "work" takes place. It acts as a container for other directories such as Cache, Temp, Target, etc. | +| %ProjectCache% | The Project Cache is used by the core build scripts to cache things like WinRE.wim and registry hives in order to speed up subsequent builds. | +| %ProgramsCache% | The Programs Cache stores downloaded programs. This is done to speed up building and save bandwidth. | +| %ProjectTemp% | The Project Temp directory is used during build for temporary files. | +| %Tools% | The Tools directory contains 3rd party tools and applications used during the build process. | +| %Shell% | The name of the shell (Explorer/WinXShell/etc.). This variable is used by scripts to determine if any shell specific processing needs to be completed.| + +## Target (Build) Global Variables + +Target variables provide a convenient way to reference common directories during the build process. + +| Variable | Description | +| --- | --- | +| %TargetDir% | TargetDir is the directory where the WinPE build is constructed. This directory is eventually packed into Boot.wim. | +| %TargetWindows% | The `Windows` directory of the WinPE environment. | +| %TargetSystem32% | The `System32` directory of the WinPE environment. | +| %TargetBootWim% | The path to the final Boot.wim file. | +| %TargetPrograms% | The `Program Files` directory of the WinPE environment. Contains any programs set to `RunFromRam`.| +| %PEPrograms% | PEPrograms is a special variable used to represent the `Program Files` or `Programs` folder from within a running WinPE environment. It is used for creating shortcuts and referencing paths inside a running WinPE. | +| %TargetAppData% | The user profile Roaming AppData directory `Users\Default\AppData\Roaming` of the WinPE environment. | +| %TargetLocalAppData% | The user profile Local AppData directory `Users\Default\AppData\Local` of the WinPE environment. | + +## Output Global Variables + +These variables are set by by 'Config Source' script and define where the final build files will be placed. + +| Variable | Description | +| --- | --- | +| %OutputDir% | The directory that contains the final build, including Bootloaders, Programs, and Boot.wim before the ISO image is created. | +| %ISODir% | The directory where the final ISO image will be created. | +| %ISOFile% | The full path to the final ISO image. | + +## Registry Global Variables + +The registry variables are used to reference the various registry hives loaded during the build process. + +They may be used in conjunctions with PEBakery's `RegHiveLoad` and `RegHiveUnLoad` commands to access and modify the WinPE registry. + +| Variable | Description | +| --- | --- | +| %RegistryCache% | The directory where registry hives will be cached to speed up subsequent builds. | +| %RegistrySoftwareSource% | The .wim file from which the SOFTWARE registry hive will be extracted. (Boot.wim/Install.wim) | +| %RegistryDriversSource% | The .wim file from which the DRIVERS registry hive will be extracted. (Boot.wim/Install.wim) | +| %RegSystem% | The full path to the target PE's SYSTEM hive. | +| %RegSoftware% | The full path to the target PE's SOFTWARE hive. | +| %RegDefault% | The full path to the target PE's DEFAULT (HKCU\SOFTWARE) hive. | +| %RegComponents% | The full path to the target PE's COMPONENTS hive. | +| %RegDrivers% | The full path to the target PE's DRIVERS hive. | +| %RegInstallSystem% | The full path to the source Install.wim SYSTEM hive. | +| %RegInstallSoftware% | The full path to the source Install.wim SOFTWARE hive. | +| %RegInstallDefault% | The full path to the source Install.wim DEFAULT (HKCU\SOFTWARE) hive. | +| %RegInstallComponents% | The full path to the source Install.wim COMPONENTS hive. | +| %RegInstallDrivers% | The full path to the source Install.wim DRIVERS hive. | + +## Source Global Variables + +Source variables are generated by the 'Config Source' script and contain information about the source windows environment used to build PhoneixPE. + +| Variable | Description | +| --- | --- | +| %SourceDir% | The directory containing the extracted or mounted Windows install files. | +| %SourceBaseWimName% | The name of the base wim image (Boot.wim/WinRE.wim) used to build PhoenixPE. Used for determining what files/registry entries need to be processed. | +| %SourceBaseWim% | The full path to the base wim image (Boot.wim/WinRE.wim) used to build PhoenixPE. | +| %SourceInstallWim% | The full path to the Install.wim file used to add features and components to the base wim image. | +| %SourceBaseWimImage% | The wim image for the Base image. | +| %SourceInstallWimImage% | The wim image for the Install image. | +| %SourceArch% | The architecture of the selected Windows image. `x86` or `x64` | +| %SourceLang% | The primary language of the selected Windows image. | +| %SourceFallbackLang% | A pipe separated list of fallback languages used in case the primary translation is unavailable. | +| %SourceVer% | The version of the selected Windows image. | + +## Other Global Variables + +| Variable | Description | +| --- | --- | +| %HostArch% | The architecture of the Host computer. `x86` or `x64` |