Skip to content

Commit

Permalink
Many XSD fixes found by scanning WiX v4 test code
Browse files Browse the repository at this point in the history
  • Loading branch information
robmen committed Jan 3, 2023
1 parent dcb55f8 commit 04735ff
Show file tree
Hide file tree
Showing 4 changed files with 1,909 additions and 1,658 deletions.
1 change: 0 additions & 1 deletion src/xsd4/dependency.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xse="http://wixtoolset.org/schemas/XmlSchemaExtension"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:wxs="http://wixtoolset.org/schemas/v4/wxs"
targetNamespace="http://wixtoolset.org/schemas/v4/wxs/dependency"
xmlns="http://wixtoolset.org/schemas/v4/wxs/dependency">
Expand Down
231 changes: 117 additions & 114 deletions src/xsd4/netfx.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:xse="http://wixtoolset.org/schemas/XmlSchemaExtension"
xmlns:html="http://www.w3.org/1999/xhtml"
xmlns:wxs="http://wixtoolset.org/schemas/v4/wxs"
targetNamespace="http://wixtoolset.org/schemas/v4/wxs/netfx"
xmlns="http://wixtoolset.org/schemas/v4/wxs/netfx">
Expand All @@ -26,31 +25,26 @@
<xs:appinfo>
<xse:parent namespace="http://wixtoolset.org/schemas/v4/wxs" ref="File" />
<xse:remarks>
<html:p>
Native images are files containing compiled processor-specific machine code, which
are installed into the native image cache on the local computer. The runtime
can use native images from the cache instead using the just-in-time (JIT)
compiler to compile the original assembly.
</html:p>
<html:p>
The native image custom actions are configured to ignore failures so that failing
to generate or remove a native image will not cause setup to fail and roll back.
</html:p>
<html:p>
**Note for patches:** if you built your target, or baseline, MSI with
previous versions 3.0 or 3.5 of this extension and want to upgrade to formattable
values for @AssemblyApplication or @AppBaseDirectory you must also include a
BinaryRef to "NetFxCA" to pull in necessary changes. If you do use formattable
values and do not include the binary changes ngen.exe will not optimize your
native images for the specified application.
</html:p>
<html:p>
This should be a rare occurrence, however. Because you cannot remove components
in a patch - and pyro does validate you do not - it is not practical to switch
from using identifiers to formattable values in a patch. One practical possibility
is if you wanted to use a different application to optimize your native images
and that application is not already installed with the MSI to be updated.
</html:p>
Native images are files containing compiled processor-specific machine code, which
are installed into the native image cache on the local computer. The runtime
can use native images from the cache instead using the just-in-time (JIT)
compiler to compile the original assembly.

The native image custom actions are configured to ignore failures so that failing
to generate or remove a native image will not cause setup to fail and roll back.

**Note for patches:** if you built your target, or baseline, MSI with
previous versions 3.0 or 3.5 of this extension and want to upgrade to formattable
values for @AssemblyApplication or @AppBaseDirectory you must also include a
BinaryRef to "NetFxCA" to pull in necessary changes. If you do use formattable
values and do not include the binary changes ngen.exe will not optimize your
native images for the specified application.

This should be a rare occurrence, however. Because you cannot remove components
in a patch - and pyro does validate you do not - it is not practical to switch
from using identifiers to formattable values in a patch. One practical possibility
is if you wanted to use a different application to optimize your native images
and that application is not already installed with the MSI to be updated.
</xse:remarks>
</xs:appinfo>
</xs:annotation>
Expand All @@ -73,50 +67,42 @@
<xs:attribute name="AppBaseDirectory" type="xs:string">
<xs:annotation>
<xs:documentation>
<html:p>
The directory to use for locating dependent assemblies.
For DLL assemblies and assemblies installed to the Global Assembly Cache (GAC),
this attribute should be set to the directory of the application which loads this
assembly. For EXE assemblies, this attribute does not need to be set because NGen
will use the directory of the assembly file by default.
</html:p>
<html:p>
The value can be in the form of a directory identifier, or a formatted string
that resolves to either a directory identifier or a full path to a directory.
</html:p>
The directory to use for locating dependent assemblies.
For DLL assemblies and assemblies installed to the Global Assembly Cache (GAC),
this attribute should be set to the directory of the application which loads this
assembly. For EXE assemblies, this attribute does not need to be set because NGen
will use the directory of the assembly file by default.

The value can be in the form of a directory identifier, or a formatted string
that resolves to either a directory identifier or a full path to a directory.
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="AssemblyApplication" type="xs:string">
<xs:annotation>
<xs:documentation>
<html:p>
The application which will load this assembly.
For DLL assemblies which are loaded via reflection, this attribute should
be set to indicate the application which will load this assembly.
The configuration of the application (usually specified via an exe.config file) will be used
to determine how to resolve dependencies for this assembly.
</html:p>
<html:p>
The value can be in the form of a file identifier, or a formatted string
that resolves to either a file identifier or a full path to a file.
</html:p>
<html:p>
When a shared component is loaded at run time, using the Load method, the
application's configuration file determines the dependencies that are loaded
for the shared component — for example, the version of a dependency that is loaded.
This attribute gives guidance on which dependencies would be loaded at run time in order
to figure out which dependency assemblies will also need to have native images generated
(assuming the Dependency attribute is not set to "no").
</html:p>
<html:p>
This attribute cannot be set if the AssemblyApplication attribute is set on the parent
File element (please note that these attributes both refer to the same application
assembly but do very different things: specifiying File/@AssemblyApplication will force
an assembly to install to a private location next to the indicated application, whereas
this AssemblyApplication attribute will be used to help resolve dependent assemblies
while generating native images for this assembly).
</html:p>
The application which will load this assembly.
For DLL assemblies which are loaded via reflection, this attribute should
be set to indicate the application which will load this assembly.
The configuration of the application (usually specified via an exe.config file) will be used
to determine how to resolve dependencies for this assembly.

