HP logo

Windows XPE

Version 1.0.7

Please Note: This plugin will ONLY work with Windows XP SP2 and Windows Server 2003 SP1 and SP2, other Windows versions are not supported.

Windows XPE is my attempt to make BartPE closer to Windows XP (XP + PE = XPE), it's "self" localized.
A lot of users contributed tests, code, suggestions and fixes, credits are in inf files.

For license, changelog, bugs and todo look at the Readme.txt file

To use PeNetCfg for the network configuration, please read instructions in z_xpe-custom.inf comments

Windows XPE Plugin Components:

This plugin needs the ramdisk plugin or a writable %temp% to work.

NOTE Important: you should DISABLE Startup Group and PELoader/Nu2Shell plugins if you run XPELogon as the shell (Default configuration, XPE already provides same features).

WMI Notice: The WMI plugin creates the WBEM Repository in %temp%\Repository (often a RAM disk), this process is very slow, you can speed it up by following this procedure: build an XPE with WMI, then copy the generated Repository directory from winpe %temp% drive into the XPE plugin directory, on the next xpe build you will already have Repository directory on the cdrom and xpe will not need to rebuild it at runtime. This will also reduce space used in %temp% drive by about 7MB, the computer name will be hardcoded in all the WMI stuff.

In order to benefit of the PnP plugin you need InfCacheBuild that will remove CopyFiles sections from the .inf files, you can use my Build Scripts.
Create following directories inside XPE plugin: inf, drivers, system and copy there needed files.
You may want to use AutoRamResizer that resizes the RAM disk at runtime.

FAQ:

I have problems accessing Windows XP SP2 shares, how can I fix this?
Merge the included reg fix to the target SP2 windows computer, then reboot it.
Please note this will enable so called Null Sessions, Microsoft has blocked this in SP2
for security reasons, I don't think this will secure your Windows since sessions with bogus
username/password will work as Null Sessions before SP2.

Can I use Windows XPE with Windows 2003?
Of course, but since it's not my primary working platform, some stuff may not work as expected.
A quick note on Windows 2003 SP1/SP2, some file type names may not be properly displayed, they will appears like %FILE_FOLDER% or similar. The problem is in hivecls.inf, it has two [Strings] sections, and pebuilder (since 3.1.3) doesn't support multiple [Strings] sections.
To fix this, manually edit hivecls.inf file (in i386 of source directory), at the end of the file:

[Strings]
 FilePathMSHTA="%SystemRoot%\system32\mshta.exe"

move FilePathMSHTA in the second [Strings] section, then remove the empty [Strings] section.

Setup: XPE + nu2menu + nu2xpe + autoramresizer:
It's very simple just look into xpe-custom.inf and comment out the line (by prefacing it with a semicolon).

0x1, "Setup", "CmdLine", "XPELogon.exe -r"

(the -r switch calls xpeinit -r that does RunOnceEx stuff)
Then enable the following plugins: nu2menu, nu2xpe, ramdisk, autoramresizer (bartpe network stuff if you want network support)

My XPE build from an English Windows XP source has some dialogs localized in Slovenian, how can I fix it?
Some old versions of pebuilder have a bug that overwrites resource file with the slovenian one (the last in the file list), upgrade pebuilder
or uncomment the following entries from you z_xpe-custom.inf

[SourceDisksFiles.2600]
; Fix for the "crazy copy" bug (old pebuilder bug)
xpsp1res.dll=2,,4
xpsp2res.dll=2,,4
xpob2res.dll=2,,4

Can I use a different shell rather than Explorer.exe (e.g. nu2menu)?
Yes, there is a Registry key to change in xpe-custom.inf:
; XPELogon Shell to launch, default is Explorer.exe - If you want to use nu2menu as shell DISABLE Startup Group Plugin 0x2,"Sherpya\XPELogon","Shell","%SystemDrive%\Programs\Nu2menu\nu2menu.exe"

How can I make a program to run on startup / add items to start menu?
You can add programs what will start before explorer.exe, or before explorer.exe but after main dll registration: simply add a shortcut in the Startup section of the Start Menu
To add a program that runs before explorer.exe, add a key in your Software.AddReg section, an example is Autoramresizer or penetcfg, for the run order look into xpe-custom.inf
You can also use xpeinit.exe as a "silent wrapper" like:

0x1,"Microsoft\Windows\CurrentVersion\RunOnceEx\600","004","||xpeinit.exe net.exe start EventLog"

This will run the command without showing the console window

The syntax is: xpeinit [-s] [-f] [-m message] cmdline
where -f means force load also if control key is pressed and -m changes the title on XPELogon window while executing the command

Shortcut creation is made in the registry so you can create plugins usable with or without XPE.
Examples are in xpe-custom.inf, directory hierarchies are created automatically, you can also localize names.

0x2,"Sherpya\XPEinit\Programs","@shell32.dll,-21761\@shell32.dll,-22019","%SystemRoot%\system32\calc.exe"

This line will add to the Start Menu/Program folder a shortcut to calc.exe, @shell32.dll,-21761 becomes Accessories in your language and @shell32.dll,-22019 becomes Calculator in your language.
The format is the same used by windows.
You can find string resources with resource hacker, just use @yourdll,-ordinal, ordinal is taken from showing the details with resource hacker prefixed by a - (minus)

