From 5b06ff3dea5d96c11515ab979cb3a78deb3e07ad Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sat, 13 Dec 2025 12:25:56 -0800 Subject: Properly deprecate PatchCreation and remove mostly dead code Resolves 9099 --- src/api/wix/WixToolset.Data/ErrorMessages.cs | 14 +- src/api/wix/WixToolset.Data/OutputType.cs | 1 + src/api/wix/WixToolset.Data/SectionType.cs | 1 + .../WixToolset.Data/Symbols/ExternalFilesSymbol.cs | 8 +- .../Symbols/FamilyFileRangesSymbol.cs | 8 +- .../WixToolset.Data/Symbols/ImageFamiliesSymbol.cs | 8 +- .../Symbols/MsiPatchMetadataSymbol.cs | 31 +- .../WixToolset.Data/Symbols/PatchMetadataSymbol.cs | 31 +- .../WixToolset.Data/Symbols/PatchPackageSymbol.cs | 2 +- .../WixToolset.Data/Symbols/PatchSequenceSymbol.cs | 8 +- .../WixToolset.Data/Symbols/SymbolDefinitions.cs | 10 + .../Symbols/TargetFilesOptionalDataSymbol.cs | 8 +- .../WixToolset.Data/Symbols/TargetImagesSymbol.cs | 8 +- .../Symbols/UpgradedFilesOptionalDataSymbol.cs | 6 + .../Symbols/UpgradedFilesToIgnoreSymbol.cs | 8 +- .../Symbols/UpgradedImagesSymbol.cs | 8 +- src/api/wix/WixToolset.Data/WarningMessages.cs | 18 - .../WindowsInstaller/WindowsInstallerData.cs | 2 + .../WindowsInstallerTableDefinitions.cs | 13 + .../WixToolset.Data/WindowsInstaller/Xsd/data.xsd | 1 - .../WindowsInstaller/Xsd/objects.xsd | 1 - .../ConvertSymbols.cs | 2 - .../CreateWindowsInstallerDataFromIRCommand.cs | 47 - .../Decompile/Decompiler.cs | 627 +--------- .../Decompile/Names.cs | 8 +- .../WindowsInstallerBackendFactory.cs | 4 - .../WixToolset.Core/CommandLine/BuildCommand.cs | 7 - src/wix/WixToolset.Core/Compiler.cs | 151 ++- src/wix/WixToolset.Core/CompilerWarnings.cs | 6 + src/wix/WixToolset.Core/Compiler_Patch.cs | 83 ++ src/wix/WixToolset.Core/Compiler_PatchCreation.cs | 1265 -------------------- .../Link/FindEntrySectionAndLoadSymbolsCommand.cs | 2 +- src/wix/WixToolset.Sdk/tools/wix.targets | 3 +- .../LinkerFixture.cs | 4 +- src/xsd/wix.xsd | 507 +------- 35 files changed, 316 insertions(+), 2595 deletions(-) delete mode 100644 src/wix/WixToolset.Core/Compiler_PatchCreation.cs diff --git a/src/api/wix/WixToolset.Data/ErrorMessages.cs b/src/api/wix/WixToolset.Data/ErrorMessages.cs index 4052917c..f3add0a1 100644 --- a/src/api/wix/WixToolset.Data/ErrorMessages.cs +++ b/src/api/wix/WixToolset.Data/ErrorMessages.cs @@ -563,11 +563,6 @@ namespace WixToolset.Data return Message(null, Ids.ExpectedPatchIdInWixMsp, "The WixMsp is missing the patch ID."); } - public static Message ExpectedRowInPatchCreationPackage(string tableName) - { - return Message(null, Ids.ExpectedRowInPatchCreationPackage, "Could not find a row in the '{0}' table for this patch creation package. Patch creation packages must contain at least one row in the '{0}' table.", tableName); - } - public static Message ExpectedSignedCabinetName(SourceLineNumber sourceLineNumbers) { return Message(sourceLineNumbers, Ids.ExpectedSignedCabinetName, "The Media/@Cabinet attribute was not found; it is required when this element contains a DigitalSignature child element. This is because Windows Installer can only verify the digital signatures of external cabinets. Please either remove the DigitalSignature element or specify a valid external cabinet name via the Cabinet attribute."); @@ -1413,7 +1408,7 @@ namespace WixToolset.Data public static Message MissingEntrySection() { - return Message(null, Ids.MissingEntrySection, "Could not find entry section in provided list of intermediates. Supported entry section types are: Package, Bundle, Patch, PatchCreation, Module."); + return Message(null, Ids.MissingEntrySection, "Could not find entry section in provided list of intermediates. Supported entry section types are: Package, Bundle, Patch, Module."); } public static Message MissingEntrySection(string sectionType) @@ -2056,11 +2051,6 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.UnexpectedTableInPatch, "An unexpected row in the '{0}' table was found in this patch. Patches cannot contain the '{0}' table.", tableName); } - public static Message UnexpectedTableInPatchCreationPackage(SourceLineNumber sourceLineNumbers, string tableName) - { - return Message(sourceLineNumbers, Ids.UnexpectedTableInPatchCreationPackage, "An unexpected row in the '{0}' table was found in this patch creation package. Patch creation packages cannot contain the '{0}' table.", tableName); - } - public static Message UnhandledExtensionAttribute(SourceLineNumber sourceLineNumbers, string elementName, string extensionAttributeName, string extensionNamespace) { return Message(sourceLineNumbers, Ids.UnhandledExtensionAttribute, "The {0} element contains an unhandled extension attribute '{1}'. Please ensure that the extension for attributes in the '{2}' namespace has been provided.", elementName, extensionAttributeName, extensionNamespace); @@ -2435,9 +2425,7 @@ namespace WixToolset.Data NoUniqueActionSequenceNumber2 = 180, ActionScheduledRelativeToItself = 181, MissingTableDefinition = 182, - ExpectedRowInPatchCreationPackage = 183, UnexpectedTableInMergeModule = 184, - UnexpectedTableInPatchCreationPackage = 185, MergeExcludedModule = 186, MergeFeatureRequired = 187, MergeLanguageFailed = 188, diff --git a/src/api/wix/WixToolset.Data/OutputType.cs b/src/api/wix/WixToolset.Data/OutputType.cs index abe484bd..ceb1c011 100644 --- a/src/api/wix/WixToolset.Data/OutputType.cs +++ b/src/api/wix/WixToolset.Data/OutputType.cs @@ -25,6 +25,7 @@ namespace WixToolset.Data Patch, /// Patch Creation output type. + [Obsolete] PatchCreation, /// Package output type. diff --git a/src/api/wix/WixToolset.Data/SectionType.cs b/src/api/wix/WixToolset.Data/SectionType.cs index 21fb5eac..d58154dd 100644 --- a/src/api/wix/WixToolset.Data/SectionType.cs +++ b/src/api/wix/WixToolset.Data/SectionType.cs @@ -29,6 +29,7 @@ namespace WixToolset.Data Product = Package, /// Patch creation section type. + [Obsolete] PatchCreation, /// Patch section type. diff --git a/src/api/wix/WixToolset.Data/Symbols/ExternalFilesSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/ExternalFilesSymbol.cs index 87888f0b..4e91ec5b 100644 --- a/src/api/wix/WixToolset.Data/Symbols/ExternalFilesSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/ExternalFilesSymbol.cs @@ -2,10 +2,12 @@ namespace WixToolset.Data { + using System; using WixToolset.Data.Symbols; public static partial class SymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition ExternalFiles = new IntermediateSymbolDefinition( SymbolDefinitionType.ExternalFiles, new[] @@ -25,6 +27,9 @@ namespace WixToolset.Data namespace WixToolset.Data.Symbols { + using System; + + [Obsolete] public enum ExternalFilesSymbolFields { Family, @@ -37,6 +42,7 @@ namespace WixToolset.Data.Symbols Order, } + [Obsolete] public class ExternalFilesSymbol : IntermediateSymbol { public ExternalFilesSymbol() : base(SymbolDefinitions.ExternalFiles, null, null) @@ -97,4 +103,4 @@ namespace WixToolset.Data.Symbols set => this.Set((int)ExternalFilesSymbolFields.Order, value); } } -} \ No newline at end of file +} diff --git a/src/api/wix/WixToolset.Data/Symbols/FamilyFileRangesSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/FamilyFileRangesSymbol.cs index 84cd5b4b..f3400de0 100644 --- a/src/api/wix/WixToolset.Data/Symbols/FamilyFileRangesSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/FamilyFileRangesSymbol.cs @@ -2,10 +2,12 @@ namespace WixToolset.Data { + using System; using WixToolset.Data.Symbols; public static partial class SymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition FamilyFileRanges = new IntermediateSymbolDefinition( SymbolDefinitionType.FamilyFileRanges, new[] @@ -21,6 +23,9 @@ namespace WixToolset.Data namespace WixToolset.Data.Symbols { + using System; + + [Obsolete] public enum FamilyFileRangesSymbolFields { Family, @@ -29,6 +34,7 @@ namespace WixToolset.Data.Symbols RetainLengths, } + [Obsolete] public class FamilyFileRangesSymbol : IntermediateSymbol { public FamilyFileRangesSymbol() : base(SymbolDefinitions.FamilyFileRanges, null, null) @@ -65,4 +71,4 @@ namespace WixToolset.Data.Symbols set => this.Set((int)FamilyFileRangesSymbolFields.RetainLengths, value); } } -} \ No newline at end of file +} diff --git a/src/api/wix/WixToolset.Data/Symbols/ImageFamiliesSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/ImageFamiliesSymbol.cs index 090628ef..39ac8ea0 100644 --- a/src/api/wix/WixToolset.Data/Symbols/ImageFamiliesSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/ImageFamiliesSymbol.cs @@ -2,10 +2,12 @@ namespace WixToolset.Data { + using System; using WixToolset.Data.Symbols; public static partial class SymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition ImageFamilies = new IntermediateSymbolDefinition( SymbolDefinitionType.ImageFamilies, new[] @@ -23,6 +25,9 @@ namespace WixToolset.Data namespace WixToolset.Data.Symbols { + using System; + + [Obsolete] public enum ImageFamiliesSymbolFields { Family, @@ -33,6 +38,7 @@ namespace WixToolset.Data.Symbols VolumeLabel, } + [Obsolete] public class ImageFamiliesSymbol : IntermediateSymbol { public ImageFamiliesSymbol() : base(SymbolDefinitions.ImageFamilies, null, null) @@ -81,4 +87,4 @@ namespace WixToolset.Data.Symbols set => this.Set((int)ImageFamiliesSymbolFields.VolumeLabel, value); } } -} \ No newline at end of file +} diff --git a/src/api/wix/WixToolset.Data/Symbols/MsiPatchMetadataSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/MsiPatchMetadataSymbol.cs index 682adbca..599883dc 100644 --- a/src/api/wix/WixToolset.Data/Symbols/MsiPatchMetadataSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/MsiPatchMetadataSymbol.cs @@ -20,6 +20,8 @@ namespace WixToolset.Data namespace WixToolset.Data.Symbols { + using System; + public enum MsiPatchMetadataSymbolFields { Company, @@ -27,6 +29,33 @@ namespace WixToolset.Data.Symbols Value, } + /// + /// Values for the OptimizeCA MsiPatchMetdata property, which indicates whether custom actions can be skipped when applying the patch. + /// + [Flags] + public enum OptimizeCAFlags + { + /// + /// No custom actions are skipped. + /// + None = 0, + + /// + /// Skip property (type 51) and directory (type 35) assignment custom actions. + /// + SkipAssignment = 1, + + /// + /// Skip immediate custom actions that are not property or directory assignment custom actions. + /// + SkipImmediate = 2, + + /// + /// Skip custom actions that run within the script. + /// + SkipDeferred = 4 + } + public class MsiPatchMetadataSymbol : IntermediateSymbol { public MsiPatchMetadataSymbol() : base(SymbolDefinitions.MsiPatchMetadata, null, null) @@ -57,4 +86,4 @@ namespace WixToolset.Data.Symbols set => this.Set((int)MsiPatchMetadataSymbolFields.Value, value); } } -} \ No newline at end of file +} diff --git a/src/api/wix/WixToolset.Data/Symbols/PatchMetadataSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/PatchMetadataSymbol.cs index 201b8444..ec8b9a5e 100644 --- a/src/api/wix/WixToolset.Data/Symbols/PatchMetadataSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/PatchMetadataSymbol.cs @@ -2,10 +2,12 @@ namespace WixToolset.Data { + using System; using WixToolset.Data.Symbols; public static partial class SymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition PatchMetadata = new IntermediateSymbolDefinition( SymbolDefinitionType.PatchMetadata, new[] @@ -22,6 +24,7 @@ namespace WixToolset.Data.Symbols { using System; + [Obsolete] public enum PatchMetadataSymbolFields { Company, @@ -29,33 +32,7 @@ namespace WixToolset.Data.Symbols Value, } - /// - /// Values for the OptimizeCA MsiPatchMetdata property, which indicates whether custom actions can be skipped when applying the patch. - /// - [Flags] - public enum OptimizeCAFlags - { - /// - /// No custom actions are skipped. - /// - None = 0, - - /// - /// Skip property (type 51) and directory (type 35) assignment custom actions. - /// - SkipAssignment = 1, - - /// - /// Skip immediate custom actions that are not property or directory assignment custom actions. - /// - SkipImmediate = 2, - - /// - /// Skip custom actions that run within the script. - /// - SkipDeferred = 4 - } - + [Obsolete] public class PatchMetadataSymbol : IntermediateSymbol { public PatchMetadataSymbol() : base(SymbolDefinitions.PatchMetadata, null, null) diff --git a/src/api/wix/WixToolset.Data/Symbols/PatchPackageSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/PatchPackageSymbol.cs index 0efdfd25..2d8b3f81 100644 --- a/src/api/wix/WixToolset.Data/Symbols/PatchPackageSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/PatchPackageSymbol.cs @@ -49,4 +49,4 @@ namespace WixToolset.Data.Symbols set => this.Set((int)PatchPackageSymbolFields.MediaDiskIdRef, value); } } -} \ No newline at end of file +} diff --git a/src/api/wix/WixToolset.Data/Symbols/PatchSequenceSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/PatchSequenceSymbol.cs index a4cbca61..d769651f 100644 --- a/src/api/wix/WixToolset.Data/Symbols/PatchSequenceSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/PatchSequenceSymbol.cs @@ -2,10 +2,12 @@ namespace WixToolset.Data { + using System; using WixToolset.Data.Symbols; public static partial class SymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition PatchSequence = new IntermediateSymbolDefinition( SymbolDefinitionType.PatchSequence, new[] @@ -21,6 +23,9 @@ namespace WixToolset.Data namespace WixToolset.Data.Symbols { + using System; + + [Obsolete] public enum PatchSequenceSymbolFields { PatchFamily, @@ -29,6 +34,7 @@ namespace WixToolset.Data.Symbols Supersede, } + [Obsolete] public class PatchSequenceSymbol : IntermediateSymbol { public PatchSequenceSymbol() : base(SymbolDefinitions.PatchSequence, null, null) @@ -65,4 +71,4 @@ namespace WixToolset.Data.Symbols set => this.Set((int)PatchSequenceSymbolFields.Supersede, value); } } -} \ No newline at end of file +} diff --git a/src/api/wix/WixToolset.Data/Symbols/SymbolDefinitions.cs b/src/api/wix/WixToolset.Data/Symbols/SymbolDefinitions.cs index 64c1a2a5..ad4b2e11 100644 --- a/src/api/wix/WixToolset.Data/Symbols/SymbolDefinitions.cs +++ b/src/api/wix/WixToolset.Data/Symbols/SymbolDefinitions.cs @@ -4,6 +4,7 @@ namespace WixToolset.Data { using System; +#pragma warning disable CS0612 // includes some obsolete symbol definitions public enum SymbolDefinitionType { SummaryInformation, @@ -34,7 +35,9 @@ namespace WixToolset.Data Error, EventMapping, Extension, + [Obsolete] ExternalFiles, + [Obsolete] FamilyFileRanges, Feature, FeatureComponents, @@ -86,8 +89,10 @@ namespace WixToolset.Data ODBCSourceAttribute, ODBCTranslator, Patch, + [Obsolete] PatchMetadata, PatchPackage, + [Obsolete] PatchSequence, ProgId, Properties, @@ -106,14 +111,19 @@ namespace WixToolset.Data Shortcut, Signature, SoftwareIdentificationTag, + [Obsolete] TargetFilesOptionalData, + [Obsolete] TargetImages, TextStyle, TypeLib, UIText, Upgrade, + [Obsolete] UpgradedFilesOptionalData, + [Obsolete] UpgradedFilesToIgnore, + [Obsolete] UpgradedImages, Verb, WixAction, diff --git a/src/api/wix/WixToolset.Data/Symbols/TargetFilesOptionalDataSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/TargetFilesOptionalDataSymbol.cs index 66fdc30c..fe3800ff 100644 --- a/src/api/wix/WixToolset.Data/Symbols/TargetFilesOptionalDataSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/TargetFilesOptionalDataSymbol.cs @@ -2,10 +2,12 @@ namespace WixToolset.Data { + using System; using WixToolset.Data.Symbols; public static partial class SymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition TargetFilesOptionalData = new IntermediateSymbolDefinition( SymbolDefinitionType.TargetFilesOptionalData, new[] @@ -23,6 +25,9 @@ namespace WixToolset.Data namespace WixToolset.Data.Symbols { + using System; + + [Obsolete] public enum TargetFilesOptionalDataSymbolFields { Target, @@ -33,6 +38,7 @@ namespace WixToolset.Data.Symbols RetainOffsets, } + [Obsolete] public class TargetFilesOptionalDataSymbol : IntermediateSymbol { public TargetFilesOptionalDataSymbol() : base(SymbolDefinitions.TargetFilesOptionalData, null, null) @@ -81,4 +87,4 @@ namespace WixToolset.Data.Symbols set => this.Set((int)TargetFilesOptionalDataSymbolFields.RetainOffsets, value); } } -} \ No newline at end of file +} diff --git a/src/api/wix/WixToolset.Data/Symbols/TargetImagesSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/TargetImagesSymbol.cs index 4748b1f3..20b3ec5d 100644 --- a/src/api/wix/WixToolset.Data/Symbols/TargetImagesSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/TargetImagesSymbol.cs @@ -2,10 +2,12 @@ namespace WixToolset.Data { + using System; using WixToolset.Data.Symbols; public static partial class SymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition TargetImages = new IntermediateSymbolDefinition( SymbolDefinitionType.TargetImages, new[] @@ -24,6 +26,9 @@ namespace WixToolset.Data namespace WixToolset.Data.Symbols { + using System; + + [Obsolete] public enum TargetImagesSymbolFields { Target, @@ -35,6 +40,7 @@ namespace WixToolset.Data.Symbols IgnoreMissingSrcFiles, } + [Obsolete] public class TargetImagesSymbol : IntermediateSymbol { public TargetImagesSymbol() : base(SymbolDefinitions.TargetImages, null, null) @@ -89,4 +95,4 @@ namespace WixToolset.Data.Symbols set => this.Set((int)TargetImagesSymbolFields.IgnoreMissingSrcFiles, value); } } -} \ No newline at end of file +} diff --git a/src/api/wix/WixToolset.Data/Symbols/UpgradedFilesOptionalDataSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/UpgradedFilesOptionalDataSymbol.cs index 9e669ec3..8f2ccf00 100644 --- a/src/api/wix/WixToolset.Data/Symbols/UpgradedFilesOptionalDataSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/UpgradedFilesOptionalDataSymbol.cs @@ -2,10 +2,12 @@ namespace WixToolset.Data { + using System; using WixToolset.Data.Symbols; public static partial class SymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition UpgradedFilesOptionalData = new IntermediateSymbolDefinition( SymbolDefinitionType.UpgradedFilesOptionalData, new[] @@ -22,6 +24,9 @@ namespace WixToolset.Data namespace WixToolset.Data.Symbols { + using System; + + [Obsolete] public enum UpgradedFilesOptionalDataSymbolFields { Upgraded, @@ -31,6 +36,7 @@ namespace WixToolset.Data.Symbols IncludeWholeFile, } + [Obsolete] public class UpgradedFilesOptionalDataSymbol : IntermediateSymbol { public UpgradedFilesOptionalDataSymbol() : base(SymbolDefinitions.UpgradedFilesOptionalData, null, null) diff --git a/src/api/wix/WixToolset.Data/Symbols/UpgradedFilesToIgnoreSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/UpgradedFilesToIgnoreSymbol.cs index e21af6a2..1afcb980 100644 --- a/src/api/wix/WixToolset.Data/Symbols/UpgradedFilesToIgnoreSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/UpgradedFilesToIgnoreSymbol.cs @@ -2,10 +2,12 @@ namespace WixToolset.Data { + using System; using WixToolset.Data.Symbols; public static partial class SymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition UpgradedFilesToIgnore = new IntermediateSymbolDefinition( SymbolDefinitionType.UpgradedFilesToIgnore, new[] @@ -19,12 +21,16 @@ namespace WixToolset.Data namespace WixToolset.Data.Symbols { + using System; + + [Obsolete] public enum UpgradedFilesToIgnoreSymbolFields { Upgraded, FTK, } + [Obsolete] public class UpgradedFilesToIgnoreSymbol : IntermediateSymbol { public UpgradedFilesToIgnoreSymbol() : base(SymbolDefinitions.UpgradedFilesToIgnore, null, null) @@ -49,4 +55,4 @@ namespace WixToolset.Data.Symbols set => this.Set((int)UpgradedFilesToIgnoreSymbolFields.FTK, value); } } -} \ No newline at end of file +} diff --git a/src/api/wix/WixToolset.Data/Symbols/UpgradedImagesSymbol.cs b/src/api/wix/WixToolset.Data/Symbols/UpgradedImagesSymbol.cs index 28eae08a..438ca493 100644 --- a/src/api/wix/WixToolset.Data/Symbols/UpgradedImagesSymbol.cs +++ b/src/api/wix/WixToolset.Data/Symbols/UpgradedImagesSymbol.cs @@ -2,10 +2,12 @@ namespace WixToolset.Data { + using System; using WixToolset.Data.Symbols; public static partial class SymbolDefinitions { + [Obsolete] public static readonly IntermediateSymbolDefinition UpgradedImages = new IntermediateSymbolDefinition( SymbolDefinitionType.UpgradedImages, new[] @@ -22,6 +24,9 @@ namespace WixToolset.Data namespace WixToolset.Data.Symbols { + using System; + + [Obsolete] public enum UpgradedImagesSymbolFields { Upgraded, @@ -31,6 +36,7 @@ namespace WixToolset.Data.Symbols Family, } + [Obsolete] public class UpgradedImagesSymbol : IntermediateSymbol { public UpgradedImagesSymbol() : base(SymbolDefinitions.UpgradedImages, null, null) @@ -73,4 +79,4 @@ namespace WixToolset.Data.Symbols set => this.Set((int)UpgradedImagesSymbolFields.Family, value); } } -} \ No newline at end of file +} diff --git a/src/api/wix/WixToolset.Data/WarningMessages.cs b/src/api/wix/WixToolset.Data/WarningMessages.cs index 83d9dc51..67915620 100644 --- a/src/api/wix/WixToolset.Data/WarningMessages.cs +++ b/src/api/wix/WixToolset.Data/WarningMessages.cs @@ -167,11 +167,6 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.DeprecatedLongNameAttribute, "The {0}/@{1} attribute has been deprecated. Since WiX now has the ability to generate short file/directory names, the desired name should be specified in the {2} attribute instead. If the name specified in the {2} attribute is a short name, then WiX will not generate a short name. If the name specified in the {2} attribute is a long name and you want to manually specify the short name, please set the short name value in the {3} attribute.", elementName, longNameAttributeName, nameAttributeName, shortNameAttributeName); } - public static Message DeprecatedPatchSequenceTargetAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return Message(sourceLineNumbers, Ids.DeprecatedPatchSequenceTargetAttribute, "The {0}/@{1} attribute has been deprecated in favor of the more strongly-typed ProductCode or TargetImage attributes. Please use the ProductCode attribute for indicating the ProductCode of a patch family directly, or the TargetImage attribute to specify the TargetImage which in turn will retrieve the ProductCode of the patch family.", elementName, attributeName); - } - public static Message DeprecatedPreProcVariable(SourceLineNumber sourceLineNumbers, string oldName, string newName) { return Message(sourceLineNumbers, Ids.DeprecatedPreProcVariable, "The built-in preprocessor variable '{0}' is deprecated. Please correct your authoring to use the new '{1}' preprocessor variable instead.", oldName, newName); @@ -332,11 +327,6 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.IllegalColumnValue, "The {0}.{1} column's value, '{2}', is not a recognized legal value. This information will be left out of the decompiled output.", tableName, columnName, value); } - public static Message IllegalPatchCreationTable(SourceLineNumber sourceLineNumbers, string tableName) - { - return Message(sourceLineNumbers, Ids.IllegalPatchCreationTable, "The {0} table is not legal in a patch creation file. The information in this table will be left out of the decompiled output.", tableName); - } - public static Message IllegalRegistryKeyPath(SourceLineNumber sourceLineNumbers, string componentName, string registryId) { return Message(sourceLineNumbers, Ids.IllegalRegistryKeyPath, "Component '{0}' specifies an illegal registry keypath of '{1}'. Since this entry actually represents a registry key, not a registry value, it cannot be the keypath.", componentName, registryId); @@ -542,11 +532,6 @@ namespace WixToolset.Data return Message(sourceLineNumbers, Ids.SkippingMergeModuleTable, "The {0} table can only be represented in WiX for merge modules. The information in this table will be left out of the decompiled output.", tableName); } - public static Message SkippingPatchCreationTable(SourceLineNumber sourceLineNumbers, string tableName) - { - return Message(sourceLineNumbers, Ids.SkippingPatchCreationTable, "The {0} table can only be represented in WiX for patch creation files. The information in this table will be left out of the decompiled output.", tableName); - } - public static Message StandardDirectoryConflictInMergeModule(SourceLineNumber sourceLineNumbers, string directory, string standardDirectory) { return Message(sourceLineNumbers, Ids.StandardDirectoryConflictInMergeModule, "The Directory '{0}' starts with the same Id as the standard folder in Windows Installer '{1}'. A directory Id that begins with the same Id as a standard folder that is in an MSM may encounter a conflict when merging the MSM into an MSI. This may result in the contents of this merge module being installed to an unexpected location. To eliminate this warning, change your directory Id to not start with the same Id as any standard folders.", directory, standardDirectory); @@ -762,9 +747,7 @@ namespace WixToolset.Data IllegalActionInSequence = 1058, ExpectedForeignRow = 1059, DecompilingAsCustomTable = 1060, - IllegalPatchCreationTable = 1061, SkippingMergeModuleTable = 1062, - SkippingPatchCreationTable = 1063, UnrepresentableColumnValue = 1064, DeprecatedTable = 1065, PatchTable = 1066, @@ -782,7 +765,6 @@ namespace WixToolset.Data EmptyCabinet = 1079, DeprecatedRegistryElement = 1080, IllegalRegistryKeyPath = 1081, - DeprecatedPatchSequenceTargetAttribute = 1082, ProductIdAuthored = 1083, ImplicitMergeModulePrimaryFeature = 1084, DeprecatedIgnoreModularizationElement = 1085, diff --git a/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs b/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs index fbb38501..2f27e45d 100644 --- a/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs +++ b/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerData.cs @@ -214,9 +214,11 @@ namespace WixToolset.Data.WindowsInstaller case "Patch": output.Type = OutputType.Patch; break; +#pragma warning disable CS0612 // still supported backward compatiblity case "PatchCreation": output.Type = OutputType.PatchCreation; break; +#pragma warning restore CS0612 case "Package": case "Product": output.Type = OutputType.Package; diff --git a/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerTableDefinitions.cs b/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerTableDefinitions.cs index 9f0cdd96..96ae929d 100644 --- a/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerTableDefinitions.cs +++ b/src/api/wix/WixToolset.Data/WindowsInstaller/WindowsInstallerTableDefinitions.cs @@ -2,6 +2,7 @@ namespace WixToolset.Data.WindowsInstaller { + using System; using WixToolset.Data.WindowsInstaller.Rows; public static class WindowsInstallerTableDefinitions @@ -861,6 +862,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); + [Obsolete] public static readonly TableDefinition PatchMetadata = new TableDefinition( "PatchMetadata", SymbolDefinitions.PatchMetadata, @@ -908,6 +910,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); + [Obsolete] public static readonly TableDefinition PatchSequence = new TableDefinition( "PatchSequence", SymbolDefinitions.PatchSequence, @@ -1560,6 +1563,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); + [Obsolete] public static readonly TableDefinition ImageFamilies = new TableDefinition( "ImageFamilies", SymbolDefinitions.ImageFamilies, @@ -1575,6 +1579,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); + [Obsolete] public static readonly TableDefinition UpgradedImages = new TableDefinition( "UpgradedImages", SymbolDefinitions.UpgradedImages, @@ -1589,6 +1594,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); + [Obsolete] public static readonly TableDefinition UpgradedFilesToIgnore = new TableDefinition( "UpgradedFilesToIgnore", SymbolDefinitions.UpgradedFilesToIgnore, @@ -1600,6 +1606,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); + [Obsolete] public static readonly TableDefinition UpgradedFilesOptionalData = new TableDefinition( "UpgradedFiles_OptionalData", SymbolDefinitions.UpgradedFilesOptionalData, @@ -1614,6 +1621,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); + [Obsolete] public static readonly TableDefinition TargetImages = new TableDefinition( "TargetImages", SymbolDefinitions.TargetImages, @@ -1630,6 +1638,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); + [Obsolete] public static readonly TableDefinition TargetFilesOptionalData = new TableDefinition( "TargetFiles_OptionalData", SymbolDefinitions.TargetFilesOptionalData, @@ -1645,6 +1654,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); + [Obsolete] public static readonly TableDefinition FamilyFileRanges = new TableDefinition( "FamilyFileRanges", SymbolDefinitions.FamilyFileRanges, @@ -1658,6 +1668,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); + [Obsolete] public static readonly TableDefinition ExternalFiles = new TableDefinition( "ExternalFiles", SymbolDefinitions.ExternalFiles, @@ -1772,6 +1783,7 @@ namespace WixToolset.Data.WindowsInstaller symbolIdIsPrimaryKey: false ); +#pragma warning disable CS0612 // includes some obsolete table definitions public static readonly TableDefinition[] All = new[] { ActionText, @@ -1903,5 +1915,6 @@ namespace WixToolset.Data.WindowsInstaller WixDependencyProvider, WixDependencyRef, }; +#pragma warning restore CS0618 } } diff --git a/src/api/wix/WixToolset.Data/WindowsInstaller/Xsd/data.xsd b/src/api/wix/WixToolset.Data/WindowsInstaller/Xsd/data.xsd index 2ee214d8..c4109dc1 100644 --- a/src/api/wix/WixToolset.Data/WindowsInstaller/Xsd/data.xsd +++ b/src/api/wix/WixToolset.Data/WindowsInstaller/Xsd/data.xsd @@ -37,7 +37,6 @@ - diff --git a/src/api/wix/WixToolset.Data/WindowsInstaller/Xsd/objects.xsd b/src/api/wix/WixToolset.Data/WindowsInstaller/Xsd/objects.xsd index 84b59321..404290f1 100644 --- a/src/api/wix/WixToolset.Data/WindowsInstaller/Xsd/objects.xsd +++ b/src/api/wix/WixToolset.Data/WindowsInstaller/Xsd/objects.xsd @@ -121,7 +121,6 @@ - diff --git a/src/wix/WixToolset.Converters.Symbolizer/ConvertSymbols.cs b/src/wix/WixToolset.Converters.Symbolizer/ConvertSymbols.cs index 6e6f212d..bbf6e929 100644 --- a/src/wix/WixToolset.Converters.Symbolizer/ConvertSymbols.cs +++ b/src/wix/WixToolset.Converters.Symbolizer/ConvertSymbols.cs @@ -822,8 +822,6 @@ namespace WixToolset.Converters.Symbolizer return SectionType.Module; case Wix3.OutputType.Patch: return SectionType.Patch; - case Wix3.OutputType.PatchCreation: - return SectionType.PatchCreation; case Wix3.OutputType.Product: return SectionType.Package; case Wix3.OutputType.Transform: diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs b/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs index eb0c69c6..f2d70f2b 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/Bind/CreateWindowsInstallerDataFromIRCommand.cs @@ -1376,29 +1376,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.Data.EnsureTable(this.TableDefinitions["ModuleSignature"]); break; - case OutputType.PatchCreation: - var imageFamiliesCount = this.Data.Tables["ImageFamilies"]?.Rows.Count ?? 0; - var targetImagesCount = this.Data.Tables["TargetImages"]?.Rows.Count ?? 0; - var upgradedImagesCount = this.Data.Tables["UpgradedImages"]?.Rows.Count ?? 0; - - if (imageFamiliesCount < 1) - { - this.Messaging.Write(ErrorMessages.ExpectedRowInPatchCreationPackage("ImageFamilies")); - } - - if (targetImagesCount < 1) - { - this.Messaging.Write(ErrorMessages.ExpectedRowInPatchCreationPackage("TargetImages")); - } - - if (upgradedImagesCount < 1) - { - this.Messaging.Write(ErrorMessages.ExpectedRowInPatchCreationPackage("UpgradedImages")); - } - - this.Data.EnsureTable(this.TableDefinitions["Properties"]); - break; - case OutputType.Package: this.Data.EnsureTable(this.TableDefinitions["File"]); this.Data.EnsureTable(this.TableDefinitions["Media"]); @@ -1456,28 +1433,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind } break; - case OutputType.PatchCreation: - if (!table.Definition.Unreal && - "_SummaryInformation" != table.Name && - "ExternalFiles" != table.Name && - "FamilyFileRanges" != table.Name && - "ImageFamilies" != table.Name && - "PatchMetadata" != table.Name && - "PatchSequence" != table.Name && - "Properties" != table.Name && - "TargetFiles_OptionalData" != table.Name && - "TargetImages" != table.Name && - "UpgradedFiles_OptionalData" != table.Name && - "UpgradedFilesToIgnore" != table.Name && - "UpgradedImages" != table.Name) - { - foreach (var row in table.Rows) - { - this.Messaging.Write(ErrorMessages.UnexpectedTableInPatchCreationPackage(row.SourceLineNumbers, table.Name)); - } - } - break; - case OutputType.Patch: if (!table.Definition.Unreal && "_SummaryInformation" != table.Name && @@ -1607,8 +1562,6 @@ namespace WixToolset.Core.WindowsInstaller.Bind return OutputType.Module; case SectionType.Package: return OutputType.Package; - case SectionType.PatchCreation: - return OutputType.PatchCreation; case SectionType.Patch: return OutputType.Patch; diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs index 8699ca2c..8f23a886 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Decompiler.cs @@ -133,9 +133,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile case OutputType.Module: this.DecompilerHelper.RootElement = new XElement(Names.ModuleElement); break; - case OutputType.PatchCreation: - this.DecompilerHelper.RootElement = new XElement(Names.PatchCreationElement); - break; case OutputType.Package: this.DecompilerHelper.RootElement = new XElement(Names.PackageElement); break; @@ -571,31 +568,24 @@ namespace WixToolset.Core.WindowsInstaller.Decompile /// The collection of all tables. private void FinalizeDecompile(TableIndexedCollection tables) { - if (OutputType.PatchCreation == this.OutputType) - { - this.FinalizeFamilyFileRangesTable(tables); - } - else - { - this.FinalizeSummaryInformationStream(tables); - this.FinalizeCheckBoxTable(tables); - this.FinalizeComponentTable(tables); - this.FinalizeDialogTable(tables); - this.FinalizeDuplicateMoveFileTables(tables); - this.FinalizeFeatureComponentsTable(tables); - this.FinalizeFileTable(tables); - this.FinalizeMIMETable(tables); - this.FinalizeMsiLockPermissionsExTable(tables); - this.FinalizeLockPermissionsTable(tables); - this.FinalizeProgIdTable(tables); - this.FinalizePropertyTable(tables); - this.FinalizeRemoveFileTable(tables); - this.FinalizeSearchTables(tables); - this.FinalizeShortcutTable(tables); - this.FinalizeUpgradeTable(tables); - this.FinalizeSequenceTables(tables); - this.FinalizeVerbTable(tables); - } + this.FinalizeSummaryInformationStream(tables); + this.FinalizeCheckBoxTable(tables); + this.FinalizeComponentTable(tables); + this.FinalizeDialogTable(tables); + this.FinalizeDuplicateMoveFileTables(tables); + this.FinalizeFeatureComponentsTable(tables); + this.FinalizeFileTable(tables); + this.FinalizeMIMETable(tables); + this.FinalizeMsiLockPermissionsExTable(tables); + this.FinalizeLockPermissionsTable(tables); + this.FinalizeProgIdTable(tables); + this.FinalizePropertyTable(tables); + this.FinalizeRemoveFileTable(tables); + this.FinalizeSearchTables(tables); + this.FinalizeShortcutTable(tables); + this.FinalizeUpgradeTable(tables); + this.FinalizeSequenceTables(tables); + this.FinalizeVerbTable(tables); foreach (var extension in this.Extensions) { @@ -971,126 +961,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile } } - /// - /// Finalize the FamilyFileRanges table. - /// - /// The collection of all tables. - private void FinalizeFamilyFileRangesTable(TableIndexedCollection tables) - { - var familyFileRangesTable = tables["FamilyFileRanges"]; - if (null != familyFileRangesTable) - { - foreach (var row in familyFileRangesTable.Rows) - { - var xProtectRange = new XElement(Names.ProtectRangeElement); - - if (!row.IsColumnNull(2) && !row.IsColumnNull(3)) - { - var retainOffsets = row.FieldAsString(2).Split(','); - var retainLengths = row.FieldAsString(3).Split(','); - - if (retainOffsets.Length == retainLengths.Length) - { - for (var i = 0; i < retainOffsets.Length; i++) - { - if (retainOffsets[i].StartsWith("0x", StringComparison.Ordinal)) - { - xProtectRange.SetAttributeValue("Offset", Convert.ToInt32(retainOffsets[i].Substring(2), 16)); - } - else - { - xProtectRange.SetAttributeValue("Offset", Convert.ToInt32(retainOffsets[i], CultureInfo.InvariantCulture)); - } - - if (retainLengths[i].StartsWith("0x", StringComparison.Ordinal)) - { - xProtectRange.SetAttributeValue("Length", Convert.ToInt32(retainLengths[i].Substring(2), 16)); - } - else - { - xProtectRange.SetAttributeValue("Length", Convert.ToInt32(retainLengths[i], CultureInfo.InvariantCulture)); - } - } - } - else - { - // TODO: warn - } - } - else if (!row.IsColumnNull(2) || !row.IsColumnNull(3)) - { - // TODO: warn about mismatch between columns - } - - this.DecompilerHelper.IndexElement(row, xProtectRange); - } - } - - var usedProtectRanges = new HashSet(); - var externalFilesTable = tables["ExternalFiles"]; - if (null != externalFilesTable) - { - foreach (var row in externalFilesTable.Rows) - { - if (this.DecompilerHelper.TryGetIndexedElement(row, out var xExternalFile) - && this.DecompilerHelper.TryGetIndexedElement("FamilyFileRanges", row.FieldAsString(0), row.FieldAsString(0), out var xProtectRange)) - { - xExternalFile.Add(xProtectRange); - usedProtectRanges.Add(xProtectRange); - } - } - } - - var targetFiles_OptionalDataTable = tables["TargetFiles_OptionalData"]; - if (null != targetFiles_OptionalDataTable) - { - var targetImagesTable = tables["TargetImages"]; - var targetImageRows = targetImagesTable?.Rows.ToDictionary(row => row.FieldAsString(0)); - - var upgradedImagesTable = tables["UpgradedImages"]; - var upgradedImagesRows = upgradedImagesTable?.Rows.ToDictionary(row => row.FieldAsString(0)); - - foreach (var row in targetFiles_OptionalDataTable.Rows) - { - var xTargetFile = this.PatchTargetFiles[row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter)]; - - if (!targetImageRows.TryGetValue(row.FieldAsString(0), out var targetImageRow)) - { - this.Messaging.Write(WarningMessages.ExpectedForeignRow(row.SourceLineNumbers, targetFiles_OptionalDataTable.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Target", row.FieldAsString(0), "TargetImages")); - continue; - } - - if (!upgradedImagesRows.TryGetValue(row.FieldAsString(3), out var upgradedImagesRow)) - { - this.Messaging.Write(WarningMessages.ExpectedForeignRow(targetImageRow.SourceLineNumbers, targetImageRow.Table.Name, targetImageRow.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Upgraded", row.FieldAsString(3), "UpgradedImages")); - continue; - } - - if (this.DecompilerHelper.TryGetIndexedElement("FamilyFileRanges", upgradedImagesRow.FieldAsString(4), row.FieldAsString(1), out var xProtectRange)) - { - xTargetFile.Add(xProtectRange); - usedProtectRanges.Add(xProtectRange); - } - } - } - - if (null != familyFileRangesTable) - { - foreach (var row in familyFileRangesTable.Rows) - { - var xProtectRange = this.DecompilerHelper.GetIndexedElement(row); - - if (!usedProtectRanges.Contains(xProtectRange)) - { - var xProtectFile = new XElement(Names.ProtectFileElement, new XAttribute("File", row.FieldAsString(1))); - xProtectFile.Add(xProtectRange); - - this.AddChildToParent("ImageFamilies", xProtectFile, row, 0); - } - } - } - } - /// /// Finalize the FeatureComponents table. /// @@ -2640,12 +2510,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile case "Extension": this.DecompileExtensionTable(table); break; - case "ExternalFiles": - this.DecompileExternalFilesTable(table); - break; - case "FamilyFileRanges": - // handled in FinalizeFamilyFileRangesTable - break; case "Feature": this.DecompileFeatureTable(table); break; @@ -2664,9 +2528,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile case "Icon": this.DecompileIconTable(table); break; - case "ImageFamilies": - this.DecompileImageFamiliesTable(table); - break; case "IniFile": this.DecompileIniFileTable(table); break; @@ -2764,12 +2625,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile case "ODBCTranslator": this.DecompileODBCTranslatorTable(table); break; - case "PatchMetadata": - this.DecompilePatchMetadataTable(table); - break; - case "PatchSequence": - this.DecompilePatchSequenceTable(table); - break; case "ProgId": this.DecompileProgIdTable(table); break; @@ -2821,12 +2676,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile case "Signature": this.DecompileSignatureTable(table); break; - case "TargetFiles_OptionalData": - this.DecompileTargetFiles_OptionalDataTable(table); - break; - case "TargetImages": - this.DecompileTargetImagesTable(table); - break; case "TextStyle": this.DecompileTextStyleTable(table); break; @@ -2836,15 +2685,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile case "Upgrade": this.DecompileUpgradeTable(table); break; - case "UpgradedFiles_OptionalData": - this.DecompileUpgradedFiles_OptionalDataTable(table); - break; - case "UpgradedFilesToIgnore": - this.DecompileUpgradedFilesToIgnoreTable(table); - break; - case "UpgradedImages": - this.DecompileUpgradedImagesTable(table); - break; case "UIText": this.DecompileUITextTable(table); break; @@ -2924,15 +2764,7 @@ namespace WixToolset.Core.WindowsInstaller.Decompile case "UpgradedFiles_OptionalData": case "UpgradedFilesToIgnore": case "UpgradedImages": - if (OutputType.PatchCreation != output.Type) - { - this.Messaging.Write(WarningMessages.SkippingPatchCreationTable(output.SourceLineNumbers, tableName)); - return false; - } - else - { - return true; - } + return false; case "MsiPatchHeaders": case "MsiPatchMetadata": case "MsiPatchOldAssemblyName": @@ -2948,16 +2780,8 @@ namespace WixToolset.Core.WindowsInstaller.Decompile case "MsiAssemblyName": case "MsiFileHash": return false; - default: // all other tables are allowed in any output except for a patch creation package - if (OutputType.PatchCreation == output.Type) - { - this.Messaging.Write(WarningMessages.IllegalPatchCreationTable(output.SourceLineNumbers, tableName)); - return false; - } - else - { - return true; - } + default: // all other tables are allowed in any output. + return true; } } @@ -4589,74 +4413,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile } } - /// - /// Decompile the ExternalFiles table. - /// - /// The table to decompile. - private void DecompileExternalFilesTable(Table table) - { - foreach (var row in table.Rows) - { - var xExternalFile = new XElement(Names.ExternalFileElement, - new XAttribute("File", row.FieldAsString(1)), - new XAttribute("Source", row.FieldAsString(2))); - - AddSymbolPaths(row, 3, xExternalFile); - - if (!row.IsColumnNull(4) && !row.IsColumnNull(5)) - { - var ignoreOffsets = row.FieldAsString(4).Split(','); - var ignoreLengths = row.FieldAsString(5).Split(','); - - if (ignoreOffsets.Length == ignoreLengths.Length) - { - for (var i = 0; i < ignoreOffsets.Length; i++) - { - var xIgnoreRange = new XElement(Names.IgnoreRangeElement); - - if (ignoreOffsets[i].StartsWith("0x", StringComparison.Ordinal)) - { - xIgnoreRange.SetAttributeValue("Offset", Convert.ToInt32(ignoreOffsets[i].Substring(2), 16)); - } - else - { - xIgnoreRange.SetAttributeValue("Offset", Convert.ToInt32(ignoreOffsets[i], CultureInfo.InvariantCulture)); - } - - if (ignoreLengths[i].StartsWith("0x", StringComparison.Ordinal)) - { - xIgnoreRange.SetAttributeValue("Length", Convert.ToInt32(ignoreLengths[i].Substring(2), 16)); - } - else - { - xIgnoreRange.SetAttributeValue("Length", Convert.ToInt32(ignoreLengths[i], CultureInfo.InvariantCulture)); - } - - xExternalFile.Add(xIgnoreRange); - } - } - else - { - // TODO: warn - } - } - else if (!row.IsColumnNull(4) || !row.IsColumnNull(5)) - { - // TODO: warn about mismatch between columns - } - - // the RetainOffsets column is handled in FinalizeFamilyFileRangesTable - - if (!row.IsColumnNull(7)) - { - xExternalFile.SetAttributeValue("Order", row.FieldAsInteger(7)); - } - - this.AddChildToParent("ImageFamilies", xExternalFile, row, 0); - this.DecompilerHelper.IndexElement(row, xExternalFile); - } - } - /// /// Decompile the Feature table. /// @@ -4887,27 +4643,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile } } - /// - /// Decompile the ImageFamilies table. - /// - /// The table to decompile. - private void DecompileImageFamiliesTable(Table table) - { - foreach (var row in table.Rows) - { - var family = new XElement(Names.FamilyElement, - new XAttribute("Name", row.FieldAsString(0)), - row.IsColumnNull(1) ? null : new XAttribute("MediaSrcProp", row.FieldAsString(1)), - row.IsColumnNull(2) ? null : new XAttribute("DiskId", row.FieldAsString(2)), - row.IsColumnNull(3) ? null : new XAttribute("SequenceStart", row.FieldAsString(3)), - row.IsColumnNull(4) ? null : new XAttribute("DiskPrompt", row.FieldAsString(4)), - row.IsColumnNull(5) ? null : new XAttribute("VolumeLabel", row.FieldAsString(5))); - - this.DecompilerHelper.AddElementToRoot(family); - this.DecompilerHelper.IndexElement(row, family); - } - } - /// /// Decompile the IniFile table. /// @@ -5874,156 +5609,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile } } - /// - /// Decompile the PatchMetadata table. - /// - /// The table to decompile. - private void DecompilePatchMetadataTable(Table table) - { - if (0 < table.Rows.Count) - { - var xPatchMetadata = new XElement(Names.PatchMetadataElement); - - foreach (var row in table.Rows) - { - var value = row.FieldAsString(2); - - switch (row.FieldAsString(1)) - { - case "AllowRemoval": - if ("1" == value) - { - xPatchMetadata.SetAttributeValue("AllowRemoval", "yes"); - } - break; - case "Classification": - if (null != value) - { - xPatchMetadata.SetAttributeValue("Classification", value); - } - break; - case "CreationTimeUTC": - if (null != value) - { - xPatchMetadata.SetAttributeValue("CreationTimeUTC", value); - } - break; - case "Description": - if (null != value) - { - xPatchMetadata.SetAttributeValue("Description", value); - } - break; - case "DisplayName": - if (null != value) - { - xPatchMetadata.SetAttributeValue("DisplayName", value); - } - break; - case "ManufacturerName": - if (null != value) - { - xPatchMetadata.SetAttributeValue("ManufacturerName", value); - } - break; - case "MinorUpdateTargetRTM": - if (null != value) - { - xPatchMetadata.SetAttributeValue("MinorUpdateTargetRTM", value); - } - break; - case "MoreInfoURL": - if (null != value) - { - xPatchMetadata.SetAttributeValue("MoreInfoURL", value); - } - break; - case "OptimizeCA": - var xOptimizeCustomActions = new XElement(Names.OptimizeCustomActionsElement); - var optimizeCA = Int32.Parse(value, CultureInfo.InvariantCulture); - if (0 != (Convert.ToInt32(OptimizeCAFlags.SkipAssignment) & optimizeCA)) - { - xOptimizeCustomActions.SetAttributeValue("SkipAssignment", "yes"); - } - - if (0 != (Convert.ToInt32(OptimizeCAFlags.SkipImmediate) & optimizeCA)) - { - xOptimizeCustomActions.SetAttributeValue("SkipImmediate", "yes"); - } - - if (0 != (Convert.ToInt32(OptimizeCAFlags.SkipDeferred) & optimizeCA)) - { - xOptimizeCustomActions.SetAttributeValue("SkipDeferred", "yes"); - } - - xPatchMetadata.Add(xOptimizeCustomActions); - break; - case "OptimizedInstallMode": - if ("1" == value) - { - xPatchMetadata.SetAttributeValue("OptimizedInstallMode", "yes"); - } - break; - case "TargetProductName": - if (null != value) - { - xPatchMetadata.SetAttributeValue("TargetProductName", value); - } - break; - default: - var xCustomProperty = new XElement(Names.CustomPropertyElement, - XAttributeIfNotNull("Company", row, 0), - XAttributeIfNotNull("Property", row, 1), - XAttributeIfNotNull("Value", row, 2)); - - xPatchMetadata.Add(xCustomProperty); - break; - } - } - - this.DecompilerHelper.AddElementToRoot(xPatchMetadata); - } - } - - /// - /// Decompile the PatchSequence table. - /// - /// The table to decompile. - private void DecompilePatchSequenceTable(Table table) - { - foreach (var row in table.Rows) - { - var patchSequence = new XElement(Names.PatchSequenceElement, - new XAttribute("PatchFamily", row.FieldAsString(0))); - - if (!row.IsColumnNull(1)) - { - try - { - var guid = new Guid(row.FieldAsString(1)); - - patchSequence.SetAttributeValue("ProductCode", row.FieldAsString(1)); - } - catch // non-guid value - { - patchSequence.SetAttributeValue("TargetImage", row.FieldAsString(1)); - } - } - - if (!row.IsColumnNull(2)) - { - patchSequence.SetAttributeValue("Sequence", row.FieldAsString(2)); - } - - if (!row.IsColumnNull(3) && 0x1 == row.FieldAsInteger(3)) - { - patchSequence.SetAttributeValue("Supersede", "yes"); - } - - this.DecompilerHelper.AddElementToRoot(patchSequence); - } - } - /// /// Decompile the ProgId table. /// @@ -7071,105 +6656,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile } } - /// - /// Decompile the TargetFiles_OptionalData table. - /// - /// The table to decompile. - private void DecompileTargetFiles_OptionalDataTable(Table table) - { - foreach (var row in table.Rows) - { - if (!this.PatchTargetFiles.TryGetValue(row.FieldAsString(0), out var xPatchTargetFile)) - { - xPatchTargetFile = new XElement(Names.TargetFileElement, - new XAttribute("Id", row.FieldAsString(1))); - - if (this.DecompilerHelper.TryGetIndexedElement("TargetImages", row.FieldAsString(0), out var xTargetImage)) - { - xTargetImage.Add(xPatchTargetFile); - } - else - { - this.Messaging.Write(WarningMessages.ExpectedForeignRow(row.SourceLineNumbers, table.Name, row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), "Target", row.FieldAsString(0), "TargetImages")); - } - - this.PatchTargetFiles.Add(row.GetPrimaryKey(DecompilerConstants.PrimaryKeyDelimiter), xPatchTargetFile); - } - - AddSymbolPaths(row, 2, xPatchTargetFile); - - if (!row.IsColumnNull(3) && !row.IsColumnNull(4)) - { - var ignoreOffsets = row.FieldAsString(3).Split(','); - var ignoreLengths = row.FieldAsString(4).Split(','); - - if (ignoreOffsets.Length == ignoreLengths.Length) - { - for (var i = 0; i < ignoreOffsets.Length; i++) - { - var xIgnoreRange = new XElement(Names.IgnoreRangeElement); - - if (ignoreOffsets[i].StartsWith("0x", StringComparison.Ordinal)) - { - xIgnoreRange.SetAttributeValue("Offset", Convert.ToInt32(ignoreOffsets[i].Substring(2), 16)); - } - else - { - xIgnoreRange.SetAttributeValue("Offset", Convert.ToInt32(ignoreOffsets[i], CultureInfo.InvariantCulture)); - } - - if (ignoreLengths[i].StartsWith("0x", StringComparison.Ordinal)) - { - xIgnoreRange.SetAttributeValue("Length", Convert.ToInt32(ignoreLengths[i].Substring(2), 16)); - } - else - { - xIgnoreRange.SetAttributeValue("Length", Convert.ToInt32(ignoreLengths[i], CultureInfo.InvariantCulture)); - } - - xPatchTargetFile.Add(xIgnoreRange); - } - } - else - { - // TODO: warn - } - } - else if (!row.IsColumnNull(3) || !row.IsColumnNull(4)) - { - // TODO: warn about mismatch between columns - } - - // the RetainOffsets column is handled in FinalizeFamilyFileRangesTable - } - } - - /// - /// Decompile the TargetImages table. - /// - /// The table to decompile. - private void DecompileTargetImagesTable(Table table) - { - foreach (var row in table.Rows) - { - var xTargetImage = new XElement(Names.TargetImageElement, - new XAttribute("Id", row.FieldAsString(0)), - new XAttribute("SourceFile", row.FieldAsString(1)), - new XAttribute("Order", row.FieldAsInteger(4)), - XAttributeIfNotNull("Validation", row, 5)); - - AddSymbolPaths(row, 2, xTargetImage); - - if (0 != row.FieldAsInteger(6)) - { - xTargetImage.SetAttributeValue("IgnoreMissingFiles", "yes"); - } - - this.AddChildToParent("UpgradedImages", xTargetImage, row, 3); - this.DecompilerHelper.IndexElement(row, xTargetImage); - } - } - /// /// Decompile the TextStyle table. /// @@ -7342,77 +6828,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile } } - /// - /// Decompile the UpgradedFiles_OptionalData table. - /// - /// The table to decompile. - private void DecompileUpgradedFiles_OptionalDataTable(Table table) - { - foreach (var row in table.Rows) - { - var xUpgradeFile = new XElement(Names.UpgradeFileElement, - new XAttribute("File", row.FieldAsString(1)), - new XAttribute("Ignore", "no")); - - AddSymbolPaths(row, 2, xUpgradeFile); - - if (!row.IsColumnNull(3) && 1 == row.FieldAsInteger(3)) - { - xUpgradeFile.SetAttributeValue("AllowIgnoreOnError", "yes"); - } - - if (!row.IsColumnNull(4) && 0 != row.FieldAsInteger(4)) - { - xUpgradeFile.SetAttributeValue("WholeFile", "yes"); - } - - this.AddChildToParent("UpgradedImages", xUpgradeFile, row, 0); - } - } - - /// - /// Decompile the UpgradedFilesToIgnore table. - /// - /// The table to decompile. - private void DecompileUpgradedFilesToIgnoreTable(Table table) - { - foreach (var row in table.Rows) - { - if ("*" != row.FieldAsString(0)) - { - var xUpgradeFile = new XElement(Names.UpgradeFileElement, - new XAttribute("File", row.FieldAsString(1)), - new XAttribute("Ignore", "yes")); - - this.AddChildToParent("UpgradedImages", xUpgradeFile, row, 0); - } - else - { - this.Messaging.Write(WarningMessages.UnrepresentableColumnValue(row.SourceLineNumbers, table.Name, row.Fields[0].Column.Name, row[0])); - } - } - } - - /// - /// Decompile the UpgradedImages table. - /// - /// The table to decompile. - private void DecompileUpgradedImagesTable(Table table) - { - foreach (var row in table.Rows) - { - var xUpgradeImage = new XElement(Names.UpgradeImageElement, - new XAttribute("Id", row.FieldAsString(0)), - new XAttribute("SourceFile", row.FieldAsString(1)), - XAttributeIfNotNull("SourcePatch", row, 2)); - - AddSymbolPaths(row, 3, xUpgradeImage); - - this.AddChildToParent("ImageFamilies", xUpgradeImage, row, 4); - this.DecompilerHelper.IndexElement(row, xUpgradeImage); - } - } - private static void AddSymbolPaths(Row row, int column, XElement xParent) { if (!row.IsColumnNull(column)) diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Names.cs b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Names.cs index e49c1df9..1738ae73 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Names.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/Decompile/Names.cs @@ -10,7 +10,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile public static readonly XName PackageElement = WxsNamespace + "Package"; public static readonly XName ModuleElement = WxsNamespace + "Module"; - public static readonly XName PatchCreationElement = WxsNamespace + "PatchCreation"; public static readonly XName SummaryInformationElement = WxsNamespace + "SummaryInformation"; @@ -27,9 +26,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile public static readonly XName PropertyElement = WxsNamespace + "Property"; - public static readonly XName ProtectRangeElement = WxsNamespace + "ProtectRange"; - public static readonly XName ProtectFileElement = WxsNamespace + "ProtectFile"; - public static readonly XName FileElement = WxsNamespace + "File"; public static readonly XName EnsureTableElement = WxsNamespace + "EnsureTable"; @@ -44,7 +40,7 @@ namespace WixToolset.Core.WindowsInstaller.Decompile public static readonly XName BillboardElement = WxsNamespace + "Billboard"; public static readonly XName BillboardActionElement = WxsNamespace + "BillboardAction"; - + public static readonly XName BinaryElement = WxsNamespace + "Binary"; public static readonly XName ClassElement = WxsNamespace + "Class"; @@ -115,8 +111,6 @@ namespace WixToolset.Core.WindowsInstaller.Decompile public static readonly XName ODBCTranslatorElement = WxsNamespace + "ODBCTranslator"; public static readonly XName PatchMetadataElement = WxsNamespace + "PatchMetadata"; public static readonly XName OptimizeCustomActionsElement = WxsNamespace + "OptimizeCustomActions"; - public static readonly XName CustomPropertyElement = WxsNamespace + "CustomProperty"; - public static readonly XName PatchSequenceElement = WxsNamespace + "PatchSequence"; public static readonly XName ProgIdElement = WxsNamespace + "ProgId"; public static readonly XName ReplacePatchElement = WxsNamespace + "ReplacePatch"; public static readonly XName TargetProductCodeElement = WxsNamespace + "TargetProductCode"; diff --git a/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs b/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs index 42e1a45d..21e99f46 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/WindowsInstallerBackendFactory.cs @@ -37,10 +37,6 @@ namespace WixToolset.Core.WindowsInstaller case ".msp": backend = new MspBackend(); return true; - - //case "patchcreation": - //case ".pcp": - // return new PatchCreationBackend(); } backend = null; diff --git a/src/wix/WixToolset.Core/CommandLine/BuildCommand.cs b/src/wix/WixToolset.Core/CommandLine/BuildCommand.cs index 73a1dd33..d45b9301 100644 --- a/src/wix/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/wix/WixToolset.Core/CommandLine/BuildCommand.cs @@ -450,8 +450,6 @@ namespace WixToolset.Core.CommandLine return ".msm"; case SectionType.Package: return ".msi"; - case SectionType.PatchCreation: - return ".pcp"; case SectionType.Patch: return ".msp"; case SectionType.Fragment: @@ -473,8 +471,6 @@ namespace WixToolset.Core.CommandLine return ".msm"; case OutputType.Patch: return ".msp"; - case OutputType.PatchCreation: - return ".pcp"; case OutputType.Package: return ".msi"; case OutputType.Transform: @@ -786,9 +782,6 @@ namespace WixToolset.Core.CommandLine case ".msp": return Data.OutputType.Patch; - case ".pcp": - return Data.OutputType.PatchCreation; - case "product": case "package": case ".msi": diff --git a/src/wix/WixToolset.Core/Compiler.cs b/src/wix/WixToolset.Core/Compiler.cs index e184e86c..9bcdca4a 100644 --- a/src/wix/WixToolset.Core/Compiler.cs +++ b/src/wix/WixToolset.Core/Compiler.cs @@ -220,7 +220,7 @@ namespace WixToolset.Core this.ParseModuleElement(child); break; case "PatchCreation": - this.ParsePatchCreationElement(child); + this.Core.Write(CompilerWarnings.PatchCreationDeprecated(sourceLineNumbers)); break; case "Package": this.ParsePackageElement(child); @@ -8037,89 +8037,6 @@ namespace WixToolset.Core return path; } - /// - /// Parses the All element under a PatchFamily. - /// - /// The element to parse. - private void ParseAllElement(XElement node) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - - // find unexpected attributes - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - this.Core.UnexpectedAttribute(node, attrib); - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - this.Core.ParseForExtensionElements(node); - - // Always warn when using the All element. - this.Core.Write(WarningMessages.AllChangesIncludedInPatch(sourceLineNumbers)); - - if (!this.Core.EncounteredError) - { - this.Core.AddSymbol(new WixPatchRefSymbol(sourceLineNumbers) - { - Table = "*", - PrimaryKeys = "*", - }); - } - } - - /// - /// Parses all reference elements under a PatchFamily. - /// - /// The element to parse. - /// Table that reference was made to. - private void ParsePatchChildRefElement(XElement node, string tableName) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - string id = null; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "Id": - id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == id) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); - } - - this.Core.ParseForExtensionElements(node); - - if (!this.Core.EncounteredError) - { - this.Core.AddSymbol(new WixPatchRefSymbol(sourceLineNumbers) - { - Table = tableName, - PrimaryKeys = id - }); - } - } - /// /// Parses a PatchBaseline element. /// @@ -8220,6 +8137,72 @@ namespace WixToolset.Core } } + /// + /// Parses a range element (ProtectRange, IgnoreRange, etc). + /// + /// The element to parse. + /// Reference to the offsets string. + /// Reference to the lengths string. + private void ParseRangeElement(XElement node, ref string offsets, ref string lengths) + { + var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); + string length = null; + string offset = null; + + foreach (var attrib in node.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Length": + length = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + break; + case "Offset": + offset = this.Core.GetAttributeValue(sourceLineNumbers, attrib); + break; + default: + this.Core.UnexpectedAttribute(node, attrib); + break; + } + } + else + { + this.Core.ParseExtensionAttribute(node, attrib); + } + } + + if (null == length) + { + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Length")); + } + + if (null == offset) + { + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Offset")); + } + + this.Core.ParseForExtensionElements(node); + + if (null != lengths) + { + lengths = String.Concat(lengths, ",", length); + } + else + { + lengths = length; + } + + if (null != offsets) + { + offsets = String.Concat(offsets, ",", offset); + } + else + { + offsets = offset; + } + } + /// /// Parses a Validate element. /// diff --git a/src/wix/WixToolset.Core/CompilerWarnings.cs b/src/wix/WixToolset.Core/CompilerWarnings.cs index 97d20ba6..6685f2b2 100644 --- a/src/wix/WixToolset.Core/CompilerWarnings.cs +++ b/src/wix/WixToolset.Core/CompilerWarnings.cs @@ -31,6 +31,11 @@ namespace WixToolset.Core return Message(sourceLineNumbers, Ids.DiscouragedVersionAttribute, "The Provides/@Version attribute should not be specified for MSI package {0}. The ProductVersion will be used by default.", id); } + public static Message PatchCreationDeprecated(SourceLineNumber sourceLineNumbers) + { + return Message(sourceLineNumbers, Ids.PatchCreationDeprecated, "The PatchCreation element is not supported in WiX v4 and later. Use the Patch element instead."); + } + public static Message PropertyRemoved(string name) { return Message(null, Ids.PropertyRemoved, "The property {0} was authored in the package with a value and will be removed. The property should not be authored.", name); @@ -72,6 +77,7 @@ namespace WixToolset.Core DefiningStandardDirectoryDeprecated = 5437, ReadonlyLogVariableTarget = 5438, // DO_NOT_REUSE ReservedBurnNamespaceWarning = 5439, + PatchCreationDeprecated = 5440, } // 5400-5499 and 6600-6699 were the ranges for Dependency and Tag which are now in Core between CompilerWarnings and CompilerErrors. } } diff --git a/src/wix/WixToolset.Core/Compiler_Patch.cs b/src/wix/WixToolset.Core/Compiler_Patch.cs index 43e1d2e9..e20737dd 100644 --- a/src/wix/WixToolset.Core/Compiler_Patch.cs +++ b/src/wix/WixToolset.Core/Compiler_Patch.cs @@ -565,6 +565,53 @@ namespace WixToolset.Core } } + /// + /// Parses all reference elements under a PatchFamily. + /// + /// The element to parse. + /// Table that reference was made to. + private void ParsePatchChildRefElement(XElement node, string tableName) + { + var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); + string id = null; + + foreach (var attrib in node.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) + { + switch (attrib.Name.LocalName) + { + case "Id": + id = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + break; + default: + this.Core.UnexpectedAttribute(node, attrib); + break; + } + } + else + { + this.Core.ParseExtensionAttribute(node, attrib); + } + } + + if (null == id) + { + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + } + + this.Core.ParseForExtensionElements(node); + + if (!this.Core.EncounteredError) + { + this.Core.AddSymbol(new WixPatchRefSymbol(sourceLineNumbers) + { + Table = tableName, + PrimaryKeys = id + }); + } + } + /// /// Parses a TargetProductCodes element. /// @@ -644,6 +691,42 @@ namespace WixToolset.Core } } + /// + /// Parses the All element under a PatchFamily. + /// + /// The element to parse. + private void ParseAllElement(XElement node) + { + var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); + + // find unexpected attributes + foreach (var attrib in node.Attributes()) + { + if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) + { + this.Core.UnexpectedAttribute(node, attrib); + } + else + { + this.Core.ParseExtensionAttribute(node, attrib); + } + } + + this.Core.ParseForExtensionElements(node); + + // Always warn when using the All element. + this.Core.Write(WarningMessages.AllChangesIncludedInPatch(sourceLineNumbers)); + + if (!this.Core.EncounteredError) + { + this.Core.AddSymbol(new WixPatchRefSymbol(sourceLineNumbers) + { + Table = "*", + PrimaryKeys = "*", + }); + } + } + private void AddMsiPatchMetadata(SourceLineNumber sourceLineNumbers, string company, string property, string value) { this.Core.AddSymbol(new MsiPatchMetadataSymbol(sourceLineNumbers, new Identifier(AccessModifier.Section, company, property)) diff --git a/src/wix/WixToolset.Core/Compiler_PatchCreation.cs b/src/wix/WixToolset.Core/Compiler_PatchCreation.cs deleted file mode 100644 index 81ae4121..00000000 --- a/src/wix/WixToolset.Core/Compiler_PatchCreation.cs +++ /dev/null @@ -1,1265 +0,0 @@ -// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. - -namespace WixToolset.Core -{ - using System; - using System.Collections.Generic; - using System.Globalization; - using System.Xml.Linq; - using WixToolset.Data; - using WixToolset.Data.Symbols; - using WixToolset.Extensibility; - - /// - /// Compiler of the WiX toolset. - /// - internal partial class Compiler : ICompiler - { - /// - /// Parses a patch creation element. - /// - /// The element to parse. - private void ParsePatchCreationElement(XElement node) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - var clean = true; // Default is to clean - var codepage = 0; - string outputPath = null; - var productMismatches = false; - var replaceGuids = String.Empty; - string sourceList = null; - string symbolFlags = null; - var targetProducts = String.Empty; - var versionMismatches = false; - var wholeFiles = false; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "Id": - this.activeName = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); - break; - case "AllowMajorVersionMismatches": - versionMismatches = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; - case "AllowProductCodeMismatches": - productMismatches = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; - case "CleanWorkingFolder": - clean = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; - case "Codepage": - codepage = this.Core.GetAttributeCodePageValue(sourceLineNumbers, attrib); - break; - case "OutputPath": - outputPath = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "SourceList": - sourceList = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "SymbolFlags": - symbolFlags = String.Format(CultureInfo.InvariantCulture, "0x{0:x8}", this.Core.GetAttributeLongValue(sourceLineNumbers, attrib, 0, UInt32.MaxValue)); - break; - case "WholeFilesOnly": - wholeFiles = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == this.activeName) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); - } - - this.Core.CreateActiveSection(this.activeName, SectionType.PatchCreation, this.Context.CompilationId); - - foreach (var child in node.Elements()) - { - if (CompilerCore.WixNamespace == child.Name.Namespace) - { - switch (child.Name.LocalName) - { - case "Family": - this.ParseFamilyElement(child); - break; - case "PatchInformation": - this.ParsePatchInformationElement(child); - break; - case "PatchMetadata": - this.ParsePatchMetadataElement(child); - break; - case "PatchProperty": - this.ParsePatchPropertyElement(child, false); - break; - case "PatchSequence": - this.ParsePatchSequenceElement(child); - break; - case "ReplacePatch": - replaceGuids = String.Concat(replaceGuids, this.ParseReplacePatchElement(child)); - break; - case "TargetProductCode": - var targetProduct = this.ParseTargetProductCodeElement(child); - if (0 < targetProducts.Length) - { - targetProducts = String.Concat(targetProducts, ";"); - } - targetProducts = String.Concat(targetProducts, targetProduct); - break; - default: - this.Core.UnexpectedElement(node, child); - break; - } - } - else - { - this.Core.ParseExtensionElement(node, child); - } - } - - this.AddPrivateProperty(sourceLineNumbers, "PatchGUID", this.activeName); - this.AddPrivateProperty(sourceLineNumbers, "AllowProductCodeMismatches", productMismatches ? "1" : "0"); - this.AddPrivateProperty(sourceLineNumbers, "AllowProductVersionMajorMismatches", versionMismatches ? "1" : "0"); - this.AddPrivateProperty(sourceLineNumbers, "DontRemoveTempFolderWhenFinished", clean ? "0" : "1"); - this.AddPrivateProperty(sourceLineNumbers, "IncludeWholeFilesOnly", wholeFiles ? "1" : "0"); - - if (null != symbolFlags) - { - this.AddPrivateProperty(sourceLineNumbers, "ApiPatchingSymbolFlags", symbolFlags); - } - - if (0 < replaceGuids.Length) - { - this.AddPrivateProperty(sourceLineNumbers, "ListOfPatchGUIDsToReplace", replaceGuids); - } - - if (0 < targetProducts.Length) - { - this.AddPrivateProperty(sourceLineNumbers, "ListOfTargetProductCodes", targetProducts); - } - - if (null != outputPath) - { - this.AddPrivateProperty(sourceLineNumbers, "PatchOutputPath", outputPath); - } - - if (null != sourceList) - { - this.AddPrivateProperty(sourceLineNumbers, "PatchSourceList", sourceList); - } - } - - /// - /// Parses a family element. - /// - /// The element to parse. - private void ParseFamilyElement(XElement node) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - var diskId = CompilerConstants.IntegerNotSet; - string diskPrompt = null; - string mediaSrcProp = null; - string name = null; - var sequenceStart = CompilerConstants.IntegerNotSet; - string volumeLabel = null; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "DiskId": - diskId = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int16.MaxValue); - break; - case "DiskPrompt": - diskPrompt = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "MediaSrcProp": - mediaSrcProp = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "Name": - name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "SequenceStart": - sequenceStart = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, Int32.MaxValue); - break; - case "VolumeLabel": - volumeLabel = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == name) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); - } - else if (0 < name.Length) - { - if (8 < name.Length) // check the length - { - this.Core.Write(ErrorMessages.FamilyNameTooLong(sourceLineNumbers, node.Name.LocalName, "Name", name, name.Length)); - } - else // check for illegal characters - { - foreach (var character in name) - { - if (!Char.IsLetterOrDigit(character) && '_' != character) - { - this.Core.Write(ErrorMessages.IllegalFamilyName(sourceLineNumbers, node.Name.LocalName, "Name", name)); - } - } - } - } - - foreach (var child in node.Elements()) - { - if (CompilerCore.WixNamespace == child.Name.Namespace) - { - switch (child.Name.LocalName) - { - case "UpgradeImage": - this.ParseUpgradeImageElement(child, name); - break; - case "ExternalFile": - this.ParseExternalFileElement(child, name); - break; - case "ProtectFile": - this.ParseProtectFileElement(child, name); - break; - default: - this.Core.UnexpectedElement(node, child); - break; - } - } - else - { - this.Core.ParseExtensionElement(node, child); - } - } - - if (!this.Core.EncounteredError) - { - var symbol = this.Core.AddSymbol(new ImageFamiliesSymbol(sourceLineNumbers) - { - Family = name, - MediaSrcPropName = mediaSrcProp, - DiskPrompt = diskPrompt, - VolumeLabel = volumeLabel - }); - - if (CompilerConstants.IntegerNotSet != diskId) - { - symbol.MediaDiskId = diskId; - } - - if (CompilerConstants.IntegerNotSet != sequenceStart) - { - symbol.FileSequenceStart = sequenceStart; - } - } - } - - /// - /// Parses an upgrade image element. - /// - /// The element to parse. - /// The family for this element. - private void ParseUpgradeImageElement(XElement node, string family) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - string sourceFile = null; - string sourcePatch = null; - var symbols = new List(); - string upgrade = null; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "Id": - upgrade = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - if (13 < upgrade.Length) - { - this.Core.Write(ErrorMessages.IdentifierTooLongError(sourceLineNumbers, node.Name.LocalName, "Id", upgrade, 13)); - } - break; - case "SourceFile": - sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "SourcePatch": - sourcePatch = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == upgrade) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); - } - - if (null == sourceFile) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); - } - - foreach (var child in node.Elements()) - { - if (CompilerCore.WixNamespace == child.Name.Namespace) - { - switch (child.Name.LocalName) - { - case "SymbolPath": - symbols.Add(this.ParseSymbolPathElement(child)); - break; - case "TargetImage": - this.ParseTargetImageElement(child, upgrade, family); - break; - case "UpgradeFile": - this.ParseUpgradeFileElement(child, upgrade); - break; - default: - this.Core.UnexpectedElement(node, child); - break; - } - } - else - { - this.Core.ParseExtensionElement(node, child); - } - } - - if (!this.Core.EncounteredError) - { - this.Core.AddSymbol(new UpgradedImagesSymbol(sourceLineNumbers) - { - Upgraded = upgrade, - MsiPath = sourceFile, - PatchMsiPath = sourcePatch, - SymbolPaths = String.Join(";", symbols), - Family = family - }); - } - } - - /// - /// Parses an upgrade file element. - /// - /// The element to parse. - /// The upgrade key for this element. - private void ParseUpgradeFileElement(XElement node, string upgrade) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - var allowIgnoreOnError = false; - string file = null; - var ignore = false; - var symbols = new List(); - var wholeFile = false; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "AllowIgnoreOnError": - allowIgnoreOnError = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; - case "File": - file = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "Ignore": - ignore = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; - case "WholeFile": - wholeFile = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == file) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "File")); - } - - foreach (var child in node.Elements()) - { - if (CompilerCore.WixNamespace == child.Name.Namespace) - { - switch (child.Name.LocalName) - { - case "SymbolPath": - symbols.Add(this.ParseSymbolPathElement(child)); - break; - default: - this.Core.UnexpectedElement(node, child); - break; - } - } - else - { - this.Core.ParseExtensionElement(node, child); - } - } - - if (!this.Core.EncounteredError) - { - if (ignore) - { - this.Core.AddSymbol(new UpgradedFilesToIgnoreSymbol(sourceLineNumbers) - { - Upgraded = upgrade, - FTK = file - }); - } - else - { - this.Core.AddSymbol(new UpgradedFilesOptionalDataSymbol(sourceLineNumbers) - { - Upgraded = upgrade, - FTK = file, - SymbolPaths = String.Join(";", symbols), - AllowIgnoreOnPatchError = allowIgnoreOnError, - IncludeWholeFile = wholeFile - }); - } - } - } - - /// - /// Parses a target image element. - /// - /// The element to parse. - /// The upgrade key for this element. - /// The family key for this element. - private void ParseTargetImageElement(XElement node, string upgrade, string family) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - var ignore = false; - var order = CompilerConstants.IntegerNotSet; - string sourceFile = null; - string symbols = null; - string target = null; - string validation = null; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "Id": - target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - if (target.Length > 13) - { - this.Core.Write(ErrorMessages.IdentifierTooLongError(sourceLineNumbers, node.Name.LocalName, "Id", target, 13)); - } - break; - case "IgnoreMissingFiles": - ignore = YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; - case "Order": - order = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, Int32.MinValue + 2, Int32.MaxValue); - break; - case "SourceFile": - sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "Validation": - validation = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == target) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); - } - - if (null == sourceFile) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); - } - - if (CompilerConstants.IntegerNotSet == order) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Order")); - } - - foreach (var child in node.Elements()) - { - if (CompilerCore.WixNamespace == child.Name.Namespace) - { - switch (child.Name.LocalName) - { - case "SymbolPath": - if (null != symbols) - { - symbols = String.Concat(symbols, ";", this.ParseSymbolPathElement(child)); - } - else - { - symbols = this.ParseSymbolPathElement(child); - } - break; - case "TargetFile": - this.ParseTargetFileElement(child, target, family); - break; - default: - this.Core.UnexpectedElement(node, child); - break; - } - } - else - { - this.Core.ParseExtensionElement(node, child); - } - } - - if (!this.Core.EncounteredError) - { - this.Core.AddSymbol(new TargetImagesSymbol(sourceLineNumbers) - { - Target = target, - MsiPath = sourceFile, - SymbolPaths = symbols, - Upgraded = upgrade, - Order = order, - ProductValidateFlags = validation, - IgnoreMissingSrcFiles = ignore - }); - } - } - - /// - /// Parses an upgrade file element. - /// - /// The element to parse. - /// The upgrade key for this element. - /// The family key for this element. - private void ParseTargetFileElement(XElement node, string target, string family) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - string file = null; - string ignoreLengths = null; - string ignoreOffsets = null; - string protectLengths = null; - string protectOffsets = null; - string symbols = null; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "Id": - file = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == file) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); - } - - foreach (var child in node.Elements()) - { - if (CompilerCore.WixNamespace == child.Name.Namespace) - { - switch (child.Name.LocalName) - { - case "IgnoreRange": - this.ParseRangeElement(child, ref ignoreOffsets, ref ignoreLengths); - break; - case "ProtectRange": - this.ParseRangeElement(child, ref protectOffsets, ref protectLengths); - break; - case "SymbolPath": - symbols = this.ParseSymbolPathElement(child); - break; - default: - this.Core.UnexpectedElement(node, child); - break; - } - } - else - { - this.Core.ParseExtensionElement(node, child); - } - } - - if (!this.Core.EncounteredError) - { - var symbol = this.Core.AddSymbol(new TargetFilesOptionalDataSymbol(sourceLineNumbers) - { - Target = target, - FTK = file, - SymbolPaths = symbols, - IgnoreOffsets = ignoreOffsets, - IgnoreLengths = ignoreLengths, - }); - - if (null != protectOffsets) - { - symbol.RetainOffsets = protectOffsets; - - this.Core.AddSymbol(new FamilyFileRangesSymbol(sourceLineNumbers) - { - Family = family, - FTK = file, - RetainOffsets = protectOffsets, - RetainLengths = protectLengths, - }); - } - } - } - - /// - /// Parses an external file element. - /// - /// The element to parse. - /// The family for this element. - private void ParseExternalFileElement(XElement node, string family) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - string file = null; - string ignoreLengths = null; - string ignoreOffsets = null; - var order = CompilerConstants.IntegerNotSet; - string protectLengths = null; - string protectOffsets = null; - string source = null; - string symbols = null; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "File": - file = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "Order": - order = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, Int32.MinValue + 2, Int32.MaxValue); - break; - case "Source": - source = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == file) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "File")); - } - - if (null == source) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Source")); - } - - if (CompilerConstants.IntegerNotSet == order) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Order")); - } - - foreach (var child in node.Elements()) - { - if (CompilerCore.WixNamespace == child.Name.Namespace) - { - switch (child.Name.LocalName) - { - case "IgnoreRange": - this.ParseRangeElement(child, ref ignoreOffsets, ref ignoreLengths); - break; - case "ProtectRange": - this.ParseRangeElement(child, ref protectOffsets, ref protectLengths); - break; - case "SymbolPath": - symbols = this.ParseSymbolPathElement(child); - break; - default: - this.Core.UnexpectedElement(node, child); - break; - } - } - else - { - this.Core.ParseExtensionElement(node, child); - } - } - - if (!this.Core.EncounteredError) - { - var symbol = this.Core.AddSymbol(new ExternalFilesSymbol(sourceLineNumbers) - { - Family = family, - FTK = file, - FilePath = source, - SymbolPaths = symbols, - IgnoreOffsets = ignoreOffsets, - IgnoreLengths = ignoreLengths, - }); - - if (null != protectOffsets) - { - symbol.RetainOffsets = protectOffsets; - } - - if (CompilerConstants.IntegerNotSet != order) - { - symbol.Order = order; - } - - if (null != protectOffsets) - { - this.Core.AddSymbol(new FamilyFileRangesSymbol(sourceLineNumbers) - { - Family = family, - FTK = file, - RetainOffsets = protectOffsets, - RetainLengths = protectLengths, - }); - } - } - } - - /// - /// Parses a protect file element. - /// - /// The element to parse. - /// The family for this element. - private void ParseProtectFileElement(XElement node, string family) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - string file = null; - string protectLengths = null; - string protectOffsets = null; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "File": - file = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == file) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "File")); - } - - foreach (var child in node.Elements()) - { - if (CompilerCore.WixNamespace == child.Name.Namespace) - { - switch (child.Name.LocalName) - { - case "ProtectRange": - this.ParseRangeElement(child, ref protectOffsets, ref protectLengths); - break; - default: - this.Core.UnexpectedElement(node, child); - break; - } - } - else - { - this.Core.ParseExtensionElement(node, child); - } - } - - if (null == protectOffsets || null == protectLengths) - { - this.Core.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "ProtectRange")); - } - - if (!this.Core.EncounteredError) - { - this.Core.AddSymbol(new FamilyFileRangesSymbol(sourceLineNumbers) - { - Family = family, - FTK = file, - RetainOffsets = protectOffsets, - RetainLengths = protectLengths - }); - } - } - - /// - /// Parses a range element (ProtectRange, IgnoreRange, etc). - /// - /// The element to parse. - /// Reference to the offsets string. - /// Reference to the lengths string. - private void ParseRangeElement(XElement node, ref string offsets, ref string lengths) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - string length = null; - string offset = null; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "Length": - length = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "Offset": - offset = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == length) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Length")); - } - - if (null == offset) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Offset")); - } - - this.Core.ParseForExtensionElements(node); - - if (null != lengths) - { - lengths = String.Concat(lengths, ",", length); - } - else - { - lengths = length; - } - - if (null != offsets) - { - offsets = String.Concat(offsets, ",", offset); - } - else - { - offsets = offset; - } - } - - /// - /// Parses a patch metadata element. - /// - /// Element to parse. - private void ParsePatchMetadataElement(XElement node) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - var allowRemoval = YesNoType.NotSet; - string classification = null; - string creationTimeUtc = null; - string description = null; - string displayName = null; - string manufacturerName = null; - string minorUpdateTargetRTM = null; - string moreInfoUrl = null; - var optimizeCA = CompilerConstants.IntegerNotSet; - var optimizedInstallMode = YesNoType.NotSet; - string targetProductName = null; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "AllowRemoval": - allowRemoval = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; - case "Classification": - classification = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "CreationTimeUTC": - creationTimeUtc = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "Description": - description = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "DisplayName": - displayName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "ManufacturerName": - manufacturerName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "MinorUpdateTargetRTM": - minorUpdateTargetRTM = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "MoreInfoURL": - moreInfoUrl = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "OptimizedInstallMode": - optimizedInstallMode = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); - break; - case "TargetProductName": - targetProductName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (YesNoType.NotSet == allowRemoval) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "AllowRemoval")); - } - - if (null == classification) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Classification")); - } - - if (null == description) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Description")); - } - - if (null == displayName) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisplayName")); - } - - if (null == manufacturerName) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ManufacturerName")); - } - - if (null == moreInfoUrl) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "MoreInfoURL")); - } - - if (null == targetProductName) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "TargetProductName")); - } - - foreach (var child in node.Elements()) - { - if (CompilerCore.WixNamespace == child.Name.Namespace) - { - switch (child.Name.LocalName) - { - case "CustomProperty": - this.ParseCustomPropertyElement(child); - break; - case "OptimizeCustomActions": - optimizeCA = this.ParseOptimizeCustomActionsElement(child); - break; - default: - this.Core.UnexpectedElement(node, child); - break; - } - } - else - { - this.Core.ParseExtensionElement(node, child); - } - } - - if (!this.Core.EncounteredError) - { - if (YesNoType.NotSet != allowRemoval) - { - this.AddPatchMetadata(sourceLineNumbers, null, "AllowRemoval", YesNoType.Yes == allowRemoval ? "1" : "0"); - } - - if (null != classification) - { - this.AddPatchMetadata(sourceLineNumbers, null, "Classification", classification); - } - - if (null != creationTimeUtc) - { - this.AddPatchMetadata(sourceLineNumbers, null, "CreationTimeUTC", creationTimeUtc); - } - - if (null != description) - { - this.AddPatchMetadata(sourceLineNumbers, null, "Description", description); - } - - if (null != displayName) - { - this.AddPatchMetadata(sourceLineNumbers, null, "DisplayName", displayName); - } - - if (null != manufacturerName) - { - this.AddPatchMetadata(sourceLineNumbers, null, "ManufacturerName", manufacturerName); - } - - if (null != minorUpdateTargetRTM) - { - this.AddPatchMetadata(sourceLineNumbers, null, "MinorUpdateTargetRTM", minorUpdateTargetRTM); - } - - if (null != moreInfoUrl) - { - this.AddPatchMetadata(sourceLineNumbers, null, "MoreInfoURL", moreInfoUrl); - } - - if (CompilerConstants.IntegerNotSet != optimizeCA) - { - this.AddPatchMetadata(sourceLineNumbers, null, "OptimizeCA", optimizeCA.ToString(CultureInfo.InvariantCulture)); - } - - if (YesNoType.NotSet != optimizedInstallMode) - { - this.AddPatchMetadata(sourceLineNumbers, null, "OptimizedInstallMode", YesNoType.Yes == optimizedInstallMode ? "1" : "0"); - } - - if (null != targetProductName) - { - this.AddPatchMetadata(sourceLineNumbers, null, "TargetProductName", targetProductName); - } - } - } - - /// - /// Parses a custom property element for the PatchMetadata table. - /// - /// Element to parse. - private void ParseCustomPropertyElement(XElement node) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - string company = null; - string property = null; - string value = null; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "Company": - company = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "Property": - property = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "Value": - value = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == company) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Company")); - } - - if (null == property) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); - } - - if (null == value) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); - } - - this.Core.ParseForExtensionElements(node); - - if (!this.Core.EncounteredError) - { - this.AddPatchMetadata(sourceLineNumbers, company, property, value); - } - } - - /// - /// Parses a patch sequence element. - /// - /// The element to parse. - private void ParsePatchSequenceElement(XElement node) - { - var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - string family = null; - string target = null; - string sequence = null; - var attributes = 0; - - foreach (var attrib in node.Attributes()) - { - if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || CompilerCore.WixNamespace == attrib.Name.Namespace) - { - switch (attrib.Name.LocalName) - { - case "PatchFamily": - family = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); - break; - case "ProductCode": - if (null != target) - { - this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Target", "TargetImage")); - } - target = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); - break; - case "Target": - if (null != target) - { - this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "TargetImage", "ProductCode")); - } - this.Core.Write(WarningMessages.DeprecatedPatchSequenceTargetAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); - target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - break; - case "TargetImage": - if (null != target) - { - this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Target", "ProductCode")); - } - target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - this.Core.CreateSimpleReference(sourceLineNumbers, SymbolDefinitions.TargetImages, target); - break; - case "Sequence": - sequence = this.Core.GetAttributeVersionValue(sourceLineNumbers, attrib); - break; - case "Supersede": - if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) - { - attributes |= 0x1; - } - break; - default: - this.Core.UnexpectedAttribute(node, attrib); - break; - } - } - else - { - this.Core.ParseExtensionAttribute(node, attrib); - } - } - - if (null == family) - { - this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "PatchFamily")); - } - - this.Core.ParseForExtensionElements(node); - - if (!this.Core.EncounteredError) - { - this.Core.AddSymbol(new PatchSequenceSymbol(sourceLineNumbers) - { - PatchFamily = family, - Target = target, - Sequence = sequence, - Supersede = attributes, - }); - } - } - - private void AddPatchMetadata(SourceLineNumber sourceLineNumbers, string company, string property, string value) - { - this.Core.AddSymbol(new PatchMetadataSymbol(sourceLineNumbers, new Identifier(AccessModifier.Section, company, property)) - { - Company = company, - Property = property, - Value = value, - }); - } - } -} diff --git a/src/wix/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs b/src/wix/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs index 8eaac27d..ddf446d4 100644 --- a/src/wix/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs +++ b/src/wix/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs @@ -64,7 +64,7 @@ namespace WixToolset.Core.Link foreach (var section in this.Sections) { // Try to find the one and only entry section. - if (SectionType.Package == section.Type || SectionType.Module == section.Type || SectionType.PatchCreation == section.Type || SectionType.Patch == section.Type || SectionType.Bundle == section.Type) + if (SectionType.Package == section.Type || SectionType.Module == section.Type || SectionType.Patch == section.Type || SectionType.Bundle == section.Type) { if (SectionType.Unknown != expectedEntrySectionType && section.Type != expectedEntrySectionType) { diff --git a/src/wix/WixToolset.Sdk/tools/wix.targets b/src/wix/WixToolset.Sdk/tools/wix.targets index 59b7d85f..a9c54269 100644 --- a/src/wix/WixToolset.Sdk/tools/wix.targets +++ b/src/wix/WixToolset.Sdk/tools/wix.targets @@ -91,7 +91,6 @@ .msi .msm .msp - .pcp .wixlib .exe .wixipl @@ -479,7 +478,7 @@ --> + Condition=" '$(OutputType)' == 'Package' or '$(OutputType)' == 'Module' "> diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs index e42c7810..e25a69b2 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/LinkerFixture.cs @@ -136,7 +136,7 @@ namespace WixToolsetTest.CoreIntegration } catch (WixException we) { - WixAssert.StringEqual("Could not find entry section in provided list of intermediates. Supported entry section types are: Package, Bundle, Patch, PatchCreation, Module.", we.Message); + WixAssert.StringEqual("Could not find entry section in provided list of intermediates. Supported entry section types are: Package, Bundle, Patch, Module.", we.Message); return; } @@ -166,7 +166,7 @@ namespace WixToolsetTest.CoreIntegration } catch (WixException we) { - WixAssert.StringEqual("Could not find entry section in provided list of intermediates. Supported entry section types are: Package, Bundle, Patch, PatchCreation, Module.", we.Message); + WixAssert.StringEqual("Could not find entry section in provided list of intermediates. Supported entry section types are: Package, Bundle, Patch, Module.", we.Message); return; } diff --git a/src/xsd/wix.xsd b/src/xsd/wix.xsd index 05de58c6..b8e69f29 100644 --- a/src/xsd/wix.xsd +++ b/src/xsd/wix.xsd @@ -34,7 +34,6 @@ - @@ -3384,77 +3383,6 @@ - - - - - The PatchCreation element is analogous to the main function in a C program. When linking, only one PatchCreation section - can be given to the linker to produce a successful result. Using this element creates a pcp file. - - - - You can specify any valid Windows code by by integer like 1252, or by web name like Windows-1252. See [Code pages](../../../tools/codepage/) for more information. - - - - - - - - - - - - - - - - - - PatchCreation identifier; this is the primary key for identifying patches. - - - - - Use this to set whether the major versions between the upgrade and target images match. See AllowProductVersionMajorMismatches for more information. - - - - - Use this to set whether the product code between the upgrade and target images match. See AllowProductCodeMismatches for more information. - - - - - Use this to set whether Patchwiz should clean the temp folder when finished. See DontRemoveTempFolderWhenFinished for more information. - - - - - The code page integer value or web name for the resulting PCP. See remarks for more information. - - - - - The full path, including file name, of the patch package file that is to be generated. See PatchOutputPath for more information. - - - - - Used to locate the .msp file for the patch if the cached copy is unavailable. See PatchSourceList for more information. - - - - - An 8-digit hex integer representing the combination of patch symbol usage flags to use when creating a binary file patch. See ApiPatchingSymbolFlags for more information. - - - - - Use this to set whether changing files should be included in their entirety. See IncludeWholeFilesOnly for more information. - - - @@ -3537,123 +3465,6 @@ - - - Properties about the patch to be placed in the PatchMetadata table. - - - - - - - - - - A custom property that extends the standard set. - - - - - Indicates whether custom actions can be skipped when applying the patch. - - - - - - - Whether this is an uninstallable patch. - - - - - Category of updates. Recommended values are Critical Update, Hotfix, Security Rollup, Security Update, Service Pack, Update, Update Rollup. - - - - - Creation time of the .msp file in the form mm-dd-yy HH:MM (month-day-year hour:minute). - - - - - Description of the patch. - - - - - A title for the patch that is suitable for public display. In Add/Remove Programs from XP SP2 on. - - - - - Name of the manufacturer. - - - - - - Indicates that the patch targets the RTM version of the product or the most recent major - upgrade patch. Author this optional property in minor update patches that contain sequencing - information to indicate that the patch removes all patches up to the RTM version of the - product, or up to the most recent major upgrade patch. This property is available beginning - with Windows Installer 3.1. - - - - - - A URL that provides information specific to this patch. In Add/Remove Programs from XP SP2 on. - - - - - - If this attribute is set to 'yes' in all the patches to be applied in a transaction, the - application of the patch is optimized if possible. Available beginning with Windows Installer 3.1. - - - - - - Name of the application or target product suite. - - - - - - - A custom property for the PatchMetadata table. - - - - - The name of the company. - - - - - The name of the metadata property. - - - - - Value of the metadata property. - - - - - - - A patch that is deprecated by this patch. - - - - - Patch GUID to be unregistered if it exists on the machine targeted by this patch. - - - - @@ -3674,12 +3485,11 @@ - A product code for a product that can accept the patch. - + A product code for a product that can accept the patch. + - When using the PatchCreation element, if the Id attribute value is '*' or this element is not authored, the product codes of all products referenced by the TargetImages element are used. - When using the Patch element, the Id attribute value must not be '*'. Use the TargetProductCodes/@Replace attribute instead. + The Id attribute value must not be '*'. Use the TargetProductCodes/@Replace attribute instead. @@ -3687,8 +3497,8 @@ - The product code for a product that can accept the patch. This can be '*'. See remarks for more information. - + The product code for a product that can accept the patch. This can be '*'. See remarks for more information. + @@ -3699,7 +3509,7 @@ - When authored under the Patch element, the PatchProperty defines entries in the MsiPatchMetadata table. + The PatchProperty defines entries in the MsiPatchMetadata table. @@ -3721,305 +3531,6 @@ - - - Sequence information for this patch database. Sequence information is generated automatically in most cases, and rarely needs to be set explicitly. - - - - - - - - Identifier which indicates a sequence family to which this patch belongs. - - - - - - Specifies the ProductCode of the product that this family applies to. - This attribute cannot the specified if the TargetImage attribute is specified. - - - - - - Used to populate the sequence column of the MsiPatchSequence table in the final MSP file. Specified in x.x.x.x format. See documentation for Sequence column of MsiPatchSequence table in MSI SDK. - - - - - - Set this value to 'yes' to indicate that this patch will supersede all previous patches in this patch family. - The default value is 'no'. - - - - - - - - - - - - - - Specifies the TargetImage that this family applies to. - This attribute cannot the specified if the ProductCode attribute is specified. - - - - - - - - Group of one or more upgraded images of a product. - - - - - - - - - - - - Entered into the DiskId field of the new Media table record. - - - - - Value to display in the "[1]" of the DiskPrompt Property. Using this attribute will require you to define a DiskPrompt Property. - - - - - Entered into the Source field of the new Media table entry of the upgraded image. - - - - - Identifier for the family. - - - - - Sequence number for the starting file. - - - - - Entered into the VolumeLabel field of the new Media table record. - - - - - - - Contains information about the upgraded images of the product. - - - - - - - - - - - - Identifier to connect target images with upgraded image. - - - - - Full path to location of msi file for upgraded image. - - - - - Modified copy of the upgraded installation database that contains additional authoring specific to patching. - - - - - - - Contains information about the target images of the product. - - - - - - - - - Identifier for the target image. - - - - - Full path to the location of the msi file for the target image. - - - - - Relative order of the target image. - - - - - Product checking to avoid applying irrelevant transforms. - - - - - Files missing from the target image are ignored by the installer. - - - - - - - Information about specific files in a target image. - - - - - - - - - - - - Foreign key into the File table. - - - - - - - Specifies part of a file that is to be ignored during patching. - - - - - Offset of the start of the range. - - - - - Length of the range. - - - - - - - Specifies part of a file that cannot be overwritten during patching. - - - - - Offset of the start of the range. - - - - - Length of the range. - - - - - - - Specifies a file to be protected. - - - - - - - - Foreign key into the File table. - - - - - - - Contains information about specific files that are not part of a regular target image. - - - - - - - - - - - - Foreign key into the File table. - - - - - Full path of the external file. - - - - - Specifies the order of the external files to use when creating the patch. - - - - - - - Specifies files to either ignore or to specify optional data about a file. - - - - - - - - Foreign key into the File table. - - - - - If yes, the file is ignored during patching, and the next two attributes are ignored. - - - - - Specifies whether patching this file is vital. - - - - - Whether the whole file should be installed, rather than creating a binary patch. - - - - - - - A path to symbols. - - - - - The path. - - - - @@ -4063,9 +3574,9 @@ - The MsiAssemblyName table specifies the schema for the elements of a strong assembly cache name for a .NET Framework or Win32 assembly. - Consider using the Assembly attribute on File element to have the toolset populate these entries automatically. - + The MsiAssemblyName table specifies the schema for the elements of a strong assembly cache name for a .NET Framework or Win32 assembly. + Consider using the Assembly attribute on File element to have the toolset populate these entries automatically. + -- cgit v1.2.3-55-g6feb