Better document Web Wizard providers

This commit is contained in:
~lucidiot 2022-06-06 23:57:01 +02:00
parent 96840fbac1
commit d0a29f2b16
2 changed files with 208 additions and 2 deletions

View File

@ -38,11 +38,23 @@ The provider name is an arbitrary string of your choice. The following values ca
`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 locatoin selection step even though it does not make sense there.
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
@ -80,9 +92,11 @@ Upon startup, all three wizards will fetch a file called the *provider manifest*
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
Coming soon: an XSD describing the provider manifest.
I wrote [an XSD file](../xsd/provider-manifest.xsd) 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

192
xsd/provider-manifest.xsd Normal file
View File

@ -0,0 +1,192 @@
<?xml version="1.0" encoding="utf-8"?>
<xs:schema
elementFormDefault="unqualified"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
<xs:simpleType name="LangID">
<xs:annotation>
<xs:documentation>
2-byte language ID, either a primary language identifier or a sublanguage identifier.
Invalid or missing language IDs are ignored, and only the first of any duplicate language IDs will be used.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:hexBinary">
<xs:length value="2" />
</xs:restriction>
</xs:simpleType>
<xs:complexType name="String">
<xs:annotation>
<xs:documentation>
An internationalized string.
The combination of `langid` and `id` should be unique.
Strings with invalid or missing `id` or `langid` will be ignored.
Only the first of multiple strings with a duplicate `id` and `langid` combo will be used.
</xs:documentation>
</xs:annotation>
<xs:simpleContent>
<xs:extension base="xs:string">
<xs:attribute name="langid" type="LangID" use="required">
<xs:annotation>
<xs:documentation>
Sub-language identifier.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="id" type="xs:NCName" use="required">
<xs:annotation>
<xs:documentation>
Identifier for this internationalized string.
Known values are DisplayName and Description.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:extension>
</xs:simpleContent>
</xs:complexType>
<xs:complexType name="Strings">
<xs:annotation>
<xs:documentation>
A sequence of internationalized strings for the provider.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="string" type="String" minOccurs="0" maxOccurs="unbounded">
<xs:key name="uniqueStringAttributes">
<xs:selector xpath="string" />
<xs:field xpath="@id" />
<xs:field xpath="@langid" />
</xs:key>
</xs:element>
</xs:sequence>
<xs:attribute name="langid" type="LangID" use="required">
<xs:annotation>
<xs:documentation>
Identifier for the primary language of the strings.
An invalid or missing language ID is ignored.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="Provider">
<xs:annotation>
<xs:documentation>
A provider for a web wizard.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="strings" type="Strings" minOccurs="0" maxOccurs="unbounded">
<xs:key name="uniqueStringsLangId">
<xs:selector xpath="strings" />
<xs:field xpath="@langid" />
</xs:key>
</xs:element>
</xs:sequence>
<xs:attribute name="id" type="xs:NCName" use="required">
<xs:annotation>
<xs:documentation>
Unique identifier for the provider within this scope.
When no identifier is provided, the provider will be skipped.
Duplicate IDs may cause undefined behavior.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="icon" type="xs:anyURI" use="optional">
<xs:annotation>
<xs:documentation>
URL pointing to a remote location for the icon, relative to http://shell.windows.com/publishwizard/.
Any protocol supported by Internet Explorer should be supported here.
The icon will be downloaded, stored into a cache, and only its cached path will be saved in the registry.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="iconpath" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Path to an icon on the local system. This can use icon resources in DLLs using the `shell32.dll,42` syntax.
This takes precedence over `icon`.
If neither `icon` or `iconpath` is set, the wizard falls back to the value of `DefaultIcon` in `HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer\PublishingWizard\[scope]`. If that value is not set, `shell32.dll,-244` is used.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="displayname" type="xs:string" use="optional" >
<xs:annotation>
<xs:documentation>
Name of the provider shown in the providers list in the wizard.
If this starts with an @ character, then this points to a string resource in a DLL.
If a &lt;string&gt; for the user's current locale with an ID set to `DisplayName` exists, then it will be used instead of this attribute.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="description" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Short description of the provider shown in the providers list in the wizard.
If this starts with an @ character, then this points to a string resource in a DLL.
If a &lt;string&gt; for the user's current locale with an ID set to `Description` exists, then it will be used instead of this attribute.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="href" type="xs:anyURI" use="optional">
<xs:annotation>
<xs:documentation>
URL to the first page that will be displayed in the wizard after the user selects this provider.
All Internet Explorer-supported protocols are allowed.
If not set, the Add Network Places form is shown instead.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="requiresWebDAV" type="xs:boolean" use="optional" default="0">
<xs:annotation>
<xs:documentation>
Whether this provider requires WebDAV support to function properly.
If WebDAV support is not installed on the system, the provider will be skipped.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="supportedtypes" type="xs:string" use="optional">
<xs:annotation>
<xs:documentation>
Supported file types, as a semicolon-separated list of filters.
For example, "*.jpg; *.png" will support JPEG and PNG files.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="Providers">
<xs:sequence>
<xs:element name="provider" type="Provider" minOccurs="0" maxOccurs="unbounded">
<xs:key name="uniqueProviderId">
<xs:selector xpath="provider" />
<xs:field xpath="@id" />
</xs:key>
</xs:element>
</xs:sequence>
<xs:attribute name="scope" type="xs:string" use="required">
<xs:annotation>
<xs:documentation>
On which wizard this provider can be used.
Known values are AddNetPlaces, PublishingWizard and InternetPhotoPrinting.
Unsupported values will be ignored.
When multiple elements have duplicate scopes, only the first one will be used.
</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>
<xs:complexType name="ProviderManifest">
<xs:sequence>
<xs:element name="providers" type="Providers" minOccurs="0" maxOccurs="unbounded">
<xs:key name="uniqueProvidersScope">
<xs:selector xpath="providers" />
<xs:field xpath="@scope" />
</xs:key>
</xs:element>
</xs:sequence>
</xs:complexType>
<xs:element name="providermanifest" type="ProviderManifest" />
</xs:schema>