From f680e915f065026efd0301a76fd524f87b8c5f06 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 19 Dec 2017 12:24:16 -0800 Subject: Simplify message handling --- src/WixToolset.Data/WindowsInstaller/Output.cs | 2 +- src/WixToolset.Data/WindowsInstaller/Pdb.cs | 2 +- .../WindowsInstaller/Rows/FileRow.cs | 2 +- src/WixToolset.Data/WindowsInstaller/Table.cs | 2 +- .../WindowsInstaller/TableDefinition.cs | 2 +- .../WindowsInstaller/TableDefinitionCollection.cs | 2 +- .../WixMissingTableDefinitionException.cs | 2 +- .../WindowsInstaller/Xsd/libraries.xsd | 66 ++++++++++ .../WindowsInstaller/Xsd/objects.xsd | 143 +++++++++++++++++++++ .../WindowsInstaller/Xsd/outputs.xsd | 66 ++++++++++ src/WixToolset.Data/WindowsInstaller/Xsd/pdbs.xsd | 32 +++++ 11 files changed, 314 insertions(+), 7 deletions(-) create mode 100644 src/WixToolset.Data/WindowsInstaller/Xsd/libraries.xsd create mode 100644 src/WixToolset.Data/WindowsInstaller/Xsd/objects.xsd create mode 100644 src/WixToolset.Data/WindowsInstaller/Xsd/outputs.xsd create mode 100644 src/WixToolset.Data/WindowsInstaller/Xsd/pdbs.xsd (limited to 'src/WixToolset.Data/WindowsInstaller') diff --git a/src/WixToolset.Data/WindowsInstaller/Output.cs b/src/WixToolset.Data/WindowsInstaller/Output.cs index 6164622d..7f2990f4 100644 --- a/src/WixToolset.Data/WindowsInstaller/Output.cs +++ b/src/WixToolset.Data/WindowsInstaller/Output.cs @@ -165,7 +165,7 @@ namespace WixToolset.Data.WindowsInstaller if (!suppressVersionCheck && null != version && !Output.CurrentVersion.Equals(version)) { - throw new WixException(WixDataErrors.VersionMismatch(SourceLineNumber.CreateFromUri(reader.BaseURI), "wixOutput", version.ToString(), Output.CurrentVersion.ToString())); + throw new WixException(ErrorMessages.VersionMismatch(SourceLineNumber.CreateFromUri(reader.BaseURI), "wixOutput", version.ToString(), Output.CurrentVersion.ToString())); } // loop through the rest of the xml building up the Output object diff --git a/src/WixToolset.Data/WindowsInstaller/Pdb.cs b/src/WixToolset.Data/WindowsInstaller/Pdb.cs index 41700b0d..d3fea0fe 100644 --- a/src/WixToolset.Data/WindowsInstaller/Pdb.cs +++ b/src/WixToolset.Data/WindowsInstaller/Pdb.cs @@ -107,7 +107,7 @@ namespace WixToolset.Data.WindowsInstaller if (!suppressVersionCheck && null != version && !Pdb.CurrentVersion.Equals(version)) { - throw new WixException(WixDataErrors.VersionMismatch(SourceLineNumber.CreateFromUri(reader.BaseURI), "wixPdb", version.ToString(), Pdb.CurrentVersion.ToString())); + throw new WixException(ErrorMessages.VersionMismatch(SourceLineNumber.CreateFromUri(reader.BaseURI), "wixPdb", version.ToString(), Pdb.CurrentVersion.ToString())); } // loop through the rest of the pdb building up the Output object diff --git a/src/WixToolset.Data/WindowsInstaller/Rows/FileRow.cs b/src/WixToolset.Data/WindowsInstaller/Rows/FileRow.cs index 7fc34b3d..673d2315 100644 --- a/src/WixToolset.Data/WindowsInstaller/Rows/FileRow.cs +++ b/src/WixToolset.Data/WindowsInstaller/Rows/FileRow.cs @@ -179,7 +179,7 @@ namespace WixToolset.Data.WindowsInstaller.Rows if (compressedFlag && noncompressedFlag) { - throw new WixException(WixDataErrors.IllegalFileCompressionAttributes(this.SourceLineNumbers)); + throw new WixException(ErrorMessages.IllegalFileCompressionAttributes(this.SourceLineNumbers)); } else if (compressedFlag) { diff --git a/src/WixToolset.Data/WindowsInstaller/Table.cs b/src/WixToolset.Data/WindowsInstaller/Table.cs index 7fcc1b31..ccdcb40b 100644 --- a/src/WixToolset.Data/WindowsInstaller/Table.cs +++ b/src/WixToolset.Data/WindowsInstaller/Table.cs @@ -323,7 +323,7 @@ namespace WixToolset.Data.WindowsInstaller if (primaryKeys.TryGetValue(primaryKey, out var collisionSourceLineNumber)) { - throw new WixException(WixDataErrors.DuplicatePrimaryKey(collisionSourceLineNumber, primaryKey, this.Definition.Name)); + throw new WixException(ErrorMessages.DuplicatePrimaryKey(collisionSourceLineNumber, primaryKey, this.Definition.Name)); } primaryKeys.Add(primaryKey, row.SourceLineNumbers); diff --git a/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs b/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs index 518f0926..2fb655e5 100644 --- a/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs +++ b/src/WixToolset.Data/WindowsInstaller/TableDefinition.cs @@ -175,7 +175,7 @@ namespace WixToolset.Data.WindowsInstaller if (!unreal && !bootstrapperApplicationData && !hasPrimaryKeyColumn) { - throw new WixException(WixDataErrors.RealTableMissingPrimaryKeyColumn(SourceLineNumber.CreateFromUri(reader.BaseURI), name)); + throw new WixException(ErrorMessages.RealTableMissingPrimaryKeyColumn(SourceLineNumber.CreateFromUri(reader.BaseURI), name)); } if (!done) diff --git a/src/WixToolset.Data/WindowsInstaller/TableDefinitionCollection.cs b/src/WixToolset.Data/WindowsInstaller/TableDefinitionCollection.cs index 0954e9de..619a5206 100644 --- a/src/WixToolset.Data/WindowsInstaller/TableDefinitionCollection.cs +++ b/src/WixToolset.Data/WindowsInstaller/TableDefinitionCollection.cs @@ -59,7 +59,7 @@ namespace WixToolset.Data.WindowsInstaller { if (!this.collection.TryGetValue(tableName, out var table)) { - throw new WixMissingTableDefinitionException(WixDataErrors.MissingTableDefinition(tableName)); + throw new WixMissingTableDefinitionException(ErrorMessages.MissingTableDefinition(tableName)); } return table; diff --git a/src/WixToolset.Data/WindowsInstaller/WixMissingTableDefinitionException.cs b/src/WixToolset.Data/WindowsInstaller/WixMissingTableDefinitionException.cs index 4b15c0e5..9f7e5fa8 100644 --- a/src/WixToolset.Data/WindowsInstaller/WixMissingTableDefinitionException.cs +++ b/src/WixToolset.Data/WindowsInstaller/WixMissingTableDefinitionException.cs @@ -14,7 +14,7 @@ namespace WixToolset.Data.WindowsInstaller /// Instantiate new WixMissingTableDefinitionException. /// /// Localized error information. - public WixMissingTableDefinitionException(MessageEventArgs error) + public WixMissingTableDefinitionException(Message error) : base(error) { } diff --git a/src/WixToolset.Data/WindowsInstaller/Xsd/libraries.xsd b/src/WixToolset.Data/WindowsInstaller/Xsd/libraries.xsd new file mode 100644 index 00000000..a4504c01 --- /dev/null +++ b/src/WixToolset.Data/WindowsInstaller/Xsd/libraries.xsd @@ -0,0 +1,66 @@ + + + + + + + + Schema for describing WiX Library files (.wixlib). + + + + + + + + + + + + + + + + Version of WiX used to create this library file + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.Data/WindowsInstaller/Xsd/objects.xsd b/src/WixToolset.Data/WindowsInstaller/Xsd/objects.xsd new file mode 100644 index 00000000..5d95a59c --- /dev/null +++ b/src/WixToolset.Data/WindowsInstaller/Xsd/objects.xsd @@ -0,0 +1,143 @@ + + + + + + + + Schema for describing WiX Object files (.wixobj). + + + + + + + + + + + + Version of WiX used to create this object file. + + + + + + + + + + + + + Identifier for section (optional for Fragments) + + + + + Type of section + + + + + Codepage for output file, only valid on entry sections. + + + + + + + + + + + + + Name of table in Windows Installer database + + + + + + + + + + + + + + + + Row in a table + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Data for a particular field in a row. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.Data/WindowsInstaller/Xsd/outputs.xsd b/src/WixToolset.Data/WindowsInstaller/Xsd/outputs.xsd new file mode 100644 index 00000000..00e20f12 --- /dev/null +++ b/src/WixToolset.Data/WindowsInstaller/Xsd/outputs.xsd @@ -0,0 +1,66 @@ + + + + + + + + Schema for describing WiX Output files (.wixout). + + + + + + + + + + + + + + + + Codepage of the output. + + + + + Type of the output. + + + + + + + + + + + + + + + Version of WiX used to create this output file. + + + + + + + + + + + + + Name of the substorage. + + + + + diff --git a/src/WixToolset.Data/WindowsInstaller/Xsd/pdbs.xsd b/src/WixToolset.Data/WindowsInstaller/Xsd/pdbs.xsd new file mode 100644 index 00000000..c1d1756d --- /dev/null +++ b/src/WixToolset.Data/WindowsInstaller/Xsd/pdbs.xsd @@ -0,0 +1,32 @@ + + + + + + + + Schema for describing WiX Pdb files (.wixpdb). + + + + + + + + + + + + + + + + Version of WiX used to create this pdb file + + + + + -- cgit v1.2.3-55-g6feb