HP logo

Windows XPE

Version 1.0.2

Please Note: This plugin will work ONLY with Windows XP SP2 and Windows Server 2003, I cannot retain sp1 compatibility since there are no ways to apply different actions to sp1 or sp2, windows version is always 2600 on Windows XP

Windows XPE is my attempt to make BartPE closer to Windows XP (XP + PE = XPE), it's almost localized, tell me if some "important" stuff is not in your locale
Base work on plugin is my job but a lot of users contribuited tests, code, suggestions and fixes (credits should be in inf files on respective stuff).
The plugin is currently splitted for better customization/implementation.

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

To use PeNetCfg for the network configuration, read instructions in z_xpe-custom

This plugin needs ramdisk enabled to work, also note my ramdisk autoresizer plugin needs itself ramdisk plugin, pebuilder version should be >= 3.0.24

NOTE Important: you should DISABLE Startup Group and PE Loader plugins if you run XPELogon as shell (Default configuration)

WMI Notice: The wmi plugin creates the wbem Repository in %temp%\Repository (most likely a ramdrive), this process is a bit slow, but you can speedup it, just build an xpe with wmi, then copy Repository directory from winpe %temp% drive into xpe plugin directory, on the next xpe build yout will have Repository directory on the cdrom and xpe will not rebuild it at runtime. This also will reduce ram usage by about 7 mb, but computer name will be hardcoded in all wmi stuff.

WMI does not work on Windows Server 2003 builds.

FAQ:

In order to use PnP plugin you need InfCacheBuild to remove CopyFiles stuff from inf files, you can use my Build Scripts.
Create following directories inside xpe plugin: inf, drivers, system and copy needed files.
Also you may want to use AutoRamResizer that resizes ramdisk at runtime

Can I use windows xpe with windows 2003?
Off course, but since it's not my primary working platform, some stuff could not work as expected.

To setup XPE + nu2menu + nu2xpe + autoramresizer:
Yes, its' very simple just look into xpe-custom.inf and add a comment to this line

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

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

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 some program to run on startup / add items to start menu?
You can add programs that starts before explorer.exe, before explorer.exe but after dll regestration, you can add shortcut on StartUp section of Start Menu
To Add a program that runs before explorer.exe, add a key in your Software.AddReg section, like Autoramresizer or penetcfg, for run order look into xpe-custom.inf
You can use also xpeinit.exe as "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

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

Shortcut creation is made into registry so you can create plugin usable with and 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 Start Menu Program 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 resource with resource hacker, just use @yourdll,-ordinal, ordinal is taken showing details with resource hacker prefixed by a - (minus)

or using simple syntax:

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 shortcurts icons are included in xpeinit.exe executable, look into xpe-custom.inf

Can I run XPE from HD?
Yes use my Build Scripts package.

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 insterting 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 at all this problem you can patch xp sp2 usbhub.sys at 0xa8ab and changing 7c 1c in 90 90, on w2k3 the offset is at 0x9cbc. I'm still looking for a cleaner solution.
None of this is necessary if usb device is yet plugged in at boot.

I've installed many plugins but I see nothing on 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, it's 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 pugin dir 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 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 into xpe-custom.inf)
Don't make name collision in RunOnceEx keys or the first key will be overwritten.

Note: I've receved some request about msado plugin incompabilities, the problem is msado plugin create Registration directory windows directory, since Registration directory should be read-write and not readonly you shouln't never create it on a read-only media or most of dll registrations will fail. The user will be warned in this case, and I don't want to reply to users having this problem.

Syntax for the bundled software:

XPEinit.exe

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

-b sends a broadcast message to all apps to re-read environment variables
-l creates shortcuts
-y disables driver signing
-p setup ie proxy from xpeinit reg 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 shift key is pressed
-m message to show 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 to XPELogon to reboot the system)
-0 shutdown system (tells to 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 doesn't 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

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


Copyright © 2004 - Gianluigi Tiesi [Sherpya]