HP logo

Windows XPE

Version 1.0.4

Please Note: This plugin will work ONLY with Windows XP SP2 and Windows Server 2003 SP1, I cannot retain previous service packs compatibility since there are no ways to apply different actions for different service packs.

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 contributed 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

Windows XPE Plugin Components:

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 PELoader/Nu2Shell plugins if you run XPELogon as shell (Default configuration, btw xpe provides same features).

WMI Notice: The wmi plugin creates the wbem Repository in %temp%\Repository (most likely a ramdrive), this process is a lot 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 you 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.

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.

I have problems accessing to Windows XP SP2 shares, how can I fix this?
Merge the included reg fix to the target sp2 windows, then reboot.
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?
Off course, but since it's not my primary working platform, some stuff could not work as expected.
Please note on Windows 2003 SP1, you will have some file type names not currently named, they 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 you should manually edit hivecls.inf file (in i386 of source directory), go at the end of the file, here:

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

you must move FilePathMSHTA in the second [Strings] section, then remove the [Strings] identifier from first section.

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)

My xpe build from an English Windows XP source has some dialogs localized in Slovenian, how can I fix it?
Some old version of pebuilder has a bug that overwrites resource file with the slovenian one, 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 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 registration, 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

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

Can I run XPE from HD?
Copy emptyregdb.dat from system32 to xpe plugin directory. Then use my Build Scripts package (Note you must follow 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 at all this problem you can 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 seam to like w2k3 drivers.
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 plugin 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 received 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 shouldn'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.
You can also add -x to XPELogon command line, this will disable integrity checks.

Syntax for the bundled software:

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 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 control 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 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 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
-e enables environment updates when receiving WM_SETTINGCHANGE broadcast messages, beware it can lead xpelogon crashes
-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 pass len < 16 chars)

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


Copyright © 2005 - Gianluigi Tiesi [Sherpya]