for example:

0x2,"Sherpya\XPEinit\Programs","Internet\Mozilla FireFox","%SystemDrive%\Programs\Firefox\FireFox.exe"

Can I remove/use small arrow on shortcuts?
Yes. Blank and small arrow shortcuts icons are included in xpeinit.exe executable, look at xpe-custom.inf for details

Can I run XPE from a Hard Disk?
Copy emptyregdb.dat from system32 to XPE plugin directory. Then use my Build Scripts package (Note you must follow the docs to modify the original peinstall script).

How to make USB storage media work?
Just plug in the USB storage and XPE should works as normal Windows. There is a drawback, you should add you device ID in as registry key or you will need to plug in and unplug the device to make it works.
You can look in z_xpe-custom.sample:

; Custom Usb Storage Ids
; example: eXagerate Usb Key 256MB
0x3,"ControlSet001\Control\UsbFlags\011701170100","osvc",00,00

This is for my USB storage key, after inserting the device the first time you will see what is the code to add in ControlSet001\Control\UsbFlags registry key:

0x3,"ControlSet001\Control\UsbFlags\XXXXYYYYZZZZ","osvc",00,00

XXXX is the vendor id, YYYY the product id and ZZZZ the revision number.
To avoid all of these problems, you can optionally patch XP SP2 usbhub.sys at 0xa8ab and changing 7c 1c in 90 90, on w2k3 SP1 the offset is at 0xad29, you will need some pe exe editor to update the pe checksum or you'll have problem using it.
A program that does this kind of operation is peks, but it doesn't seem to like w2k3 drivers.
I'm still looking for a cleaner solution.
None of this is necessary if the USB device is already plugged in at boot time.

I've installed many plugins but I see nothing in my start menu
XPE by defaults only adds entries on start menu for plugins with XPE registry shortcut entries, anyway nu2parser converts entries of nu2menu to XPE registry entries. Because nu2parser seams no more updated, I've created a similar plugin, called nu2xpe, you can download it here.

Note: Updated flash plugin files (also needed if you build w2k3) can be downloaded here
create flash directory inside the plugin directory and put in the flash OCX file extracted from the cab.

Note: If you are using HTA stuff you may need comdlg32.ocx, you can find it here, uncompress the cab and put comdlg32.ocx in a directory called system into the XPE plugin main directory.

Note: autorun stuff will be handled using RunOnceEx and wrapping it with xpeinit, look in xpe-custom, XPE now uses bartpe.exe to initialize network (look at xpe-custom.inf)
Don't make name collision in RunOnceEx keys or the first key will be overwritten.

Note: I've received some requests about msado plugin incompabilities, the problem is the msado plugin creates a Registration directory, since Registration directory should be read-write and not readonly you should never create it on a read-only media or most of the dll registrations will fail. The user will be warned in this case, and I don't want to reply to users having this problem.
You can force it by adding -x to the command line, this will disable integrity checks.

Syntax of bundled utilites:

XPEinit.exe

no switches -> command to execute without showing window (proxy mode), holding control key skips the execution

-b sends a broadcast message to all apps to re-read the environment variables
-l creates shortcuts
-x fix all wmp path registry entries, it needs one argument, the wmp path, my wmp plugin uses %SystemRoot%\System32
-y disables unsigned driver warning dialog box
-p setup ie proxy from xpeinit registry keys
-z setup refresh
-h max refresh rate for -z
-d runoncedel, deletes RunOnceEx keys between 400 and 600
-s doesn't complain if the launched command fails
-r processes RunOnceEx keys
-f force, when running in proxy mode, executes the program, even if the control key is pressed
-m message to display in the title of window when launching an application in proxy mode
-w check for WBEM repository in %SystemRoot%\system32\wbem\Repository or build it in %temp%\Repository
-9 disables 24 hour time limit by killing smss.exe and winlogon.exe (thx TheTruth)
-6 reboot system (tells XPELogon to reboot the system)
-0 shutdown system (tells XPELogon to shutdown the system)

Extended shortcut registry key syntax, the value field

program_to_launch|program_arguments|icon_file[,n] - n icon index in the icon file

XPELogon.exe

-w disable desktop switching (this implies winlogon resource limit)
-n do not show the progressbar
-d launch a command line prompt at startup (before any other action), this is used mainly for debug
-r calls xpeinit -r that does RunOnceEx using internal routine
-p profiles boot time, displays a message with msec elapsed during boot, the counter starts when XPELogon.exe is launched
-s only used with -r causes xpeinit to not display an error message when an entry in RunOnceEx fails
-e enables environment updates when receiving WM_SETTINGCHANGE broadcast messages, beware it can lead to xpelogon crashing
-h set winlogon shell registry key according to shell selected within XPELogon
-x skips Registration directory and shell32 locale mismatch integrity checks, use only if sure
-5 password : generate md5 hash for the given password, the hash will be copied into the clipboard (please use passwords less than 16 characters long)

Microsoft Windows is a registered trademark of Microsoft Corporation, I'm not affiliated in any way with Microsoft Corporation.


Copyright © 2007 - Gianluigi Tiesi [Sherpya]