~lucidiot's wiki

Web Wizards

Windows XP introduced publishing wizards, wizards that include a step in which you have to pick an online service provider. The wizard will then load a webpage for that provider and includes an XML file in window.external.Property('TransferManifest'), which can then be edited in JavaScript or VBScript to let the website include info on how to upload files or perform whatever action the user was trying to do.

In the Win32 API, this type of wizard is called a WebWizard. There are three known Web Wizards:

  • The Add Network Places wizard
  • The Web Publishing wizard
  • The Internet Photo Printing wizard

The Visual Studio 2005 setup project provided in this repository allows you to register the JavaScript and VBScript consoles in all three wizards.

Provider registration

Official docs: Registering a Service

To register an online provider, you will need to add a new registry key under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard\[WIZARD NAME]\Providers\[PROVIDER NAME]. The wizard name is one of the following:

  • Add Network Places: AddNetPlace
  • Web Publishing: PublishingWizard
  • Internet Photo Printing: InternetPhotoPrinting

The provider name is an arbitrary string of your choice. The following values can be included:

DisplayName
The name of the provider shown in the wizard’s list.
Description
A short description of the provider, also shown in the wizard’s list.
HREF
URL to the first page of the service. file:///, https:// and http:// are known to work. Other protocols have not yet been tested; please report your findings!
If this is missing, then any wizard will instead display the remote location selection page as in the Add Network Places wizard. See Default provider for Add Network Places below.
IconPath
Path to a local file holding an icon. This can use a local .ico file or find an icon a WinPE executable by appending an icon number, for example shell32.dll,-172.
SupportedTypes
Not relevant to the Add Network Places wizard. This holds a list of supported file types, as patterns separated by semicolons: *.htm; *.html; *.css. If nothing is set, then the provider will always be shown. If this value is set, then the provider is only shown when the files selected for publication by the user all match those patterns.

Other registry keys

Under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard\[WIZARD NAME], Providers is not the only key. A DefaultProvider string value may be found, storing the last provider ID the user selected, and a LocationMRU key holds a variable number of values used for autocompletion of the location selection page of the Add Network Places wizard. The MRUList value lists all the value names available, in the order they should appear; for example, cba means that there should be a c value, a b value and a a value present, and each of them should be shown in that order in the suggested locations.

Under HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard, one key might be found for each wizard name. In that key, two values may be defined:

ContentTypeFilter
A MIME type filter applied to files for this wizard before any provider is selected. This is used for InternetPhotoPrinting, to restrict it to image/*.
DefaultIcon
A default icon, with the same syntax as IconPath, for providers that do not have an icon or have an invalid one.

Default provider for Add Network Places

The Add Network Places wizard automatically gets a provider whose name is other. Its registry values do not include HREF, and this is what causes the wizard to display the remote location selection step instead of a web page.

Interestingly, if you remove HREF from a provider in the Web Publishing or Internet Photo Printing wizard, then those wizards can also show the remote location selection step even though it does not make sense there.

Online provider fetching

Upon startup, all three wizards will fetch a file called the provider manifest. This behavior has been observed by inspecting HTTP requests and is not documented. The file is fetched from http://shell.windows.com/publishwizard/[region].xml, where [region] is a three-letter code. Known regions include:

bra
Brazil. Last archived version
chn
China. Last archived version
deu
Germany. Last archived version
esp
Spain. Last archived version
fra
France. Last archived version
gbr
Great Britain. Last archived version
hkg
Hong Kong. Last archived version
jpn
Japan. Last archived version
prt
Portugal. Last archived version
usa
United States. Last archived version

Nowadays, all of these URLs return an HTTP 404 error. To be more precise, every single URL under http://shell.windows.com/publishwizard/* return an HTTP 404, where any other random URL outside of this directory will instead redirect to bing.com. It seems this behavior was intended to prevent the wizards from no longer functioning or timing out even after the online service providers were taken down.

When the fetching fails, the wizard falls back to an XML file built into its DLL, loading res://netplwiz.dll/xml/providers.xml. That XML file lists no providers for both the photo printing and web publishing wizards, but includes the default provider for the Add Network Places wizard. It is not using an absolute URL, which means it is theoretically possible to override that file without touching the system by providing your own modified netplwiz.dll somewhere else in your PATH.

Provider Manifest

I wrote an XSD file to describe the provider manifest, including its failure modes when some expected attributes are missing or invalid, after a lot of testing with various broken XML files. Almost no validation is actually performed by the wizard; if you feed it an invalid file, it is likely to fail silently.

Transfer Manifest

Official docs:

The official schema is pretty imprecise and lots of experiments using the provided consoles will be required.

Write an XSD for the Transfer Manifest from experiments