The value can be in the form of a file identifier, or a formatted string
that resolves to either a file identifier or a full path to a file.

When a shared component is loaded at run time, using the Load method, the
application's configuration file determines the dependencies that are loaded
for the shared component — for example, the version of a dependency that is loaded.
This attribute gives guidance on which dependencies would be loaded at run time in order
to figure out which dependency assemblies will also need to have native images generated
(assuming the Dependency attribute is not set to "no").

This attribute cannot be set if the AssemblyApplication attribute is set on the parent
File element (please note that these attributes both refer to the same application
assembly but do very different things: specifiying File/@AssemblyApplication will force
an assembly to install to a private location next to the indicated application, whereas
this AssemblyApplication attribute will be used to help resolve dependent assemblies
while generating native images for this assembly).
</xs:documentation>
</xs:annotation>
</xs:attribute>
Expand All @@ -136,45 +122,12 @@
</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Platform">
<xs:attribute name="Platform" type="NativeImagePreprocessorPlatformType">
<xs:annotation>
<xs:documentation>
Sets the platform(s) for which native images will be generated.
</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="32bit">
<xs:annotation>
<xs:documentation>
Attempt to generate native images only for the 32-bit version of the .NET Framework
on the target machine. If the 32-bit version of the .NET Framework 2.0 or newer is not
present on the target machine, native image custom actions will not be scheduled.
This is the default value.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="64bit">
<xs:annotation>
<xs:documentation>
Attempt to generate native images only for the 64-bit version of the .NET Framework
on the target machine. If a 64-bit version of the .NET Framework 2.0 or newer is not
present on the target machine, native image custom actions will not be scheduled.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="all">
<xs:annotation>
<xs:documentation>
Attempt to generate native images for the 32-bit and 64-bit versions of the .NET Framework
on the target machine. If a version of the .NET Framework 2.0 or newer is not present on the
target machine for a processor architecture, native image custom actions will not be
scheduled for that processor architecture.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Priority">
<xs:annotation>
Expand Down Expand Up @@ -295,17 +248,10 @@
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Platform">
<xs:attribute name="Platform" type="NetfxPreprocessorPlatformType">
<xs:annotation>
<xs:documentation>The platform to search for.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="arm64" />
<xs:enumeration value="x64" />
<xs:enumeration value="x86" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="MajorVersion" type="wxs:Integer">
<xs:annotation>
Expand Down Expand Up @@ -406,17 +352,10 @@
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Platform">
<xs:attribute name="Platform" type="NetfxPreprocessorPlatformType">
<xs:annotation>
<xs:documentation>The platform to use to validate.</xs:documentation>
</xs:annotation>
<xs:simpleType>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="arm64" />
<xs:enumeration value="x64" />
<xs:enumeration value="x86" />
</xs:restriction>
</xs:simpleType>
</xs:attribute>
<xs:attribute name="Version" type="wxs:VersionType">
<xs:annotation>
Expand Down Expand Up @@ -480,4 +419,68 @@
</xs:complexType>
</xs:element>

<xs:simpleType name="NativeImagePlatformType">
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="32bit">
<xs:annotation>
<xs:documentation>
Attempt to generate native images only for the 32-bit version of the .NET Framework
on the target machine. If the 32-bit version of the .NET Framework 2.0 or newer is not
present on the target machine, native image custom actions will not be scheduled.
This is the default value.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="64bit">
<xs:annotation>
<xs:documentation>
Attempt to generate native images only for the 64-bit version of the .NET Framework
on the target machine. If a 64-bit version of the .NET Framework 2.0 or newer is not
present on the target machine, native image custom actions will not be scheduled.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value="all">
<xs:annotation>
<xs:documentation>
Attempt to generate native images for the 32-bit and 64-bit versions of the .NET Framework
on the target machine. If a version of the .NET Framework 2.0 or newer is not present on the
target machine for a processor architecture, native image custom actions will not be
scheduled for that processor architecture.
</xs:documentation>
</xs:annotation>
</xs:enumeration>
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="NativeImagePreprocessorPlatformType">
<xs:annotation>
<xs:documentation>
Platform referencing the machine architecture.
</xs:documentation>
</xs:annotation>
<xs:union memberTypes="NativeImagePlatformType wxs:PreprocessorVariables"/>
</xs:simpleType>

<xs:simpleType name="NetfxPlatformType">
<xs:annotation>
<xs:documentation>
Platform referencing the machine architecture.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:NMTOKEN">
<xs:enumeration value="arm64" />
<xs:enumeration value="x64" />
<xs:enumeration value="x86" />
</xs:restriction>
</xs:simpleType>

<xs:simpleType name="NetfxPreprocessorPlatformType">
<xs:annotation>
<xs:documentation>
Platform referencing the machine architecture.
</xs:documentation>
</xs:annotation>
<xs:union memberTypes="NetfxPlatformType wxs:PreprocessorVariables"/>
</xs:simpleType>
</xs:schema>
10 changes: 10 additions & 0 deletions src/xsd4/util.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,16 @@
<xs:documentation>Indicates whether failure to create the user or add the user to a group fails the installation. The default value is "yes".</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="Comment" type="xs:string">
<xs:annotation>
<xs:documentation>Optional comment to set on the user.</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name="RemoveComment" type="wxs:YesNoTypeUnion">
<xs:annotation>
<xs:documentation>Indicates whether remove the comment from the user. The default value is "no".</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:anyAttribute namespace="##other" processContents="lax">
<xs:annotation>
<xs:documentation>
Expand Down
Loading

0 comments on commit 04735ff

Please sign in to comment.