From 155a6e96346e0cb3d9ab6f5372fa29b46ebaee89 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Tue, 19 Dec 2017 12:25:40 -0800 Subject: Integrate simplified message handling --- src/WixToolset.BuildTasks/DoIt.cs | 65 +- src/WixToolset.BuildTasks/WixToolTask.cs | 2 - src/WixToolset.Core.Burn/Bundles/BurnCommon.cs | 21 +- src/WixToolset.Core.Burn/Bundles/BurnReader.cs | 9 +- src/WixToolset.Core.Burn/Bundles/BurnWriter.cs | 11 +- .../Inscribe/InscribeBundleCommand.cs | 2 +- .../Bind/AssignMediaCommand.cs | 21 +- .../Bind/BindDatabaseCommand.cs | 49 +- .../Bind/BindTransformCommand.cs | 15 +- .../Bind/CabinetBuilder.cs | 22 +- .../Bind/CabinetResolver.cs | 2 +- .../Bind/CalculateComponentGuids.cs | 16 +- .../Bind/CopyTransformDataCommand.cs | 11 +- .../Bind/CreateCabinetsCommand.cs | 41 +- .../Bind/CreateIdtFileCommand.cs | 10 +- .../Bind/ExtractMergeModuleFilesCommand.cs | 26 +- .../Bind/GenerateDatabaseCommand.cs | 18 +- .../Bind/MergeModulesCommand.cs | 37 +- .../Bind/ProcessUncompressedFilesCommand.cs | 2 +- .../Bind/SequenceActionsCommand.cs | 43 +- .../Bind/UpdateControlTextCommand.cs | 11 +- .../Bind/UpdateFileFacadesCommand.cs | 46 +- .../Data/Xsd/actions.xsd | 73 + .../Data/Xsd/tables.xsd | 248 ++ src/WixToolset.Core.WindowsInstaller/Differ.cs | 30 +- .../Inscribe/InscribeMsiPackageCommand.cs | 14 +- src/WixToolset.Core.WindowsInstaller/MelterCore.cs | 4 +- .../Msi/WixInvalidIdtException.cs | 4 +- src/WixToolset.Core.WindowsInstaller/Patch.cs | 9 - .../PatchTransform.cs | 11 +- .../Unbind/ExtractCabinetsCommand.cs | 2 +- .../Unbind/UnbindDatabaseCommand.cs | 9 +- .../Unbind/UnbindTranformCommand.cs | 7 +- .../UnbindContext.cs | 7 +- src/WixToolset.Core.WindowsInstaller/Unbinder.cs | 4 +- src/WixToolset.Core.WindowsInstaller/Validator.cs | 42 +- .../ValidatorExtension.cs | 36 +- .../WindowsInstallerStandardInternal.cs | 4 +- src/WixToolset.Core/AppCommon.cs | 102 - src/WixToolset.Core/BackendContext.cs | 16 - src/WixToolset.Core/Bind/FileResolver.cs | 2 +- .../Bind/ResolveDelayedFieldsCommand.cs | 10 +- src/WixToolset.Core/Bind/ResolveFieldsCommand.cs | 9 +- src/WixToolset.Core/Bind/TransferFilesCommand.cs | 26 +- src/WixToolset.Core/BindContext.cs | 2 +- src/WixToolset.Core/Binder.cs | 13 +- src/WixToolset.Core/BinderFileManagerCore.cs | 9 - src/WixToolset.Core/CommandLine/BuildCommand.cs | 59 +- src/WixToolset.Core/CommandLine/CommandLine.cs | 26 +- .../CommandLine/CommandLineContext.cs | 3 +- src/WixToolset.Core/CommandLine/CompileCommand.cs | 9 +- src/WixToolset.Core/Common.cs | 53 +- src/WixToolset.Core/CompileContext.cs | 3 +- src/WixToolset.Core/Compiler.cs | 1250 +++--- src/WixToolset.Core/CompilerCore.cs | 66 +- src/WixToolset.Core/Converter.cs | 11 +- .../Data/WixToolset.Core.Data.messages.resources | Bin 137688 -> 0 bytes .../Data/WixToolset.Core.WixStrings.resources | Bin 5655 -> 0 bytes src/WixToolset.Core/Data/messages.cs | 3106 --------------- src/WixToolset.Core/Data/messages.xml.old | 3998 -------------------- .../Exceptions/WixFileNotFoundException.cs | 52 - src/WixToolset.Core/Extensibility/HeatExtension.cs | 12 +- .../Extensibility/IHarvesterCore.cs | 18 +- src/WixToolset.Core/Extensibility/IHeatCore.cs | 14 - .../ExtensibilityServices/ExtensionManager.cs | 113 + .../ExtensibilityServices/Messaging.cs | 194 + .../ExtensibilityServices/ParseHelper.cs | 66 +- .../ExtensibilityServices/PreprocessHelper.cs | 38 +- src/WixToolset.Core/ExtensionManager.cs | 113 - src/WixToolset.Core/Harvester.cs | 2 +- src/WixToolset.Core/HarvesterCore.cs | 39 +- src/WixToolset.Core/HeatCore.cs | 21 +- src/WixToolset.Core/ICommand.cs | 9 - src/WixToolset.Core/IfDefEventHandler.cs | 46 - src/WixToolset.Core/IncludedFileEventHandler.cs | 52 - src/WixToolset.Core/IncribeContext.cs | 4 +- src/WixToolset.Core/Inscriber.cs | 7 +- src/WixToolset.Core/InspectorCore.cs | 32 - src/WixToolset.Core/Librarian.cs | 6 +- src/WixToolset.Core/LibraryContext.cs | 3 +- .../Link/FindEntrySectionAndLoadSymbolsCommand.cs | 14 +- .../Link/ReportConflictingSymbolsCommand.cs | 10 +- .../Link/ResolveReferencesCommand.cs | 18 +- src/WixToolset.Core/Link/WixGroupingOrdering.cs | 56 +- src/WixToolset.Core/LinkContext.cs | 2 +- src/WixToolset.Core/Linker.cs | 54 +- src/WixToolset.Core/Localizer.cs | 91 +- src/WixToolset.Core/Mutator.cs | 6 +- .../Preprocess/IfDefEventHandler.cs | 28 + .../Preprocess/IncludedFileEventHandler.cs | 43 + .../Preprocess/ProcessedStreamEventHandler.cs | 43 + .../Preprocess/ResolvedVariableEventHandler.cs | 25 + src/WixToolset.Core/PreprocessContext.cs | 3 +- src/WixToolset.Core/Preprocessor.cs | 72 +- src/WixToolset.Core/ProcessedStreamEventHandler.cs | 43 - .../ResolvedVariableEventHandler.cs | 39 - src/WixToolset.Core/SourceFile.cs | 2 - src/WixToolset.Core/Util.cs | 17 - src/WixToolset.Core/Uuid.cs | 9 +- src/WixToolset.Core/WixFileNotFoundException.cs | 44 + src/WixToolset.Core/WixGenericMessageEventArgs.cs | 45 - src/WixToolset.Core/WixStrings.Designer.cs | 250 +- src/WixToolset.Core/WixStrings.resx | 75 - src/WixToolset.Core/WixToolsetServiceProvider.cs | 6 + src/WixToolset.Core/WixVariableResolver.cs | 26 +- .../ExtensionFixture.cs | 4 +- .../ProgramFixture.cs | 16 +- src/wix/Program.cs | 70 +- 108 files changed, 2286 insertions(+), 9423 deletions(-) create mode 100644 src/WixToolset.Core.WindowsInstaller/Data/Xsd/actions.xsd create mode 100644 src/WixToolset.Core.WindowsInstaller/Data/Xsd/tables.xsd delete mode 100644 src/WixToolset.Core/BackendContext.cs delete mode 100644 src/WixToolset.Core/Data/WixToolset.Core.Data.messages.resources delete mode 100644 src/WixToolset.Core/Data/WixToolset.Core.WixStrings.resources delete mode 100644 src/WixToolset.Core/Data/messages.cs delete mode 100644 src/WixToolset.Core/Data/messages.xml.old delete mode 100644 src/WixToolset.Core/Exceptions/WixFileNotFoundException.cs create mode 100644 src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs create mode 100644 src/WixToolset.Core/ExtensibilityServices/Messaging.cs delete mode 100644 src/WixToolset.Core/ExtensionManager.cs delete mode 100644 src/WixToolset.Core/ICommand.cs delete mode 100644 src/WixToolset.Core/IfDefEventHandler.cs delete mode 100644 src/WixToolset.Core/IncludedFileEventHandler.cs delete mode 100644 src/WixToolset.Core/InspectorCore.cs create mode 100644 src/WixToolset.Core/Preprocess/IfDefEventHandler.cs create mode 100644 src/WixToolset.Core/Preprocess/IncludedFileEventHandler.cs create mode 100644 src/WixToolset.Core/Preprocess/ProcessedStreamEventHandler.cs create mode 100644 src/WixToolset.Core/Preprocess/ResolvedVariableEventHandler.cs delete mode 100644 src/WixToolset.Core/ProcessedStreamEventHandler.cs delete mode 100644 src/WixToolset.Core/ResolvedVariableEventHandler.cs delete mode 100644 src/WixToolset.Core/Util.cs create mode 100644 src/WixToolset.Core/WixFileNotFoundException.cs delete mode 100644 src/WixToolset.Core/WixGenericMessageEventArgs.cs diff --git a/src/WixToolset.BuildTasks/DoIt.cs b/src/WixToolset.BuildTasks/DoIt.cs index dddf433c..aabd92b5 100644 --- a/src/WixToolset.BuildTasks/DoIt.cs +++ b/src/WixToolset.BuildTasks/DoIt.cs @@ -9,6 +9,7 @@ namespace WixToolset.BuildTasks using Microsoft.Build.Utilities; using WixToolset.Core; using WixToolset.Data; + using WixToolset.Extensibility; using WixToolset.Extensibility.Services; /// @@ -16,11 +17,13 @@ namespace WixToolset.BuildTasks /// public sealed class DoIt : Task { - public DoIt() + public DoIt() : this(null) { - Messaging.Instance.InitializeAppName("WIX", "wix.exe"); + } - Messaging.Instance.Display += this.DisplayMessage; + public DoIt(IMessageListener listener) + { + this.Listener = listener ?? new MsbuildMessageListener(this.Log, "WIX", "wix.exe"); } public string AdditionalOptions { get; set; } @@ -112,6 +115,8 @@ namespace WixToolset.BuildTasks public string[] SuppressIces { get; set; } public string AdditionalCub { get; set; } + private IMessageListener Listener { get; } + public override bool Execute() { try @@ -168,7 +173,11 @@ namespace WixToolset.BuildTasks var serviceProvider = new WixToolsetServiceProvider(); var context = serviceProvider.GetService(); - context.Messaging = Messaging.Instance; + + var messaging = serviceProvider.GetService(); + messaging.SetListener(this.Listener); + + context.Messaging = messaging; context.ExtensionManager = this.CreateExtensionManagerWithStandardBackends(serviceProvider); context.Arguments = commandLineString; @@ -284,5 +293,53 @@ namespace WixToolset.BuildTasks // commandLineBuilder.AppendFileNamesIfNotNull(this.SourceFiles, " "); // } //} + + private class MsbuildMessageListener : IMessageListener + { + public MsbuildMessageListener(TaskLoggingHelper logger, string longName, string shortName) + { + this.Logger = logger; + this.LongAppName = longName; + this.ShortAppName = shortName; + } + + public string ShortAppName { get; } + + public string LongAppName { get; } + + private TaskLoggingHelper Logger { get; } + + public void Write(Message message) + { + switch (message.Level) + { + case MessageLevel.Error: + this.Logger.LogError(null, this.ShortAppName + message.Id.ToString(), null, message.SourceLineNumbers?.FileName ?? this.LongAppName, message.SourceLineNumbers?.LineNumber ?? 0, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs); + break; + + case MessageLevel.Warning: + this.Logger.LogWarning(null, this.ShortAppName + message.Id.ToString(), null, message.SourceLineNumbers?.FileName ?? this.LongAppName, message.SourceLineNumbers?.LineNumber ?? 0, 0, 0, 0, message.ResourceNameOrFormat, message.MessageArgs); + break; + + default: + // TODO: Revisit this because something is going horribly awry. The commented out LogMessage call is crashing saying that the "message" parameter is null. When you look at the call stack, the code + // is in the wrong LogMessage override and the "null" subcategory was passed in as the message. Not clear why it is picking the wrong overload. + //if (message.Id > 0) + //{ + // this.Logger.LogMessage(null, code, null, message.SourceLineNumber?.FileName, message.SourceLineNumber?.LineNumber ?? 0, 0, 0, 0, MessageImportance.Normal, message.Format, message.FormatData); + //} + //else + //{ + this.Logger.LogMessage(MessageImportance.Normal, message.ResourceNameOrFormat, message.MessageArgs); + //} + break; + } + } + + public void Write(string message) + { + this.Logger.LogMessage(MessageImportance.Low, message); + } + } } } diff --git a/src/WixToolset.BuildTasks/WixToolTask.cs b/src/WixToolset.BuildTasks/WixToolTask.cs index 2e5e8705..69c837c3 100644 --- a/src/WixToolset.BuildTasks/WixToolTask.cs +++ b/src/WixToolset.BuildTasks/WixToolTask.cs @@ -184,8 +184,6 @@ namespace WixToolset.BuildTasks this.messagesAvailable = new ManualResetEvent(false); this.toolExited = new ManualResetEvent(false); - Util.RunningInMsBuild = true; - WixToolTaskLogger logger = new WixToolTaskLogger(this.messageQueue, this.messagesAvailable); TextWriter saveConsoleOut = Console.Out; TextWriter saveConsoleError = Console.Error; diff --git a/src/WixToolset.Core.Burn/Bundles/BurnCommon.cs b/src/WixToolset.Core.Burn/Bundles/BurnCommon.cs index 0baa6094..df328eb6 100644 --- a/src/WixToolset.Core.Burn/Bundles/BurnCommon.cs +++ b/src/WixToolset.Core.Burn/Bundles/BurnCommon.cs @@ -6,6 +6,7 @@ namespace WixToolset.Core.Burn.Bundles using System.Diagnostics; using System.IO; using WixToolset.Data; + using WixToolset.Extensibility.Services; /// /// Common functionality for Burn PE Writer & Reader for the WiX toolset. @@ -77,7 +78,6 @@ namespace WixToolset.Core.Burn.Bundles protected const UInt32 BURN_SECTION_MAGIC = 0x00f14300; protected const UInt32 BURN_SECTION_VERSION = 0x00000002; - protected string fileExe; protected UInt32 peOffset = UInt32.MaxValue; protected UInt16 sections = UInt16.MaxValue; @@ -103,8 +103,9 @@ namespace WixToolset.Core.Burn.Bundles /// /// File to modify in-place. /// GUID for the bundle. - public BurnCommon(string fileExe) + public BurnCommon(IMessaging messaging, string fileExe) { + this.messaging = messaging; this.fileExe = fileExe; } @@ -123,6 +124,8 @@ namespace WixToolset.Core.Burn.Bundles public UInt32 AttachedContainerAddress { get; protected set; } public UInt32 AttachedContainerSize { get; protected set; } + protected IMessaging messaging { get; } + public void Dispose() { Dispose(true); @@ -176,21 +179,21 @@ namespace WixToolset.Core.Burn.Bundles uint32 = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_MAGIC); if (BURN_SECTION_MAGIC != uint32) { - Messaging.Instance.OnMessage(WixErrors.InvalidBundle(this.fileExe)); + this.messaging.Write(ErrorMessages.InvalidBundle(this.fileExe)); return false; } this.Version = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_VERSION); if (BURN_SECTION_VERSION != this.Version) { - Messaging.Instance.OnMessage(WixErrors.BundleTooNew(this.fileExe, this.Version)); + this.messaging.Write(ErrorMessages.BundleTooNew(this.fileExe, this.Version)); return false; } uint32 = BurnCommon.ReadUInt32(bytes, BURN_SECTION_OFFSET_FORMAT); // We only know how to deal with CABs right now if (1 != uint32) { - Messaging.Instance.OnMessage(WixErrors.InvalidBundle(this.fileExe)); + this.messaging.Write(ErrorMessages.InvalidBundle(this.fileExe)); return false; } @@ -257,7 +260,7 @@ namespace WixToolset.Core.Burn.Bundles if (UInt32.MaxValue == wixburnSectionOffset) { - Messaging.Instance.OnMessage(WixErrors.StubMissingWixburnSection(this.fileExe)); + this.messaging.Write(ErrorMessages.StubMissingWixburnSection(this.fileExe)); return false; } @@ -265,7 +268,7 @@ namespace WixToolset.Core.Burn.Bundles // the smallest alignment (512 bytes), but just to be paranoid... if (BURN_SECTION_SIZE > BurnCommon.ReadUInt32(bytes, IMAGE_SECTION_HEADER_OFFSET_SIZEOFRAWDATA)) { - Messaging.Instance.OnMessage(WixErrors.StubWixburnSectionTooSmall(this.fileExe)); + this.messaging.Write(ErrorMessages.StubWixburnSectionTooSmall(this.fileExe)); return false; } @@ -294,7 +297,7 @@ namespace WixToolset.Core.Burn.Bundles // Verify the NT signature... if (IMAGE_NT_SIGNATURE != BurnCommon.ReadUInt32(bytes, IMAGE_NT_HEADER_OFFSET_SIGNATURE)) { - Messaging.Instance.OnMessage(WixErrors.InvalidStubExe(this.fileExe)); + this.messaging.Write(ErrorMessages.InvalidStubExe(this.fileExe)); return false; } @@ -329,7 +332,7 @@ namespace WixToolset.Core.Burn.Bundles // Verify the DOS 'MZ' signature. if (IMAGE_DOS_SIGNATURE != BurnCommon.ReadUInt16(bytes, IMAGE_DOS_HEADER_OFFSET_MAGIC)) { - Messaging.Instance.OnMessage(WixErrors.InvalidStubExe(this.fileExe)); + this.messaging.Write(ErrorMessages.InvalidStubExe(this.fileExe)); return false; } diff --git a/src/WixToolset.Core.Burn/Bundles/BurnReader.cs b/src/WixToolset.Core.Burn/Bundles/BurnReader.cs index 3b3076c4..b4e23623 100644 --- a/src/WixToolset.Core.Burn/Bundles/BurnReader.cs +++ b/src/WixToolset.Core.Burn/Bundles/BurnReader.cs @@ -8,6 +8,7 @@ namespace WixToolset.Core.Burn.Bundles using System.IO; using System.Xml; using WixToolset.Core.Native; + using WixToolset.Extensibility.Services; /// /// Burn PE reader for the WiX toolset. @@ -32,8 +33,8 @@ namespace WixToolset.Core.Burn.Bundles /// Creates a BurnReader for reading a PE file. /// /// File to read. - private BurnReader(string fileExe) - : base(fileExe) + private BurnReader(IMessaging messaging, string fileExe) + : base(messaging, fileExe) { this.attachedContainerPayloadNames = new List(); } @@ -59,9 +60,9 @@ namespace WixToolset.Core.Burn.Bundles /// /// Path to file. /// Burn reader. - public static BurnReader Open(string fileExe) + public static BurnReader Open(IMessaging messaging, string fileExe) { - BurnReader reader = new BurnReader(fileExe); + BurnReader reader = new BurnReader(messaging, fileExe); reader.binaryReader = new BinaryReader(File.Open(fileExe, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete)); if (!reader.Initialize(reader.binaryReader)) diff --git a/src/WixToolset.Core.Burn/Bundles/BurnWriter.cs b/src/WixToolset.Core.Burn/Bundles/BurnWriter.cs index e7365212..08eeaa15 100644 --- a/src/WixToolset.Core.Burn/Bundles/BurnWriter.cs +++ b/src/WixToolset.Core.Burn/Bundles/BurnWriter.cs @@ -6,6 +6,7 @@ namespace WixToolset.Core.Burn.Bundles using System.Diagnostics; using System.IO; using WixToolset.Data; + using WixToolset.Extensibility.Services; /// /// Burn PE writer for the WiX toolset. @@ -30,8 +31,8 @@ namespace WixToolset.Core.Burn.Bundles /// /// File to modify in-place. /// GUID for the bundle. - private BurnWriter(string fileExe) - : base(fileExe) + private BurnWriter(IMessaging messaging, string fileExe) + : base(messaging, fileExe) { } @@ -40,9 +41,9 @@ namespace WixToolset.Core.Burn.Bundles /// /// Path to file. /// Burn writer. - public static BurnWriter Open(string fileExe) + public static BurnWriter Open(IMessaging messaging, string fileExe) { - BurnWriter writer = new BurnWriter(fileExe); + BurnWriter writer = new BurnWriter(messaging, fileExe); using (BinaryReader binaryReader = new BinaryReader(File.Open(fileExe, FileMode.Open, FileAccess.Read, FileShare.Read | FileShare.Delete))) { @@ -76,7 +77,7 @@ namespace WixToolset.Core.Burn.Bundles this.WriteToBurnSectionOffset(BURN_SECTION_OFFSET_MAGIC, BURN_SECTION_MAGIC); this.WriteToBurnSectionOffset(BURN_SECTION_OFFSET_VERSION, BURN_SECTION_VERSION); - Messaging.Instance.OnMessage(WixVerboses.BundleGuid(bundleId.ToString("B"))); + this.messaging.Write(VerboseMessages.BundleGuid(bundleId.ToString("B"))); this.binaryWriter.BaseStream.Seek(this.wixburnDataOffset + BURN_SECTION_OFFSET_BUNDLEGUID, SeekOrigin.Begin); this.binaryWriter.Write(bundleId.ToByteArray()); diff --git a/src/WixToolset.Core.Burn/Inscribe/InscribeBundleCommand.cs b/src/WixToolset.Core.Burn/Inscribe/InscribeBundleCommand.cs index 5eb76479..0dea8b1d 100644 --- a/src/WixToolset.Core.Burn/Inscribe/InscribeBundleCommand.cs +++ b/src/WixToolset.Core.Burn/Inscribe/InscribeBundleCommand.cs @@ -29,7 +29,7 @@ namespace WixToolset.Core.Burn.Inscribe { reader.Stream.Seek(reader.AttachedContainerAddress, SeekOrigin.Begin); - using (BurnWriter writer = BurnWriter.Open(tempFile)) + using (BurnWriter writer = BurnWriter.Open(this.Context.Messaging, tempFile)) { writer.RememberThenResetSignature(); writer.AppendContainer(reader.Stream, reader.AttachedContainerSize, BurnCommon.Container.Attached); diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs index 1f2cee74..0f278640 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/AssignMediaCommand.cs @@ -8,22 +8,25 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Linq; using WixToolset.Core.Bind; using WixToolset.Data; - using WixToolset.Data.Rows; using WixToolset.Data.Tuples; + using WixToolset.Extensibility.Services; /// /// AssignMediaCommand assigns files to cabs based on Media or MediaTemplate rows. /// internal class AssignMediaCommand { - public AssignMediaCommand(IntermediateSection section) + public AssignMediaCommand(IntermediateSection section, IMessaging messaging) { this.CabinetNameTemplate = "Cab{0}.cab"; this.Section = section; + this.Messaging = messaging; } private IntermediateSection Section { get; } + private IMessaging Messaging { get; } + public IEnumerable FileFacades { private get; set; } public bool FilesCompressed { private get; set; } @@ -60,7 +63,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // If both tables are authored, it is an error. if (mediaTemplateTable.Count > 0 && mediaTable.Count > 1) { - throw new WixException(WixErrors.MediaTableCollision(null)); + throw new WixException(ErrorMessages.MediaTableCollision(null)); } // When building merge module, all the files go to "#MergeModule.CABinet". @@ -144,11 +147,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (FormatException) { - throw new WixException(WixErrors.IllegalEnvironmentVariable("WIX_MUMS", mumsString)); + throw new WixException(ErrorMessages.IllegalEnvironmentVariable("WIX_MUMS", mumsString)); } catch (OverflowException) { - throw new WixException(WixErrors.MaximumUncompressedMediaSizeTooLarge(null, maxPreCabSizeInMB)); + throw new WixException(ErrorMessages.MaximumUncompressedMediaSizeTooLarge(null, maxPreCabSizeInMB)); } foreach (FileFacade facade in this.FileFacades) @@ -234,8 +237,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (cabinetMediaRows.TryGetValue(mediaRow.Cabinet, out var existingRow)) { - Messaging.Instance.OnMessage(WixErrors.DuplicateCabinetName(mediaRow.SourceLineNumbers, mediaRow.Cabinet)); - Messaging.Instance.OnMessage(WixErrors.DuplicateCabinetName2(existingRow.SourceLineNumbers, existingRow.Cabinet)); + this.Messaging.Write(ErrorMessages.DuplicateCabinetName(mediaRow.SourceLineNumbers, mediaRow.Cabinet)); + this.Messaging.Write(ErrorMessages.DuplicateCabinetName2(existingRow.SourceLineNumbers, existingRow.Cabinet)); } else { @@ -259,7 +262,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (!mediaRows.TryGetValue(facade.WixFile.DiskId, out var mediaRow)) { - Messaging.Instance.OnMessage(WixErrors.MissingMedia(facade.File.SourceLineNumbers, facade.WixFile.DiskId)); + this.Messaging.Write(ErrorMessages.MissingMedia(facade.File.SourceLineNumbers, facade.WixFile.DiskId)); continue; } @@ -279,7 +282,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else { - Messaging.Instance.OnMessage(WixErrors.ExpectedMediaCabinet(facade.File.SourceLineNumbers, facade.File.File, facade.WixFile.DiskId)); + this.Messaging.Write(ErrorMessages.ExpectedMediaCabinet(facade.File.SourceLineNumbers, facade.File.File, facade.WixFile.DiskId)); } } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs index 9e30aed2..410e462a 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindDatabaseCommand.cs @@ -35,6 +35,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.ExpectedEmbeddedFiles = context.ExpectedEmbeddedFiles; this.Extensions = context.Extensions; this.Intermediate = context.IntermediateRepresentation; + this.Messaging = context.Messaging; this.OutputPath = context.OutputPath; this.PdbFile = context.OutputPdbPath; this.IntermediateFolder = context.IntermediateFolder; @@ -68,6 +69,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind private Intermediate Intermediate { get; } + private IMessaging Messaging { get; } + private string OutputPath { get; } private bool SuppressAddingValidationRows { get; } @@ -160,7 +163,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Sequence all the actions. { var command = new SequenceActionsCommand(section); - command.Messaging = Messaging.Instance; + command.Messaging = this.Messaging; command.Execute(); } @@ -191,12 +194,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind ////} #endif - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } - Messaging.Instance.OnMessage(WixVerboses.UpdatingFileInformation()); + this.Messaging.Write(VerboseMessages.UpdatingFileInformation()); // This must occur after all variables and source paths have been resolved. List fileFacades; @@ -215,7 +218,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Gather information about files that did not come from merge modules (i.e. rows with a reference to the File table). { - var command = new UpdateFileFacadesCommand(section); + var command = new UpdateFileFacadesCommand(this.Messaging, section); command.FileFacades = fileFacades; command.UpdateFileFacades = fileFacades.Where(f => !f.FromModule); command.OverwriteHash = true; @@ -227,13 +230,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Now that the variable cache is populated, resolve any delayed fields. if (this.DelayedFields.Any()) { - var command = new ResolveDelayedFieldsCommand(this.DelayedFields, variableCache); + var command = new ResolveDelayedFieldsCommand(this.Messaging, this.DelayedFields, variableCache); command.Execute(); } // Set generated component guids. { - var command = new CalculateComponentGuids(section); + var command = new CalculateComponentGuids(this.Messaging, section); command.Execute(); } @@ -244,7 +247,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (wixMergeTuples.Any()) { - var command = new ExtractMergeModuleFilesCommand(section, wixMergeTuples); + var command = new ExtractMergeModuleFilesCommand(this.Messaging, section, wixMergeTuples); command.FileFacades = fileFacades; command.OutputInstallerVersion = installerVersion; command.SuppressLayout = this.SuppressLayout; @@ -265,7 +268,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind #endif // stop processing if an error previously occurred - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } @@ -280,7 +283,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind Dictionary> filesByCabinetMedia; IEnumerable uncompressedFiles; { - var command = new AssignMediaCommand(section); + var command = new AssignMediaCommand(section, this.Messaging); command.FileFacades = fileFacades; command.FilesCompressed = compressed; command.Execute(); @@ -291,7 +294,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // stop processing if an error previously occurred - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } @@ -355,7 +358,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind #endif // Stop processing if an error previously occurred. - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } @@ -374,13 +377,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind string layoutDirectory = Path.GetDirectoryName(this.OutputPath); if (!this.SuppressLayout || OutputType.Module == output.Type) { - Messaging.Instance.OnMessage(WixVerboses.CreatingCabinetFiles()); + this.Messaging.Write(VerboseMessages.CreatingCabinetFiles()); var command = new CreateCabinetsCommand(); command.CabbingThreadCount = this.CabbingThreadCount; command.CabCachePath = this.CabCachePath; command.DefaultCompressionLevel = this.DefaultCompressionLevel; command.Output = output; + command.Messaging = this.Messaging; command.BackendExtensions = this.BackendExtensions; command.LayoutDirectory = layoutDirectory; command.Compressed = compressed; @@ -435,13 +439,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.ValidateComponentGuids(output); // stop processing if an error previously occurred - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } // Generate database file. - Messaging.Instance.OnMessage(WixVerboses.GeneratingDatabase()); + this.Messaging.Write(VerboseMessages.GeneratingDatabase()); string tempDatabaseFile = Path.Combine(this.IntermediateFolder, Path.GetFileName(this.OutputPath)); this.GenerateDatabase(output, tempDatabaseFile, false, false); @@ -452,7 +456,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // Stop processing if an error previously occurred. - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } @@ -468,7 +472,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Merge modules. if (OutputType.Product == output.Type) { - Messaging.Instance.OnMessage(WixVerboses.MergingModules()); + this.Messaging.Write(VerboseMessages.MergingModules()); var command = new MergeModulesCommand(); command.FileFacades = fileFacades; @@ -478,7 +482,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind command.Execute(); } - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } @@ -492,12 +496,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind // set the output file for source line information this.Validator.Output = this.Output; - Messaging.Instance.OnMessage(WixVerboses.ValidatingDatabase()); + Messaging.Instance.Write(WixVerboses.ValidatingDatabase()); this.Validator.Validate(tempDatabaseFile); stopwatch.Stop(); - Messaging.Instance.OnMessage(WixVerboses.ValidatedDatabase(stopwatch.ElapsedMilliseconds)); + Messaging.Instance.Write(WixVerboses.ValidatedDatabase(stopwatch.ElapsedMilliseconds)); // Stop processing if an error occurred. if (Messaging.Instance.EncounteredError) @@ -508,7 +512,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind #endif // Process uncompressed files. - if (!Messaging.Instance.EncounteredError && !this.SuppressLayout && uncompressedFiles.Any()) + if (!this.Messaging.EncounteredError && !this.SuppressLayout && uncompressedFiles.Any()) { var command = new ProcessUncompressedFilesCommand(section); command.Compressed = compressed; @@ -908,11 +912,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (allComponentsHaveConditions) { - Messaging.Instance.OnMessage(WixWarnings.DuplicateComponentGuidsMustHaveMutuallyExclusiveConditions(row.SourceLineNumbers, row.Component, row.Guid)); + this.Messaging.Write(WarningMessages.DuplicateComponentGuidsMustHaveMutuallyExclusiveConditions(row.SourceLineNumbers, row.Component, row.Guid)); } else { - Messaging.Instance.OnMessage(WixErrors.DuplicateComponentGuids(row.SourceLineNumbers, row.Component, row.Guid)); + this.Messaging.Write(ErrorMessages.DuplicateComponentGuids(row.SourceLineNumbers, row.Component, row.Guid)); } } @@ -929,6 +933,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind private void UpdateControlText(Output output) { var command = new UpdateControlTextCommand(); + command.Messaging = this.Messaging; command.BBControlTable = output.Tables["BBControl"]; command.WixBBControlTable = output.Tables["WixBBControl"]; command.ControlTable = output.Tables["Control"]; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs index 49440cea..800ebac0 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs @@ -6,11 +6,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Collections.Generic; using System.Globalization; using System.IO; + using WixToolset.Core.Native; using WixToolset.Data; + using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; using WixToolset.Msi; - using WixToolset.Core.Native; - using WixToolset.Data.WindowsInstaller; internal class BindTransformCommand { @@ -22,6 +23,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind public Output Transform { private get; set; } + public IMessaging Messaging { private get; set; } + public string OutputPath { private get; set; } public void Execute() @@ -197,7 +200,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (((int)TransformFlags.ValidateUpgradeCode & transformFlags) != 0 && (String.IsNullOrEmpty(targetUpgradeCode) || String.IsNullOrEmpty(updatedUpgradeCode))) { - Messaging.Instance.OnMessage(WixErrors.BothUpgradeCodesRequired()); + this.Messaging.Write(ErrorMessages.BothUpgradeCodesRequired()); } string emptyFile = null; @@ -276,7 +279,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (RowOperation.Add == fileRow.Operation) { - Messaging.Instance.OnMessage(WixErrors.InvalidAddedFileRowWithoutSequence(fileRow.SourceLineNumbers, (string)fileRow[0])); + this.Messaging.Write(ErrorMessages.InvalidAddedFileRowWithoutSequence(fileRow.SourceLineNumbers, (string)fileRow[0])); break; } @@ -384,7 +387,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind //} // Any errors encountered up to this point can cause errors during generation. - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } @@ -419,7 +422,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else { - Messaging.Instance.OnMessage(WixErrors.NoDifferencesInTransform(this.Transform.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.NoDifferencesInTransform(this.Transform.SourceLineNumbers)); } } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs index fde781a3..0c167699 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetBuilder.cs @@ -4,13 +4,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind { using System; using System.Collections; - using System.Collections.Generic; using System.IO; using System.Linq; using System.Threading; using WixToolset.Core.Bind; using WixToolset.Core.Native; using WixToolset.Data; + using WixToolset.Extensibility.Services; /// /// Builds cabinets using multiple threads. This implements a thread pool that generates cabinets with multiple @@ -25,16 +25,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Address of Binder's callback function for Cabinet Splitting private IntPtr newCabNamesCallBackAddress; - public int MaximumCabinetSizeForLargeFileSplitting { get; set; } - - public int MaximumUncompressedMediaSize { get; set; } - /// /// Instantiate a new CabinetBuilder. /// /// number of threads to use /// Address of Binder's callback function for Cabinet Splitting - public CabinetBuilder(int threadCount, IntPtr newCabNamesCallBackAddress) + public CabinetBuilder(IMessaging messaging, int threadCount, IntPtr newCabNamesCallBackAddress) { if (0 >= threadCount) { @@ -43,13 +39,19 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.cabinetWorkItems = new Queue(); this.lockObject = new object(); - + this.Messaging = messaging; this.threadCount = threadCount; // Set Address of Binder's callback function for Cabinet Splitting this.newCabNamesCallBackAddress = newCabNamesCallBackAddress; } + private IMessaging Messaging { get; } + + public int MaximumCabinetSizeForLargeFileSplitting { get; set; } + + public int MaximumUncompressedMediaSize { get; set; } + /// /// Enqueues a CabinetWorkItem to the queue. /// @@ -119,11 +121,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (WixException we) { - Messaging.Instance.OnMessage(we.Error); + this.Messaging.Write(we.Error); } catch (Exception e) { - Messaging.Instance.OnMessage(WixErrors.UnexpectedException(e.Message, e.GetType().ToString(), e.StackTrace)); + this.Messaging.Write(ErrorMessages.UnexpectedException(e.Message, e.GetType().ToString(), e.StackTrace)); } } @@ -133,7 +135,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// CabinetWorkItem containing information about the cabinet to create. private void CreateCabinet(CabinetWorkItem cabinetWorkItem) { - Messaging.Instance.OnMessage(WixVerboses.CreateCabinet(cabinetWorkItem.CabinetFile)); + this.Messaging.Write(VerboseMessages.CreateCabinet(cabinetWorkItem.CabinetFile)); int maxCabinetSize = 0; // The value of 0 corresponds to default of 2GB which means no cabinet splitting ulong maxPreCompressedSizeInBytes = 0; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs index 370d4b9c..cf8eb338 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CabinetResolver.cs @@ -109,7 +109,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (ArgumentException) { - throw new WixException(WixErrors.IllegalCharactersInPath(path)); + throw new WixException(ErrorMessages.IllegalCharactersInPath(path)); } } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs index 0c0aea1f..056f92a7 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CalculateComponentGuids.cs @@ -10,17 +10,21 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Core.Native; using WixToolset.Data; using WixToolset.Data.Tuples; + using WixToolset.Extensibility.Services; /// /// Set the guids for components with generatable guids. /// internal class CalculateComponentGuids { - public CalculateComponentGuids(IntermediateSection section) + public CalculateComponentGuids(IMessaging messaging, IntermediateSection section) { + this.Messaging = messaging; this.Section = section; } + private IMessaging Messaging { get; } + private IntermediateSection Section { get; } public void Execute() @@ -43,7 +47,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (String.IsNullOrEmpty(componentRow.KeyPath) || odbcDataSourceKeyPath) { - Messaging.Instance.OnMessage(WixErrors.IllegalComponentWithAutoGeneratedGuid(componentRow.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.IllegalComponentWithAutoGeneratedGuid(componentRow.SourceLineNumbers)); continue; } @@ -143,13 +147,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind path.StartsWith(@"StartMenuFolder\programs", StringComparison.Ordinal) || path.StartsWith(@"WindowsFolder\fonts", StringComparison.Ordinal)) { - Messaging.Instance.OnMessage(WixErrors.IllegalPathForGeneratedComponentGuid(componentRow.SourceLineNumbers, fileRow.Component_, path)); + this.Messaging.Write(ErrorMessages.IllegalPathForGeneratedComponentGuid(componentRow.SourceLineNumbers, fileRow.Component_, path)); } // if component has more than one file, the key path must be versioned if (1 < numFilesInComponent && String.IsNullOrEmpty(fileRow.Version)) { - Messaging.Instance.OnMessage(WixErrors.IllegalGeneratedGuidComponentUnversionedKeypath(componentRow.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.IllegalGeneratedGuidComponentUnversionedKeypath(componentRow.SourceLineNumbers)); } } else @@ -157,13 +161,13 @@ namespace WixToolset.Core.WindowsInstaller.Bind // not a key path, so it must be an unversioned file if component has more than one file if (1 < numFilesInComponent && !String.IsNullOrEmpty(fileRow.Version)) { - Messaging.Instance.OnMessage(WixErrors.IllegalGeneratedGuidComponentVersionedNonkeypath(componentRow.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.IllegalGeneratedGuidComponentVersionedNonkeypath(componentRow.SourceLineNumbers)); } } } // if the rules were followed, reward with a generated guid - if (!Messaging.Instance.EncounteredError) + if (!this.Messaging.EncounteredError) { componentRow.ComponentId = Uuid.NewUuid(BindDatabaseCommand.WixComponentGuidNamespace, path).ToString("B").ToUpperInvariant(); } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CopyTransformDataCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CopyTransformDataCommand.cs index 559d440c..13408312 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CopyTransformDataCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CopyTransformDataCommand.cs @@ -12,13 +12,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; internal class CopyTransformDataCommand { public bool CopyOutFileRows { private get; set; } public IEnumerable Extensions { private get; set; } - + + public IMessaging Messaging { private get; set; } + public Output Output { private get; set; } public TableDefinitionCollection TableDefinitions { private get; set; } @@ -465,14 +468,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (seqDuplicateFiles < seqInstallFiles) { - throw new WixException(WixErrors.InsertInvalidSequenceActionOrder(mainFileRow.SourceLineNumbers, iesTable.Name, "InstallFiles", "DuplicateFiles", wixPatchAction.Action)); + throw new WixException(ErrorMessages.InsertInvalidSequenceActionOrder(mainFileRow.SourceLineNumbers, iesTable.Name, "InstallFiles", "DuplicateFiles", wixPatchAction.Action)); } else { sequence = (seqDuplicateFiles + seqInstallFiles) / 2; if (seqInstallFiles == sequence || seqDuplicateFiles == sequence) { - throw new WixException(WixErrors.InsertSequenceNoSpace(mainFileRow.SourceLineNumbers, iesTable.Name, "InstallFiles", "DuplicateFiles", wixPatchAction.Action)); + throw new WixException(ErrorMessages.InsertSequenceNoSpace(mainFileRow.SourceLineNumbers, iesTable.Name, "InstallFiles", "DuplicateFiles", wixPatchAction.Action)); } } } @@ -579,7 +582,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Make sure all changes to non keypath files also had a change in the keypath. if (!componentWithChangedKeyPath.ContainsKey(componentFile.Key) && componentKeyPath.ContainsKey(componentFile.Key)) { - Messaging.Instance.OnMessage(WixWarnings.UpdateOfNonKeyPathFile((string)componentFile.Value, (string)componentFile.Key, (string)componentKeyPath[componentFile.Key])); + this.Messaging.Write(WarningMessages.UpdateOfNonKeyPathFile((string)componentFile.Value, (string)componentFile.Key, (string)componentKeyPath[componentFile.Key])); } } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs index 0aa50bd9..28e7f6df 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateCabinetsCommand.cs @@ -16,6 +16,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; /// /// Creates cabinet files. @@ -45,6 +46,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind public string CabCachePath { private get; set; } + public IMessaging Messaging { private get; set; } + public string TempFilesLocation { private get; set; } /// @@ -85,7 +88,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.SetCabbingThreadCount(); // Send Binder object to Facilitate NewCabNamesCallBack Callback - CabinetBuilder cabinetBuilder = new CabinetBuilder(this.CabbingThreadCount, Marshal.GetFunctionPointerForDelegate(this.newCabNamesCallBack)); + CabinetBuilder cabinetBuilder = new CabinetBuilder(this.Messaging, this.CabbingThreadCount, Marshal.GetFunctionPointerForDelegate(this.newCabNamesCallBack)); // Supply Compile MediaTemplate Attributes to Cabinet Builder this.GetMediaTemplateAttributes(out var MaximumCabinetSizeForLargeFileSplitting, out var MaximumUncompressedMediaSize); @@ -120,14 +123,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // stop processing if an error previously occurred - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } // create queued cabinets with multiple threads cabinetBuilder.CreateQueuedCabinets(); - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } @@ -152,7 +155,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (0 >= this.CabbingThreadCount) { - throw new WixException(WixErrors.IllegalEnvironmentVariable("NUMBER_OF_PROCESSORS", numberOfProcessors)); + throw new WixException(ErrorMessages.IllegalEnvironmentVariable("NUMBER_OF_PROCESSORS", numberOfProcessors)); } } else // default to 1 if the environment variable is not set @@ -160,15 +163,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind this.CabbingThreadCount = 1; } - Messaging.Instance.OnMessage(WixVerboses.SetCabbingThreadCount(this.CabbingThreadCount.ToString())); + this.Messaging.Write(VerboseMessages.SetCabbingThreadCount(this.CabbingThreadCount.ToString())); } catch (ArgumentException) { - throw new WixException(WixErrors.IllegalEnvironmentVariable("NUMBER_OF_PROCESSORS", numberOfProcessors)); + throw new WixException(ErrorMessages.IllegalEnvironmentVariable("NUMBER_OF_PROCESSORS", numberOfProcessors)); } catch (FormatException) { - throw new WixException(WixErrors.IllegalEnvironmentVariable("NUMBER_OF_PROCESSORS", numberOfProcessors)); + throw new WixException(ErrorMessages.IllegalEnvironmentVariable("NUMBER_OF_PROCESSORS", numberOfProcessors)); } } } @@ -202,11 +205,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind // If building a patch, remind them to run -p for torch. if (OutputType.Patch == output.Type) { - Messaging.Instance.OnMessage(WixWarnings.EmptyCabinet(mediaRow.SourceLineNumbers, cabinetName, true)); + this.Messaging.Write(WarningMessages.EmptyCabinet(mediaRow.SourceLineNumbers, cabinetName, true)); } else { - Messaging.Instance.OnMessage(WixWarnings.EmptyCabinet(mediaRow.SourceLineNumbers, cabinetName)); + this.Messaging.Write(WarningMessages.EmptyCabinet(mediaRow.SourceLineNumbers, cabinetName)); } } @@ -223,7 +226,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else // reuse the cabinet from the cabinet cache. { - Messaging.Instance.OnMessage(WixVerboses.ReusingCabCache(mediaRow.SourceLineNumbers, mediaRow.Cabinet, resolvedCabinet.Path)); + this.Messaging.Write(VerboseMessages.ReusingCabCache(mediaRow.SourceLineNumbers, mediaRow.Cabinet, resolvedCabinet.Path)); try { @@ -237,7 +240,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (Exception e) { - Messaging.Instance.OnMessage(WixWarnings.CannotUpdateCabCache(mediaRow.SourceLineNumbers, resolvedCabinet.Path, e.Message)); + this.Messaging.Write(WarningMessages.CannotUpdateCabCache(mediaRow.SourceLineNumbers, resolvedCabinet.Path, e.Message)); } } @@ -303,7 +306,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (!mutex.WaitOne(0, false)) // Check if you can get the lock { // Cound not get the Lock - Messaging.Instance.OnMessage(WixVerboses.CabinetsSplitInParallel()); + this.Messaging.Write(VerboseMessages.CabinetsSplitInParallel()); mutex.WaitOne(); // Wait on other thread } @@ -333,7 +336,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Check if File Transfer was added if (!transferAdded) { - throw new WixException(WixErrors.SplitCabinetCopyRegistrationFailed(newCabinetName, firstCabinetName)); + throw new WixException(ErrorMessages.SplitCabinetCopyRegistrationFailed(newCabinetName, firstCabinetName)); } // Add the new Cabinets to media table using LastSequence of Base Cabinet @@ -365,14 +368,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (newCabinetName.Equals(mediaRow.Cabinet, StringComparison.InvariantCultureIgnoreCase)) { // Name Collision of generated Split Cabinet Name and user Specified Cab name for current row - throw new WixException(WixErrors.SplitCabinetNameCollision(newCabinetName, firstCabinetName)); + throw new WixException(ErrorMessages.SplitCabinetNameCollision(newCabinetName, firstCabinetName)); } } // Check if the last Split Cabinet was found in the Media Table if (!lastSplitCabinetFound) { - throw new WixException(WixErrors.SplitCabinetInsertionFailed(newCabinetName, firstCabinetName, lastCabinetOfThisSequence)); + throw new WixException(ErrorMessages.SplitCabinetInsertionFailed(newCabinetName, firstCabinetName, lastCabinetOfThisSequence)); } // The new Row has to be inserted just after the last cab in this cabinet split chain according to DiskID Sort @@ -454,11 +457,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (FormatException) { - throw new WixException(WixErrors.IllegalEnvironmentVariable("WIX_MCSLFS", mcslfsString)); + throw new WixException(ErrorMessages.IllegalEnvironmentVariable("WIX_MCSLFS", mcslfsString)); } catch (OverflowException) { - throw new WixException(WixErrors.MaximumCabinetSizeForLargeFileSplittingTooLarge(null, maxCabSizeForLargeFileInMB, MaxValueOfMaxCabSizeForLargeFileSplitting)); + throw new WixException(ErrorMessages.MaximumCabinetSizeForLargeFileSplittingTooLarge(null, maxCabSizeForLargeFileInMB, MaxValueOfMaxCabSizeForLargeFileSplitting)); } try @@ -476,11 +479,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (FormatException) { - throw new WixException(WixErrors.IllegalEnvironmentVariable("WIX_MUMS", mumsString)); + throw new WixException(ErrorMessages.IllegalEnvironmentVariable("WIX_MUMS", mumsString)); } catch (OverflowException) { - throw new WixException(WixErrors.MaximumUncompressedMediaSizeTooLarge(null, maxPreCompressedSizeInMB)); + throw new WixException(ErrorMessages.MaximumUncompressedMediaSizeTooLarge(null, maxPreCompressedSizeInMB)); } maxCabSizeForLargeFileSplitting = maxCabSizeForLargeFileInMB; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs index 1fc7d068..9afb3260 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateIdtFileCommand.cs @@ -8,17 +8,21 @@ namespace WixToolset.Core.WindowsInstaller.Bind using System.Text; using WixToolset.Data; using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility.Services; internal class CreateIdtFileCommand { - public CreateIdtFileCommand(Table table, int codepage, string intermediateFolder, bool keepAddedColumns) + public CreateIdtFileCommand(IMessaging messaging, Table table, int codepage, string intermediateFolder, bool keepAddedColumns) { + this.Messaging = messaging; this.Table = table; this.Codepage = codepage; this.IntermediateFolder = intermediateFolder; this.KeepAddedColumns = keepAddedColumns; } + private IMessaging Messaging { get; } + private Table Table { get; } private int Codepage { get; set; } @@ -67,7 +71,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (TableDefinition.MaxColumnsInRealTable < table.Definition.Columns.Count) { - throw new WixException(WixDataErrors.TooManyColumnsInRealTable(table.Definition.Name, table.Definition.Columns.Count, TableDefinition.MaxColumnsInRealTable)); + throw new WixException(ErrorMessages.TooManyColumnsInRealTable(table.Definition.Name, table.Definition.Columns.Count, TableDefinition.MaxColumnsInRealTable)); } // Tack on the table header, and flush before we start writing bytes directly to the stream. @@ -98,7 +102,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (EncoderFallbackException) { - Messaging.Instance.OnMessage(WixDataErrors.InvalidStringForCodepage(row.SourceLineNumbers, Convert.ToString(writer.Encoding.WindowsCodePage, CultureInfo.InvariantCulture))); + this.Messaging.Write(ErrorMessages.InvalidStringForCodepage(row.SourceLineNumbers, Convert.ToString(writer.Encoding.WindowsCodePage, CultureInfo.InvariantCulture))); rowBytes = convertEncoding.GetBytes(rowString); } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs index a31c8079..e1777246 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ExtractMergeModuleFilesCommand.cs @@ -15,18 +15,22 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Core.Native; using WixToolset.Core.Bind; using WixToolset.Data.Tuples; + using WixToolset.Extensibility.Services; /// /// Retrieve files information and extract them from merge modules. /// internal class ExtractMergeModuleFilesCommand { - public ExtractMergeModuleFilesCommand(IntermediateSection section, List wixMergeTuples) + public ExtractMergeModuleFilesCommand(IMessaging messaging, IntermediateSection section, List wixMergeTuples) { + this.Messaging = messaging; this.Section = section; this.WixMergeTuples = wixMergeTuples; } + private IMessaging Messaging { get; } + private IntermediateSection Section { get; } private List WixMergeTuples { get; } @@ -121,11 +125,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind // If case-sensitive collision with another merge module or a user-authored file identifier. if (indexedFileFacades.TryGetValue(mergeModuleFileFacade.File.File, out var collidingFacade)) { - Messaging.Instance.OnMessage(WixErrors.DuplicateModuleFileIdentifier(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, collidingFacade.File.File)); + this.Messaging.Write(ErrorMessages.DuplicateModuleFileIdentifier(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, collidingFacade.File.File)); } else if (uniqueModuleFileIdentifiers.TryGetValue(mergeModuleFileFacade.File.File, out collidingFacade)) // case-insensitive collision with another file identifier in the same merge module { - Messaging.Instance.OnMessage(WixErrors.DuplicateModuleCaseInsensitiveFileIdentifier(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, mergeModuleFileFacade.File.File, collidingFacade.File.File)); + this.Messaging.Write(ErrorMessages.DuplicateModuleCaseInsensitiveFileIdentifier(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, mergeModuleFileFacade.File.File, collidingFacade.File.File)); } else // no collision { @@ -152,23 +156,23 @@ namespace WixToolset.Core.WindowsInstaller.Bind int moduleInstallerVersion = Convert.ToInt32(moduleInstallerVersionString, CultureInfo.InvariantCulture); if (moduleInstallerVersion > this.OutputInstallerVersion) { - Messaging.Instance.OnMessage(WixWarnings.InvalidHigherInstallerVersionInModule(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, moduleInstallerVersion, this.OutputInstallerVersion)); + this.Messaging.Write(WarningMessages.InvalidHigherInstallerVersionInModule(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, moduleInstallerVersion, this.OutputInstallerVersion)); } } catch (FormatException) { - throw new WixException(WixErrors.MissingOrInvalidModuleInstallerVersion(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, wixMergeRow.SourceFile, moduleInstallerVersionString)); + throw new WixException(ErrorMessages.MissingOrInvalidModuleInstallerVersion(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, wixMergeRow.SourceFile, moduleInstallerVersionString)); } } } } catch (FileNotFoundException) { - throw new WixException(WixErrors.FileNotFound(wixMergeRow.SourceLineNumbers, wixMergeRow.SourceFile)); + throw new WixException(ErrorMessages.FileNotFound(wixMergeRow.SourceLineNumbers, wixMergeRow.SourceFile)); } catch (Win32Exception) { - throw new WixException(WixErrors.CannotOpenMergeModule(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, wixMergeRow.SourceFile)); + throw new WixException(ErrorMessages.CannotOpenMergeModule(wixMergeRow.SourceLineNumbers, wixMergeRow.Id.Id, wixMergeRow.SourceFile)); } return containsFiles; @@ -187,7 +191,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (FormatException) { - Messaging.Instance.OnMessage(WixErrors.InvalidMergeLanguage(wixMergeRow.SourceLineNumbers, mergeId, wixMergeRow.Language.ToString())); + this.Messaging.Write(ErrorMessages.InvalidMergeLanguage(wixMergeRow.SourceLineNumbers, mergeId, wixMergeRow.Language.ToString())); return; } @@ -210,16 +214,16 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (FileNotFoundException) { - throw new WixException(WixErrors.CabFileDoesNotExist(moduleCabPath, wixMergeRow.SourceFile, mergeIdPath)); + throw new WixException(ErrorMessages.CabFileDoesNotExist(moduleCabPath, wixMergeRow.SourceFile, mergeIdPath)); } catch { - throw new WixException(WixErrors.CabExtractionFailed(moduleCabPath, wixMergeRow.SourceFile, mergeIdPath)); + throw new WixException(ErrorMessages.CabExtractionFailed(moduleCabPath, wixMergeRow.SourceFile, mergeIdPath)); } } catch (COMException ce) { - throw new WixException(WixErrors.UnableToOpenModule(wixMergeRow.SourceLineNumbers, wixMergeRow.SourceFile, ce.Message)); + throw new WixException(ErrorMessages.UnableToOpenModule(wixMergeRow.SourceLineNumbers, wixMergeRow.SourceFile, ce.Message)); } finally { diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs index e4e66559..ee7cc61b 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/GenerateDatabaseCommand.cs @@ -13,6 +13,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Msi; using WixToolset.Core.Native; using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility.Services; internal class GenerateDatabaseCommand { @@ -25,6 +26,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// public bool KeepAddedColumns { private get; set; } + public IMessaging Messaging { private get; set; } + public Output Output { private get; set; } public string OutputPath { private get; set; } @@ -177,7 +180,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind try { //db.ImportTable(this.Output.Codepage, importTable, baseDirectory, this.KeepAddedColumns); - var command = new CreateIdtFileCommand(importTable, this.Output.Codepage, baseDirectory, this.KeepAddedColumns); + var command = new CreateIdtFileCommand(this.Messaging, importTable, this.Output.Codepage, baseDirectory, this.KeepAddedColumns); command.Execute(); db.Import(command.IdtPath); @@ -262,11 +265,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (0xA1 == e.NativeErrorCode) // ERROR_BAD_PATHNAME { - throw new WixException(WixErrors.FileNotFound(row.SourceLineNumbers, (string)row[i])); + throw new WixException(ErrorMessages.FileNotFound(row.SourceLineNumbers, (string)row[i])); } else { - throw new WixException(WixErrors.Win32Exception(e.NativeErrorCode, e.Message)); + throw new WixException(ErrorMessages.Win32Exception(e.NativeErrorCode, e.Message)); } } } @@ -279,7 +282,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // check for a stream name that is more than 62 characters long (the maximum allowed length) if (needStream && MsiInterop.MsiMaxStreamNameLength < streamName.Length) { - Messaging.Instance.OnMessage(WixErrors.StreamNameTooLong(row.SourceLineNumbers, table.Name, streamName.ToString(), streamName.Length)); + this.Messaging.Write(ErrorMessages.StreamNameTooLong(row.SourceLineNumbers, table.Name, streamName.ToString(), streamName.Length)); } else // add the row to the database { @@ -309,7 +312,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Bind the transform. this.BindTransform(subStorage.Data, transformFile); - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { continue; } @@ -338,7 +341,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind private void BindTransform(Output transform, string outputPath) { - BindTransformCommand command = new BindTransformCommand(); + var command = new BindTransformCommand(); + command.Messaging = this.Messaging; command.Extensions = this.Extensions; command.TempFilesLocation = this.TempFilesLocation; command.Transform = transform; @@ -372,7 +376,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind catch (WixInvalidIdtException) { // the IDT should be valid, so an invalid code page was given - throw new WixException(WixErrors.IllegalCodepage(codepage)); + throw new WixException(ErrorMessages.IllegalCodepage(codepage)); } } } diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs index 32a05d93..8d1edb41 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs @@ -13,6 +13,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Data; using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; + using WixToolset.Extensibility.Services; using WixToolset.MergeMod; using WixToolset.Msi; @@ -23,6 +24,8 @@ namespace WixToolset.Core.WindowsInstaller.Bind { public IEnumerable FileFacades { private get; set; } + public IMessaging Messaging { private get; set; } + public Output Output { private get; set; } public string OutputPath { private get; set; } @@ -73,11 +76,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (FormatException) { - Messaging.Instance.OnMessage(WixErrors.InvalidMergeLanguage(wixMergeRow.SourceLineNumbers, wixMergeRow.Id, wixMergeRow.Language)); + this.Messaging.Write(ErrorMessages.InvalidMergeLanguage(wixMergeRow.SourceLineNumbers, wixMergeRow.Id, wixMergeRow.Language)); continue; } - Messaging.Instance.OnMessage(WixVerboses.OpeningMergeModule(wixMergeRow.SourceFile, mergeLanguage)); + this.Messaging.Write(VerboseMessages.OpeningMergeModule(wixMergeRow.SourceFile, mergeLanguage)); merge.OpenModule(wixMergeRow.SourceFile, mergeLanguage); moduleOpen = true; @@ -89,7 +92,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // merge the module into the database that's being built - Messaging.Instance.OnMessage(WixVerboses.MergingMergeModule(wixMergeRow.SourceFile)); + this.Messaging.Write(VerboseMessages.MergingMergeModule(wixMergeRow.SourceFile)); merge.MergeEx(wixMergeRow.Feature, wixMergeRow.Directory, callback); // connect any non-primary features @@ -99,7 +102,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (wixMergeRow.Id == (string)row[1]) { - Messaging.Instance.OnMessage(WixVerboses.ConnectingMergeModule(wixMergeRow.SourceFile, (string)row[0])); + this.Messaging.Write(VerboseMessages.ConnectingMergeModule(wixMergeRow.SourceFile, (string)row[0])); merge.Connect((string)row[0]); } } @@ -144,38 +147,38 @@ namespace WixToolset.Core.WindowsInstaller.Bind switch (mergeError.Type) { case MsmErrorType.msmErrorExclusion: - Messaging.Instance.OnMessage(WixErrors.MergeExcludedModule(wixMergeRow.SourceLineNumbers, wixMergeRow.Id, moduleKeys.ToString())); + this.Messaging.Write(ErrorMessages.MergeExcludedModule(wixMergeRow.SourceLineNumbers, wixMergeRow.Id, moduleKeys.ToString())); break; case MsmErrorType.msmErrorFeatureRequired: - Messaging.Instance.OnMessage(WixErrors.MergeFeatureRequired(wixMergeRow.SourceLineNumbers, mergeError.ModuleTable, moduleKeys.ToString(), wixMergeRow.SourceFile, wixMergeRow.Id)); + this.Messaging.Write(ErrorMessages.MergeFeatureRequired(wixMergeRow.SourceLineNumbers, mergeError.ModuleTable, moduleKeys.ToString(), wixMergeRow.SourceFile, wixMergeRow.Id)); break; case MsmErrorType.msmErrorLanguageFailed: - Messaging.Instance.OnMessage(WixErrors.MergeLanguageFailed(wixMergeRow.SourceLineNumbers, mergeError.Language, wixMergeRow.SourceFile)); + this.Messaging.Write(ErrorMessages.MergeLanguageFailed(wixMergeRow.SourceLineNumbers, mergeError.Language, wixMergeRow.SourceFile)); break; case MsmErrorType.msmErrorLanguageUnsupported: - Messaging.Instance.OnMessage(WixErrors.MergeLanguageUnsupported(wixMergeRow.SourceLineNumbers, mergeError.Language, wixMergeRow.SourceFile)); + this.Messaging.Write(ErrorMessages.MergeLanguageUnsupported(wixMergeRow.SourceLineNumbers, mergeError.Language, wixMergeRow.SourceFile)); break; case MsmErrorType.msmErrorResequenceMerge: - Messaging.Instance.OnMessage(WixWarnings.MergeRescheduledAction(wixMergeRow.SourceLineNumbers, mergeError.DatabaseTable, databaseKeys.ToString(), wixMergeRow.SourceFile)); + this.Messaging.Write(WarningMessages.MergeRescheduledAction(wixMergeRow.SourceLineNumbers, mergeError.DatabaseTable, databaseKeys.ToString(), wixMergeRow.SourceFile)); break; case MsmErrorType.msmErrorTableMerge: if ("_Validation" != mergeError.DatabaseTable) // ignore merge errors in the _Validation table { - Messaging.Instance.OnMessage(WixWarnings.MergeTableFailed(wixMergeRow.SourceLineNumbers, mergeError.DatabaseTable, databaseKeys.ToString(), wixMergeRow.SourceFile)); + this.Messaging.Write(WarningMessages.MergeTableFailed(wixMergeRow.SourceLineNumbers, mergeError.DatabaseTable, databaseKeys.ToString(), wixMergeRow.SourceFile)); } break; case MsmErrorType.msmErrorPlatformMismatch: - Messaging.Instance.OnMessage(WixErrors.MergePlatformMismatch(wixMergeRow.SourceLineNumbers, wixMergeRow.SourceFile)); + this.Messaging.Write(ErrorMessages.MergePlatformMismatch(wixMergeRow.SourceLineNumbers, wixMergeRow.SourceFile)); break; default: - Messaging.Instance.OnMessage(WixErrors.UnexpectedException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedMergerErrorWithType, Enum.GetName(typeof(MsmErrorType), mergeError.Type), logPath), "InvalidOperationException", Environment.StackTrace)); + this.Messaging.Write(ErrorMessages.UnexpectedException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedMergerErrorWithType, Enum.GetName(typeof(MsmErrorType), mergeError.Type), logPath), "InvalidOperationException", Environment.StackTrace)); break; } } if (0 >= mergeErrors.Count && !commit) { - Messaging.Instance.OnMessage(WixErrors.UnexpectedException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedMergerErrorInSourceFile, wixMergeRow.SourceFile, logPath), "InvalidOperationException", Environment.StackTrace)); + this.Messaging.Write(ErrorMessages.UnexpectedException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedMergerErrorInSourceFile, wixMergeRow.SourceFile, logPath), "InvalidOperationException", Environment.StackTrace)); } if (moduleOpen) @@ -199,7 +202,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // stop processing if an error previously occurred - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return; } @@ -223,7 +226,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (null != record) { - Messaging.Instance.OnMessage(WixWarnings.SuppressMergedAction((string)row[1], row[0].ToString())); + this.Messaging.Write(WarningMessages.SuppressMergedAction((string)row[1], row[0].ToString())); view.Modify(ModifyView.Delete, record); } } @@ -251,7 +254,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind break; } - Messaging.Instance.OnMessage(WixWarnings.SuppressMergedAction(resultRecord.GetString(1), tableName)); + this.Messaging.Write(WarningMessages.SuppressMergedAction(resultRecord.GetString(1), tableName)); } } } @@ -273,7 +276,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } // now update the Attributes column for the files from the Merge Modules - Messaging.Instance.OnMessage(WixVerboses.ResequencingMergeModuleFiles()); + this.Messaging.Write(VerboseMessages.ResequencingMergeModuleFiles()); using (View view = db.OpenView("SELECT `Sequence`, `Attributes` FROM `File` WHERE `File`=?")) { foreach (var file in this.FileFacades) diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs index aa4382f5..e1a26a67 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/ProcessUncompressedFilesCommand.cs @@ -97,7 +97,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (null == fileRecord) { - throw new WixException(WixErrors.FileIdentifierNotFound(facade.File.SourceLineNumbers, facade.File.File)); + throw new WixException(ErrorMessages.FileIdentifierNotFound(facade.File.SourceLineNumbers, facade.File.File)); } relativeFileLayoutPath = Binder.GetFileSourcePath(directories, fileRecord[1], fileRecord[2], this.Compressed, this.LongNamesInImage); diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs index cf9c0332..47eb9408 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs @@ -9,6 +9,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Core.Native; using WixToolset.Data; using WixToolset.Data.Tuples; + using WixToolset.Extensibility.Services; internal class SequenceActionsCommand { @@ -27,7 +28,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind private Dictionary StandardActionsById { get; } - public Messaging Messaging { private get; set; } + public IMessaging Messaging { private get; set; } public void Execute() { @@ -64,10 +65,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (overridableActionRows.TryGetValue(actionRow.Id.Id, out var collidingActionRow)) { - this.Messaging.OnMessage(WixErrors.OverridableActionCollision(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action)); + this.Messaging.Write(ErrorMessages.OverridableActionCollision(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action)); if (null != collidingActionRow.SourceLineNumbers) { - this.Messaging.OnMessage(WixErrors.OverridableActionCollision2(collidingActionRow.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.OverridableActionCollision2(collidingActionRow.SourceLineNumbers)); } } else @@ -93,10 +94,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (overridableActionRows.TryGetValue(actionRow.Id.Id, out var collidingActionRow)) { - this.Messaging.OnMessage(WixErrors.ActionCollision(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action)); + this.Messaging.Write(ErrorMessages.ActionCollision(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action)); if (null != collidingActionRow.SourceLineNumbers) { - this.Messaging.OnMessage(WixErrors.ActionCollision2(collidingActionRow.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.ActionCollision2(collidingActionRow.SourceLineNumbers)); } } else @@ -127,20 +128,20 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (requiredActionRow.Overridable) { - this.Messaging.OnMessage(WixWarnings.SuppressAction(suppressActionRow.SourceLineNumbers, suppressActionRow.Action, suppressActionRow.SequenceTable.ToString())); + this.Messaging.Write(WarningMessages.SuppressAction(suppressActionRow.SourceLineNumbers, suppressActionRow.Action, suppressActionRow.SequenceTable.ToString())); if (null != requiredActionRow.SourceLineNumbers) { - this.Messaging.OnMessage(WixWarnings.SuppressAction2(requiredActionRow.SourceLineNumbers)); + this.Messaging.Write(WarningMessages.SuppressAction2(requiredActionRow.SourceLineNumbers)); } requiredActionRows.Remove(key); } else // suppressing a non-overridable action row { - this.Messaging.OnMessage(WixErrors.SuppressNonoverridableAction(suppressActionRow.SourceLineNumbers, suppressActionRow.SequenceTable.ToString(), suppressActionRow.Action)); + this.Messaging.Write(ErrorMessages.SuppressNonoverridableAction(suppressActionRow.SourceLineNumbers, suppressActionRow.SequenceTable.ToString(), suppressActionRow.Action)); if (null != requiredActionRow.SourceLineNumbers) { - this.Messaging.OnMessage(WixErrors.SuppressNonoverridableAction2(requiredActionRow.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.SuppressNonoverridableAction2(requiredActionRow.SourceLineNumbers)); } } } @@ -156,14 +157,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind // check for standard actions that don't have a sequence number in a merge module if (SectionType.Module == this.Section.Type && WindowsInstallerStandard.IsStandardAction(actionRow.Action)) { - this.Messaging.OnMessage(WixErrors.StandardActionRelativelyScheduledInModule(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action)); + this.Messaging.Write(ErrorMessages.StandardActionRelativelyScheduledInModule(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action)); } this.SequenceActionRow(actionRow, requiredActionRows); } else if (SectionType.Module == this.Section.Type && 0 < actionRow.Sequence && !WindowsInstallerStandard.IsStandardAction(actionRow.Action)) // check for custom actions and dialogs that have a sequence number { - this.Messaging.OnMessage(WixErrors.CustomActionSequencedInModule(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action)); + this.Messaging.Write(ErrorMessages.CustomActionSequencedInModule(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action)); } } @@ -231,10 +232,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (sequenceScheduledActionRow.Sequence == actionRow.Sequence) { - this.Messaging.OnMessage(WixWarnings.ActionSequenceCollision(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action, sequenceScheduledActionRow.Action, actionRow.Sequence)); + this.Messaging.Write(WarningMessages.ActionSequenceCollision(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action, sequenceScheduledActionRow.Action, actionRow.Sequence)); if (null != sequenceScheduledActionRow.SourceLineNumbers) { - this.Messaging.OnMessage(WixWarnings.ActionSequenceCollision2(sequenceScheduledActionRow.SourceLineNumbers)); + this.Messaging.Write(WarningMessages.ActionSequenceCollision2(sequenceScheduledActionRow.SourceLineNumbers)); } } } @@ -262,19 +263,19 @@ namespace WixToolset.Core.WindowsInstaller.Bind // Create errors for all the before actions. foreach (var actionRow in relativeActions.PreviousActions) { - this.Messaging.OnMessage(WixErrors.ActionScheduledRelativeToTerminationAction(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action, absoluteActionRow.Action)); + this.Messaging.Write(ErrorMessages.ActionScheduledRelativeToTerminationAction(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action, absoluteActionRow.Action)); } // Create errors for all the after actions. foreach (var actionRow in relativeActions.NextActions) { - this.Messaging.OnMessage(WixErrors.ActionScheduledRelativeToTerminationAction(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action, absoluteActionRow.Action)); + this.Messaging.Write(ErrorMessages.ActionScheduledRelativeToTerminationAction(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action, absoluteActionRow.Action)); } // If there is source line information for the absolutely scheduled action display it if (absoluteActionRow.SourceLineNumbers != null) { - this.Messaging.OnMessage(WixErrors.ActionScheduledRelativeToTerminationAction2(absoluteActionRow.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.ActionScheduledRelativeToTerminationAction2(absoluteActionRow.SourceLineNumbers)); } continue; @@ -289,10 +290,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind // look for collisions if (unusedSequence == previousUsedSequence) { - this.Messaging.OnMessage(WixErrors.NoUniqueActionSequenceNumber(relativeActionRow.SourceLineNumbers, relativeActionRow.SequenceTable.ToString(), relativeActionRow.Action, absoluteActionRow.Action)); + this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber(relativeActionRow.SourceLineNumbers, relativeActionRow.SequenceTable.ToString(), relativeActionRow.Action, absoluteActionRow.Action)); if (absoluteActionRow.SourceLineNumbers != null) { - this.Messaging.OnMessage(WixErrors.NoUniqueActionSequenceNumber2(absoluteActionRow.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber2(absoluteActionRow.SourceLineNumbers)); } unusedSequence++; @@ -319,10 +320,10 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (unusedSequence == nextUsedSequence) { - this.Messaging.OnMessage(WixErrors.NoUniqueActionSequenceNumber(relativeActionRow.SourceLineNumbers, relativeActionRow.SequenceTable.ToString(), relativeActionRow.Action, absoluteActionRow.Action)); + this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber(relativeActionRow.SourceLineNumbers, relativeActionRow.SequenceTable.ToString(), relativeActionRow.Action, absoluteActionRow.Action)); if (absoluteActionRow.SourceLineNumbers != null) { - this.Messaging.OnMessage(WixErrors.NoUniqueActionSequenceNumber2(absoluteActionRow.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.NoUniqueActionSequenceNumber2(absoluteActionRow.SourceLineNumbers)); } unusedSequence--; @@ -596,7 +597,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else if (actionRow == parentActionRow || this.ContainsChildActionRow(actionRow, parentActionRow)) // cycle detected { - throw new WixException(WixErrors.ActionCircularDependency(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action, parentActionRow.Action)); + throw new WixException(ErrorMessages.ActionCircularDependency(actionRow.SourceLineNumbers, actionRow.SequenceTable.ToString(), actionRow.Action, parentActionRow.Action)); } // Add this action to the appropriate list of dependent action rows. diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateControlTextCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateControlTextCommand.cs index dddc9380..3ad2470f 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateControlTextCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateControlTextCommand.cs @@ -7,9 +7,12 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Data; using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; + using WixToolset.Extensibility.Services; internal class UpdateControlTextCommand { + public IMessaging Messaging { private get; set; } + public Table BBControlTable { private get; set; } public Table WixBBControlTable { private get; set; } @@ -60,19 +63,19 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (DirectoryNotFoundException e) { - Messaging.Instance.OnMessage(WixErrors.BinderFileManagerMissingFile(sourceLineNumbers, e.Message)); + this.Messaging.Write(ErrorMessages.BinderFileManagerMissingFile(sourceLineNumbers, e.Message)); } catch (FileNotFoundException e) { - Messaging.Instance.OnMessage(WixErrors.BinderFileManagerMissingFile(sourceLineNumbers, e.Message)); + this.Messaging.Write(ErrorMessages.BinderFileManagerMissingFile(sourceLineNumbers, e.Message)); } catch (IOException e) { - Messaging.Instance.OnMessage(WixErrors.BinderFileManagerMissingFile(sourceLineNumbers, e.Message)); + this.Messaging.Write(ErrorMessages.BinderFileManagerMissingFile(sourceLineNumbers, e.Message)); } catch (NotSupportedException) { - Messaging.Instance.OnMessage(WixErrors.FileNotFound(sourceLineNumbers, source)); + this.Messaging.Write(ErrorMessages.FileNotFound(sourceLineNumbers, source)); } return text; diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs index cf620e72..10eae8f8 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/UpdateFileFacadesCommand.cs @@ -15,6 +15,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind using WixToolset.Data; using WixToolset.Data.Tuples; using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility.Services; using WixToolset.Msi; /// @@ -22,11 +23,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind /// internal class UpdateFileFacadesCommand { - public UpdateFileFacadesCommand(IntermediateSection section) + public UpdateFileFacadesCommand(IMessaging messaging, IntermediateSection section) { + this.Messaging = messaging; this.Section = section; } + private IMessaging Messaging { get; } + private IntermediateSection Section { get; } public IEnumerable FileFacades { private get; set; } @@ -62,23 +66,23 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (ArgumentException) { - Messaging.Instance.OnMessage(WixDataErrors.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path)); + this.Messaging.Write(ErrorMessages.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path)); return; } catch (PathTooLongException) { - Messaging.Instance.OnMessage(WixDataErrors.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path)); + this.Messaging.Write(ErrorMessages.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path)); return; } catch (NotSupportedException) { - Messaging.Instance.OnMessage(WixDataErrors.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path)); + this.Messaging.Write(ErrorMessages.InvalidFileName(file.File.SourceLineNumbers, file.WixFile.Source.Path)); return; } if (!fileInfo.Exists) { - Messaging.Instance.OnMessage(WixErrors.CannotFindFile(file.File.SourceLineNumbers, file.File.File, file.File.LongFileName, file.WixFile.Source.Path)); + this.Messaging.Write(ErrorMessages.CannotFindFile(file.File.SourceLineNumbers, file.File.File, file.File.LongFileName, file.WixFile.Source.Path)); return; } @@ -86,7 +90,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (Int32.MaxValue < fileStream.Length) { - throw new WixException(WixErrors.FileTooLarge(file.File.SourceLineNumbers, file.WixFile.Source.Path)); + throw new WixException(ErrorMessages.FileTooLarge(file.File.SourceLineNumbers, file.WixFile.Source.Path)); } file.File.FileSize = Convert.ToInt32(fileStream.Length, CultureInfo.InvariantCulture); @@ -102,11 +106,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (0x2 == e.NativeErrorCode) // ERROR_FILE_NOT_FOUND { - throw new WixException(WixErrors.FileNotFound(file.File.SourceLineNumbers, fileInfo.FullName)); + throw new WixException(ErrorMessages.FileNotFound(file.File.SourceLineNumbers, fileInfo.FullName)); } else { - throw new WixException(WixErrors.Win32Exception(e.NativeErrorCode, e.Message)); + throw new WixException(ErrorMessages.Win32Exception(e.NativeErrorCode, e.Message)); } } @@ -128,14 +132,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind // for unversioned file. That's allowed but generally a dangerous thing to do so let's point that out to the user. if (!this.FileFacades.Any(r => file.File.Version.Equals(r.File.File, StringComparison.Ordinal))) { - Messaging.Instance.OnMessage(WixWarnings.DefaultVersionUsedForUnversionedFile(file.File.SourceLineNumbers, file.File.Version, file.File.File)); + this.Messaging.Write(WarningMessages.DefaultVersionUsedForUnversionedFile(file.File.SourceLineNumbers, file.File.Version, file.File.File)); } } else { if (null != file.File.Language) { - Messaging.Instance.OnMessage(WixWarnings.DefaultLanguageUsedForUnversionedFile(file.File.SourceLineNumbers, file.File.Language, file.File.File)); + this.Messaging.Write(WarningMessages.DefaultLanguageUsedForUnversionedFile(file.File.SourceLineNumbers, file.File.Language, file.File.File)); } int[] hash; @@ -147,11 +151,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (0x2 == e.NativeErrorCode) // ERROR_FILE_NOT_FOUND { - throw new WixException(WixErrors.FileNotFound(file.File.SourceLineNumbers, fileInfo.FullName)); + throw new WixException(ErrorMessages.FileNotFound(file.File.SourceLineNumbers, fileInfo.FullName)); } else { - throw new WixException(WixErrors.Win32Exception(e.NativeErrorCode, fileInfo.FullName, e.Message)); + throw new WixException(ErrorMessages.Win32Exception(e.NativeErrorCode, fileInfo.FullName, e.Message)); } } @@ -193,7 +197,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind if (!String.IsNullOrEmpty(file.File.Language) && String.IsNullOrEmpty(language)) { - Messaging.Instance.OnMessage(WixWarnings.DefaultLanguageUsedForVersionedFile(file.File.SourceLineNumbers, file.File.Language, file.File.File)); + this.Messaging.Write(WarningMessages.DefaultLanguageUsedForVersionedFile(file.File.SourceLineNumbers, file.File.Language, file.File.File)); } else // override the default provided by the user (usually nothing) with the actual language from the file itself. { @@ -260,7 +264,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else if (file.WixFile.File_AssemblyApplication == null) { - throw new WixException(WixErrors.GacAssemblyNoStrongName(file.File.SourceLineNumbers, fileInfo.FullName, file.File.Component_)); + throw new WixException(ErrorMessages.GacAssemblyNoStrongName(file.File.SourceLineNumbers, fileInfo.FullName, file.File.Component_)); } string assemblyVersion = referenceIdentity.GetAttribute(null, "Version"); @@ -271,7 +275,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } else { - Messaging.Instance.OnMessage(WixErrors.InvalidAssemblyFile(file.File.SourceLineNumbers, fileInfo.FullName, String.Format(CultureInfo.InvariantCulture, "HRESULT: 0x{0:x8}", result))); + this.Messaging.Write(ErrorMessages.InvalidAssemblyFile(file.File.SourceLineNumbers, fileInfo.FullName, String.Format(CultureInfo.InvariantCulture, "HRESULT: 0x{0:x8}", result))); return; } @@ -360,7 +364,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind FileFacade fileManifest = this.FileFacades.SingleOrDefault(r => r.File.File.Equals(file.WixFile.File_AssemblyManifest, StringComparison.Ordinal)); if (null == fileManifest) { - Messaging.Instance.OnMessage(WixErrors.MissingManifestForWin32Assembly(file.File.SourceLineNumbers, file.File.File, file.WixFile.File_AssemblyManifest)); + this.Messaging.Write(ErrorMessages.MissingManifestForWin32Assembly(file.File.SourceLineNumbers, file.File.File, file.WixFile.File_AssemblyManifest)); } string win32Type = null; @@ -397,7 +401,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind } if (!hasNextSibling) { - Messaging.Instance.OnMessage(WixErrors.InvalidManifestContent(file.File.SourceLineNumbers, fileManifest.WixFile.Source.Path)); + this.Messaging.Write(ErrorMessages.InvalidManifestContent(file.File.SourceLineNumbers, fileManifest.WixFile.Source.Path)); return; } @@ -435,11 +439,11 @@ namespace WixToolset.Core.WindowsInstaller.Bind } catch (FileNotFoundException fe) { - Messaging.Instance.OnMessage(WixErrors.FileNotFound(new SourceLineNumber(fileManifest.WixFile.Source.Path), fe.FileName, "AssemblyManifest")); + this.Messaging.Write(ErrorMessages.FileNotFound(new SourceLineNumber(fileManifest.WixFile.Source.Path), fe.FileName, "AssemblyManifest")); } catch (XmlException xe) { - Messaging.Instance.OnMessage(WixErrors.InvalidXml(new SourceLineNumber(fileManifest.WixFile.Source.Path), "manifest", xe.Message)); + this.Messaging.Write(ErrorMessages.InvalidXml(new SourceLineNumber(fileManifest.WixFile.Source.Path), "manifest", xe.Message)); } if (!String.IsNullOrEmpty(win32Name)) @@ -482,7 +486,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind // check for null value (this can occur when grabbing the file version from an assembly without one) if (String.IsNullOrEmpty(value)) { - Messaging.Instance.OnMessage(WixWarnings.NullMsiAssemblyNameValue(file.File.SourceLineNumbers, file.File.Component_, name)); + this.Messaging.Write(WarningMessages.NullMsiAssemblyNameValue(file.File.SourceLineNumbers, file.File.Component_, name)); } else { @@ -491,7 +495,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind String.IsNullOrEmpty(file.WixFile.File_AssemblyApplication) && !String.Equals(Path.GetFileNameWithoutExtension(file.File.LongFileName), value, StringComparison.OrdinalIgnoreCase)) { - Messaging.Instance.OnMessage(WixErrors.GACAssemblyIdentityWarning(file.File.SourceLineNumbers, Path.GetFileNameWithoutExtension(file.File.LongFileName), value)); + this.Messaging.Write(ErrorMessages.GACAssemblyIdentityWarning(file.File.SourceLineNumbers, Path.GetFileNameWithoutExtension(file.File.LongFileName), value)); } // override directly authored value diff --git a/src/WixToolset.Core.WindowsInstaller/Data/Xsd/actions.xsd b/src/WixToolset.Core.WindowsInstaller/Data/Xsd/actions.xsd new file mode 100644 index 00000000..bf0ccb95 --- /dev/null +++ b/src/WixToolset.Core.WindowsInstaller/Data/Xsd/actions.xsd @@ -0,0 +1,73 @@ + + + + + + + + Schema for describing standard actions in the Windows Installer. + + + + + + + + + + + + + + + + Name of action + + + + + Default condition for action + + + + + Sequence of action + + + + + Specifies if action is allowed in AdminExecuteSequence + + + + + Specifies if action is allowed in AdminUISequence + + + + + Specifies if action is allowed in AdvtExecuteSequence + + + + + Specifies if action is allowed in InstallExecuteSequence + + + + + Specifies if action is allowed in InstallUISequence + + + + + + + + + + + + diff --git a/src/WixToolset.Core.WindowsInstaller/Data/Xsd/tables.xsd b/src/WixToolset.Core.WindowsInstaller/Data/Xsd/tables.xsd new file mode 100644 index 00000000..f87471bb --- /dev/null +++ b/src/WixToolset.Core.WindowsInstaller/Data/Xsd/tables.xsd @@ -0,0 +1,248 @@ + + + + + + + + Schema for describing table definitions in Windows Installer. + + + + + + + + + + + + + + + + + + + Boolean whether rows in this table create symbols + + + + + Name of table in Windows Installer database + + + + + Specifies if table is virtual or not + + + + + Specifies if the table is a part of the Bootstrapper Application Data manifest + + + + + + + + + + Name of column in Windows Installer table + + + + + + Whether this column was added by a transform. + + + + + + Type of column in Windows Installer table + + + + + + Type of column in Windows Installer table + + + + + + + + + + + + Boolean whether column is primary key of Windows Installer table + + + + + + Boolean whether column is nullable in Windows Installer table + + + + + + Boolean whether column is virtual in Windows Installer table + + + + + + Enumeration specifying how column should have the ModuleId appended + + + + + + Set to "yes" in order to allow substitution for localized variables. + + + + + + Minimum value for column in Windows Installer table + + + + + + Maximum value for column in Windows Installer table + + + + + + Foreign key table for column in Windows Installer table + + + + + + Maximum value for column in Windows Installer table + + + + + + + + + + + + Specific column data types for column + + + + + + List of permissible values for the column + + + + + + Description of column + + + + + + Set to "yes" in order to make the idt exporter escape whitespace characters \r, \n, and \t. + + + + + + Set to "yes" in order to make the Intermediate and Output objects wrap their data in a CDATA element to preserve whitespace. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/WixToolset.Core.WindowsInstaller/Differ.cs b/src/WixToolset.Core.WindowsInstaller/Differ.cs index 9bbde302..7cc204f9 100644 --- a/src/WixToolset.Core.WindowsInstaller/Differ.cs +++ b/src/WixToolset.Core.WindowsInstaller/Differ.cs @@ -10,26 +10,29 @@ namespace WixToolset.Core.WindowsInstaller using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; using WixToolset.Msi; /// /// Creates a transform by diffing two outputs. /// - public sealed class Differ : IMessageHandler + public sealed class Differ { private List inspectorExtensions; private bool showPedanticMessages; private bool suppressKeepingSpecialRows; private bool preserveUnchangedRows; private const char sectionDelimiter = '/'; + private readonly IMessaging messaging; private SummaryInformationStreams transformSummaryInfo; /// /// Instantiates a new Differ class. /// - public Differ() + public Differ(IMessaging messaging) { this.inspectorExtensions = new List(); + this.messaging = messaging; } /// @@ -99,17 +102,17 @@ namespace WixToolset.Core.WindowsInstaller // compare the codepages if (targetOutput.Codepage != updatedOutput.Codepage && 0 == (TransformFlags.ErrorChangeCodePage & validationFlags)) { - this.OnMessage(WixErrors.OutputCodepageMismatch(targetOutput.SourceLineNumbers, targetOutput.Codepage, updatedOutput.Codepage)); + this.messaging.Write(ErrorMessages.OutputCodepageMismatch(targetOutput.SourceLineNumbers, targetOutput.Codepage, updatedOutput.Codepage)); if (null != updatedOutput.SourceLineNumbers) { - this.OnMessage(WixErrors.OutputCodepageMismatch2(updatedOutput.SourceLineNumbers)); + this.messaging.Write(ErrorMessages.OutputCodepageMismatch2(updatedOutput.SourceLineNumbers)); } } // compare the output types if (targetOutput.Type != updatedOutput.Type) { - throw new WixException(WixErrors.OutputTypeMismatch(targetOutput.SourceLineNumbers, targetOutput.Type.ToString(), updatedOutput.Type.ToString())); + throw new WixException(ErrorMessages.OutputTypeMismatch(targetOutput.SourceLineNumbers, targetOutput.Type.ToString(), updatedOutput.Type.ToString())); } // compare the contents of the tables @@ -159,15 +162,6 @@ namespace WixToolset.Core.WindowsInstaller return transform; } - /// - /// Sends a message to the message delegate if there is one. - /// - /// Message event arguments. - public void OnMessage(MessageEventArgs e) - { - Messaging.Instance.OnMessage(e); - } - /// /// Add a row to the using the primary key. /// @@ -210,7 +204,7 @@ namespace WixToolset.Core.WindowsInstaller } else if (this.showPedanticMessages) { - this.OnMessage(WixWarnings.DuplicatePrimaryKey(row.SourceLineNumbers, primaryKey, row.Table.Name)); + this.messaging.Write(ErrorMessages.DuplicatePrimaryKey(row.SourceLineNumbers, primaryKey, row.Table.Name)); } } else // use the string representation of the row as its primary key (it may not be unique) @@ -370,7 +364,7 @@ namespace WixToolset.Core.WindowsInstaller if (0 != targetTable.Definition.CompareTo(updatedTable.Definition)) { // continue to the next table; may be more mismatches - this.OnMessage(WixErrors.DatabaseSchemaMismatch(targetOutput.SourceLineNumbers, targetTable.Name)); + this.messaging.Write(ErrorMessages.DatabaseSchemaMismatch(targetOutput.SourceLineNumbers, targetTable.Name)); } else { @@ -425,7 +419,7 @@ namespace WixToolset.Core.WindowsInstaller this.transformSummaryInfo.TargetProductCode = (string)row[1]; if ("*" == this.transformSummaryInfo.TargetProductCode) { - this.OnMessage(WixErrors.ProductCodeInvalidForTransform(row.SourceLineNumbers)); + this.messaging.Write(ErrorMessages.ProductCodeInvalidForTransform(row.SourceLineNumbers)); } } else if ("ProductVersion" == (string)row[0]) @@ -466,7 +460,7 @@ namespace WixToolset.Core.WindowsInstaller this.transformSummaryInfo.UpdatedProductCode = (string)row[1]; if ("*" == this.transformSummaryInfo.UpdatedProductCode) { - this.OnMessage(WixErrors.ProductCodeInvalidForTransform(row.SourceLineNumbers)); + this.messaging.Write(ErrorMessages.ProductCodeInvalidForTransform(row.SourceLineNumbers)); } } else if ("ProductVersion" == (string)row[0]) diff --git a/src/WixToolset.Core.WindowsInstaller/Inscribe/InscribeMsiPackageCommand.cs b/src/WixToolset.Core.WindowsInstaller/Inscribe/InscribeMsiPackageCommand.cs index 5c56d9aa..93dd9d3b 100644 --- a/src/WixToolset.Core.WindowsInstaller/Inscribe/InscribeMsiPackageCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Inscribe/InscribeMsiPackageCommand.cs @@ -36,7 +36,7 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe FileAttributes attributes = File.GetAttributes(this.Context.InputFilePath); if (FileAttributes.ReadOnly == (attributes & FileAttributes.ReadOnly)) { - this.Context.Messaging.OnMessage(WixErrors.ReadOnlyOutputFile(this.Context.InputFilePath)); + this.Context.Messaging.Write(ErrorMessages.ReadOnlyOutputFile(this.Context.InputFilePath)); return shouldCommit; } @@ -179,7 +179,7 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe // If the cabs aren't there, throw an error but continue to catch the other errors if (!File.Exists(cabPath)) { - this.Context.Messaging.OnMessage(WixErrors.WixFileNotFound(cabPath)); + this.Context.Messaging.Write(ErrorMessages.WixFileNotFound(cabPath)); continue; } @@ -205,11 +205,11 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe if ((5 == Environment.OSVersion.Version.Major && 2 == Environment.OSVersion.Version.Minor) || // W2K3 (5 == Environment.OSVersion.Version.Major && 1 == Environment.OSVersion.Version.Minor)) // XP { - this.Context.Messaging.OnMessage(WixErrors.UnableToGetAuthenticodeCertOfFileDownlevelOS(cabPath, String.Format(CultureInfo.InvariantCulture, "HRESULT: 0x{0:x8}", HResult))); + this.Context.Messaging.Write(ErrorMessages.UnableToGetAuthenticodeCertOfFileDownlevelOS(cabPath, String.Format(CultureInfo.InvariantCulture, "HRESULT: 0x{0:x8}", HResult))); } else // otherwise, generic error { - this.Context.Messaging.OnMessage(WixErrors.UnableToGetAuthenticodeCertOfFile(cabPath, String.Format(CultureInfo.InvariantCulture, "HRESULT: 0x{0:x8}", HResult))); + this.Context.Messaging.Write(ErrorMessages.UnableToGetAuthenticodeCertOfFile(cabPath, String.Format(CultureInfo.InvariantCulture, "HRESULT: 0x{0:x8}", HResult))); } } @@ -252,7 +252,7 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe if (digitalCertificateTable.Rows.Count > 0) { - var command = new CreateIdtFileCommand(digitalCertificateTable, codepage, this.Context.IntermediateFolder, true); + var command = new CreateIdtFileCommand(this.Context.Messaging, digitalCertificateTable, codepage, this.Context.IntermediateFolder, true); command.Execute(); database.Import(command.IdtPath); @@ -261,7 +261,7 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe if (digitalSignatureTable.Rows.Count > 0) { - var command = new CreateIdtFileCommand(digitalSignatureTable, codepage, this.Context.IntermediateFolder, true); + var command = new CreateIdtFileCommand(this.Context.Messaging, digitalSignatureTable, codepage, this.Context.IntermediateFolder, true); command.Execute(); database.Import(command.IdtPath); @@ -275,7 +275,7 @@ namespace WixToolset.Core.WindowsInstaller.Inscribe // If we did find external cabs but none of them were signed, give a warning if (foundUnsignedExternals) { - this.Context.Messaging.OnMessage(WixWarnings.ExternalCabsAreNotSigned(this.Context.InputFilePath)); + this.Context.Messaging.Write(WarningMessages.ExternalCabsAreNotSigned(this.Context.InputFilePath)); } if (shouldCommit) diff --git a/src/WixToolset.Core.WindowsInstaller/MelterCore.cs b/src/WixToolset.Core.WindowsInstaller/MelterCore.cs index 75d43619..034c9465 100644 --- a/src/WixToolset.Core.WindowsInstaller/MelterCore.cs +++ b/src/WixToolset.Core.WindowsInstaller/MelterCore.cs @@ -7,8 +7,9 @@ namespace WixToolset /// /// Melts a Module Wix document into a ComponentGroup representation. /// - public sealed class MelterCore : IMessageHandler + public sealed class MelterCore { +#if TODO_MELT /// /// Gets whether the melter core encountered an error while processing. /// @@ -26,5 +27,6 @@ namespace WixToolset { Messaging.Instance.OnMessage(e); } +#endif } } diff --git a/src/WixToolset.Core.WindowsInstaller/Msi/WixInvalidIdtException.cs b/src/WixToolset.Core.WindowsInstaller/Msi/WixInvalidIdtException.cs index a603d5a7..589da648 100644 --- a/src/WixToolset.Core.WindowsInstaller/Msi/WixInvalidIdtException.cs +++ b/src/WixToolset.Core.WindowsInstaller/Msi/WixInvalidIdtException.cs @@ -16,7 +16,7 @@ namespace WixToolset.Msi /// /// The invalid idt file. public WixInvalidIdtException(string idtFile) : - base(WixDataErrors.InvalidIdt(new SourceLineNumber(idtFile), idtFile)) + base(ErrorMessages.InvalidIdt(new SourceLineNumber(idtFile), idtFile)) { } @@ -26,7 +26,7 @@ namespace WixToolset.Msi /// The invalid idt file. /// The table name of the invalid idt file. public WixInvalidIdtException(string idtFile, string tableName) : - base(WixDataErrors.InvalidIdt(new SourceLineNumber(idtFile), idtFile, tableName)) + base(ErrorMessages.InvalidIdt(new SourceLineNumber(idtFile), idtFile, tableName)) { } } diff --git a/src/WixToolset.Core.WindowsInstaller/Patch.cs b/src/WixToolset.Core.WindowsInstaller/Patch.cs index 24a54859..c1914aca 100644 --- a/src/WixToolset.Core.WindowsInstaller/Patch.cs +++ b/src/WixToolset.Core.WindowsInstaller/Patch.cs @@ -1232,14 +1232,5 @@ namespace WixToolset.Data #endif throw new NotImplementedException(); } - - /// - /// Sends a message to the message delegate if there is one. - /// - /// Message event arguments. - public void OnMessage(MessageEventArgs mea) - { - Messaging.Instance.OnMessage(mea); - } } } diff --git a/src/WixToolset.Core.WindowsInstaller/PatchTransform.cs b/src/WixToolset.Core.WindowsInstaller/PatchTransform.cs index 9ba14843..0dc1e874 100644 --- a/src/WixToolset.Core.WindowsInstaller/PatchTransform.cs +++ b/src/WixToolset.Core.WindowsInstaller/PatchTransform.cs @@ -10,7 +10,7 @@ namespace WixToolset using WixToolset.Data; using WixToolset.Extensibility; - public class PatchTransform : IMessageHandler + public class PatchTransform { private string baseline; private Intermediate transform; @@ -264,14 +264,5 @@ namespace WixToolset #endif throw new NotImplementedException(); } - - /// - /// Sends a message to the message delegate if there is one. - /// - /// Message event arguments. - public void OnMessage(MessageEventArgs e) - { - Messaging.Instance.OnMessage(e); - } } } diff --git a/src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs b/src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs index 1757e06f..ed3161ef 100644 --- a/src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Unbind/ExtractCabinetsCommand.cs @@ -136,7 +136,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind } catch (FileNotFoundException) { - throw new WixException(WixErrors.FileNotFound(new SourceLineNumber(this.InputFilePath), cabinetFile)); + throw new WixException(ErrorMessages.FileNotFound(new SourceLineNumber(this.InputFilePath), cabinetFile)); } } } diff --git a/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs b/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs index 72e0c3c8..5d24d08a 100644 --- a/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindDatabaseCommand.cs @@ -12,11 +12,12 @@ namespace WixToolset.Core.WindowsInstaller.Unbind using WixToolset.Data; using WixToolset.Data.WindowsInstaller; using WixToolset.Data.WindowsInstaller.Rows; + using WixToolset.Extensibility.Services; using WixToolset.Msi; internal class UnbindDatabaseCommand { - public UnbindDatabaseCommand(Messaging messaging, Database database, string databasePath, OutputType outputType, string exportBasePath, string intermediateFolder, bool isAdminImage, bool suppressDemodularization, bool skipSummaryInfo) + public UnbindDatabaseCommand(IMessaging messaging, Database database, string databasePath, OutputType outputType, string exportBasePath, string intermediateFolder, bool isAdminImage, bool suppressDemodularization, bool skipSummaryInfo) { this.Messaging = messaging; this.Database = database; @@ -31,7 +32,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions(); } - public Messaging Messaging { get; } + public IMessaging Messaging { get; } public Database Database { get; } @@ -316,7 +317,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind if (!success) { - this.Messaging.OnMessage(WixWarnings.BadColumnDataIgnored(row.SourceLineNumbers, Convert.ToString(intValue, CultureInfo.InvariantCulture), tableName, row.Fields[i].Column.Name)); + this.Messaging.Write(WarningMessages.BadColumnDataIgnored(row.SourceLineNumbers, Convert.ToString(intValue, CultureInfo.InvariantCulture), tableName, row.Fields[i].Column.Name)); } break; case ColumnType.Object: @@ -480,7 +481,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind if (!File.Exists(wixFileRow.Source)) { - throw new WixException(WixErrors.WixFileNotFound(wixFileRow.Source)); + throw new WixException(ErrorMessages.WixFileNotFound(wixFileRow.Source)); } wixFileTable.Rows.Add(wixFileRow); diff --git a/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindTranformCommand.cs b/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindTranformCommand.cs index 70f751f5..2b018013 100644 --- a/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindTranformCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Unbind/UnbindTranformCommand.cs @@ -13,11 +13,12 @@ namespace WixToolset.Core.WindowsInstaller.Unbind using WixToolset.Data; using WixToolset.Data.WindowsInstaller; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; using WixToolset.Msi; internal class UnbindTransformCommand { - public UnbindTransformCommand(Messaging messaging, string transformFile, string exportBasePath, string intermediateFolder) + public UnbindTransformCommand(IMessaging messaging, string transformFile, string exportBasePath, string intermediateFolder) { this.Messaging = messaging; this.TransformFile = transformFile; @@ -27,7 +28,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind this.TableDefinitions = WindowsInstallerStandardInternal.GetTableDefinitions(); } - private Messaging Messaging { get; } + private IMessaging Messaging { get; } private string TransformFile { get; } @@ -152,7 +153,7 @@ namespace WixToolset.Core.WindowsInstaller.Unbind // this commonly happens when the transform was built // against a database schema different from the internal // table definitions - throw new WixException(WixErrors.TransformSchemaMismatch()); + throw new WixException(ErrorMessages.TransformSchemaMismatch()); } } diff --git a/src/WixToolset.Core.WindowsInstaller/UnbindContext.cs b/src/WixToolset.Core.WindowsInstaller/UnbindContext.cs index ed55f312..ff71bea4 100644 --- a/src/WixToolset.Core.WindowsInstaller/UnbindContext.cs +++ b/src/WixToolset.Core.WindowsInstaller/UnbindContext.cs @@ -2,12 +2,15 @@ namespace WixToolset.Core { - using WixToolset.Data; + using System; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; internal class UnbindContext : IUnbindContext { - public Messaging Messaging { get; } = Messaging.Instance; + public IServiceProvider ServiceProvider { get; } + + public IMessaging Messaging { get; set; } public string ExportBasePath { get; set; } diff --git a/src/WixToolset.Core.WindowsInstaller/Unbinder.cs b/src/WixToolset.Core.WindowsInstaller/Unbinder.cs index d2d27d45..db121fc0 100644 --- a/src/WixToolset.Core.WindowsInstaller/Unbinder.cs +++ b/src/WixToolset.Core.WindowsInstaller/Unbinder.cs @@ -53,11 +53,11 @@ namespace WixToolset.Core { if (OutputType.Transform == outputType) { - throw new WixException(WixErrors.FileNotFound(null, file, "Transform")); + throw new WixException(ErrorMessages.FileNotFound(null, file, "Transform")); } else { - throw new WixException(WixErrors.FileNotFound(null, file, "Database")); + throw new WixException(ErrorMessages.FileNotFound(null, file, "Database")); } } diff --git a/src/WixToolset.Core.WindowsInstaller/Validator.cs b/src/WixToolset.Core.WindowsInstaller/Validator.cs index eb17d8af..d553cc71 100644 --- a/src/WixToolset.Core.WindowsInstaller/Validator.cs +++ b/src/WixToolset.Core.WindowsInstaller/Validator.cs @@ -22,7 +22,7 @@ namespace WixToolset.Core.WindowsInstaller /// /// Runs internal consistency evaluators (ICEs) from cub files against a database. /// - public sealed class Validator : IMessageHandler + public sealed class Validator { private string actionName; private StringCollection cubeFiles; @@ -30,15 +30,17 @@ namespace WixToolset.Core.WindowsInstaller private Output output; private InstallUIHandler validationUIHandler; private bool validationSessionComplete; + private readonly IMessaging messaging; /// /// Instantiate a new Validator. /// - public Validator() + public Validator(IMessaging messaging) { this.cubeFiles = new StringCollection(); - this.extension = new ValidatorExtension(); + this.extension = new ValidatorExtension(messaging); this.validationUIHandler = new InstallUIHandler(this.ValidationUIHandler); + this.messaging = messaging; } /// @@ -127,7 +129,7 @@ namespace WixToolset.Core.WindowsInstaller { if (!mutex.WaitOne(0, false)) { - this.OnMessage(WixVerboses.ValidationSerialized()); + this.messaging.Write(VerboseMessages.ValidationSerialized()); mutex.WaitOne(); } @@ -176,7 +178,7 @@ namespace WixToolset.Core.WindowsInstaller { if (0x6E == e.NativeErrorCode) // ERROR_OPEN_FAILED { - throw new WixException(WixErrors.CubeFileNotFound(cubeFile)); + throw new WixException(ErrorMessages.CubeFileNotFound(cubeFile)); } throw; @@ -248,7 +250,7 @@ namespace WixToolset.Core.WindowsInstaller } catch (Win32Exception e) { - if (!Messaging.Instance.EncounteredError) + if (!this.messaging.EncounteredError) { throw e; } @@ -270,7 +272,7 @@ namespace WixToolset.Core.WindowsInstaller catch (Win32Exception e) { // avoid displaying errors twice since one may have already occurred in the UI handler - if (!Messaging.Instance.EncounteredError) + if (!this.messaging.EncounteredError) { if (0x6E == e.NativeErrorCode) // ERROR_OPEN_FAILED { @@ -278,23 +280,23 @@ namespace WixToolset.Core.WindowsInstaller // this would be the temporary copy and there would be // no final output since the error occured; during smoke // they should know the path passed into smoke - this.OnMessage(WixErrors.ValidationFailedToOpenDatabase()); + this.messaging.Write(ErrorMessages.ValidationFailedToOpenDatabase()); } else if (0x64D == e.NativeErrorCode) { - this.OnMessage(WixErrors.ValidationFailedDueToLowMsiEngine()); + this.messaging.Write(ErrorMessages.ValidationFailedDueToLowMsiEngine()); } else if (0x654 == e.NativeErrorCode) { - this.OnMessage(WixErrors.ValidationFailedDueToInvalidPackage()); + this.messaging.Write(ErrorMessages.ValidationFailedDueToInvalidPackage()); } else if (0x658 == e.NativeErrorCode) { - this.OnMessage(WixErrors.ValidationFailedDueToMultilanguageMergeModule()); + this.messaging.Write(ErrorMessages.ValidationFailedDueToMultilanguageMergeModule()); } else if (0x659 == e.NativeErrorCode) { - this.OnMessage(WixWarnings.ValidationFailedDueToSystemPolicy()); + this.messaging.Write(WarningMessages.ValidationFailedDueToSystemPolicy()); } else { @@ -305,7 +307,7 @@ namespace WixToolset.Core.WindowsInstaller msgTemp = String.Concat("Action - '", this.actionName, "' ", e.Message); } - this.OnMessage(WixErrors.Win32Exception(e.NativeErrorCode, msgTemp)); + this.messaging.Write(ErrorMessages.Win32Exception(e.NativeErrorCode, msgTemp)); } } } @@ -322,16 +324,6 @@ namespace WixToolset.Core.WindowsInstaller } } - /// - /// Sends a message to the message delegate if there is one. - /// - /// Message event arguments. - public void OnMessage(MessageEventArgs e) - { - Messaging.Instance.OnMessage(e); - this.extension.OnMessage(e); - } - public static Validator CreateFromContext(IBindContext context, string cubeFilename) { Validator validator = null; @@ -339,7 +331,7 @@ namespace WixToolset.Core.WindowsInstaller // Tell the binder about the validator if validation isn't suppressed if (!context.SuppressValidation) { - validator = new Validator(); + validator = new Validator(context.Messaging); validator.IntermediateFolder = Path.Combine(context.IntermediateFolder, "validate"); // set the default cube file @@ -378,7 +370,7 @@ namespace WixToolset.Core.WindowsInstaller } catch (WixException ex) { - this.OnMessage(ex.Error); + this.messaging.Write(ex.Error); } return 1; diff --git a/src/WixToolset.Core.WindowsInstaller/ValidatorExtension.cs b/src/WixToolset.Core.WindowsInstaller/ValidatorExtension.cs index 67f5962c..48f73bf2 100644 --- a/src/WixToolset.Core.WindowsInstaller/ValidatorExtension.cs +++ b/src/WixToolset.Core.WindowsInstaller/ValidatorExtension.cs @@ -6,23 +6,26 @@ namespace WixToolset.Extensibility using System.Collections; using WixToolset.Data; using WixToolset.Data.WindowsInstaller; + using WixToolset.Extensibility.Services; /// /// Base class for creating a validator extension. This default implementation /// will fire and event with the ICE name and description. /// - public class ValidatorExtension : IMessageHandler + public class ValidatorExtension { private string databaseFile; private Hashtable indexedSourceLineNumbers; private Output output; private SourceLineNumber sourceLineNumbers; + private readonly IMessaging messaging; /// /// Instantiate a new . /// - public ValidatorExtension() + public ValidatorExtension(IMessaging messaging) { + this.messaging = messaging; } /// @@ -183,11 +186,11 @@ namespace WixToolset.Extensibility { if (null == action) { - throw new WixException(WixErrors.UnexpectedExternalUIMessage(message)); + throw new WixException(ErrorMessages.UnexpectedExternalUIMessage(message)); } else { - throw new WixException(WixErrors.UnexpectedExternalUIMessage(message, action)); + throw new WixException(ErrorMessages.UnexpectedExternalUIMessage(message, action)); } } @@ -209,16 +212,16 @@ namespace WixToolset.Extensibility { case "0": case "1": - this.OnMessage(WixErrors.ValidationError(messageSourceLineNumbers, messageParts[0], messageParts[2])); + this.messaging.Write(ErrorMessages.ValidationError(messageSourceLineNumbers, messageParts[0], messageParts[2])); break; case "2": - this.OnMessage(WixWarnings.ValidationWarning(messageSourceLineNumbers, messageParts[0], messageParts[2])); + this.messaging.Write(WarningMessages.ValidationWarning(messageSourceLineNumbers, messageParts[0], messageParts[2])); break; case "3": - this.OnMessage(WixVerboses.ValidationInfo(messageParts[0], messageParts[2])); + this.messaging.Write(VerboseMessages.ValidationInfo(messageParts[0], messageParts[2])); break; default: - throw new WixException(WixErrors.InvalidValidatorMessageType(messageParts[1])); + throw new WixException(ErrorMessages.InvalidValidatorMessageType(messageParts[1])); } } @@ -264,7 +267,7 @@ namespace WixToolset.Extensibility if (this.indexedSourceLineNumbers.ContainsKey(key)) { - this.OnMessage(WixWarnings.DuplicatePrimaryKey(row.SourceLineNumbers, primaryKey, table.Name)); + this.messaging.Write(WarningMessages.DuplicatePrimaryKey(row.SourceLineNumbers, primaryKey, table.Name)); } else { @@ -281,20 +284,5 @@ namespace WixToolset.Extensibility // use the file name as the source line information return this.sourceLineNumbers; } - - /// - /// Sends a message to the delegate if there is one. - /// - /// Message event arguments. - /// - /// Notes to Inheritors: When overriding OnMessage - /// in a derived class, be sure to call the base class's - /// OnMessage method so that registered delegates recieve - /// the event. - /// - public virtual void OnMessage(MessageEventArgs e) - { - Messaging.Instance.OnMessage(e); - } } } diff --git a/src/WixToolset.Core.WindowsInstaller/WindowsInstallerStandardInternal.cs b/src/WixToolset.Core.WindowsInstaller/WindowsInstallerStandardInternal.cs index 3b4721a6..759bda14 100644 --- a/src/WixToolset.Core.WindowsInstaller/WindowsInstallerStandardInternal.cs +++ b/src/WixToolset.Core.WindowsInstaller/WindowsInstallerStandardInternal.cs @@ -16,7 +16,9 @@ namespace WixToolset.Core.WindowsInstaller private static readonly object lockObject = new object(); private static TableDefinitionCollection tableDefinitions; +#if REVISIT_FOR_PATCHING private static WixActionRowCollection standardActions; +#endif /// /// Gets the table definitions stored in this assembly. @@ -57,7 +59,7 @@ namespace WixToolset.Core.WindowsInstaller } return WindowsInstallerStandardInternal.standardActions; -#endif +#endif throw new NotImplementedException(); } } diff --git a/src/WixToolset.Core/AppCommon.cs b/src/WixToolset.Core/AppCommon.cs index 7716155a..3ea09f08 100644 --- a/src/WixToolset.Core/AppCommon.cs +++ b/src/WixToolset.Core/AppCommon.cs @@ -3,115 +3,13 @@ namespace WixToolset.Core { using System; - using System.Collections.Specialized; - using System.Globalization; - using System.IO; using System.Reflection; - using System.Text; - using System.Threading; - using WixToolset.Data; /// /// Common utilities for Wix applications. /// public static class AppCommon { - /// - /// Read the configuration file (*.exe.config). - /// - /// Extensions to load. - public static void ReadConfiguration(StringCollection extensions) - { - if (null == extensions) - { - throw new ArgumentNullException("extensions"); - } - -#if REDO_IN_NETCORE - // Don't use the default AppSettings reader because - // the tool may be called from within another process. - // Instead, read the .exe.config file from the tool location. - string toolPath = (new System.Uri(Assembly.GetCallingAssembly().CodeBase)).LocalPath; - Configuration config = ConfigurationManager.OpenExeConfiguration(toolPath); - if (config.HasFile) - { - KeyValueConfigurationElement configVal = config.AppSettings.Settings["extensions"]; - if (configVal != null) - { - string extensionTypes = configVal.Value; - foreach (string extensionType in extensionTypes.Split(";".ToCharArray())) - { - extensions.Add(extensionType); - } - } - } -#endif - } - - /// - /// Gets a unique temporary location or uses the provided temporary location. - /// - /// Optional temporary location to use. - /// Temporary location. - public static string GetTempLocation(string tempLocation = null) - { - if (String.IsNullOrEmpty(tempLocation)) - { - tempLocation = Environment.GetEnvironmentVariable("WIX_TEMP") ?? Path.GetTempPath(); - - do - { - tempLocation = Path.Combine(tempLocation, DateTime.Now.ToString("wixyyMMddTHHmmssffff")); - } while (Directory.Exists(tempLocation)); - } - - return tempLocation; - } - - /// - /// Delete a directory with retries and best-effort cleanup. - /// - /// The directory to delete. - /// The message handler. - /// True if all files were deleted, false otherwise. - public static bool DeleteDirectory(string path, IMessageHandler messageHandler) - { - return Common.DeleteTempFiles(path, messageHandler); - } - - /// - /// Prepares the console for localization. - /// - public static void PrepareConsoleForLocalization() - { - Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); - if ((Console.OutputEncoding.CodePage != Encoding.UTF8.CodePage) && - (Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage) && - (Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage)) - { - Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); - } - } - - /// - /// Handler for display message events. - /// - /// Sender of message. - /// Event arguments containing message to display. - public static void ConsoleDisplayMessage(object sender, DisplayEventArgs e) - { - switch (e.Level) - { - case MessageLevel.Warning: - case MessageLevel.Error: - Console.Error.WriteLine(e.Message); - break; - default: - Console.WriteLine(e.Message); - break; - } - } - /// /// Creates and returns the string for CreatingApplication field (MSI Summary Information Stream). /// diff --git a/src/WixToolset.Core/BackendContext.cs b/src/WixToolset.Core/BackendContext.cs deleted file mode 100644 index 7166a3a3..00000000 --- a/src/WixToolset.Core/BackendContext.cs +++ /dev/null @@ -1,16 +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 WixToolset.Data; - - public class BackendContext - { - internal BackendContext() - { - this.Messaging = Messaging.Instance; - } - - public Messaging Messaging { get; } - } -} diff --git a/src/WixToolset.Core/Bind/FileResolver.cs b/src/WixToolset.Core/Bind/FileResolver.cs index 8d624e6f..2142d261 100644 --- a/src/WixToolset.Core/Bind/FileResolver.cs +++ b/src/WixToolset.Core/Bind/FileResolver.cs @@ -221,7 +221,7 @@ namespace WixToolset.Core.Bind } catch (ArgumentException) { - throw new WixException(WixErrors.IllegalCharactersInPath(path)); + throw new WixException(ErrorMessages.IllegalCharactersInPath(path)); } } diff --git a/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs b/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs index 4585b71a..3ded9a87 100644 --- a/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs +++ b/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs @@ -7,6 +7,7 @@ namespace WixToolset.Core.Bind using System.Globalization; using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; /// /// Resolves the fields which had variables that needed to be resolved after the file information @@ -19,12 +20,15 @@ namespace WixToolset.Core.Bind /// /// The fields which had resolution delayed. /// The file information to use when resolving variables. - public ResolveDelayedFieldsCommand(IEnumerable delayedFields, Dictionary variableCache) + public ResolveDelayedFieldsCommand(IMessaging messaging, IEnumerable delayedFields, Dictionary variableCache) { + this.Messaging = messaging; this.DelayedFields = delayedFields; this.VariableCache = variableCache; } + private IMessaging Messaging { get; } + private IEnumerable DelayedFields { get;} private IDictionary VariableCache { get; } @@ -58,7 +62,7 @@ namespace WixToolset.Core.Bind } catch (WixException we) { - Messaging.Instance.OnMessage(we.Error); + this.Messaging.Write(we.Error); continue; } } @@ -103,7 +107,7 @@ namespace WixToolset.Core.Bind } catch (WixException we) { - Messaging.Instance.OnMessage(we.Error); + this.Messaging.Write(we.Error); } } } diff --git a/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs b/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs index 9253f352..e8c90956 100644 --- a/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs +++ b/src/WixToolset.Core/Bind/ResolveFieldsCommand.cs @@ -7,12 +7,15 @@ namespace WixToolset.Core.Bind using WixToolset.Data; using WixToolset.Data.Bind; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; /// /// Resolve source fields in the tables included in the output /// internal class ResolveFieldsCommand { + public IMessaging Messaging { private get; set; } + public bool BuildingPatch { private get; set; } public IBindVariableResolver BindVariableResolver { private get; set; } @@ -75,7 +78,7 @@ namespace WixToolset.Core.Bind } // Move to next row if we've hit an error resolving variables. - if (Messaging.Instance.EncounteredError) // TODO: make this error handling more specific to just the failure to resolve variables in this field. + if (this.Messaging.EncounteredError) // TODO: make this error handling more specific to just the failure to resolve variables in this field. { continue; } @@ -151,7 +154,7 @@ namespace WixToolset.Core.Bind catch (WixFileNotFoundException) { // display the error with source line information - Messaging.Instance.OnMessage(WixErrors.FileNotFound(row.SourceLineNumbers, objectField.Path)); + this.Messaging.Write(ErrorMessages.FileNotFound(row.SourceLineNumbers, objectField.Path)); } } @@ -208,7 +211,7 @@ namespace WixToolset.Core.Bind catch (WixFileNotFoundException) { // display the error with source line information - Messaging.Instance.OnMessage(WixErrors.FileNotFound(row.SourceLineNumbers, (string)objectField.PreviousData)); + Messaging.Instance.Write(WixErrors.FileNotFound(row.SourceLineNumbers, (string)objectField.PreviousData)); } } } diff --git a/src/WixToolset.Core/Bind/TransferFilesCommand.cs b/src/WixToolset.Core/Bind/TransferFilesCommand.cs index f116569c..68d8b129 100644 --- a/src/WixToolset.Core/Bind/TransferFilesCommand.cs +++ b/src/WixToolset.Core/Bind/TransferFilesCommand.cs @@ -9,18 +9,22 @@ namespace WixToolset.Core.Bind using WixToolset.Data; using WixToolset.Data.Bind; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; internal class TransferFilesCommand { - public TransferFilesCommand(IEnumerable bindPaths, IEnumerable extensions, IEnumerable fileTransfers, bool suppressAclReset) + public TransferFilesCommand(IMessaging messaging, IEnumerable bindPaths, IEnumerable extensions, IEnumerable fileTransfers, bool suppressAclReset) { this.FileResolver = new FileResolver(bindPaths, extensions); + this.Messaging = messaging; this.FileTransfers = fileTransfers; this.SuppressAclReset = suppressAclReset; } private FileResolver FileResolver { get; } + private IMessaging Messaging { get; } + private IEnumerable FileTransfers { get; } private bool SuppressAclReset { get; } @@ -47,12 +51,12 @@ namespace WixToolset.Core.Bind { if (fileTransfer.Move) { - Messaging.Instance.OnMessage(WixVerboses.MoveFile(fileSource, fileTransfer.Destination)); + this.Messaging.Write(VerboseMessages.MoveFile(fileSource, fileTransfer.Destination)); this.TransferFile(true, fileSource, fileTransfer.Destination); } else { - Messaging.Instance.OnMessage(WixVerboses.CopyFile(fileSource, fileTransfer.Destination)); + this.Messaging.Write(VerboseMessages.CopyFile(fileSource, fileTransfer.Destination)); this.TransferFile(false, fileSource, fileTransfer.Destination); } @@ -61,7 +65,7 @@ namespace WixToolset.Core.Bind } catch (FileNotFoundException e) { - throw new WixFileNotFoundException(e.FileName); + throw new WixFileNotFoundException(fileTransfer.SourceLineNumbers, e.FileName); } catch (DirectoryNotFoundException) { @@ -72,7 +76,7 @@ namespace WixToolset.Core.Bind } string directory = Path.GetDirectoryName(fileTransfer.Destination); - Messaging.Instance.OnMessage(WixVerboses.CreateDirectory(directory)); + this.Messaging.Write(VerboseMessages.CreateDirectory(directory)); Directory.CreateDirectory(directory); retry = true; } @@ -86,7 +90,7 @@ namespace WixToolset.Core.Bind if (File.Exists(fileTransfer.Destination)) { - Messaging.Instance.OnMessage(WixVerboses.RemoveDestinationFile(fileTransfer.Destination)); + this.Messaging.Write(VerboseMessages.RemoveDestinationFile(fileTransfer.Destination)); // try to ensure the file is not read-only FileAttributes attributes = File.GetAttributes(fileTransfer.Destination); @@ -96,7 +100,7 @@ namespace WixToolset.Core.Bind } catch (ArgumentException) // thrown for unauthorized access errors { - throw new WixException(WixErrors.UnauthorizedAccess(fileTransfer.Destination)); + throw new WixException(ErrorMessages.UnauthorizedAccess(fileTransfer.Destination)); } // try to delete the file @@ -106,7 +110,7 @@ namespace WixToolset.Core.Bind } catch (IOException) { - throw new WixException(WixErrors.FileInUse(null, fileTransfer.Destination)); + throw new WixException(ErrorMessages.FileInUse(null, fileTransfer.Destination)); } retry = true; @@ -126,7 +130,7 @@ namespace WixToolset.Core.Bind if (File.Exists(fileTransfer.Destination)) { - Messaging.Instance.OnMessage(WixVerboses.RemoveDestinationFile(fileTransfer.Destination)); + this.Messaging.Write(VerboseMessages.RemoveDestinationFile(fileTransfer.Destination)); // ensure the file is not read-only, then delete it FileAttributes attributes = File.GetAttributes(fileTransfer.Destination); @@ -137,7 +141,7 @@ namespace WixToolset.Core.Bind } catch (IOException) { - throw new WixException(WixErrors.FileInUse(null, fileTransfer.Destination)); + throw new WixException(ErrorMessages.FileInUse(null, fileTransfer.Destination)); } retry = true; @@ -168,7 +172,7 @@ namespace WixToolset.Core.Bind } catch { - Messaging.Instance.OnMessage(WixWarnings.UnableToResetAcls()); + this.Messaging.Write(WarningMessages.UnableToResetAcls()); } } } diff --git a/src/WixToolset.Core/BindContext.cs b/src/WixToolset.Core/BindContext.cs index 7ef7ddd4..41d0ddf9 100644 --- a/src/WixToolset.Core/BindContext.cs +++ b/src/WixToolset.Core/BindContext.cs @@ -17,7 +17,7 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public Messaging Messaging { get; set; } + public IMessaging Messaging { get; set; } public IEnumerable BindPaths { get; set; } diff --git a/src/WixToolset.Core/Binder.cs b/src/WixToolset.Core/Binder.cs index e282ead8..2369b600 100644 --- a/src/WixToolset.Core/Binder.cs +++ b/src/WixToolset.Core/Binder.cs @@ -215,7 +215,7 @@ namespace WixToolset.Core this.Layout(bindResult); } - return Messaging.Instance.EncounteredError; + return this.Context.Messaging.EncounteredError; } private ResolveResult Resolve() @@ -227,6 +227,7 @@ namespace WixToolset.Core IEnumerable delayedFields; { var command = new ResolveFieldsCommand(); + command.Messaging = this.Context.Messaging; command.BuildingPatch = buildingPatch; command.BindVariableResolver = this.Context.WixVariableResolver; command.BindPaths = this.Context.BindPaths; @@ -437,12 +438,12 @@ namespace WixToolset.Core { if (!this.DeleteTempFiles()) { - this.Context.Messaging.OnMessage(WixWarnings.FailedToDeleteTempDir(this.TempFilesLocation)); + this.Context.Messaging.Write(WarningMessages.FailedToDeleteTempDir(this.TempFilesLocation)); } } else { - this.Context.Messaging.OnMessage(WixVerboses.BinderTempDirLocatedAt(this.TempFilesLocation)); + this.Context.Messaging.Write(VerboseMessages.BinderTempDirLocatedAt(this.TempFilesLocation)); } } @@ -594,9 +595,9 @@ namespace WixToolset.Core { if (null != transfers && transfers.Any()) { - this.Context.Messaging.OnMessage(WixVerboses.LayingOutMedia()); + this.Context.Messaging.Write(VerboseMessages.LayingOutMedia()); - var command = new TransferFilesCommand(this.Context.BindPaths, this.Context.Extensions, transfers, this.Context.SuppressAclReset); + var command = new TransferFilesCommand(this.Context.Messaging, this.Context.BindPaths, this.Context.Extensions, transfers, this.Context.SuppressAclReset); command.Execute(); } } @@ -613,7 +614,7 @@ namespace WixToolset.Core { if (!directories.ContainsKey(directory)) { - throw new WixException(WixErrors.ExpectedDirectory(directory)); + throw new WixException(ErrorMessages.ExpectedDirectory(directory)); } ResolvedDirectory resolvedDirectory = (ResolvedDirectory)directories[directory]; diff --git a/src/WixToolset.Core/BinderFileManagerCore.cs b/src/WixToolset.Core/BinderFileManagerCore.cs index 5780983a..e699f0ce 100644 --- a/src/WixToolset.Core/BinderFileManagerCore.cs +++ b/src/WixToolset.Core/BinderFileManagerCore.cs @@ -96,14 +96,5 @@ namespace WixToolset return Enumerable.Empty(); } - - /// - /// Sends a message to the message delegate if there is one. - /// - /// Message event arguments. - public void OnMessage(MessageEventArgs e) - { - Messaging.Instance.OnMessage(e); - } } } diff --git a/src/WixToolset.Core/CommandLine/BuildCommand.cs b/src/WixToolset.Core/CommandLine/BuildCommand.cs index 7a63b869..43b75f33 100644 --- a/src/WixToolset.Core/CommandLine/BuildCommand.cs +++ b/src/WixToolset.Core/CommandLine/BuildCommand.cs @@ -13,9 +13,10 @@ namespace WixToolset.Core internal class BuildCommand : ICommandLineCommand { - public BuildCommand(IServiceProvider serviceProvider, IExtensionManager extensions, IEnumerable sources, IDictionary preprocessorVariables, IEnumerable locFiles, IEnumerable libraryFiles, string outputPath, OutputType outputType, string cabCachePath, IEnumerable cultures, bool bindFiles, IEnumerable bindPaths, string intermediateFolder, string contentsFile, string outputsFile, string builtOutputsFile, string wixProjectFile) + public BuildCommand(IServiceProvider serviceProvider, IMessaging messaging, IExtensionManager extensions, IEnumerable sources, IDictionary preprocessorVariables, IEnumerable locFiles, IEnumerable libraryFiles, string outputPath, OutputType outputType, string cabCachePath, IEnumerable cultures, bool bindFiles, IEnumerable bindPaths, string intermediateFolder, string contentsFile, string outputsFile, string builtOutputsFile, string wixProjectFile) { this.ServiceProvider = serviceProvider; + this.Messaging = messaging; this.ExtensionManager = extensions; this.LocFiles = locFiles; this.LibraryFiles = libraryFiles; @@ -38,6 +39,8 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } + public IMessaging Messaging { get; } + public IExtensionManager ExtensionManager { get; } public IEnumerable IncludeSearchPaths { get; } @@ -91,13 +94,13 @@ namespace WixToolset.Core { var output = this.LinkPhase(intermediates); - if (!Messaging.Instance.EncounteredError) + if (!this.Messaging.EncounteredError) { this.BindPhase(output); } } - return Messaging.Instance.LastErrorNumber; + return this.Messaging.LastErrorNumber; } private IEnumerable CompilePhase() @@ -107,7 +110,7 @@ namespace WixToolset.Core foreach (var sourceFile in this.SourceFiles) { var preprocessContext = this.ServiceProvider.GetService(); - preprocessContext.Messaging = Messaging.Instance; + preprocessContext.Messaging = this.Messaging; preprocessContext.Extensions = this.ExtensionManager.Create(); preprocessContext.Platform = Platform.X86; // TODO: set this correctly preprocessContext.IncludeSearchPaths = this.IncludeSearchPaths?.ToList() ?? new List(); @@ -117,18 +120,24 @@ namespace WixToolset.Core var preprocessor = new Preprocessor(); var document = preprocessor.Process(preprocessContext); - var compileContext = this.ServiceProvider.GetService(); - compileContext.Messaging = Messaging.Instance; - compileContext.CompilationId = Guid.NewGuid().ToString("N"); - compileContext.Extensions = this.ExtensionManager.Create(); - compileContext.OutputPath = sourceFile.OutputPath; - compileContext.Platform = Platform.X86; // TODO: set this correctly - compileContext.Source = document; - - var compiler = new Compiler(); - var intermediate = compiler.Compile(compileContext); - - intermediates.Add(intermediate); + if (!this.Messaging.EncounteredError) + { + var compileContext = this.ServiceProvider.GetService(); + compileContext.Messaging = this.Messaging; + compileContext.CompilationId = Guid.NewGuid().ToString("N"); + compileContext.Extensions = this.ExtensionManager.Create(); + compileContext.OutputPath = sourceFile.OutputPath; + compileContext.Platform = Platform.X86; // TODO: set this correctly + compileContext.Source = document; + + var compiler = new Compiler(); + var intermediate = compiler.Compile(compileContext); + + if (!this.Messaging.EncounteredError) + { + intermediates.Add(intermediate); + } + } } return intermediates; @@ -139,7 +148,7 @@ namespace WixToolset.Core var localizations = this.LoadLocalizationFiles().ToList(); // If there was an error adding localization files, then bail. - if (Messaging.Instance.EncounteredError) + if (this.Messaging.EncounteredError) { return null; } @@ -166,7 +175,7 @@ namespace WixToolset.Core var libraries = this.LoadLibraries(creator); var context = this.ServiceProvider.GetService(); - context.Messaging = Messaging.Instance; + context.Messaging = this.Messaging; context.Extensions = this.ExtensionManager.Create(); context.ExtensionData = this.ExtensionManager.Create(); context.ExpectedOutputType = this.OutputType; @@ -182,7 +191,7 @@ namespace WixToolset.Core { var localizations = this.LoadLocalizationFiles().ToList(); - var localizer = new Localizer(localizations); + var localizer = new Localizer(this.Messaging, localizations); var resolver = CreateWixResolverWithVariables(localizer, output); @@ -193,7 +202,7 @@ namespace WixToolset.Core } var context = this.ServiceProvider.GetService(); - context.Messaging = Messaging.Instance; + context.Messaging = this.Messaging; context.ExtensionManager = this.ExtensionManager; context.BindPaths = this.BindPaths ?? Array.Empty(); //context.CabbingThreadCount = this.CabbingThreadCount; @@ -234,11 +243,11 @@ namespace WixToolset.Core } catch (WixCorruptFileException e) { - Messaging.Instance.OnMessage(e.Error); + this.Messaging.Write(e.Error); } catch (WixUnexpectedFileFormatException e) { - Messaging.Instance.OnMessage(e.Error); + this.Messaging.Write(e.Error); } } } @@ -250,15 +259,15 @@ namespace WixToolset.Core { foreach (var loc in this.LocFiles) { - var localization = Localizer.ParseLocalizationFile(loc); + var localization = Localizer.ParseLocalizationFile(this.Messaging, loc); yield return localization; } } - private static WixVariableResolver CreateWixResolverWithVariables(Localizer localizer, Intermediate output) + private WixVariableResolver CreateWixResolverWithVariables(Localizer localizer, Intermediate output) { - var resolver = new WixVariableResolver(localizer); + var resolver = new WixVariableResolver(this.Messaging, localizer); // Gather all the wix variables. var wixVariables = output?.Sections.SelectMany(s => s.Tuples).OfType(); diff --git a/src/WixToolset.Core/CommandLine/CommandLine.cs b/src/WixToolset.Core/CommandLine/CommandLine.cs index 9bedca9a..9db1b2f9 100644 --- a/src/WixToolset.Core/CommandLine/CommandLine.cs +++ b/src/WixToolset.Core/CommandLine/CommandLine.cs @@ -24,12 +24,10 @@ namespace WixToolset.Core internal class CommandLine : ICommandLine, IParseCommandLine { - public CommandLine() - { - } - private IServiceProvider ServiceProvider { get; set; } + private IMessaging Messaging { get; set; } + public static string ExpectedArgument { get; } = "expected argument"; public string ActiveCommand { get; private set; } @@ -48,6 +46,8 @@ namespace WixToolset.Core { this.ServiceProvider = context.ServiceProvider; + this.Messaging = context.Messaging ?? this.ServiceProvider.GetService(); + this.ExtensionManager = context.ExtensionManager ?? this.ServiceProvider.GetService(); var args = context.ParsedArguments ?? Array.Empty(); @@ -186,7 +186,7 @@ namespace WixToolset.Core } }); - Messaging.Instance.ShowVerboseMessages = verbose; + this.Messaging.ShowVerboseMessages = verbose; if (showVersion) { @@ -208,17 +208,17 @@ namespace WixToolset.Core case Commands.Build: { var sourceFiles = GatherSourceFiles(files, outputFolder); - var variables = GatherPreprocessorVariables(defines); - var bindPathList = GatherBindPaths(bindPaths); + var variables = this.GatherPreprocessorVariables(defines); + var bindPathList = this.GatherBindPaths(bindPaths); var type = CalculateOutputType(outputType, outputFile); - return new BuildCommand(this.ServiceProvider, this.ExtensionManager, sourceFiles, variables, locFiles, libraryFiles, outputFile, type, cabCachePath, cultures, bindFiles, bindPathList, intermediateFolder, contentsFile, outputsFile, builtOutputsFile, wixProjectFile); + return new BuildCommand(this.ServiceProvider, this.Messaging, this.ExtensionManager, sourceFiles, variables, locFiles, libraryFiles, outputFile, type, cabCachePath, cultures, bindFiles, bindPathList, intermediateFolder, contentsFile, outputsFile, builtOutputsFile, wixProjectFile); } case Commands.Compile: { var sourceFiles = GatherSourceFiles(files, outputFolder); var variables = GatherPreprocessorVariables(defines); - return new CompileCommand(this.ServiceProvider, this.ExtensionManager, sourceFiles, variables); + return new CompileCommand(this.ServiceProvider, this.Messaging, this.ExtensionManager, sourceFiles, variables); } } @@ -305,7 +305,7 @@ namespace WixToolset.Core return files; } - private static IDictionary GatherPreprocessorVariables(IEnumerable defineConstants) + private IDictionary GatherPreprocessorVariables(IEnumerable defineConstants) { var variables = new Dictionary(); @@ -315,7 +315,7 @@ namespace WixToolset.Core if (variables.ContainsKey(value[0])) { - Messaging.Instance.OnMessage(WixErrors.DuplicateVariableDefinition(value[0], (1 == value.Length) ? String.Empty : value[1], variables[value[0]])); + this.Messaging.Write(ErrorMessages.DuplicateVariableDefinition(value[0], (1 == value.Length) ? String.Empty : value[1], variables[value[0]])); continue; } @@ -325,7 +325,7 @@ namespace WixToolset.Core return variables; } - private static IEnumerable GatherBindPaths(IEnumerable bindPaths) + private IEnumerable GatherBindPaths(IEnumerable bindPaths) { var result = new List(); @@ -339,7 +339,7 @@ namespace WixToolset.Core } else if (File.Exists(bp.Path)) { - Messaging.Instance.OnMessage(WixErrors.ExpectedDirectoryGotFile("-bindpath", bp.Path)); + this.Messaging.Write(ErrorMessages.ExpectedDirectoryGotFile("-bindpath", bp.Path)); } } diff --git a/src/WixToolset.Core/CommandLine/CommandLineContext.cs b/src/WixToolset.Core/CommandLine/CommandLineContext.cs index 96c149be..cbb9af53 100644 --- a/src/WixToolset.Core/CommandLine/CommandLineContext.cs +++ b/src/WixToolset.Core/CommandLine/CommandLineContext.cs @@ -3,7 +3,6 @@ namespace WixToolset.Core { using System; - using WixToolset.Data; using WixToolset.Extensibility.Services; internal class CommandLineContext : ICommandLineContext @@ -15,7 +14,7 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public Messaging Messaging { get; set; } + public IMessaging Messaging { get; set; } public IExtensionManager ExtensionManager { get; set; } diff --git a/src/WixToolset.Core/CommandLine/CompileCommand.cs b/src/WixToolset.Core/CommandLine/CompileCommand.cs index e7fcdd4d..856dd29f 100644 --- a/src/WixToolset.Core/CommandLine/CompileCommand.cs +++ b/src/WixToolset.Core/CommandLine/CompileCommand.cs @@ -11,16 +11,19 @@ namespace WixToolset.Core internal class CompileCommand : ICommandLineCommand { - public CompileCommand(IServiceProvider serviceProvider, IExtensionManager extensions, IEnumerable sources, IDictionary preprocessorVariables) + public CompileCommand(IServiceProvider serviceProvider, IMessaging messaging, IExtensionManager extensions, IEnumerable sources, IDictionary preprocessorVariables) { this.PreprocessorVariables = preprocessorVariables; this.ServiceProvider = serviceProvider; + this.Messaging = messaging; this.ExtensionManager = extensions; this.SourceFiles = sources; } private IServiceProvider ServiceProvider { get; } + private IMessaging Messaging { get; } + private IExtensionManager ExtensionManager { get; } public IEnumerable IncludeSearchPaths { get; } @@ -34,7 +37,7 @@ namespace WixToolset.Core foreach (var sourceFile in this.SourceFiles) { var preprocessContext = this.ServiceProvider.GetService(); - preprocessContext.Messaging = Messaging.Instance; + preprocessContext.Messaging = this.Messaging; preprocessContext.Extensions = this.ExtensionManager.Create(); preprocessContext.Platform = Platform.X86; // TODO: set this correctly preprocessContext.IncludeSearchPaths = this.IncludeSearchPaths?.ToList() ?? new List(); @@ -45,7 +48,7 @@ namespace WixToolset.Core var document = preprocessor.Process(preprocessContext); var compileContext = this.ServiceProvider.GetService(); - compileContext.Messaging = Messaging.Instance; + compileContext.Messaging = this.Messaging; compileContext.CompilationId = Guid.NewGuid().ToString("N"); compileContext.Extensions = this.ExtensionManager.Create(); compileContext.OutputPath = sourceFile.OutputPath; diff --git a/src/WixToolset.Core/Common.cs b/src/WixToolset.Core/Common.cs index 9a0d3aec..ebcbd36f 100644 --- a/src/WixToolset.Core/Common.cs +++ b/src/WixToolset.Core/Common.cs @@ -14,6 +14,7 @@ namespace WixToolset.Core using System.Xml.Linq; using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; /// /// Common Wix utility methods and types. @@ -111,7 +112,7 @@ namespace WixToolset.Core /// The temporary directory to delete. /// The message handler. /// True if all files were deleted, false otherwise. - internal static bool DeleteTempFiles(string path, IMessageHandler messageHandler) + internal static bool DeleteTempFiles(string path, IMessaging messageHandler) { // try three times and give up with a warning if the temp files aren't gone by then int retryLimit = 3; @@ -133,7 +134,7 @@ namespace WixToolset.Core } else { - messageHandler.OnMessage(WixWarnings.AccessDeniedForDeletion(null, path)); + messageHandler.Write(WarningMessages.AccessDeniedForDeletion(null, path)); return false; } } @@ -146,7 +147,7 @@ namespace WixToolset.Core { if (i == (retryLimit - 1)) // last try failed still, give up { - messageHandler.OnMessage(WixWarnings.DirectoryInUse(null, path)); + messageHandler.Write(WarningMessages.DirectoryInUse(null, path)); return false; } @@ -203,7 +204,7 @@ namespace WixToolset.Core codePage = encoding.CodePage; if (0 > codePage || Int16.MaxValue < codePage) { - throw new WixException(WixErrors.InvalidSummaryInfoCodePage(sourceLineNumbers, codePage)); + throw new WixException(ErrorMessages.InvalidSummaryInfoCodePage(sourceLineNumbers, codePage)); } } @@ -327,7 +328,7 @@ namespace WixToolset.Core case "true": return true; default: - throw new WixException(WixErrors.IllegalAttributeValue(sourceLineNumbers, elementName, attributeName, value, "no", "yes")); + throw new WixException(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, elementName, attributeName, value, "no", "yes")); } } @@ -433,7 +434,7 @@ namespace WixToolset.Core /// The FileAttribute to change on each file. /// The message handler. /// If true, add the attribute to each file. If false, remove it. - private static void RecursiveFileAttributes(string path, FileAttributes fileAttribute, bool markAttribute, IMessageHandler messageHandler) + private static void RecursiveFileAttributes(string path, FileAttributes fileAttribute, bool markAttribute, IMessaging messageHandler) { foreach (string subDirectory in Directory.GetDirectories(path)) { @@ -458,7 +459,7 @@ namespace WixToolset.Core } catch (UnauthorizedAccessException) { - messageHandler.OnMessage(WixWarnings.AccessDeniedForSettingAttributes(null, filePath)); + messageHandler.Write(WarningMessages.AccessDeniedForSettingAttributes(null, filePath)); } } } @@ -624,14 +625,14 @@ namespace WixToolset.Core /// A rule for the contents of the value. If the contents do not follow the rule, an error is thrown. /// A delegate that receives error messages. /// The attribute's value. - internal static string GetAttributeValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule) + internal static string GetAttributeValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule) { string value = attribute.Value; if ((emptyRule == EmptyRule.MustHaveNonWhitespaceCharacters && String.IsNullOrEmpty(value.Trim())) || (emptyRule == EmptyRule.CanBeWhitespaceOnly && String.IsNullOrEmpty(value))) { - Messaging.Instance.OnMessage(WixErrors.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); + messaging.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); return String.Empty; } @@ -663,15 +664,15 @@ namespace WixToolset.Core /// The attribute containing the value to get. /// A delegate that receives error messages. /// The attribute's identifier value or a special value if an error occurred. - internal static string GetAttributeIdentifierValue(SourceLineNumber sourceLineNumbers, XAttribute attribute) + internal static string GetAttributeIdentifierValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute) { - string value = Common.GetAttributeValue(sourceLineNumbers, attribute, EmptyRule.CanBeWhitespaceOnly); + string value = Common.GetAttributeValue(messaging, sourceLineNumbers, attribute, EmptyRule.CanBeWhitespaceOnly); if (Common.IsIdentifier(value)) { if (72 < value.Length) { - Messaging.Instance.OnMessage(WixWarnings.IdentifierTooLong(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + messaging.Write(WarningMessages.IdentifierTooLong(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } return value; @@ -680,11 +681,11 @@ namespace WixToolset.Core { if (value.StartsWith("[", StringComparison.Ordinal) && value.EndsWith("]", StringComparison.Ordinal)) { - Messaging.Instance.OnMessage(WixErrors.IllegalIdentifierLooksLikeFormatted(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + messaging.Write(ErrorMessages.IllegalIdentifierLooksLikeFormatted(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } else { - Messaging.Instance.OnMessage(WixErrors.IllegalIdentifier(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + messaging.Write(ErrorMessages.IllegalIdentifier(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } return String.Empty; @@ -700,11 +701,11 @@ namespace WixToolset.Core /// The maximum legal value. /// A delegate that receives error messages. /// The attribute's integer value or a special value if an error occurred during conversion. - public static int GetAttributeIntegerValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, int minimum, int maximum) + public static int GetAttributeIntegerValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute, int minimum, int maximum) { Debug.Assert(minimum > CompilerConstants.IntegerNotSet && minimum > CompilerConstants.IllegalInteger, "The legal values for this attribute collide with at least one sentinel used during parsing."); - string value = Common.GetAttributeValue(sourceLineNumbers, attribute, EmptyRule.CanBeWhitespaceOnly); + string value = Common.GetAttributeValue(messaging, sourceLineNumbers, attribute, EmptyRule.CanBeWhitespaceOnly); int integer = CompilerConstants.IllegalInteger; if (0 < value.Length) @@ -713,17 +714,17 @@ namespace WixToolset.Core { if (CompilerConstants.IntegerNotSet == integer || CompilerConstants.IllegalInteger == integer) { - Messaging.Instance.OnMessage(WixErrors.IntegralValueSentinelCollision(sourceLineNumbers, integer)); + messaging.Write(ErrorMessages.IntegralValueSentinelCollision(sourceLineNumbers, integer)); } else if (minimum > integer || maximum < integer) { - Messaging.Instance.OnMessage(WixErrors.IntegralValueOutOfRange(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, integer, minimum, maximum)); + messaging.Write(ErrorMessages.IntegralValueOutOfRange(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, integer, minimum, maximum)); integer = CompilerConstants.IllegalInteger; } } else { - Messaging.Instance.OnMessage(WixErrors.IllegalIntegerValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + messaging.Write(ErrorMessages.IllegalIntegerValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } } @@ -737,9 +738,9 @@ namespace WixToolset.Core /// The attribute containing the value to get. /// A delegate that receives error messages. /// The attribute's YesNoType value. - internal static YesNoType GetAttributeYesNoValue(SourceLineNumber sourceLineNumbers, XAttribute attribute) + internal static YesNoType GetAttributeYesNoValue(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute) { - string value = Common.GetAttributeValue(sourceLineNumbers, attribute, EmptyRule.CanBeWhitespaceOnly); + string value = Common.GetAttributeValue(messaging, sourceLineNumbers, attribute, EmptyRule.CanBeWhitespaceOnly); YesNoType yesNo = YesNoType.IllegalValue; if ("yes".Equals(value) || "true".Equals(value)) @@ -752,7 +753,7 @@ namespace WixToolset.Core } else { - Messaging.Instance.OnMessage(WixErrors.IllegalYesNoValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + messaging.Write(ErrorMessages.IllegalYesNoValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } return yesNo; @@ -776,13 +777,13 @@ namespace WixToolset.Core /// /// Source line information about the owner element. /// The attribute. - public static void UnexpectedAttribute(SourceLineNumber sourceLineNumbers, XAttribute attribute) + public static void UnexpectedAttribute(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute attribute) { // Ignore elements defined by the W3C because we'll assume they are always right. if (!((String.IsNullOrEmpty(attribute.Name.NamespaceName) && attribute.Name.LocalName.Equals("xmlns", StringComparison.Ordinal)) || attribute.Name.NamespaceName.StartsWith(CompilerCore.W3SchemaPrefix.NamespaceName, StringComparison.Ordinal))) { - Messaging.Instance.OnMessage(WixErrors.UnexpectedAttribute(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); + messaging.Write(ErrorMessages.UnexpectedAttribute(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); } } @@ -791,13 +792,13 @@ namespace WixToolset.Core /// /// Source line information about the owner element. /// The extension attribute. - internal static void UnsupportedExtensionAttribute(SourceLineNumber sourceLineNumbers, XAttribute extensionAttribute) + internal static void UnsupportedExtensionAttribute(IMessaging messaging, SourceLineNumber sourceLineNumbers, XAttribute extensionAttribute) { // Ignore elements defined by the W3C because we'll assume they are always right. if (!((String.IsNullOrEmpty(extensionAttribute.Name.NamespaceName) && extensionAttribute.Name.LocalName.Equals("xmlns", StringComparison.Ordinal)) || extensionAttribute.Name.NamespaceName.StartsWith(CompilerCore.W3SchemaPrefix.NamespaceName, StringComparison.Ordinal))) { - Messaging.Instance.OnMessage(WixErrors.UnsupportedExtensionAttribute(sourceLineNumbers, extensionAttribute.Parent.Name.LocalName, extensionAttribute.Name.LocalName)); + messaging.Write(ErrorMessages.UnsupportedExtensionAttribute(sourceLineNumbers, extensionAttribute.Parent.Name.LocalName, extensionAttribute.Name.LocalName)); } } } diff --git a/src/WixToolset.Core/CompileContext.cs b/src/WixToolset.Core/CompileContext.cs index 85759ec9..fcca94d8 100644 --- a/src/WixToolset.Core/CompileContext.cs +++ b/src/WixToolset.Core/CompileContext.cs @@ -7,6 +7,7 @@ namespace WixToolset.Core using System.Xml.Linq; using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; public class CompileContext : ICompileContext { @@ -17,7 +18,7 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public Messaging Messaging { get; set; } + public IMessaging Messaging { get; set; } public string CompilationId { get; set; } diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index 78461b44..74ca86ac 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs @@ -112,7 +112,7 @@ namespace WixToolset.Core } else { - Messaging.Instance.OnMessage(WixErrors.DuplicateExtensionXmlSchemaNamespace(extension.GetType().ToString(), extension.Namespace.NamespaceName, collidingExtension.GetType().ToString())); + this.Context.Messaging.Write(ErrorMessages.DuplicateExtensionXmlSchemaNamespace(extension.GetType().ToString(), extension.Namespace.NamespaceName, collidingExtension.GetType().ToString())); } extension.PreCompile(context); @@ -123,9 +123,9 @@ namespace WixToolset.Core { var parseHelper = context.ServiceProvider.GetService(); - this.Core = new CompilerCore(target, parseHelper, extensionsByNamespace); + this.Core = new CompilerCore(target, this.Context.Messaging, parseHelper, extensionsByNamespace); this.Core.ShowPedanticMessages = this.ShowPedanticMessages; - this.componentIdPlaceholdersResolver = new WixVariableResolver(); + this.componentIdPlaceholdersResolver = new WixVariableResolver(this.Context.Messaging); // parse the document var source = context.Source; @@ -140,17 +140,17 @@ namespace WixToolset.Core { if (String.IsNullOrEmpty(source.Root.Name.NamespaceName)) { - this.Core.OnMessage(WixErrors.InvalidWixXmlNamespace(sourceLineNumbers, "Wix", CompilerCore.WixNamespace.ToString())); + this.Core.Write(ErrorMessages.InvalidWixXmlNamespace(sourceLineNumbers, "Wix", CompilerCore.WixNamespace.ToString())); } else { - this.Core.OnMessage(WixErrors.InvalidWixXmlNamespace(sourceLineNumbers, "Wix", source.Root.Name.NamespaceName, CompilerCore.WixNamespace.ToString())); + this.Core.Write(ErrorMessages.InvalidWixXmlNamespace(sourceLineNumbers, "Wix", source.Root.Name.NamespaceName, CompilerCore.WixNamespace.ToString())); } } } else { - this.Core.OnMessage(WixErrors.InvalidDocumentElement(sourceLineNumbers, source.Root.Name.LocalName, "source", "Wix")); + this.Core.Write(ErrorMessages.InvalidDocumentElement(sourceLineNumbers, source.Root.Name.LocalName, "source", "Wix")); } // Resolve any Component Id placeholders compiled into the intermediate. @@ -189,7 +189,7 @@ namespace WixToolset.Core this.Core = null; } - return Messaging.Instance.EncounteredError ? null : target; + return this.Context.Messaging.EncounteredError ? null : target; } /// @@ -204,7 +204,7 @@ namespace WixToolset.Core return s; } - return String.Concat(s.Substring(0, 1).ToUpper(CultureInfo.InvariantCulture), s.Substring(1)); + return String.Concat(s.Substring(0, 1).ToUpperInvariant(), s.Substring(1)); } /// @@ -254,7 +254,7 @@ namespace WixToolset.Core { if (property.Id != property.Id.ToUpperInvariant()) { - this.Core.OnMessage(WixErrors.SearchPropertyNotUppercase(sourceLineNumbers, "Property", "Id", property.Id)); + this.Core.Write(ErrorMessages.SearchPropertyNotUppercase(sourceLineNumbers, "Property", "Id", property.Id)); } var row = this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.AppSearch, property); @@ -290,7 +290,7 @@ namespace WixToolset.Core Group group = match.Groups["identifier"]; if (group.Success) { - this.Core.OnMessage(WixWarnings.PropertyValueContainsPropertyReference(sourceLineNumbers, property.Id, group.Value)); + this.Core.Write(WarningMessages.PropertyValueContainsPropertyReference(sourceLineNumbers, property.Id, group.Value)); } } } @@ -330,7 +330,7 @@ namespace WixToolset.Core { if (secure && property.Id != property.Id.ToUpperInvariant()) { - this.Core.OnMessage(WixErrors.SecurePropertyNotUppercase(sourceLineNumbers, "Property", "Id", property.Id)); + this.Core.Write(ErrorMessages.SecurePropertyNotUppercase(sourceLineNumbers, "Property", "Id", property.Id)); } if (null == section) @@ -426,12 +426,12 @@ namespace WixToolset.Core if (null == appId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if ((YesNoType.No == advertise && YesNoType.Yes == appIdAdvertise) || (YesNoType.Yes == advertise && YesNoType.No == appIdAdvertise)) { - this.Core.OnMessage(WixErrors.AppIdIncompatibleAdvertiseState(sourceLineNumbers, node.Name.LocalName, "Advertise", appIdAdvertise.ToString(), advertise.ToString())); + this.Core.Write(ErrorMessages.AppIdIncompatibleAdvertiseState(sourceLineNumbers, node.Name.LocalName, "Advertise", appIdAdvertise.ToString(), advertise.ToString())); } else { @@ -468,7 +468,7 @@ namespace WixToolset.Core { if (null != description) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenAdvertised(sourceLineNumbers, node.Name.LocalName, "Description")); + this.Core.Write(ErrorMessages.IllegalAttributeWhenAdvertised(sourceLineNumbers, node.Name.LocalName, "Description")); } if (!this.Core.EncounteredError) @@ -569,7 +569,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -609,12 +609,12 @@ namespace WixToolset.Core case "src": if (null != sourceFile) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile", "src")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile", "src")); } if ("src" == attrib.Name.LocalName) { - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "SourceFile")); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "SourceFile")); } sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; @@ -634,27 +634,27 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } else if (!String.IsNullOrEmpty(id.Id)) // only check legal values { if (55 < id.Id.Length) { - this.Core.OnMessage(WixErrors.StreamNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, id.Id.Length, 55)); + this.Core.Write(ErrorMessages.StreamNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, id.Id.Length, 55)); } else if (!this.compilingProduct) // if we're not doing a product then we can't be sure that a binary identifier will fit when modularized { if (18 < id.Id.Length) { - this.Core.OnMessage(WixWarnings.IdentifierCannotBeModularized(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, id.Id.Length, 18)); + this.Core.Write(WarningMessages.IdentifierCannotBeModularized(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, id.Id.Length, 18)); } } } if (null == sourceFile) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); } this.Core.ParseForExtensionElements(node); @@ -710,27 +710,27 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } else if (!String.IsNullOrEmpty(id.Id)) // only check legal values { if (57 < id.Id.Length) { - this.Core.OnMessage(WixErrors.StreamNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, id.Id.Length, 57)); + this.Core.Write(ErrorMessages.StreamNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, id.Id.Length, 57)); } else if (!this.compilingProduct) // if we're not doing a product then we can't be sure that a binary identifier will fit when modularized { if (20 < id.Id.Length) { - this.Core.OnMessage(WixWarnings.IdentifierCannotBeModularized(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, id.Id.Length, 20)); + this.Core.Write(WarningMessages.IdentifierCannotBeModularized(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, id.Id.Length, 20)); } } } if (null == sourceFile) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); } this.Core.ParseForExtensionElements(node); @@ -776,7 +776,7 @@ namespace WixToolset.Core if (null == property) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); } // find unexpected child elements @@ -845,12 +845,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == productCode) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ProductCode")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ProductCode")); } this.Core.ParseForExtensionElements(node); @@ -917,12 +917,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == qualifier) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Qualifier")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Qualifier")); } this.Core.ParseForExtensionElements(node); @@ -1066,7 +1066,7 @@ namespace WixToolset.Core if (null == classId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } HashSet uniqueContexts = new HashSet(); @@ -1074,7 +1074,7 @@ namespace WixToolset.Core { if (uniqueContexts.Contains(context)) { - this.Core.OnMessage(WixErrors.DuplicateContextValue(sourceLineNumbers, context)); + this.Core.Write(ErrorMessages.DuplicateContextValue(sourceLineNumbers, context)); } else { @@ -1093,7 +1093,7 @@ namespace WixToolset.Core if ((YesNoType.No == advertise && YesNoType.Yes == classAdvertise) || (YesNoType.Yes == advertise && YesNoType.No == classAdvertise)) { - this.Core.OnMessage(WixErrors.AdvertiseStateMustMatch(sourceLineNumbers, classAdvertise.ToString(), advertise.ToString())); + this.Core.Write(ErrorMessages.AdvertiseStateMustMatch(sourceLineNumbers, classAdvertise.ToString(), advertise.ToString())); } else { @@ -1108,12 +1108,12 @@ namespace WixToolset.Core if (YesNoType.Yes == advertise && 0 == contexts.Length) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Context", "Advertise", "yes")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Context", "Advertise", "yes")); } if (!String.IsNullOrEmpty(parentAppId) && !String.IsNullOrEmpty(appId)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "AppId", node.Parent.Name.LocalName)); + this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "AppId", node.Parent.Name.LocalName)); } if (!String.IsNullOrEmpty(localFileServer)) @@ -1173,12 +1173,12 @@ namespace WixToolset.Core { if (null != fileServer || null != localFileServer) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Server", "Advertise", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Server", "Advertise", "yes")); } if (null != foreignServer) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "ForeignServer", "Advertise", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "ForeignServer", "Advertise", "yes")); } if (null == appId && null != parentAppId) @@ -1226,16 +1226,16 @@ namespace WixToolset.Core { if (null == fileServer && null == localFileServer && null == foreignServer) { - this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "ForeignServer", "Server")); + this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "ForeignServer", "Server")); } if (null != fileServer && null != foreignServer) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "ForeignServer", "File")); + this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "ForeignServer", "File")); } else if (null != localFileServer && null != foreignServer) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "ForeignServer", "Server")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "ForeignServer", "Server")); } else if (null == fileServer) { @@ -1244,7 +1244,7 @@ namespace WixToolset.Core if (null != appId) // need to use nesting (not a reference) for the unadvertised Class elements { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "AppId", "Advertise", "no")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "AppId", "Advertise", "no")); } // add the core registry keys for each context in the class @@ -1254,7 +1254,7 @@ namespace WixToolset.Core { if (null != argument) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Arguments", "Context", context)); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Arguments", "Context", context)); } if (null != fileServer) @@ -1291,7 +1291,7 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Context", context, "InprocServer", "InprocServer32", "LocalServer", "LocalServer32")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Context", context, "InprocServer", "InprocServer32", "LocalServer", "LocalServer32")); } this.Core.CreateRegistryRow(sourceLineNumbers, MsiInterop.MsidbRegistryRootClassesRoot, String.Concat("CLSID\\", classId, "\\", context), String.Empty, formattedContextString, componentId); // ClassId context @@ -1342,7 +1342,7 @@ namespace WixToolset.Core if (YesNoType.NotSet != relativePath) // ClassId's RelativePath { - this.Core.OnMessage(WixErrors.RelativePathForRegistryElement(sourceLineNumbers)); + this.Core.Write(ErrorMessages.RelativePathForRegistryElement(sourceLineNumbers)); } } @@ -1454,12 +1454,12 @@ namespace WixToolset.Core if (null == interfaceId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } this.Core.ParseForExtensionElements(node); @@ -1537,17 +1537,17 @@ namespace WixToolset.Core if (null == mask) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Mask")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Mask")); } if (CompilerConstants.IntegerNotSet == offset) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Offset")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Offset")); } if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } this.Core.ParseForExtensionElements(node); @@ -1556,7 +1556,7 @@ namespace WixToolset.Core { if (mask.Length != value.Length) { - this.Core.OnMessage(WixErrors.ValueAndMaskMustBeSameLength(sourceLineNumbers)); + this.Core.Write(ErrorMessages.ValueAndMaskMustBeSameLength(sourceLineNumbers)); } cb = mask.Length / 2; } @@ -1628,7 +1628,7 @@ namespace WixToolset.Core if (null == minimum && null == maximum) { - this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "Minimum", "Maximum")); + this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "Minimum", "Maximum")); } this.Core.ParseForExtensionElements(node); @@ -1697,7 +1697,7 @@ namespace WixToolset.Core type = 2; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Type", typeValue, "directory", "file", "raw")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Type", typeValue, "directory", "file", "raw")); break; } } @@ -1729,17 +1729,17 @@ namespace WixToolset.Core if (null == key) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); } if (CompilerConstants.IntegerNotSet == root) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Root")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Root")); } if (CompilerConstants.IntegerNotSet == type) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Type")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Type")); } signature = id.Id; @@ -1753,7 +1753,7 @@ namespace WixToolset.Core case "DirectorySearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; @@ -1763,7 +1763,7 @@ namespace WixToolset.Core case "DirectorySearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseDirectorySearchRefElement(child, id.Id); @@ -1771,7 +1771,7 @@ namespace WixToolset.Core case "FileSearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet); @@ -1780,7 +1780,7 @@ namespace WixToolset.Core case "FileSearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; string newId = this.ParseSimpleRefElement(child, "Signature"); // FileSearch signatures override parent signatures @@ -1844,7 +1844,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -1933,7 +1933,7 @@ namespace WixToolset.Core case "DirectorySearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseDirectorySearchElement(child, "CCP_DRIVE"); @@ -1941,7 +1941,7 @@ namespace WixToolset.Core case "DirectorySearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseDirectorySearchRefElement(child, "CCP_DRIVE"); @@ -1959,7 +1959,7 @@ namespace WixToolset.Core if (null == signature) { - this.Core.OnMessage(WixErrors.SearchElementRequired(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.SearchElementRequired(sourceLineNumbers, node.Name.LocalName)); } return signature; @@ -2005,13 +2005,13 @@ namespace WixToolset.Core else if (signature != sig) { // all signatures under a ComplianceCheck must be the same - this.Core.OnMessage(WixErrors.MultipleIdentifiersFound(sourceLineNumbers, node.Name.LocalName, sig, signature)); + this.Core.Write(ErrorMessages.MultipleIdentifiersFound(sourceLineNumbers, node.Name.LocalName, sig, signature)); } } if (null == signature) { - this.Core.OnMessage(WixErrors.SearchElementRequired(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.SearchElementRequired(sourceLineNumbers, node.Name.LocalName)); } if (!this.Core.EncounteredError) @@ -2110,7 +2110,7 @@ namespace WixToolset.Core bits |= MsiInterop.MsidbComponentAttributesSourceOnly; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "either", "local", "source")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "either", "local", "source")); break; } } @@ -2181,30 +2181,30 @@ namespace WixToolset.Core if (null == directoryId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Directory")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Directory")); } if (String.IsNullOrEmpty(guid) && MsiInterop.MsidbComponentAttributesShared == (bits & MsiInterop.MsidbComponentAttributesShared)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Shared", "yes", "Guid", "")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Shared", "yes", "Guid", "")); } if (String.IsNullOrEmpty(guid) && MsiInterop.MsidbComponentAttributesPermanent == (bits & MsiInterop.MsidbComponentAttributesPermanent)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Permanent", "yes", "Guid", "")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Permanent", "yes", "Guid", "")); } if (null != feature) { if (this.compilingModule) { - this.Core.OnMessage(WixErrors.IllegalAttributeInMergeModule(sourceLineNumbers, node.Name.LocalName, "Feature")); + this.Core.Write(ErrorMessages.IllegalAttributeInMergeModule(sourceLineNumbers, node.Name.LocalName, "Feature")); } else { if (ComplexReferenceParentType.Feature == parentType || ComplexReferenceParentType.FeatureGroup == parentType) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "Feature", node.Parent.Name.LocalName)); + this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "Feature", node.Parent.Name.LocalName)); } else { @@ -2236,7 +2236,7 @@ namespace WixToolset.Core if (null != condition) { SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - this.Core.OnMessage(WixErrors.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); } condition = this.ParseConditionElement(child, node.Name.LocalName, null, null); break; @@ -2369,7 +2369,7 @@ namespace WixToolset.Core if (keyFound && YesNoType.Yes == keyPathSet) { - this.Core.OnMessage(WixErrors.ComponentMultipleKeyPaths(sourceLineNumbers, node.Name.LocalName, "KeyPath", "yes", "File", "RegistryValue", "ODBCDataSource")); + this.Core.Write(ErrorMessages.ComponentMultipleKeyPaths(sourceLineNumbers, node.Name.LocalName, "KeyPath", "yes", "File", "RegistryValue", "ODBCDataSource")); } // if a possible KeyPath has been found and that value was explicitly set as @@ -2398,13 +2398,13 @@ namespace WixToolset.Core { if (encounteredODBCDataSource) { - this.Core.OnMessage(WixErrors.IllegalComponentWithAutoGeneratedGuid(sourceLineNumbers)); + this.Core.Write(ErrorMessages.IllegalComponentWithAutoGeneratedGuid(sourceLineNumbers)); isGeneratableGuidOk = false; } if (0 != files && MsiInterop.MsidbComponentAttributesRegistryKeyPath == keyBits) { - this.Core.OnMessage(WixErrors.IllegalComponentWithAutoGeneratedGuid(sourceLineNumbers, true)); + this.Core.Write(ErrorMessages.IllegalComponentWithAutoGeneratedGuid(sourceLineNumbers, true)); isGeneratableGuidOk = false; } } @@ -2412,7 +2412,7 @@ namespace WixToolset.Core // check for implicit KeyPath which can easily be accidentally changed if (this.ShowPedanticMessages && !keyFound && !isGeneratableGuidOk) { - this.Core.OnMessage(WixErrors.ImplicitComponentKeyPath(sourceLineNumbers, id.Id)); + this.Core.Write(ErrorMessages.ImplicitComponentKeyPath(sourceLineNumbers, id.Id)); } // if there isn't an @Id attribute value, replace the placeholder with the id of the keypath. @@ -2428,14 +2428,14 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.CannotDefaultComponentId(sourceLineNumbers)); + this.Core.Write(ErrorMessages.CannotDefaultComponentId(sourceLineNumbers)); } } // If an id was not determined by now, we have to error. if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } // finally add the Component table row @@ -2524,7 +2524,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } @@ -2609,7 +2609,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -2658,7 +2658,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -2705,7 +2705,7 @@ namespace WixToolset.Core type = MsiInterop.MsidbLocatorTypeFileName; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, typeValue, "directory", "file")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, typeValue, "directory", "file")); break; } } @@ -2737,7 +2737,7 @@ namespace WixToolset.Core case "DirectorySearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; @@ -2747,7 +2747,7 @@ namespace WixToolset.Core case "DirectorySearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseDirectorySearchRefElement(child, id.Id); @@ -2755,7 +2755,7 @@ namespace WixToolset.Core case "FileSearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet); @@ -2764,7 +2764,7 @@ namespace WixToolset.Core case "FileSearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; string newId = this.ParseSimpleRefElement(child, "Signature"); // FileSearch signatures override parent signatures @@ -2907,7 +2907,7 @@ namespace WixToolset.Core case "FileId": if (null != fileId) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); + this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); } fileId = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); this.Core.CreateSimpleReference(sourceLineNumbers, "File", fileId); @@ -2934,22 +2934,22 @@ namespace WixToolset.Core if (null != sourceFolder && null != sourceDirectory) // SourceFolder and SourceDirectory cannot coexist { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFolder", "SourceDirectory")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFolder", "SourceDirectory")); } if (null != sourceFolder && null != sourceProperty) // SourceFolder and SourceProperty cannot coexist { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFolder", "SourceProperty")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFolder", "SourceProperty")); } if (null != sourceDirectory && null != sourceProperty) // SourceDirectory and SourceProperty cannot coexist { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceProperty", "SourceDirectory")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceProperty", "SourceDirectory")); } if (null != destinationDirectory && null != destinationProperty) // DestinationDirectory and DestinationProperty cannot coexist { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DestinationProperty", "DestinationDirectory")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DestinationProperty", "DestinationDirectory")); } // generate a short file name @@ -2970,7 +2970,7 @@ namespace WixToolset.Core // DestinationDirectory or DestinationProperty must be specified if (null == destinationDirectory && null == destinationProperty) { - this.Core.OnMessage(WixErrors.ExpectedAttributesWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DestinationDirectory", "DestinationProperty", "FileId")); + this.Core.Write(ErrorMessages.ExpectedAttributesWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DestinationDirectory", "DestinationProperty", "FileId")); } if (!this.Core.EncounteredError) @@ -3007,32 +3007,32 @@ namespace WixToolset.Core { if (null != sourceDirectory) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceDirectory", "FileId")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceDirectory", "FileId")); } if (null != sourceFolder) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFolder", "FileId")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFolder", "FileId")); } if (null != sourceName) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceName", "FileId")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceName", "FileId")); } if (null != sourceProperty) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceProperty", "FileId")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "SourceProperty", "FileId")); } if (delete) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Delete", "FileId")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Delete", "FileId")); } if (null == destinationName && null == destinationDirectory && null == destinationProperty) { - this.Core.OnMessage(WixWarnings.CopyFileFileIdUseless(sourceLineNumbers)); + this.Core.Write(WarningMessages.CopyFileFileIdUseless(sourceLineNumbers)); } if (!this.Core.EncounteredError) @@ -3084,7 +3084,7 @@ namespace WixToolset.Core case "BinaryKey": if (null != source) { - this.Core.OnMessage(WixErrors.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); + this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); } source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); sourceBits = MsiInterop.MsidbCustomActionTypeBinaryData; @@ -3093,7 +3093,7 @@ namespace WixToolset.Core case "Directory": if (null != source) { - this.Core.OnMessage(WixErrors.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); + this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); } source = this.Core.CreateDirectoryReferenceFromInlineSyntax(sourceLineNumbers, attrib, null); sourceBits = MsiInterop.MsidbCustomActionTypeDirectory; @@ -3101,7 +3101,7 @@ namespace WixToolset.Core case "DllEntry": if (null != target) { - this.Core.OnMessage(WixErrors.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); + this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); } target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); targetBits = MsiInterop.MsidbCustomActionTypeDll; @@ -3109,7 +3109,7 @@ namespace WixToolset.Core case "Error": if (null != target) { - this.Core.OnMessage(WixErrors.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); + this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); } target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); targetBits = MsiInterop.MsidbCustomActionTypeTextData | MsiInterop.MsidbCustomActionTypeSourceFile; @@ -3140,7 +3140,7 @@ namespace WixToolset.Core case "ExeCommand": if (null != target) { - this.Core.OnMessage(WixErrors.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); + this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); } target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid targetBits = MsiInterop.MsidbCustomActionTypeExe; @@ -3173,7 +3173,7 @@ namespace WixToolset.Core bits |= MsiInterop.MsidbCustomActionTypeClientRepeat; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, execute, "commit", "deferred", "firstSequence", "immediate", "oncePerProcess", "rollback", "secondSequence")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, execute, "commit", "deferred", "firstSequence", "immediate", "oncePerProcess", "rollback", "secondSequence")); break; } } @@ -3181,7 +3181,7 @@ namespace WixToolset.Core case "FileKey": if (null != source) { - this.Core.OnMessage(WixErrors.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); + this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); } source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); sourceBits = MsiInterop.MsidbCustomActionTypeSourceFile; @@ -3202,7 +3202,7 @@ namespace WixToolset.Core case "JScriptCall": if (null != target) { - this.Core.OnMessage(WixErrors.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); + this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); } target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid targetBits = MsiInterop.MsidbCustomActionTypeJScript; @@ -3216,7 +3216,7 @@ namespace WixToolset.Core case "Property": if (null != source) { - this.Core.OnMessage(WixErrors.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); + this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); } source = this.Core.GetAttributeValue(sourceLineNumbers, attrib); sourceBits = MsiInterop.MsidbCustomActionTypeProperty; @@ -3240,7 +3240,7 @@ namespace WixToolset.Core bits |= MsiInterop.MsidbCustomActionTypeContinue; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, returnValue, "asyncNoWait", "asyncWait", "check", "ignore")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, returnValue, "asyncNoWait", "asyncWait", "check", "ignore")); break; } } @@ -3248,12 +3248,12 @@ namespace WixToolset.Core case "Script": if (null != source) { - this.Core.OnMessage(WixErrors.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); + this.Core.Write(ErrorMessages.CustomActionMultipleSources(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinaryKey", "Directory", "FileKey", "Property", "Script")); } if (null != target) { - this.Core.OnMessage(WixErrors.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); + this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); } // set the source and target to empty string for error messages when the user sets multiple sources or targets @@ -3277,7 +3277,7 @@ namespace WixToolset.Core targetBits = MsiInterop.MsidbCustomActionTypeVBScript; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, script, "jscript", "vbscript")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, script, "jscript", "vbscript")); break; } } @@ -3294,7 +3294,7 @@ namespace WixToolset.Core case "Value": if (null != target) { - this.Core.OnMessage(WixErrors.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); + this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); } target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid targetBits = MsiInterop.MsidbCustomActionTypeTextData; @@ -3302,7 +3302,7 @@ namespace WixToolset.Core case "VBScriptCall": if (null != target) { - this.Core.OnMessage(WixErrors.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); + this.Core.Write(ErrorMessages.CustomActionMultipleTargets(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); } target = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty); // one of the few cases where an empty string value is valid targetBits = MsiInterop.MsidbCustomActionTypeVBScript; @@ -3327,7 +3327,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } @@ -3348,48 +3348,48 @@ namespace WixToolset.Core { if (null == source) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "VBScriptCall", "BinaryKey", "FileKey", "Property")); + this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "VBScriptCall", "BinaryKey", "FileKey", "Property")); } else if (MsiInterop.MsidbCustomActionTypeDirectory == sourceBits) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "VBScriptCall", "Directory")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "VBScriptCall", "Directory")); } } else if (MsiInterop.MsidbCustomActionTypeJScript == targetBits) // non-inline jscript { if (null == source) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "JScriptCall", "BinaryKey", "FileKey", "Property")); + this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "JScriptCall", "BinaryKey", "FileKey", "Property")); } else if (MsiInterop.MsidbCustomActionTypeDirectory == sourceBits) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "JScriptCall", "Directory")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "JScriptCall", "Directory")); } } else if (MsiInterop.MsidbCustomActionTypeExe == targetBits) // exe-command { if (null == source) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "ExeCommand", "BinaryKey", "Directory", "FileKey", "Property")); + this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "ExeCommand", "BinaryKey", "Directory", "FileKey", "Property")); } } else if (MsiInterop.MsidbCustomActionTypeTextData == (bits | sourceBits | targetBits)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "Value", "Directory", "Property")); + this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "Value", "Directory", "Property")); } else if (!String.IsNullOrEmpty(innerText)) // inner text cannot be specified with non-script CAs { - this.Core.OnMessage(WixErrors.CustomActionIllegalInnerText(sourceLineNumbers, node.Name.LocalName, innerText, "Script")); + this.Core.Write(ErrorMessages.CustomActionIllegalInnerText(sourceLineNumbers, node.Name.LocalName, innerText, "Script")); } if (MsiInterop.MsidbCustomActionType64BitScript == (bits & MsiInterop.MsidbCustomActionType64BitScript) && MsiInterop.MsidbCustomActionTypeVBScript != targetBits && MsiInterop.MsidbCustomActionTypeJScript != targetBits) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "Win64", "Script", "VBScriptCall", "JScriptCall")); + this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "Win64", "Script", "VBScriptCall", "JScriptCall")); } if ((MsiInterop.MsidbCustomActionTypeAsync | MsiInterop.MsidbCustomActionTypeContinue) == (bits & (MsiInterop.MsidbCustomActionTypeAsync | MsiInterop.MsidbCustomActionTypeContinue)) && MsiInterop.MsidbCustomActionTypeExe != targetBits) { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Return", "asyncNoWait", "ExeCommand")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Return", "asyncNoWait", "ExeCommand")); } if (MsiInterop.MsidbCustomActionTypeTSAware == (bits & MsiInterop.MsidbCustomActionTypeTSAware)) @@ -3397,7 +3397,7 @@ namespace WixToolset.Core // TS-aware CAs are valid only when deferred so require the in-script Type bit... if (0 == (bits & MsiInterop.MsidbCustomActionTypeInScript)) { - this.Core.OnMessage(WixErrors.IllegalTerminalServerCustomActionAttributes(sourceLineNumbers)); + this.Core.Write(ErrorMessages.IllegalTerminalServerCustomActionAttributes(sourceLineNumbers)); } } @@ -3406,12 +3406,12 @@ namespace WixToolset.Core MsiInterop.MsidbCustomActionTypeTextData == targetBits && 0 != (bits & MsiInterop.MsidbCustomActionTypeInScript)) { - this.Core.OnMessage(WixErrors.IllegalPropertyCustomActionAttributes(sourceLineNumbers)); + this.Core.Write(ErrorMessages.IllegalPropertyCustomActionAttributes(sourceLineNumbers)); } if (0 == targetBits) { - this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); + this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "DllEntry", "Error", "ExeCommand", "JScriptCall", "Script", "Value", "VBScriptCall")); } this.Core.ParseForExtensionElements(node); @@ -3475,7 +3475,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -3520,7 +3520,7 @@ namespace WixToolset.Core if (null == primaryKeys[0]) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.CreateSimpleReference(sourceLineNumbers, "MsiPatchSequence", primaryKeys); @@ -3565,7 +3565,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } @@ -3640,7 +3640,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -3682,11 +3682,11 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } else if (31 < id.Length) { - this.Core.OnMessage(WixErrors.TableNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", id)); + this.Core.Write(ErrorMessages.TableNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", id)); } this.Core.ParseForExtensionElements(node); @@ -3743,11 +3743,11 @@ namespace WixToolset.Core if (null == tableId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } else if (31 < tableId.Length) { - this.Core.OnMessage(WixErrors.CustomTableNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", tableId)); + this.Core.Write(ErrorMessages.CustomTableNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", tableId)); } foreach (XElement child in node.Elements()) @@ -3833,7 +3833,7 @@ namespace WixToolset.Core typeName = "CHAR"; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(childSourceLineNumbers, child.Name.LocalName, "Type", typeValue, "binary", "int", "string")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(childSourceLineNumbers, child.Name.LocalName, "Type", typeValue, "binary", "int", "string")); break; } } @@ -3849,18 +3849,18 @@ namespace WixToolset.Core if (null == columnName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Id")); } if (null == typeName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Type")); + this.Core.Write(ErrorMessages.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Type")); } else if ("SHORT" == typeName) { if (2 != width && 4 != width) { - this.Core.OnMessage(WixErrors.CustomTableIllegalColumnWidth(childSourceLineNumbers, child.Name.LocalName, "Width", width)); + this.Core.Write(ErrorMessages.CustomTableIllegalColumnWidth(childSourceLineNumbers, child.Name.LocalName, "Width", width)); } columnType = String.Concat(nullable ? "I" : "i", width); } @@ -3873,7 +3873,7 @@ namespace WixToolset.Core { if ("Binary" != category) { - this.Core.OnMessage(WixErrors.ExpectedBinaryCategory(childSourceLineNumbers)); + this.Core.Write(ErrorMessages.ExpectedBinaryCategory(childSourceLineNumbers)); } columnType = String.Concat(nullable ? "V" : "v", width); } @@ -3927,7 +3927,7 @@ namespace WixToolset.Core if (null == columnName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(dataSourceLineNumbers, data.Name.LocalName, "Column")); + this.Core.Write(ErrorMessages.ExpectedAttribute(dataSourceLineNumbers, data.Name.LocalName, "Column")); } dataValue = String.Concat(dataValue, null == dataValue ? String.Empty : Common.CustomRowFieldSeparator.ToString(), columnName, ":", Common.GetInnerText(data)); @@ -3959,7 +3959,7 @@ namespace WixToolset.Core { if (null == primaryKeys || 0 == primaryKeys.Length) { - this.Core.OnMessage(WixErrors.CustomTableMissingPrimaryKey(sourceLineNumbers)); + this.Core.Write(ErrorMessages.CustomTableMissingPrimaryKey(sourceLineNumbers)); } if (!this.Core.EncounteredError) @@ -4097,12 +4097,12 @@ namespace WixToolset.Core { if (!String.IsNullOrEmpty(shortName)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "ShortName", "Name")); + this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "ShortName", "Name")); } if (null == parentId) { - this.Core.OnMessage(WixErrors.DirectoryRootWithoutName(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.DirectoryRootWithoutName(sourceLineNumbers, node.Name.LocalName, "Name")); } } else if (!String.IsNullOrEmpty(name)) @@ -4116,11 +4116,11 @@ namespace WixToolset.Core } else if (name.Equals(".")) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "ShortName", "Name", name)); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "ShortName", "Name", name)); } else if (name.Equals(shortName)) { - this.Core.OnMessage(WixWarnings.DirectoryRedundantNames(sourceLineNumbers, node.Name.LocalName, "Name", "ShortName", name)); + this.Core.Write(WarningMessages.DirectoryRedundantNames(sourceLineNumbers, node.Name.LocalName, "Name", "ShortName", name)); } } @@ -4128,7 +4128,7 @@ namespace WixToolset.Core { if (!String.IsNullOrEmpty(shortSourceName)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "ShortSourceName", "SourceName")); + this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "ShortSourceName", "SourceName")); } } else @@ -4142,11 +4142,11 @@ namespace WixToolset.Core } else if (sourceName.Equals(".")) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "ShortSourceName", "SourceName", sourceName)); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "ShortSourceName", "SourceName", sourceName)); } else if (sourceName.Equals(shortSourceName)) { - this.Core.OnMessage(WixWarnings.DirectoryRedundantNames(sourceLineNumbers, node.Name.LocalName, "SourceName", "ShortSourceName", sourceName)); + this.Core.Write(WarningMessages.DirectoryRedundantNames(sourceLineNumbers, node.Name.LocalName, "SourceName", "ShortSourceName", sourceName)); } } @@ -4191,7 +4191,7 @@ namespace WixToolset.Core if ("TARGETDIR".Equals(id.Id) && !"SourceDir".Equals(defaultDir)) { - this.Core.OnMessage(WixErrors.IllegalTargetDirDefaultDir(sourceLineNumbers, defaultDir)); + this.Core.Write(ErrorMessages.IllegalTargetDirDefaultDir(sourceLineNumbers, defaultDir)); } foreach (XElement child in node.Elements()) @@ -4293,7 +4293,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (!String.IsNullOrEmpty(fileSource) && !fileSource.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) @@ -4391,7 +4391,7 @@ namespace WixToolset.Core case "DirectorySearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseDirectorySearchElement(child, id.Id); @@ -4399,7 +4399,7 @@ namespace WixToolset.Core case "DirectorySearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseDirectorySearchRefElement(child, id.Id); @@ -4407,7 +4407,7 @@ namespace WixToolset.Core case "FileSearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; hasFileSearch = true; @@ -4416,7 +4416,7 @@ namespace WixToolset.Core case "FileSearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseSimpleRefElement(child, "Signature"); @@ -4432,7 +4432,7 @@ namespace WixToolset.Core { if (!hasFileSearch) { - this.Core.OnMessage(WixErrors.IllegalParentAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "AssignToProperty", child.Name.LocalName)); + this.Core.Write(ErrorMessages.IllegalParentAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "AssignToProperty", child.Name.LocalName)); } else if (!oneChild) { @@ -4518,7 +4518,7 @@ namespace WixToolset.Core { if (!String.IsNullOrEmpty(parentSignature)) { - this.Core.OnMessage(WixErrors.CanNotHaveTwoParents(sourceLineNumbers, id.Id, parent.Id, parentSignature)); + this.Core.Write(ErrorMessages.CanNotHaveTwoParents(sourceLineNumbers, id.Id, parent.Id, parentSignature)); } else { @@ -4544,7 +4544,7 @@ namespace WixToolset.Core case "DirectorySearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseDirectorySearchElement(child, id.Id); @@ -4552,7 +4552,7 @@ namespace WixToolset.Core case "DirectorySearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseDirectorySearchRefElement(child, id.Id); @@ -4560,7 +4560,7 @@ namespace WixToolset.Core case "FileSearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet); @@ -4568,7 +4568,7 @@ namespace WixToolset.Core case "FileSearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseSimpleRefElement(child, "Signature"); @@ -4636,7 +4636,7 @@ namespace WixToolset.Core bits = bits | MsiInterop.MsidbFeatureAttributesUIDisallowAbsent; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, absent, "allow", "disallow")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, absent, "allow", "disallow")); break; } } @@ -4657,7 +4657,7 @@ namespace WixToolset.Core case Wix.Feature.AllowAdvertiseType.yes: // this is the default break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, allowAdvertise, "no", "system", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, allowAdvertise, "no", "system", "yes")); break; } } @@ -4681,7 +4681,7 @@ namespace WixToolset.Core case Wix.Feature.InstallDefaultType.followParent: if (ComplexReferenceParentType.Product == parentType) { - this.Core.OnMessage(WixErrors.RootFeatureCannotFollowParent(sourceLineNumbers)); + this.Core.Write(ErrorMessages.RootFeatureCannotFollowParent(sourceLineNumbers)); } bits = bits | MsiInterop.MsidbFeatureAttributesFollowParent; break; @@ -4691,7 +4691,7 @@ namespace WixToolset.Core bits = bits | MsiInterop.MsidbFeatureAttributesFavorSource; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, installDefault, "followParent", "local", "source")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, installDefault, "followParent", "local", "source")); break; } } @@ -4703,7 +4703,7 @@ namespace WixToolset.Core title = this.Core.GetAttributeValue(sourceLineNumbers, attrib); if ("PUT-FEATURE-TITLE-HERE" == title) { - this.Core.OnMessage(WixWarnings.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, title)); + this.Core.Write(WarningMessages.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, title)); } break; case "TypicalDefault": @@ -4719,7 +4719,7 @@ namespace WixToolset.Core case Wix.Feature.TypicalDefaultType.install: // this is the default break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, typicalDefault, "advertise", "install")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, typicalDefault, "advertise", "install")); break; } } @@ -4737,27 +4737,27 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } else if (38 < id.Id.Length) { - this.Core.OnMessage(WixErrors.FeatureNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); + this.Core.Write(ErrorMessages.FeatureNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); } if (null != configurableDirectory && configurableDirectory.ToUpper(CultureInfo.InvariantCulture) != configurableDirectory) { - this.Core.OnMessage(WixErrors.FeatureConfigurableDirectoryNotUppercase(sourceLineNumbers, node.Name.LocalName, "ConfigurableDirectory", configurableDirectory)); + this.Core.Write(ErrorMessages.FeatureConfigurableDirectoryNotUppercase(sourceLineNumbers, node.Name.LocalName, "ConfigurableDirectory", configurableDirectory)); } if ("advertise" == typicalDefault && "no" == allowAdvertise) { - this.Core.OnMessage(WixErrors.FeatureCannotFavorAndDisallowAdvertise(sourceLineNumbers, node.Name.LocalName, "TypicalDefault", typicalDefault, "AllowAdvertise", allowAdvertise)); + this.Core.Write(ErrorMessages.FeatureCannotFavorAndDisallowAdvertise(sourceLineNumbers, node.Name.LocalName, "TypicalDefault", typicalDefault, "AllowAdvertise", allowAdvertise)); } if (YesNoType.Yes == followParent && ("local" == installDefault || "source" == installDefault)) { - this.Core.OnMessage(WixErrors.FeatureCannotFollowParentAndFavorLocalOrSource(sourceLineNumbers, node.Name.LocalName, "InstallDefault", "FollowParent", "yes")); + this.Core.Write(ErrorMessages.FeatureCannotFollowParentAndFavorLocalOrSource(sourceLineNumbers, node.Name.LocalName, "InstallDefault", "FollowParent", "yes")); } int childDisplay = 0; @@ -4827,7 +4827,7 @@ namespace WixToolset.Core int value; if (!Int32.TryParse(display, NumberStyles.Integer, CultureInfo.InvariantCulture, out value)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Display", display, "collapse", "expand", "hidden")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Display", display, "collapse", "expand", "hidden")); } else { @@ -4892,7 +4892,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } int lastDisplay = 0; @@ -4978,7 +4978,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } @@ -5074,7 +5074,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -5133,7 +5133,7 @@ namespace WixToolset.Core action = "!"; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, value, "create", "set", "remove")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, value, "create", "set", "remove")); break; } } @@ -5145,7 +5145,7 @@ namespace WixToolset.Core part = this.Core.GetAttributeValue(sourceLineNumbers, attrib); if (!Wix.Environment.TryParsePartType(part, out partType)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Part", part, "all", "first", "last")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Part", part, "all", "first", "last")); } break; case "Permanent": @@ -5178,14 +5178,14 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } if (Wix.Environment.PartType.NotSet != partType) { if ("+" == action) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Part", "Action", "create")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Part", "Action", "create")); } switch (partType) @@ -5248,7 +5248,7 @@ namespace WixToolset.Core if (CompilerConstants.IntegerNotSet == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = CompilerConstants.IllegalInteger; } @@ -5288,7 +5288,7 @@ namespace WixToolset.Core YesNoType extensionAdvertise = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); if ((YesNoType.No == advertise && YesNoType.Yes == extensionAdvertise) || (YesNoType.Yes == advertise && YesNoType.No == extensionAdvertise)) { - this.Core.OnMessage(WixErrors.AdvertiseStateMustMatch(sourceLineNumbers, extensionAdvertise.ToString(), advertise.ToString())); + this.Core.Write(ErrorMessages.AdvertiseStateMustMatch(sourceLineNumbers, extensionAdvertise.ToString(), advertise.ToString())); } advertise = extensionAdvertise; break; @@ -5445,7 +5445,7 @@ namespace WixToolset.Core assemblyType = FileAssemblyType.Win32Assembly; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, "File", "Assembly", assemblyValue, "no", "win32", ".net")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, "File", "Assembly", assemblyValue, "no", "win32", ".net")); break; } } @@ -5545,7 +5545,7 @@ namespace WixToolset.Core procArch = "ia64"; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, "File", "ProcessorArchitecture", procArchValue, "msil", "x86", "x64", "ia64")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, "File", "ProcessorArchitecture", procArchValue, "msil", "x86", "x64", "ia64")); break; } } @@ -5609,7 +5609,7 @@ namespace WixToolset.Core // the companion file cannot be the key path of a component if (YesNoType.Yes == keyPath) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "CompanionFile", "KeyPath", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "CompanionFile", "KeyPath", "yes")); } } @@ -5618,7 +5618,7 @@ namespace WixToolset.Core name = Path.GetFileName(source); if (!this.Core.IsValidLongFilename(name, false)) { - this.Core.OnMessage(WixErrors.IllegalLongFilename(sourceLineNumbers, node.Name.LocalName, "Source", name)); + this.Core.Write(ErrorMessages.IllegalLongFilename(sourceLineNumbers, node.Name.LocalName, "Source", name)); } } @@ -5641,32 +5641,32 @@ namespace WixToolset.Core if (null != defaultVersion && null != companionFile) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DefaultVersion", "CompanionFile", companionFile)); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DefaultVersion", "CompanionFile", companionFile)); } if (FileAssemblyType.NotAnAssembly == assemblyType) { if (null != assemblyManifest) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Assembly", "AssemblyManifest")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Assembly", "AssemblyManifest")); } if (null != assemblyApplication) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Assembly", "AssemblyApplication")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Assembly", "AssemblyApplication")); } } else { if (FileAssemblyType.Win32Assembly == assemblyType && null == assemblyManifest) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "AssemblyManifest", "Assembly", "win32")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "AssemblyManifest", "Assembly", "win32")); } // allow "*" guid components to omit explicit KeyPath as they can have only one file and therefore this file is the keypath if (YesNoType.Yes != keyPath && "*" != componentGuid) { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Assembly", (FileAssemblyType.DotNetAssembly == assemblyType ? ".net" : "win32"), "KeyPath", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Assembly", (FileAssemblyType.DotNetAssembly == assemblyType ? ".net" : "win32"), "KeyPath", "yes")); } } @@ -5942,11 +5942,11 @@ namespace WixToolset.Core // Using both ShortName and Name will not always work due to a Windows Installer bug. if (null != shortName && null != name) { - this.Core.OnMessage(WixWarnings.FileSearchFileNameIssue(sourceLineNumbers, node.Name.LocalName, "ShortName", "Name")); + this.Core.Write(WarningMessages.FileSearchFileNameIssue(sourceLineNumbers, node.Name.LocalName, "ShortName", "Name")); } else if (null == shortName && null == name) // at least one name must be specified. { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } if (this.Core.IsValidShortFilename(name, false)) @@ -5958,7 +5958,7 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); } } @@ -5981,7 +5981,7 @@ namespace WixToolset.Core // value must be specified and unique. if (isSameId) { - this.Core.OnMessage(WixErrors.UniqueFileSearchIdRequired(sourceLineNumbers, parentSignature, node.Name.LocalName)); + this.Core.Write(ErrorMessages.UniqueFileSearchIdRequired(sourceLineNumbers, parentSignature, node.Name.LocalName)); } } else if (parentDepth > 1) @@ -5990,7 +5990,7 @@ namespace WixToolset.Core // as the parent DirectorySearch if AssignToProperty is not set. if (!isSameId) { - this.Core.OnMessage(WixErrors.IllegalSearchIdForParentDepth(sourceLineNumbers, id.Id, parentSignature)); + this.Core.Write(ErrorMessages.IllegalSearchIdForParentDepth(sourceLineNumbers, id.Id, parentSignature)); } } @@ -6284,7 +6284,7 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, action, "default", "disable", "enable", "hide", "show")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, action, "default", "disable", "enable", "hide", "show")); } } } @@ -6333,7 +6333,7 @@ namespace WixToolset.Core if (null == condition || 0 == condition.Length) { condition = null; - this.Core.OnMessage(WixErrors.ConditionExpected(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.ConditionExpected(sourceLineNumbers, node.Name.LocalName)); } switch (parentElementLocalName) @@ -6341,7 +6341,7 @@ namespace WixToolset.Core case "Control": if (null == action) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action")); } if (!this.Core.EncounteredError) @@ -6356,7 +6356,7 @@ namespace WixToolset.Core case "Feature": if (CompilerConstants.IntegerNotSet == level) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Level")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Level")); level = CompilerConstants.IllegalInteger; } @@ -6372,7 +6372,7 @@ namespace WixToolset.Core case "Product": if (null == message) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Message")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Message")); } if (!this.Core.EncounteredError) @@ -6437,7 +6437,7 @@ namespace WixToolset.Core action = MsiInterop.MsidbIniFileActionRemoveTag; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Action", actionValue, "addLine", "addTag", "createLine", "removeLine", "removeTag")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Action", actionValue, "addLine", "addTag", "createLine", "removeLine", "removeTag")); break; } } @@ -6473,18 +6473,18 @@ namespace WixToolset.Core if (CompilerConstants.IntegerNotSet == action) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action")); action = CompilerConstants.IllegalInteger; } if (null == key) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); } if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } else if (0 < name.Length) { @@ -6497,7 +6497,7 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); } } else // generate a short file name. @@ -6511,7 +6511,7 @@ namespace WixToolset.Core if (null == section) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Section")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Section")); } if (null == id) @@ -6529,7 +6529,7 @@ namespace WixToolset.Core { if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } tableName = TupleDefinitionType.IniFile; @@ -6606,7 +6606,7 @@ namespace WixToolset.Core type = 2; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Type", typeValue, "directory", "file", "registry")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Type", typeValue, "directory", "file", "registry")); break; } } @@ -6624,12 +6624,12 @@ namespace WixToolset.Core if (null == key) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); } if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } else if (0 < name.Length) { @@ -6642,7 +6642,7 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); } } else if (null == shortName) // generate a short file name. @@ -6653,7 +6653,7 @@ namespace WixToolset.Core if (null == section) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Section")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Section")); } if (null == id) @@ -6674,7 +6674,7 @@ namespace WixToolset.Core case "DirectorySearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); } oneChild = true; @@ -6684,7 +6684,7 @@ namespace WixToolset.Core case "DirectorySearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(childSourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseDirectorySearchRefElement(child, id.Id); @@ -6692,7 +6692,7 @@ namespace WixToolset.Core case "FileSearch": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; signature = this.ParseFileSearchElement(child, id.Id, false, CompilerConstants.IntegerNotSet); @@ -6701,7 +6701,7 @@ namespace WixToolset.Core case "FileSearchRef": if (oneChild) { - this.Core.OnMessage(WixErrors.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManySearchElements(sourceLineNumbers, node.Name.LocalName)); } oneChild = true; string newId = this.ParseSimpleRefElement(child, "Signature"); // FileSearch signatures override parent signatures @@ -6768,7 +6768,7 @@ namespace WixToolset.Core if (null == shared) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Shared")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Shared")); } this.Core.ParseForExtensionElements(node); @@ -6866,12 +6866,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } else if (40 < id.Id.Length) { - this.Core.OnMessage(WixErrors.StreamNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, id.Id.Length, 40)); + this.Core.Write(ErrorMessages.StreamNameTooLong(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, id.Id.Length, 40)); // No need to check for modularization problems since DigitalSignature and thus DigitalCertificate // currently have no usage in merge modules. @@ -6879,7 +6879,7 @@ namespace WixToolset.Core if (null == sourceFile) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); } this.Core.ParseForExtensionElements(node); @@ -6952,7 +6952,7 @@ namespace WixToolset.Core if (null == certificateId) { - this.Core.OnMessage(WixErrors.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "DigitalCertificate")); + this.Core.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "DigitalCertificate")); } if (!this.Core.EncounteredError) @@ -6985,13 +6985,13 @@ namespace WixToolset.Core string upgradeCode = contextValues["UpgradeCode"]; if (String.IsNullOrEmpty(upgradeCode)) { - this.Core.OnMessage(WixErrors.ParentElementAttributeRequired(sourceLineNumbers, "Product", "UpgradeCode", node.Name.LocalName)); + this.Core.Write(ErrorMessages.ParentElementAttributeRequired(sourceLineNumbers, "Product", "UpgradeCode", node.Name.LocalName)); } string productVersion = contextValues["ProductVersion"]; if (String.IsNullOrEmpty(productVersion)) { - this.Core.OnMessage(WixErrors.ParentElementAttributeRequired(sourceLineNumbers, "Product", "Version", node.Name.LocalName)); + this.Core.Write(ErrorMessages.ParentElementAttributeRequired(sourceLineNumbers, "Product", "Version", node.Name.LocalName)); } string productLanguage = contextValues["ProductLanguage"]; @@ -7056,27 +7056,27 @@ namespace WixToolset.Core if (!allowDowngrades && String.IsNullOrEmpty(downgradeErrorMessage)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DowngradeErrorMessage", "AllowDowngrades", "yes", true)); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DowngradeErrorMessage", "AllowDowngrades", "yes", true)); } if (allowDowngrades && !String.IsNullOrEmpty(downgradeErrorMessage)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DowngradeErrorMessage", "AllowDowngrades", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DowngradeErrorMessage", "AllowDowngrades", "yes")); } if (allowDowngrades && allowSameVersionUpgrades) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "AllowSameVersionUpgrades", "AllowDowngrades", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "AllowSameVersionUpgrades", "AllowDowngrades", "yes")); } if (blockUpgrades && String.IsNullOrEmpty(disallowUpgradeErrorMessage)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisallowUpgradeErrorMessage", "Disallow", "yes", true)); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisallowUpgradeErrorMessage", "Disallow", "yes", true)); } if (!blockUpgrades && !String.IsNullOrEmpty(disallowUpgradeErrorMessage)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DisallowUpgradeErrorMessage", "Disallow", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DisallowUpgradeErrorMessage", "Disallow", "yes")); } if (!this.Core.EncounteredError) @@ -7207,7 +7207,7 @@ namespace WixToolset.Core Wix.CompressionLevelType compressionLevelType; if (!Wix.Enums.TryParseCompressionLevelType(compressionLevelString, out compressionLevelType)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, compressionLevelString, "high", "low", "medium", "mszip", "none")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, compressionLevelString, "high", "low", "medium", "mszip", "none")); } else { @@ -7226,12 +7226,12 @@ namespace WixToolset.Core case "src": if (null != layout) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Layout", "src")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Layout", "src")); } if ("src" == attrib.Name.LocalName) { - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Layout")); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Layout")); } layout = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; @@ -7254,7 +7254,7 @@ namespace WixToolset.Core if (CompilerConstants.IntegerNotSet == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = CompilerConstants.IllegalInteger; } @@ -7264,13 +7264,13 @@ namespace WixToolset.Core { if (null == cabinet) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Cabinet", "EmbedCab", "yes")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Cabinet", "EmbedCab", "yes")); } else { if (62 < cabinet.Length) { - this.Core.OnMessage(WixErrors.MediaEmbeddedCabinetNameTooLong(sourceLineNumbers, node.Name.LocalName, "Cabinet", cabinet, cabinet.Length)); + this.Core.Write(ErrorMessages.MediaEmbeddedCabinetNameTooLong(sourceLineNumbers, node.Name.LocalName, "Cabinet", cabinet, cabinet.Length)); } cabinet = String.Concat("#", cabinet); @@ -7284,7 +7284,7 @@ namespace WixToolset.Core // WiX variables in the name will trip the "not a valid 8.3 name" switch, so let them through if (!Common.WixVariableRegex.Match(cabinet).Success) { - this.Core.OnMessage(WixWarnings.MediaExternalCabinetFilenameIllegal(sourceLineNumbers, node.Name.LocalName, "Cabinet", cabinet)); + this.Core.Write(WarningMessages.MediaExternalCabinetFilenameIllegal(sourceLineNumbers, node.Name.LocalName, "Cabinet", cabinet)); } } } @@ -7292,7 +7292,7 @@ namespace WixToolset.Core if (null != compressionLevel && null == cabinet) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Cabinet", "CompressionLevel")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Cabinet", "CompressionLevel")); } if (patch) @@ -7314,11 +7314,11 @@ namespace WixToolset.Core case "DigitalSignature": if (YesNoType.Yes == embedCab) { - this.Core.OnMessage(WixErrors.SignedEmbeddedCabinet(childSourceLineNumbers)); + this.Core.Write(ErrorMessages.SignedEmbeddedCabinet(childSourceLineNumbers)); } else if (null == cabinet) { - this.Core.OnMessage(WixErrors.ExpectedSignedCabinetName(childSourceLineNumbers)); + this.Core.Write(ErrorMessages.ExpectedSignedCabinetName(childSourceLineNumbers)); } else { @@ -7428,11 +7428,11 @@ namespace WixToolset.Core // reason for having multiple cabients. External cabinet files must also be valid file names. if (exampleCabinetName.Equals(authoredCabinetTemplateValue) || !this.Core.IsValidLongFilename(exampleCabinetName, false)) { - this.Core.OnMessage(WixErrors.InvalidCabinetTemplate(sourceLineNumbers, cabinetTemplate)); + this.Core.Write(ErrorMessages.InvalidCabinetTemplate(sourceLineNumbers, cabinetTemplate)); } else if (!this.Core.IsValidShortFilename(exampleCabinetName, false) && !Common.WixVariableRegex.Match(exampleCabinetName).Success) // ignore short names with wix variables because it rarely works out. { - this.Core.OnMessage(WixWarnings.MediaExternalCabinetFilenameIllegal(sourceLineNumbers, node.Name.LocalName, "CabinetTemplate", cabinetTemplate)); + this.Core.Write(WarningMessages.MediaExternalCabinetFilenameIllegal(sourceLineNumbers, node.Name.LocalName, "CabinetTemplate", cabinetTemplate)); } } break; @@ -7442,21 +7442,21 @@ namespace WixToolset.Core { if (!Wix.Enums.TryParseCompressionLevelType(compressionLevel, out compressionLevelType)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, compressionLevel, "high", "low", "medium", "mszip", "none")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, compressionLevel, "high", "low", "medium", "mszip", "none")); } } break; case "DiskPrompt": diskPrompt = this.Core.GetAttributeValue(sourceLineNumbers, attrib); this.Core.CreateSimpleReference(sourceLineNumbers, "Property", "DiskPrompt"); // ensure the output has a DiskPrompt Property defined - this.Core.OnMessage(WixWarnings.ReservedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); + this.Core.Write(WarningMessages.ReservedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); break; case "EmbedCab": embedCab = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); break; case "VolumeLabel": volumeLabel = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - this.Core.OnMessage(WixWarnings.ReservedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); + this.Core.Write(WarningMessages.ReservedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); break; case "MaximumUncompressedMediaSize": maximumUncompressedMediaSize = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 1, int.MaxValue); @@ -7582,22 +7582,22 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == language) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Language")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Language")); } if (null == sourceFile) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); } if (CompilerConstants.IntegerNotSet == diskId) { - this.Core.OnMessage(WixErrors.ExpectedAttributeInElementOrParent(sourceLineNumbers, node.Name.LocalName, "DiskId", "Directory")); + this.Core.Write(ErrorMessages.ExpectedAttributeInElementOrParent(sourceLineNumbers, node.Name.LocalName, "DiskId", "Directory")); diskId = CompilerConstants.IllegalInteger; } @@ -7688,7 +7688,7 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } else // need to hex encode these characters { @@ -7699,7 +7699,7 @@ namespace WixToolset.Core if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } else // need to hex encode these characters { @@ -7751,7 +7751,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -7806,7 +7806,7 @@ namespace WixToolset.Core if (null == contentType) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ContentType")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ContentType")); } // if the advertise state has not been set, default to non-advertised @@ -7821,7 +7821,7 @@ namespace WixToolset.Core { if (YesNoType.Yes != parentAdvertised) { - this.Core.OnMessage(WixErrors.AdvertiseStateMustMatch(sourceLineNumbers, advertise.ToString(), parentAdvertised.ToString())); + this.Core.Write(ErrorMessages.AdvertiseStateMustMatch(sourceLineNumbers, advertise.ToString(), parentAdvertised.ToString())); } if (!this.Core.EncounteredError) @@ -7836,7 +7836,7 @@ namespace WixToolset.Core { if (YesNoType.Yes == returnContentType && YesNoType.Yes == parentAdvertised) { - this.Core.OnMessage(WixErrors.CannotDefaultMismatchedAdvertiseStates(sourceLineNumbers)); + this.Core.Write(ErrorMessages.CannotDefaultMismatchedAdvertiseStates(sourceLineNumbers)); } this.Core.CreateRegistryRow(sourceLineNumbers, MsiInterop.MsidbRegistryRootClassesRoot, String.Concat("MIME\\Database\\Content Type\\", contentType), "Extension", String.Concat(".", extension), componentId); @@ -7873,7 +7873,7 @@ namespace WixToolset.Core this.activeName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); if ("PUT-MODULE-NAME-HERE" == this.activeName) { - this.Core.OnMessage(WixWarnings.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, this.activeName)); + this.Core.Write(WarningMessages.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, this.activeName)); } else { @@ -7885,7 +7885,7 @@ namespace WixToolset.Core break; case "Guid": moduleId = this.Core.GetAttributeGuidValue(sourceLineNumbers, attrib, false); - this.Core.OnMessage(WixWarnings.DeprecatedModuleGuidAttribute(sourceLineNumbers)); + this.Core.Write(WarningMessages.DeprecatedModuleGuidAttribute(sourceLineNumbers)); break; case "Language": this.activeLanguage = this.Core.GetAttributeLocalizableIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue); @@ -7906,21 +7906,21 @@ namespace WixToolset.Core if (null == this.activeName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == this.activeLanguage) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Language")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Language")); } if (null == version) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); } else if (!CompilerCore.IsValidModuleOrBundleVersion(version)) { - this.Core.OnMessage(WixWarnings.InvalidModuleOrBundleVersion(sourceLineNumbers, "Module", version)); + this.Core.Write(WarningMessages.InvalidModuleOrBundleVersion(sourceLineNumbers, "Module", version)); } try @@ -8119,7 +8119,7 @@ namespace WixToolset.Core if (null == this.activeName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.CreateActiveSection(this.activeName, SectionType.PatchCreation, codepage, this.Context.CompilationId); @@ -8250,13 +8250,13 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "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.OnMessage(WixErrors.FamilyNameTooLong(sourceLineNumbers, node.Name.LocalName, "Name", name, name.Length)); + this.Core.Write(ErrorMessages.FamilyNameTooLong(sourceLineNumbers, node.Name.LocalName, "Name", name, name.Length)); } else // check for illegal characters { @@ -8264,7 +8264,7 @@ namespace WixToolset.Core { if (!Char.IsLetterOrDigit(character) && '_' != character) { - this.Core.OnMessage(WixErrors.IllegalFamilyName(sourceLineNumbers, node.Name.LocalName, "Name", name)); + this.Core.Write(ErrorMessages.IllegalFamilyName(sourceLineNumbers, node.Name.LocalName, "Name", name)); } } } @@ -8338,19 +8338,19 @@ namespace WixToolset.Core upgrade = this.Core.GetAttributeValue(sourceLineNumbers, attrib); if (13 < upgrade.Length) { - this.Core.OnMessage(WixErrors.IdentifierTooLongError(sourceLineNumbers, node.Name.LocalName, "Id", upgrade, 13)); + this.Core.Write(ErrorMessages.IdentifierTooLongError(sourceLineNumbers, node.Name.LocalName, "Id", upgrade, 13)); } break; case "SourceFile": case "src": if (null != sourceFile) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "src", "SourceFile")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "src", "SourceFile")); } if ("src" == attrib.Name.LocalName) { - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "SourceFile")); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "SourceFile")); } sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; @@ -8358,12 +8358,12 @@ namespace WixToolset.Core case "srcPatch": if (null != sourcePatch) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "srcPatch", "SourcePatch")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "srcPatch", "SourcePatch")); } if ("srcPatch" == attrib.Name.LocalName) { - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "SourcePatch")); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "SourcePatch")); } sourcePatch = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; @@ -8380,12 +8380,12 @@ namespace WixToolset.Core if (null == upgrade) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == sourceFile) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); } foreach (XElement child in node.Elements()) @@ -8470,7 +8470,7 @@ namespace WixToolset.Core if (null == file) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "File")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "File")); } foreach (XElement child in node.Elements()) @@ -8539,7 +8539,7 @@ namespace WixToolset.Core target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); if (target.Length > 13) { - this.Core.OnMessage(WixErrors.IdentifierTooLongError(sourceLineNumbers, node.Name.LocalName, "Id", target, 13)); + this.Core.Write(ErrorMessages.IdentifierTooLongError(sourceLineNumbers, node.Name.LocalName, "Id", target, 13)); } break; case "IgnoreMissingFiles": @@ -8552,12 +8552,12 @@ namespace WixToolset.Core case "src": if (null != sourceFile) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "src", "SourceFile")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "src", "SourceFile")); } if ("src" == attrib.Name.LocalName) { - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "SourceFile")); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "SourceFile")); } sourceFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; @@ -8577,17 +8577,17 @@ namespace WixToolset.Core if (null == target) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == sourceFile) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); } if (CompilerConstants.IntegerNotSet == order) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Order")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Order")); } foreach (XElement child in node.Elements()) @@ -8671,7 +8671,7 @@ namespace WixToolset.Core if (null == file) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } foreach (XElement child in node.Elements()) @@ -8755,12 +8755,12 @@ namespace WixToolset.Core case "src": if (null != source) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "src", "Source")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "src", "Source")); } if ("src" == attrib.Name.LocalName) { - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Source")); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Source")); } source = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; @@ -8777,17 +8777,17 @@ namespace WixToolset.Core if (null == file) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "File")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "File")); } if (null == source) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Source")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Source")); } if (CompilerConstants.IntegerNotSet == order) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Order")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Order")); } foreach (XElement child in node.Elements()) @@ -8880,7 +8880,7 @@ namespace WixToolset.Core if (null == file) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "File")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "File")); } foreach (XElement child in node.Elements()) @@ -8905,7 +8905,7 @@ namespace WixToolset.Core if (null == protectOffsets || null == protectLengths) { - this.Core.OnMessage(WixErrors.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "ProtectRange")); + this.Core.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "ProtectRange")); } if (!this.Core.EncounteredError) @@ -8955,12 +8955,12 @@ namespace WixToolset.Core if (null == length) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Length")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Length")); } if (null == offset) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Offset")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Offset")); } this.Core.ParseForExtensionElements(node); @@ -9025,12 +9025,12 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } this.Core.ParseForExtensionElements(node); @@ -9047,7 +9047,7 @@ namespace WixToolset.Core { if (null != company) { - this.Core.OnMessage(WixErrors.UnexpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Company")); + this.Core.Write(ErrorMessages.UnexpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Company")); } this.ProcessProperties(sourceLineNumbers, name, value); } @@ -9077,22 +9077,22 @@ namespace WixToolset.Core case "ProductCode": if (null != target) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Target", "TargetImage")); + 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.OnMessage(WixErrors.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "TargetImage", "ProductCode")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "TargetImage", "ProductCode")); } - this.Core.OnMessage(WixWarnings.DeprecatedPatchSequenceTargetAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); + 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.OnMessage(WixErrors.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Target", "ProductCode")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Target", "ProductCode")); } target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); this.Core.CreateSimpleReference(sourceLineNumbers, "TargetImages", target); @@ -9119,7 +9119,7 @@ namespace WixToolset.Core if (null == family) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "PatchFamily")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "PatchFamily")); } this.Core.ParseForExtensionElements(node); @@ -9173,7 +9173,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -9221,7 +9221,7 @@ namespace WixToolset.Core string id = this.ParseTargetProductCodeElement(child); if (0 == String.CompareOrdinal("*", id)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWhenNested(sourceLineNumbers, child.Name.LocalName, "Id", id, node.Name.LocalName)); + this.Core.Write(ErrorMessages.IllegalAttributeValueWhenNested(sourceLineNumbers, child.Name.LocalName, "Id", id, node.Name.LocalName)); } else { @@ -9288,7 +9288,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -9328,7 +9328,7 @@ namespace WixToolset.Core if (null == path) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Path")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Path")); } this.Core.ParseForExtensionElements(node); @@ -9446,11 +9446,11 @@ namespace WixToolset.Core if (null == this.activeName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == classification) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Classification")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Classification")); } if (null == clientPatchId) { @@ -9458,15 +9458,15 @@ namespace WixToolset.Core } if (null == description) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Description")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Description")); } if (null == displayName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisplayName")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisplayName")); } if (null == manufacturer) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Manufacturer")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Manufacturer")); } this.Core.CreateActiveSection(this.activeName, SectionType.Patch, codepage, this.Context.CompilationId); @@ -9668,17 +9668,17 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } if (String.IsNullOrEmpty(version)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); } else if (!CompilerCore.IsValidProductVersion(version)) { - this.Core.OnMessage(WixErrors.InvalidProductVersion(sourceLineNumbers, version)); + this.Core.Write(ErrorMessages.InvalidProductVersion(sourceLineNumbers, version)); } // find unexpected child elements @@ -9768,7 +9768,7 @@ namespace WixToolset.Core this.Core.ParseForExtensionElements(node); // Always warn when using the All element. - this.Core.OnMessage(WixWarnings.AllChangesIncludedInPatch(sourceLineNumbers)); + this.Core.Write(WarningMessages.AllChangesIncludedInPatch(sourceLineNumbers)); if (!this.Core.EncounteredError) { @@ -9808,7 +9808,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -9853,12 +9853,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } else if (27 < id.Id.Length) { - this.Core.OnMessage(WixErrors.IdentifierTooLongError(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, 27)); + this.Core.Write(ErrorMessages.IdentifierTooLongError(sourceLineNumbers, node.Name.LocalName, "Id", id.Id, 27)); } foreach (XElement child in node.Elements()) @@ -9871,7 +9871,7 @@ namespace WixToolset.Core if (parsedValidate) { SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); - this.Core.OnMessage(WixErrors.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); } else { @@ -9949,7 +9949,7 @@ namespace WixToolset.Core validationFlags |= TransformFlags.ValidateUpdateVersion; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Version", check, "Major", "Minor", "Update")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Version", check, "Major", "Minor", "Update")); break; } break; @@ -9975,7 +9975,7 @@ namespace WixToolset.Core validationFlags |= TransformFlags.ValidateNewGreaterBaseVersion; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Operator", op, "Lesser", "LesserOrEqual", "Equal", "GreaterOrEqual", "Greater")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Operator", op, "Lesser", "LesserOrEqual", "Equal", "GreaterOrEqual", "Greater")); break; } break; @@ -10117,13 +10117,13 @@ namespace WixToolset.Core if (null == requiredId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "RequiredId")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "RequiredId")); requiredId = String.Empty; } if (CompilerConstants.IntegerNotSet == requiredLanguage) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "RequiredLanguage")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "RequiredLanguage")); requiredLanguage = CompilerConstants.IllegalInteger; } @@ -10188,13 +10188,13 @@ namespace WixToolset.Core if (null == excludedId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ExcludedId")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ExcludedId")); excludedId = String.Empty; } if (CompilerConstants.IntegerNotSet != excludeExceptLanguage && CompilerConstants.IntegerNotSet != excludeLanguage) { - this.Core.OnMessage(WixErrors.IllegalModuleExclusionLanguageAttributes(sourceLineNumbers)); + this.Core.Write(ErrorMessages.IllegalModuleExclusionLanguageAttributes(sourceLineNumbers)); } else if (CompilerConstants.IntegerNotSet != excludeExceptLanguage) { @@ -10278,7 +10278,7 @@ namespace WixToolset.Core format = 3; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Format", formatStr, "Text", "Key", "Integer", "Bitfield")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Format", formatStr, "Text", "Key", "Integer", "Bitfield")); break; } } @@ -10317,13 +10317,13 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); name = String.Empty; } if (CompilerConstants.IntegerNotSet == format) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Format")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Format")); format = CompilerConstants.IllegalInteger; } @@ -10388,19 +10388,19 @@ namespace WixToolset.Core if (null == column) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Column")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Column")); column = String.Empty; } if (null == table) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Table")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Table")); table = String.Empty; } if (null == rowKeys) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Row")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Row")); } this.Core.ParseForExtensionElements(node); @@ -10446,7 +10446,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -10506,7 +10506,7 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } if (null == id) @@ -10594,7 +10594,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -10656,7 +10656,7 @@ namespace WixToolset.Core registration = 1; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Registration", registrationValue, "machine", "user")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Registration", registrationValue, "machine", "user")); break; } } @@ -10674,7 +10674,7 @@ namespace WixToolset.Core if (CompilerConstants.IntegerNotSet == registration) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Registration")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Registration")); registration = CompilerConstants.IllegalInteger; } @@ -10784,7 +10784,7 @@ namespace WixToolset.Core // merge modules must always be compressed, so this attribute is invalid if (this.compilingModule) { - this.Core.OnMessage(WixWarnings.DeprecatedPackageCompressedAttribute(sourceLineNumbers)); + this.Core.Write(WarningMessages.DeprecatedPackageCompressedAttribute(sourceLineNumbers)); // this.core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "Compressed", "Module")); } else if (YesNoType.Yes == this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib)) @@ -10810,7 +10810,7 @@ namespace WixToolset.Core sourceBits = sourceBits | 8; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, installPrivileges, "elevated", "limited")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, installPrivileges, "elevated", "limited")); break; } } @@ -10833,7 +10833,7 @@ namespace WixToolset.Core sourceBits = sourceBits | 8; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, installScope, "perMachine", "perUser")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, installScope, "perMachine", "perUser")); break; } } @@ -10851,13 +10851,13 @@ namespace WixToolset.Core packageAuthor = this.Core.GetAttributeValue(sourceLineNumbers, attrib); if ("PUT-COMPANY-NAME-HERE" == packageAuthor) { - this.Core.OnMessage(WixWarnings.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, packageAuthor)); + this.Core.Write(WarningMessages.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, packageAuthor)); } break; case "Platform": if (null != platformValue) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Platforms")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Platforms")); } platformValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); @@ -10865,7 +10865,7 @@ namespace WixToolset.Core switch (platformType) { case Wix.Package.PlatformType.intel: - this.Core.OnMessage(WixWarnings.DeprecatedAttributeValue(sourceLineNumbers, platformValue, node.Name.LocalName, attrib.Name.LocalName, "x86")); + this.Core.Write(WarningMessages.DeprecatedAttributeValue(sourceLineNumbers, platformValue, node.Name.LocalName, attrib.Name.LocalName, "x86")); goto case Wix.Package.PlatformType.x86; case Wix.Package.PlatformType.x86: platform = "Intel"; @@ -10874,7 +10874,7 @@ namespace WixToolset.Core platform = "x64"; break; case Wix.Package.PlatformType.intel64: - this.Core.OnMessage(WixWarnings.DeprecatedAttributeValue(sourceLineNumbers, platformValue, node.Name.LocalName, attrib.Name.LocalName, "ia64")); + this.Core.Write(WarningMessages.DeprecatedAttributeValue(sourceLineNumbers, platformValue, node.Name.LocalName, attrib.Name.LocalName, "ia64")); goto case Wix.Package.PlatformType.ia64; case Wix.Package.PlatformType.ia64: platform = "Intel64"; @@ -10883,17 +10883,17 @@ namespace WixToolset.Core platform = "Arm"; break; default: - this.Core.OnMessage(WixErrors.InvalidPlatformValue(sourceLineNumbers, platformValue)); + this.Core.Write(ErrorMessages.InvalidPlatformValue(sourceLineNumbers, platformValue)); break; } break; case "Platforms": if (null != platformValue) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Platform")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Platform")); } - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Platform")); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Platform")); platformValue = this.Core.GetAttributeValue(sourceLineNumbers, attrib); platform = platformValue; break; @@ -10923,31 +10923,31 @@ namespace WixToolset.Core if (installPrivilegeSeen && installScopeSeen) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "InstallPrivileges", "InstallScope")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "InstallPrivileges", "InstallScope")); } if ((0 != String.Compare(platform, "Intel", StringComparison.OrdinalIgnoreCase)) && 200 > msiVersion) { msiVersion = 200; - this.Core.OnMessage(WixWarnings.RequiresMsi200for64bitPackage(sourceLineNumbers)); + this.Core.Write(WarningMessages.RequiresMsi200for64bitPackage(sourceLineNumbers)); } if ((0 == String.Compare(platform, "Arm", StringComparison.OrdinalIgnoreCase)) && 500 > msiVersion) { msiVersion = 500; - this.Core.OnMessage(WixWarnings.RequiresMsi500forArmPackage(sourceLineNumbers)); + this.Core.Write(WarningMessages.RequiresMsi500forArmPackage(sourceLineNumbers)); } if (null == packageAuthor) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Manufacturer")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Manufacturer")); } if (this.compilingModule) { if (null == packageCode) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } // merge modules use the modularization guid as the package code @@ -10968,7 +10968,7 @@ namespace WixToolset.Core if ("*" != packageCode) { - this.Core.OnMessage(WixWarnings.PackageCodeSet(sourceLineNumbers)); + this.Core.Write(WarningMessages.PackageCodeSet(sourceLineNumbers)); } } @@ -11101,37 +11101,37 @@ namespace WixToolset.Core if (YesNoType.NotSet == allowRemoval) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "AllowRemoval")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "AllowRemoval")); } if (null == classification) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Classification")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Classification")); } if (null == description) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Description")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Description")); } if (null == displayName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisplayName")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisplayName")); } if (null == manufacturerName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ManufacturerName")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ManufacturerName")); } if (null == moreInfoUrl) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "MoreInfoURL")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "MoreInfoURL")); } if (null == targetProductName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "TargetProductName")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "TargetProductName")); } foreach (XElement child in node.Elements()) @@ -11288,17 +11288,17 @@ namespace WixToolset.Core if (null == company) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Company")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Company")); } if (null == property) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); } if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } this.Core.ParseForExtensionElements(node); @@ -11382,13 +11382,13 @@ namespace WixToolset.Core switch (attrib.Name.LocalName) { case "AdminImage": - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); break; case "Comments": comments = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; case "Compressed": - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); break; case "Description": packageName = this.Core.GetAttributeValue(sourceLineNumbers, attrib); @@ -11397,19 +11397,19 @@ namespace WixToolset.Core keywords = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; case "Languages": - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); break; case "Manufacturer": packageAuthor = this.Core.GetAttributeValue(sourceLineNumbers, attrib); break; case "Platforms": - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); break; case "ReadOnly": security = this.Core.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib); break; case "ShortNames": - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); break; case "SummaryCodepage": codepage = this.Core.GetAttributeLocalizableCodePageValue(sourceLineNumbers, attrib); @@ -11508,7 +11508,7 @@ namespace WixToolset.Core SourceLineNumber sourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); string name = null; - this.Core.OnMessage(WixWarnings.DeprecatedIgnoreModularizationElement(sourceLineNumbers)); + this.Core.Write(WarningMessages.DeprecatedIgnoreModularizationElement(sourceLineNumbers)); foreach (XAttribute attrib in node.Attributes()) { @@ -11535,7 +11535,7 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } this.Core.ParseForExtensionElements(node); @@ -11624,12 +11624,12 @@ namespace WixToolset.Core if (null == user) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "User")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "User")); } if (int.MinValue == permission) // just GENERIC_READ, which is MSI_NULL { - this.Core.OnMessage(WixErrors.GenericReadNotAllowed(sourceLineNumbers)); + this.Core.Write(ErrorMessages.GenericReadNotAllowed(sourceLineNumbers)); } this.Core.ParseForExtensionElements(node); @@ -11695,7 +11695,7 @@ namespace WixToolset.Core if (null == sddl) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Sddl")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Sddl")); } if (null == id) @@ -11713,7 +11713,7 @@ namespace WixToolset.Core if (null != condition) { SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(node); - this.Core.OnMessage(WixErrors.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); } condition = this.ParseConditionElement(child, node.Name.LocalName, null, null); @@ -11776,14 +11776,14 @@ namespace WixToolset.Core manufacturer = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.MustHaveNonWhitespaceCharacters); if ("PUT-COMPANY-NAME-HERE" == manufacturer) { - this.Core.OnMessage(WixWarnings.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, manufacturer)); + this.Core.Write(WarningMessages.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, manufacturer)); } break; case "Name": this.activeName = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.MustHaveNonWhitespaceCharacters); if ("PUT-PRODUCT-NAME-HERE" == this.activeName) { - this.Core.OnMessage(WixWarnings.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, this.activeName)); + this.Core.Write(WarningMessages.PlaceholderValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, this.activeName)); } break; case "UpgradeCode": @@ -11809,36 +11809,36 @@ namespace WixToolset.Core if (null == productCode) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == this.activeLanguage) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Language")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Language")); } if (null == manufacturer) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Manufacturer")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Manufacturer")); } if (null == this.activeName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } if (null == upgradeCode) { - this.Core.OnMessage(WixWarnings.MissingUpgradeCode(sourceLineNumbers)); + this.Core.Write(WarningMessages.MissingUpgradeCode(sourceLineNumbers)); } if (null == version) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); } else if (!CompilerCore.IsValidProductVersion(version)) { - this.Core.OnMessage(WixErrors.InvalidProductVersion(sourceLineNumbers, version)); + this.Core.Write(ErrorMessages.InvalidProductVersion(sourceLineNumbers, version)); } if (this.Core.EncounteredError) @@ -12079,7 +12079,7 @@ namespace WixToolset.Core if ((YesNoType.No == advertise && YesNoType.Yes == progIdAdvertise) || (YesNoType.Yes == advertise && YesNoType.No == progIdAdvertise)) { - this.Core.OnMessage(WixErrors.AdvertiseStateMustMatch(sourceLineNumbers, advertise.ToString(), progIdAdvertise.ToString())); + this.Core.Write(ErrorMessages.AdvertiseStateMustMatch(sourceLineNumbers, advertise.ToString(), progIdAdvertise.ToString())); } else { @@ -12093,7 +12093,7 @@ namespace WixToolset.Core if (null != parent && (null != icon || CompilerConstants.IntegerNotSet != iconIndex)) { - this.Core.OnMessage(WixErrors.VersionIndependentProgIdsCannotHaveIcons(sourceLineNumbers)); + this.Core.Write(ErrorMessages.VersionIndependentProgIdsCannotHaveIcons(sourceLineNumbers)); } YesNoType firstProgIdForNestedClass = YesNoType.Yes; @@ -12125,7 +12125,7 @@ namespace WixToolset.Core else { SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); - this.Core.OnMessage(WixErrors.ProgIdNestedTooDeep(childSourceLineNumbers)); + this.Core.Write(ErrorMessages.ProgIdNestedTooDeep(childSourceLineNumbers)); } break; default: @@ -12209,7 +12209,7 @@ namespace WixToolset.Core // raise an error for an orphaned ProgId if (YesNoType.Yes == advertise && !foundExtension && null == parent && null == classId) { - this.Core.OnMessage(WixWarnings.OrphanedProgId(sourceLineNumbers, progId)); + this.Core.Write(WarningMessages.OrphanedProgId(sourceLineNumbers, progId)); } return progId; @@ -12270,16 +12270,16 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } else if ("ProductID" == id.Id) { - this.Core.OnMessage(WixWarnings.ProductIdAuthored(sourceLineNumbers)); + this.Core.Write(WarningMessages.ProductIdAuthored(sourceLineNumbers)); } else if ("SecureCustomProperties" == id.Id || "AdminProperties" == id.Id || "MsiHiddenProperties" == id.Id) { - this.Core.OnMessage(WixErrors.CannotAuthorSpecialProperties(sourceLineNumbers, id.Id)); + this.Core.Write(ErrorMessages.CannotAuthorSpecialProperties(sourceLineNumbers, id.Id)); } string innerText = this.Core.GetTrimmedInnerText(node); @@ -12288,7 +12288,7 @@ namespace WixToolset.Core // cannot specify both the value attribute and inner text if (!String.IsNullOrEmpty(innerText)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithInnerText(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.IllegalAttributeWithInnerText(sourceLineNumbers, node.Name.LocalName, "Value")); } } else // value attribute not specified, use inner text if any. @@ -12326,7 +12326,7 @@ namespace WixToolset.Core // If we're doing CCP then there must be a signature. if (complianceCheck && 0 == signatures.Count) { - this.Core.OnMessage(WixErrors.SearchElementRequiredWithAttribute(sourceLineNumbers, node.Name.LocalName, "ComplianceCheck", "yes")); + this.Core.Write(ErrorMessages.SearchElementRequiredWithAttribute(sourceLineNumbers, node.Name.LocalName, "ComplianceCheck", "yes")); } foreach (string sig in signatures) @@ -12350,7 +12350,7 @@ namespace WixToolset.Core // the element. if (String.IsNullOrEmpty(value) && !admin && !secure && !hidden) { - this.Core.OnMessage(WixWarnings.PropertyUseless(sourceLineNumbers, id.Id)); + this.Core.Write(WarningMessages.PropertyUseless(sourceLineNumbers, id.Id)); } else // there is a value and/or a flag set, do that. { @@ -12360,7 +12360,7 @@ namespace WixToolset.Core if (!this.Core.EncounteredError && YesNoType.Yes == suppressModularization) { - this.Core.OnMessage(WixWarnings.PropertyModularizationSuppressed(sourceLineNumbers)); + this.Core.Write(WarningMessages.PropertyModularizationSuppressed(sourceLineNumbers)); this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.WixSuppressModularization, id); } @@ -12402,7 +12402,7 @@ namespace WixToolset.Core id = this.Core.GetAttributeIdentifier(sourceLineNumbers, attrib); break; case "Action": - this.Core.OnMessage(WixWarnings.DeprecatedRegistryKeyActionAttribute(sourceLineNumbers)); + this.Core.Write(WarningMessages.DeprecatedRegistryKeyActionAttribute(sourceLineNumbers)); action = this.Core.GetAttributeValue(sourceLineNumbers, attrib); if (0 < action.Length) { @@ -12419,7 +12419,7 @@ namespace WixToolset.Core case Wix.RegistryKey.ActionType.none: break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, action, "create", "createAndRemoveOnUninstall", "none")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, action, "create", "createAndRemoveOnUninstall", "none")); break; } } @@ -12440,7 +12440,7 @@ namespace WixToolset.Core case "Root": if (CompilerConstants.IntegerNotSet != root) { - this.Core.OnMessage(WixErrors.RegistryRootInvalid(sourceLineNumbers)); + this.Core.Write(ErrorMessages.RegistryRootInvalid(sourceLineNumbers)); } root = this.Core.GetAttributeMsidbRegistryRootValue(sourceLineNumbers, attrib, true); @@ -12470,19 +12470,19 @@ namespace WixToolset.Core { if (null != id) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "Id", "ForceCreateOnInstall", "ForceDeleteOnUninstall", "yes", true)); + this.Core.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.LocalName, "Id", "ForceCreateOnInstall", "ForceDeleteOnUninstall", "yes", true)); } } if (CompilerConstants.IntegerNotSet == root) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Root")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Root")); root = CompilerConstants.IllegalInteger; } if (null == key) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); key = String.Empty; // set the key to something to prevent null reference exceptions } @@ -12499,7 +12499,7 @@ namespace WixToolset.Core { if (YesNoType.Yes == keyPath) { - this.Core.OnMessage(WixErrors.ComponentMultipleKeyPaths(sourceLineNumbers, child.Name.LocalName, "KeyPath", "yes", "File", "RegistryValue", "ODBCDataSource")); + this.Core.Write(ErrorMessages.ComponentMultipleKeyPaths(sourceLineNumbers, child.Name.LocalName, "KeyPath", "yes", "File", "RegistryValue", "ODBCDataSource")); } possibleKeyPath = possibleChildKeyPath; // the child is the key path @@ -12515,7 +12515,7 @@ namespace WixToolset.Core { if (YesNoType.Yes == keyPath) { - this.Core.OnMessage(WixErrors.ComponentMultipleKeyPaths(sourceLineNumbers, child.Name.LocalName, "KeyPath", "yes", "File", "RegistryValue", "ODBCDataSource")); + this.Core.Write(ErrorMessages.ComponentMultipleKeyPaths(sourceLineNumbers, child.Name.LocalName, "KeyPath", "yes", "File", "RegistryValue", "ODBCDataSource")); } possibleKeyPath = possibleChildKeyPath; // the child is the key path @@ -12529,14 +12529,14 @@ namespace WixToolset.Core case "Permission": if (!forceCreateOnInstall) { - this.Core.OnMessage(WixErrors.UnexpectedElementWithAttributeValue(sourceLineNumbers, node.Name.LocalName, child.Name.LocalName, "ForceCreateOnInstall", "yes")); + this.Core.Write(ErrorMessages.UnexpectedElementWithAttributeValue(sourceLineNumbers, node.Name.LocalName, child.Name.LocalName, "ForceCreateOnInstall", "yes")); } this.ParsePermissionElement(child, id.Id, "Registry"); break; case "PermissionEx": if (!forceCreateOnInstall) { - this.Core.OnMessage(WixErrors.UnexpectedElementWithAttributeValue(sourceLineNumbers, node.Name.LocalName, child.Name.LocalName, "ForceCreateOnInstall", "yes")); + this.Core.Write(ErrorMessages.UnexpectedElementWithAttributeValue(sourceLineNumbers, node.Name.LocalName, child.Name.LocalName, "ForceCreateOnInstall", "yes")); } this.ParsePermissionExElement(child, id.Id, "Registry"); break; @@ -12610,7 +12610,7 @@ namespace WixToolset.Core { if (!Wix.RegistryValue.TryParseActionType(action, out actionType)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, action, "append", "prepend", "write")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, action, "append", "prepend", "write")); } } break; @@ -12637,7 +12637,7 @@ namespace WixToolset.Core case "Root": if (CompilerConstants.IntegerNotSet != root) { - this.Core.OnMessage(WixErrors.RegistryRootInvalid(sourceLineNumbers)); + this.Core.Write(ErrorMessages.RegistryRootInvalid(sourceLineNumbers)); } root = this.Core.GetAttributeMsidbRegistryRootValue(sourceLineNumbers, attrib, true); @@ -12648,7 +12648,7 @@ namespace WixToolset.Core { if (!Wix.RegistryValue.TryParseTypeType(type, out typeType)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, type, "binary", "expandable", "integer", "multiString", "string")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, type, "binary", "expandable", "integer", "multiString", "string")); } } break; @@ -12675,22 +12675,22 @@ namespace WixToolset.Core if ((Wix.RegistryValue.ActionType.append == actionType || Wix.RegistryValue.ActionType.prepend == actionType) && Wix.RegistryValue.TypeType.multiString != typeType) { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Action", action, "Type", "multiString")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Action", action, "Type", "multiString")); } if (null == key) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); } if (CompilerConstants.IntegerNotSet == root) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Root")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Root")); } if (null == type) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Type")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Type")); } foreach (XElement child in node.Elements()) @@ -12702,7 +12702,7 @@ namespace WixToolset.Core case "MultiStringValue": if (Wix.RegistryValue.TypeType.multiString != typeType && null != value) { - this.Core.OnMessage(WixErrors.RegistryMultipleValuesWithoutMultiString(sourceLineNumbers, node.Name.LocalName, "Value", child.Name.LocalName, "Type")); + this.Core.Write(ErrorMessages.RegistryMultipleValuesWithoutMultiString(sourceLineNumbers, node.Name.LocalName, "Value", child.Name.LocalName, "Type")); } else if (null == value) { @@ -12773,11 +12773,11 @@ namespace WixToolset.Core // value may be set by child MultiStringValue elements, so it must be checked here if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } else if (0 == value.Length && ("+" == name || "-" == name || "*" == name)) // prevent accidental authoring of special name values { - this.Core.OnMessage(WixErrors.RegistryNameValueIncorrect(sourceLineNumbers, node.Name.LocalName, "Name", name)); + this.Core.Write(ErrorMessages.RegistryNameValueIncorrect(sourceLineNumbers, node.Name.LocalName, "Name", name)); } if (!this.Core.EncounteredError) @@ -12834,7 +12834,7 @@ namespace WixToolset.Core { if (!Wix.RemoveRegistryKey.TryParseActionType(action, out actionType)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, action, "removeOnInstall", "removeOnUninstall")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, action, "removeOnInstall", "removeOnUninstall")); } } break; @@ -12863,17 +12863,17 @@ namespace WixToolset.Core if (null == action) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action")); } if (null == key) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); } if (CompilerConstants.IntegerNotSet == root) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Root")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Root")); } this.Core.ParseForExtensionElements(node); @@ -12949,12 +12949,12 @@ namespace WixToolset.Core if (null == key) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); } if (CompilerConstants.IntegerNotSet == root) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Root")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Root")); } this.Core.ParseForExtensionElements(node); @@ -13037,7 +13037,7 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } else if (0 < name.Length) { @@ -13050,7 +13050,7 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); } } else if (null == shortName) // generate a short file name. @@ -13061,13 +13061,13 @@ namespace WixToolset.Core if (CompilerConstants.IntegerNotSet == on) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "On")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "On")); on = CompilerConstants.IllegalInteger; } if (null != directory && null != property) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Property", "Directory", directory)); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Property", "Directory", directory)); } if (null == id) @@ -13158,13 +13158,13 @@ namespace WixToolset.Core if (CompilerConstants.IntegerNotSet == on) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "On")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "On")); on = CompilerConstants.IllegalInteger; } if (null != directory && null != property) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Property", "Directory", directory)); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Property", "Directory", directory)); } if (null == id) @@ -13244,12 +13244,12 @@ namespace WixToolset.Core if (CompilerConstants.IntegerNotSet == runFromSource) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "RunFromSource")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "RunFromSource")); } if (CompilerConstants.IntegerNotSet == runLocal) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "RunLocal")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "RunLocal")); } this.Core.ParseForExtensionElements(node); @@ -13395,22 +13395,22 @@ namespace WixToolset.Core if (customAction && "Custom" == actionName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Action")); + this.Core.Write(ErrorMessages.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Action")); } else if (showDialog && "Show" == actionName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Dialog")); + this.Core.Write(ErrorMessages.ExpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Dialog")); } if (CompilerConstants.IntegerNotSet != sequence) { if (CompilerConstants.IntegerNotSet != exitSequence) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(childSourceLineNumbers, child.Name.LocalName, "Sequence", "OnExit")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(childSourceLineNumbers, child.Name.LocalName, "Sequence", "OnExit")); } else if (null != beforeAction || null != afterAction) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(childSourceLineNumbers, child.Name.LocalName, "Sequence", "Before", "After")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(childSourceLineNumbers, child.Name.LocalName, "Sequence", "Before", "After")); } } else // sequence not specified use OnExit (which may also be not set). @@ -13420,33 +13420,33 @@ namespace WixToolset.Core if (null != beforeAction && null != afterAction) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(childSourceLineNumbers, child.Name.LocalName, "After", "Before")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(childSourceLineNumbers, child.Name.LocalName, "After", "Before")); } else if ((customAction || showDialog || specialAction) && !suppress && CompilerConstants.IntegerNotSet == sequence && null == beforeAction && null == afterAction) { - this.Core.OnMessage(WixErrors.NeedSequenceBeforeOrAfter(childSourceLineNumbers, child.Name.LocalName)); + this.Core.Write(ErrorMessages.NeedSequenceBeforeOrAfter(childSourceLineNumbers, child.Name.LocalName)); } // action that is scheduled to occur before/after itself if (beforeAction == actionName) { - this.Core.OnMessage(WixErrors.ActionScheduledRelativeToItself(childSourceLineNumbers, child.Name.LocalName, "Before", beforeAction)); + this.Core.Write(ErrorMessages.ActionScheduledRelativeToItself(childSourceLineNumbers, child.Name.LocalName, "Before", beforeAction)); } else if (afterAction == actionName) { - this.Core.OnMessage(WixErrors.ActionScheduledRelativeToItself(childSourceLineNumbers, child.Name.LocalName, "After", afterAction)); + this.Core.Write(ErrorMessages.ActionScheduledRelativeToItself(childSourceLineNumbers, child.Name.LocalName, "After", afterAction)); } // normal standard actions cannot be set overridable by the user (since they are overridable by default) if (overridable && WindowsInstallerStandard.IsStandardAction(actionName) && !specialAction) { - this.Core.OnMessage(WixErrors.UnexpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Overridable")); + this.Core.Write(ErrorMessages.UnexpectedAttribute(childSourceLineNumbers, child.Name.LocalName, "Overridable")); } // suppress cannot be specified at the same time as Before, After, or Sequence if (suppress && (null != afterAction || null != beforeAction || CompilerConstants.IntegerNotSet != sequence || overridable)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttributes(childSourceLineNumbers, child.Name.LocalName, "Suppress", "Before", "After", "Sequence", "Overridable")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(childSourceLineNumbers, child.Name.LocalName, "Suppress", "Before", "After", "Sequence", "Overridable")); } this.Core.ParseForExtensionElements(child); @@ -13497,7 +13497,7 @@ namespace WixToolset.Core string requiredPrivileges = null; string sid = null; - this.Core.OnMessage(WixWarnings.ServiceConfigFamilyNotSupported(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(WarningMessages.ServiceConfigFamilyNotSupported(sourceLineNumbers, node.Name.LocalName)); foreach (XAttribute attrib in node.Attributes()) { @@ -13574,7 +13574,7 @@ namespace WixToolset.Core case "ServiceName": if (!String.IsNullOrEmpty(serviceName)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "ServiceInstall")); + this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "ServiceInstall")); } name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); @@ -13752,7 +13752,7 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(name)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ServiceName")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ServiceName")); } else if (null == id) { @@ -13761,12 +13761,12 @@ namespace WixToolset.Core if (0 == events) { - this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "OnInstall", "OnReinstall", "OnUninstall")); + this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "OnInstall", "OnReinstall", "OnUninstall")); } if (String.IsNullOrEmpty(delayedAutoStart) && String.IsNullOrEmpty(failureActionsWhen) && String.IsNullOrEmpty(preShutdownDelay) && String.IsNullOrEmpty(requiredPrivileges) && String.IsNullOrEmpty(sid)) { - this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "DelayedAutoStart", "FailureActionsWhen", "PreShutdownDelay", "ServiceSid", "RequiredPrivilege")); + this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "DelayedAutoStart", "FailureActionsWhen", "PreShutdownDelay", "ServiceSid", "RequiredPrivilege")); } if (!this.Core.EncounteredError) @@ -13841,7 +13841,7 @@ namespace WixToolset.Core string actions = null; string actionsDelays = null; - this.Core.OnMessage(WixWarnings.ServiceConfigFamilyNotSupported(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(WarningMessages.ServiceConfigFamilyNotSupported(sourceLineNumbers, node.Name.LocalName)); foreach (XAttribute attrib in node.Attributes()) { @@ -13885,7 +13885,7 @@ namespace WixToolset.Core case "ServiceName": if (!String.IsNullOrEmpty(serviceName)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "ServiceInstall")); + this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "ServiceInstall")); } name = this.Core.GetAttributeValue(sourceLineNumbers, attrib); @@ -13952,12 +13952,12 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(action)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, child.Name.LocalName, "Action")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, child.Name.LocalName, "Action")); } if (String.IsNullOrEmpty(delay)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, child.Name.LocalName, "Delay")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, child.Name.LocalName, "Delay")); } if (!String.IsNullOrEmpty(actions)) @@ -13985,7 +13985,7 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(name)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ServiceName")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ServiceName")); } else if (null == id) { @@ -13994,7 +13994,7 @@ namespace WixToolset.Core if (0 == events) { - this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "OnInstall", "OnReinstall", "OnUninstall")); + this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "OnInstall", "OnReinstall", "OnUninstall")); } if (!this.Core.EncounteredError) @@ -14106,7 +14106,7 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } // get the ServiceControl arguments @@ -14184,7 +14184,7 @@ namespace WixToolset.Core if (null == dependency) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -14255,7 +14255,7 @@ namespace WixToolset.Core errorbits |= MsiInterop.MsidbServiceInstallErrorCritical; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, errorControlValue, "ignore", "normal", "critical")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, errorControlValue, "ignore", "normal", "critical")); break; } } @@ -14293,10 +14293,10 @@ namespace WixToolset.Core break; case Wix.ServiceInstall.StartType.boot: case Wix.ServiceInstall.StartType.system: - this.Core.OnMessage(WixErrors.ValueNotSupported(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, startValue)); + this.Core.Write(ErrorMessages.ValueNotSupported(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, startValue)); break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, startValue, "auto", "demand", "disabled")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, startValue, "auto", "demand", "disabled")); break; } } @@ -14316,10 +14316,10 @@ namespace WixToolset.Core break; case Wix.ServiceInstall.TypeType.kernelDriver: case Wix.ServiceInstall.TypeType.systemDriver: - this.Core.OnMessage(WixErrors.ValueNotSupported(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, typeValue)); + this.Core.Write(ErrorMessages.ValueNotSupported(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, typeValue)); break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, node.Name.LocalName, typeValue, "ownProcess", "shareProcess")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, node.Name.LocalName, typeValue, "ownProcess", "shareProcess")); break; } } @@ -14343,7 +14343,7 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(name)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } else if (null == id) { @@ -14352,7 +14352,7 @@ namespace WixToolset.Core if (0 == startType) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Start")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Start")); } if (eraseDescription) @@ -14462,7 +14462,7 @@ namespace WixToolset.Core // default so no work necessary. break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, sequenceValue, "execute", "ui", "both")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, sequenceValue, "execute", "ui", "both")); break; } } @@ -14485,7 +14485,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } else if (String.IsNullOrEmpty(actionName)) { @@ -14494,7 +14494,7 @@ namespace WixToolset.Core if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } this.Core.ParseForExtensionElements(node); @@ -14577,7 +14577,7 @@ namespace WixToolset.Core // default so no work necessary. break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, sequenceValue, "execute", "ui", "both")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, sequenceValue, "execute", "ui", "both")); break; } } @@ -14600,7 +14600,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } else if (String.IsNullOrEmpty(actionName)) { @@ -14609,16 +14609,16 @@ namespace WixToolset.Core if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } if (null != beforeAction && null != afterAction) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "After", "Before")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "After", "Before")); } else if (null == beforeAction && null == afterAction) { - this.Core.OnMessage(WixErrors.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "After", "Before", "Id")); + this.Core.Write(ErrorMessages.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "After", "Before", "Id")); } this.Core.ParseForExtensionElements(node); @@ -14629,11 +14629,11 @@ namespace WixToolset.Core // action that is scheduled to occur before/after itself if (beforeAction == actionName) { - this.Core.OnMessage(WixErrors.ActionScheduledRelativeToItself(sourceLineNumbers, node.Name.LocalName, "Before", beforeAction)); + this.Core.Write(ErrorMessages.ActionScheduledRelativeToItself(sourceLineNumbers, node.Name.LocalName, "Before", beforeAction)); } else if (afterAction == actionName) { - this.Core.OnMessage(WixErrors.ActionScheduledRelativeToItself(sourceLineNumbers, node.Name.LocalName, "After", afterAction)); + this.Core.Write(ErrorMessages.ActionScheduledRelativeToItself(sourceLineNumbers, node.Name.LocalName, "After", afterAction)); } var row = this.Core.CreateRow(sourceLineNumbers, TupleDefinitionType.CustomAction); @@ -14712,7 +14712,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -14767,12 +14767,12 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } if (null == sourceFile) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); } foreach (XElement child in node.Elements()) @@ -14785,7 +14785,7 @@ namespace WixToolset.Core this.ParseSFPCatalogElement(child, ref parentName); if (null != dependency && parentName == dependency) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Dependency")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Dependency")); } dependency = parentName; break; @@ -14805,7 +14805,7 @@ namespace WixToolset.Core if (null == dependency) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Dependency")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Dependency")); } if (!this.Core.EncounteredError) @@ -14916,7 +14916,7 @@ namespace WixToolset.Core show = 7; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Show", showValue, "normal", "maximized", "minimized")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Show", showValue, "normal", "maximized", "minimized")); show = CompilerConstants.IllegalInteger; break; } @@ -14941,7 +14941,7 @@ namespace WixToolset.Core if (advertise && null != target) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Target", "Advertise", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Target", "Advertise", "yes")); } if (null == directory) @@ -14952,7 +14952,7 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.ExpectedAttributeWhenElementNotUnderElement(sourceLineNumbers, node.Name.LocalName, "Directory", "Component")); + this.Core.Write(ErrorMessages.ExpectedAttributeWhenElementNotUnderElement(sourceLineNumbers, node.Name.LocalName, "Directory", "Component")); } } @@ -14960,14 +14960,14 @@ namespace WixToolset.Core { if (CompilerConstants.IntegerNotSet == descriptionResourceId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DescriptionResourceDll", "DescriptionResourceId")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DescriptionResourceDll", "DescriptionResourceId")); } } else { if (CompilerConstants.IntegerNotSet != descriptionResourceId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DescriptionResourceId", "DescriptionResourceDll")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DescriptionResourceId", "DescriptionResourceDll")); } } @@ -14975,20 +14975,20 @@ namespace WixToolset.Core { if (CompilerConstants.IntegerNotSet == displayResourceId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisplayResourceDll", "DisplayResourceId")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisplayResourceDll", "DisplayResourceId")); } } else { if (CompilerConstants.IntegerNotSet != displayResourceId) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisplayResourceId", "DisplayResourceDll")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "DisplayResourceId", "DisplayResourceDll")); } } if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } else if (0 < name.Length) { @@ -15001,7 +15001,7 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", name, "ShortName")); } } else if (null == shortName) // generate a short file name. @@ -15012,7 +15012,7 @@ namespace WixToolset.Core if ("Component" != parentElementLocalName && null != target) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "Target", parentElementLocalName)); + this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "Target", parentElementLocalName)); } if (null == id) @@ -15053,7 +15053,7 @@ namespace WixToolset.Core { if (YesNoType.Yes != parentKeyPath && "Component" != parentElementLocalName) { - this.Core.OnMessage(WixWarnings.UnclearShortcut(sourceLineNumbers, id.Id, componentId, defaultTarget)); + this.Core.Write(WarningMessages.UnclearShortcut(sourceLineNumbers, id.Id, componentId, defaultTarget)); } row.Set(4, Guid.Empty.ToString("B")); } @@ -15138,7 +15138,7 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(key)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); } else if (null == id) { @@ -15154,13 +15154,13 @@ namespace WixToolset.Core } else // cannot specify both the value attribute and inner text { - this.Core.OnMessage(WixErrors.IllegalAttributeWithInnerText(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.IllegalAttributeWithInnerText(sourceLineNumbers, node.Name.LocalName, "Value")); } } if (String.IsNullOrEmpty(value)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } this.Core.ParseForExtensionElements(node); @@ -15265,12 +15265,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (CompilerConstants.IntegerNotSet == language) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Language")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Language")); language = CompilerConstants.IllegalInteger; } @@ -15334,29 +15334,29 @@ namespace WixToolset.Core { if (CompilerConstants.LongNotSet != resourceId) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenAdvertised(sourceLineNumbers, node.Name.LocalName, "ResourceId")); + this.Core.Write(ErrorMessages.IllegalAttributeWhenAdvertised(sourceLineNumbers, node.Name.LocalName, "ResourceId")); } if (0 != flags) { if (0x1 == (flags & 0x1)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Restricted", "Advertise", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Restricted", "Advertise", "yes")); } if (0x2 == (flags & 0x2)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Control", "Advertise", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Control", "Advertise", "yes")); } if (0x4 == (flags & 0x4)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Hidden", "Advertise", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Hidden", "Advertise", "yes")); } if (0x8 == (flags & 0x8)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "HasDiskImage", "Advertise", "yes")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "HasDiskImage", "Advertise", "yes")); } } @@ -15383,17 +15383,17 @@ namespace WixToolset.Core { if (CompilerConstants.IntegerNotSet != cost && CompilerConstants.IllegalInteger != cost) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Cost", "Advertise", "no")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Cost", "Advertise", "no")); } if (null == fileServer) { - this.Core.OnMessage(WixErrors.MissingTypeLibFile(sourceLineNumbers, node.Name.LocalName, "File")); + this.Core.Write(ErrorMessages.MissingTypeLibFile(sourceLineNumbers, node.Name.LocalName, "File")); } if (null == registryVersion) { - this.Core.OnMessage(WixErrors.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "MajorVersion", "MinorVersion", "Advertise", "no")); + this.Core.Write(ErrorMessages.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "MajorVersion", "MinorVersion", "Advertise", "no")); } // HKCR\TypeLib\[ID]\[MajorVersion].[MinorVersion], (Default) = [Description] @@ -15443,7 +15443,7 @@ namespace WixToolset.Core case "BinarySource": if (null != source) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "FileSource", "PropertySource")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "FileSource", "PropertySource")); } source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); type = MsiInterop.MsidbCustomActionTypeExe + MsiInterop.MsidbCustomActionTypeBinaryData; @@ -15455,7 +15455,7 @@ namespace WixToolset.Core case "FileSource": if (null != source) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinarySource", "PropertySource")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinarySource", "PropertySource")); } source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); type = MsiInterop.MsidbCustomActionTypeExe + MsiInterop.MsidbCustomActionTypeSourceFile; @@ -15464,7 +15464,7 @@ namespace WixToolset.Core case "PropertySource": if (null != source) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinarySource", "FileSource")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "BinarySource", "FileSource")); } source = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); type = MsiInterop.MsidbCustomActionTypeExe + MsiInterop.MsidbCustomActionTypeProperty; @@ -15491,7 +15491,7 @@ namespace WixToolset.Core if (null == source) { - this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "BinarySource", "FileSource", "PropertySource")); + this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "BinarySource", "FileSource", "PropertySource")); } if (!this.Core.EncounteredError) @@ -15556,7 +15556,7 @@ namespace WixToolset.Core if (0 < embeddedUICount) // there can be only one embedded UI { SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); - this.Core.OnMessage(WixErrors.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); } this.ParseEmbeddedUIElement(child); ++embeddedUICount; @@ -15582,7 +15582,7 @@ namespace WixToolset.Core if (RadioButtonType.Bitmap == radioButtonType || RadioButtonType.Icon == radioButtonType) { SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); - this.Core.OnMessage(WixErrors.RadioButtonBitmapAndIconDisallowed(childSourceLineNumbers)); + this.Core.Write(ErrorMessages.RadioButtonBitmapAndIconDisallowed(childSourceLineNumbers)); } break; case "TextStyle": @@ -15655,7 +15655,7 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.IllegalAttributeExceptOnElement(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "ListView")); + this.Core.Write(ErrorMessages.IllegalAttributeExceptOnElement(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "ListView")); } break; case "Text": @@ -15677,7 +15677,7 @@ namespace WixToolset.Core if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } this.Core.ParseForExtensionElements(node); @@ -15725,7 +15725,7 @@ namespace WixToolset.Core case "Bitmap": if (RadioButtonType.NotSet != type) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Icon", "Text")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Icon", "Text")); } text = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); this.Core.CreateSimpleReference(sourceLineNumbers, "Binary", text); @@ -15740,7 +15740,7 @@ namespace WixToolset.Core case "Icon": if (RadioButtonType.NotSet != type) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Bitmap", "Text")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttributes(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Bitmap", "Text")); } text = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); this.Core.CreateSimpleReference(sourceLineNumbers, "Binary", text); @@ -15749,7 +15749,7 @@ namespace WixToolset.Core case "Text": if (RadioButtonType.NotSet != type) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Bitmap", "Icon")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "Bitmap", "Icon")); } text = this.Core.GetAttributeValue(sourceLineNumbers, attrib); type = RadioButtonType.Text; @@ -15782,27 +15782,27 @@ namespace WixToolset.Core if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } if (null == x) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "X")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "X")); } if (null == y) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Y")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Y")); } if (null == width) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Width")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Width")); } if (null == height) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Height")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Height")); } this.Core.ParseForExtensionElements(node); @@ -15860,7 +15860,7 @@ namespace WixToolset.Core if (null == action) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } foreach (XElement child in node.Elements()) @@ -15996,7 +15996,7 @@ namespace WixToolset.Core if (null == property) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); } foreach (XElement child in node.Elements()) @@ -16064,7 +16064,7 @@ namespace WixToolset.Core if (null == property) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); } foreach (XElement child in node.Elements()) @@ -16082,7 +16082,7 @@ namespace WixToolset.Core else if (groupType != type) { SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); - this.Core.OnMessage(WixErrors.RadioButtonTypeInconsistent(childSourceLineNumbers)); + this.Core.Write(ErrorMessages.RadioButtonTypeInconsistent(childSourceLineNumbers)); } break; default: @@ -16135,7 +16135,7 @@ namespace WixToolset.Core if (null == action) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Action")); } this.Core.ParseForExtensionElements(node); @@ -16314,7 +16314,7 @@ namespace WixToolset.Core if (null == faceName) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "FaceName")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "FaceName")); } this.Core.ParseForExtensionElements(node); @@ -16458,7 +16458,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } @@ -16498,7 +16498,7 @@ namespace WixToolset.Core if (null == firstControl) { - this.Core.OnMessage(WixErrors.NoFirstControlSpecified(sourceLineNumbers, id.Id)); + this.Core.Write(ErrorMessages.NoFirstControlSpecified(sourceLineNumbers, id.Id)); } if (!this.Core.EncounteredError) @@ -16676,14 +16676,14 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(sourceFile)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); } else if (String.IsNullOrEmpty(name)) { name = Path.GetFileName(sourceFile); if (!this.Core.IsValidLongFilename(name, false)) { - this.Core.OnMessage(WixErrors.IllegalLongFilename(sourceLineNumbers, node.Name.LocalName, "Source", name)); + this.Core.Write(ErrorMessages.IllegalLongFilename(sourceLineNumbers, node.Name.LocalName, "Source", name)); } } @@ -16696,11 +16696,11 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } else if (!Common.IsIdentifier(id.Id)) { - this.Core.OnMessage(WixErrors.IllegalIdentifier(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); + this.Core.Write(ErrorMessages.IllegalIdentifier(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); } } else if (String.IsNullOrEmpty(name)) @@ -16710,7 +16710,7 @@ namespace WixToolset.Core if (!name.Contains(".")) { - this.Core.OnMessage(WixErrors.InvalidEmbeddedUIFileName(sourceLineNumbers, name)); + this.Core.Write(ErrorMessages.InvalidEmbeddedUIFileName(sourceLineNumbers, name)); } foreach (XElement child in node.Elements()) @@ -16783,14 +16783,14 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(sourceFile)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); } else if (String.IsNullOrEmpty(name)) { name = Path.GetFileName(sourceFile); if (!this.Core.IsValidLongFilename(name, false)) { - this.Core.OnMessage(WixErrors.IllegalLongFilename(sourceLineNumbers, node.Name.LocalName, "Source", name)); + this.Core.Write(ErrorMessages.IllegalLongFilename(sourceLineNumbers, node.Name.LocalName, "Source", name)); } } @@ -16803,11 +16803,11 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } else if (!Common.IsIdentifier(id.Id)) { - this.Core.OnMessage(WixErrors.IllegalIdentifier(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); + this.Core.Write(ErrorMessages.IllegalIdentifier(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); } } else if (String.IsNullOrEmpty(name)) @@ -16868,7 +16868,7 @@ namespace WixToolset.Core XAttribute typeAttribute = node.Attribute("Type"); if (null == typeAttribute) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Type")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Type")); } else { @@ -17016,14 +17016,14 @@ namespace WixToolset.Core this.Core.TrySetBitFromName(specialAttributes, "Icon32", YesNoType.Yes, bits, 16); break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, iconSizeValue, "16", "32", "48")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, iconSizeValue, "16", "32", "48")); break; } } } else { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, iconSizeValue, "Type")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, iconSizeValue, "Type")); } break; case "Property": @@ -17074,22 +17074,22 @@ namespace WixToolset.Core if (null == height) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Height")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Height")); } if (null == width) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Width")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Width")); } if (null == x) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "X")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "X")); } if (null == y) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Y")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Y")); } if (null == id) @@ -17165,7 +17165,7 @@ namespace WixToolset.Core text = Common.GetInnerText(child); if (!String.IsNullOrEmpty(text) && null != sourceFile) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithInnerText(childSourceLineNumbers, child.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.IllegalAttributeWithInnerText(childSourceLineNumbers, child.Name.LocalName, "SourceFile")); } break; default: @@ -17211,11 +17211,11 @@ namespace WixToolset.Core { if (String.IsNullOrEmpty(property) && String.IsNullOrEmpty(checkBoxPropertyRef)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property", "CheckBoxPropertyRef", true)); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property", "CheckBoxPropertyRef", true)); } else if (!String.IsNullOrEmpty(property) && !String.IsNullOrEmpty(checkBoxPropertyRef)) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Property", "CheckBoxPropertyRef")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Property", "CheckBoxPropertyRef")); } else if (!String.IsNullOrEmpty(property)) { @@ -17272,7 +17272,7 @@ namespace WixToolset.Core { if (TupleDefinitionType.BBControl == tableName) { - this.Core.OnMessage(WixErrors.TabbableControlNotAllowedInBillboard(sourceLineNumbers, node.Name.LocalName, controlType)); + this.Core.Write(ErrorMessages.TabbableControlNotAllowedInBillboard(sourceLineNumbers, node.Name.LocalName, controlType)); } if (null == firstControl) @@ -17322,14 +17322,14 @@ namespace WixToolset.Core case "Control": if (null != control) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); + this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); } control = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); break; case "Dialog": if (null != dialog) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); + this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, node.Parent.Name.LocalName)); } dialog = this.Core.GetAttributeIdentifierValue(sourceLineNumbers, attrib); this.Core.CreateSimpleReference(sourceLineNumbers, "Dialog", dialog); @@ -17361,28 +17361,28 @@ namespace WixToolset.Core if (null == control) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Control")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Control")); } if (null == dialog) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Dialog")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Dialog")); } if (null == controlEvent && null == property) // need to specify at least one { - this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "Event", "Property")); + this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "Event", "Property")); } else if (null != controlEvent && null != property) // cannot specify both { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Event", "Property")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Event", "Property")); } if (null == argument) { if (null != controlEvent) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value", "Event")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value", "Event")); } else if (null != property) { @@ -17499,7 +17499,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } // process the UpgradeVersion children here @@ -17513,7 +17513,7 @@ namespace WixToolset.Core { case "Property": this.ParsePropertyElement(child); - this.Core.OnMessage(WixWarnings.DeprecatedUpgradeProperty(childSourceLineNumbers)); + this.Core.Write(WarningMessages.DeprecatedUpgradeProperty(childSourceLineNumbers)); break; case "UpgradeVersion": this.ParseUpgradeVersionElement(child, id); @@ -17618,16 +17618,16 @@ namespace WixToolset.Core if (null == actionProperty) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Property")); } else if (actionProperty.ToUpper(CultureInfo.InvariantCulture) != actionProperty) { - this.Core.OnMessage(WixErrors.SecurePropertyNotUppercase(sourceLineNumbers, node.Name.LocalName, "Property", actionProperty)); + this.Core.Write(ErrorMessages.SecurePropertyNotUppercase(sourceLineNumbers, node.Name.LocalName, "Property", actionProperty)); } if (null == minimum && null == maximum) { - this.Core.OnMessage(WixErrors.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "Minimum", "Maximum")); + this.Core.Write(ErrorMessages.ExpectedAttributes(sourceLineNumbers, node.Name.LocalName, "Minimum", "Maximum")); } this.Core.ParseForExtensionElements(node); @@ -17694,7 +17694,7 @@ namespace WixToolset.Core break; case "Target": target = this.Core.GetAttributeValue(sourceLineNumbers, attrib); - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "TargetFile", "TargetProperty")); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, "TargetFile", "TargetProperty")); break; case "TargetFile": targetFile = this.Core.GetAttributeValue(sourceLineNumbers, attrib); @@ -17716,22 +17716,22 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null != target && null != targetFile) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Target", "TargetFile")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Target", "TargetFile")); } if (null != target && null != targetProperty) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Target", "TargetProperty")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Target", "TargetProperty")); } if (null != targetFile && null != targetProperty) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "TargetFile", "TargetProperty")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "TargetFile", "TargetProperty")); } this.Core.ParseForExtensionElements(node); @@ -17740,17 +17740,17 @@ namespace WixToolset.Core { if (null != target) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenAdvertised(sourceLineNumbers, node.Name.LocalName, "Target")); + this.Core.Write(ErrorMessages.IllegalAttributeWhenAdvertised(sourceLineNumbers, node.Name.LocalName, "Target")); } if (null != targetFile) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenAdvertised(sourceLineNumbers, node.Name.LocalName, "TargetFile")); + this.Core.Write(ErrorMessages.IllegalAttributeWhenAdvertised(sourceLineNumbers, node.Name.LocalName, "TargetFile")); } if (null != targetProperty) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenAdvertised(sourceLineNumbers, node.Name.LocalName, "TargetProperty")); + this.Core.Write(ErrorMessages.IllegalAttributeWhenAdvertised(sourceLineNumbers, node.Name.LocalName, "TargetProperty")); } if (!this.Core.EncounteredError) @@ -17770,12 +17770,12 @@ namespace WixToolset.Core { if (CompilerConstants.IntegerNotSet != sequence) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Sequence", "Advertise", "no")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Sequence", "Advertise", "no")); } if (null == target && null == targetFile && null == targetProperty) { - this.Core.OnMessage(WixErrors.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "TargetFile", "TargetProperty", "Advertise", "no")); + this.Core.Write(ErrorMessages.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "TargetFile", "TargetProperty", "Advertise", "no")); } if (null == target) @@ -17851,12 +17851,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == key) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Key")); } BundleApprovedExeForElevationAttributes attributes = BundleApprovedExeForElevationAttributes.None; @@ -17938,7 +17938,7 @@ namespace WixToolset.Core disableModify = 0; break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, value, "button", "yes", "no")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName, value, "button", "yes", "no")); break; } break; @@ -17946,7 +17946,7 @@ namespace WixToolset.Core disableRemove = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); break; case "DisableRepair": - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); break; case "HelpTelephone": helpTelephone = this.Core.GetAttributeValue(sourceLineNumbers, attrib); @@ -17990,16 +17990,16 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(version)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); } else if (!CompilerCore.IsValidModuleOrBundleVersion(version)) { - this.Core.OnMessage(WixWarnings.InvalidModuleOrBundleVersion(sourceLineNumbers, "Bundle", version)); + this.Core.Write(WarningMessages.InvalidModuleOrBundleVersion(sourceLineNumbers, "Bundle", version)); } if (String.IsNullOrEmpty(upgradeCode)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "UpgradeCode")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "UpgradeCode")); } if (String.IsNullOrEmpty(copyright)) @@ -18054,7 +18054,7 @@ namespace WixToolset.Core if (baSeen) { SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); - this.Core.OnMessage(WixErrors.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, "BootstrapperApplication")); + this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, "BootstrapperApplication")); } this.ParseBootstrapperApplicationElement(child); baSeen = true; @@ -18072,7 +18072,7 @@ namespace WixToolset.Core if (chainSeen) { SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); - this.Core.OnMessage(WixErrors.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, "Chain")); + this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, "Chain")); } this.ParseChainElement(child); chainSeen = true; @@ -18087,7 +18087,7 @@ namespace WixToolset.Core if (logSeen) { SourceLineNumber childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(child); - this.Core.OnMessage(WixErrors.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, "Log")); + this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, "Log")); } logVariablePrefixAndExtension = this.ParseLogElement(child, fileSystemSafeBundleName); logSeen = true; @@ -18124,7 +18124,7 @@ namespace WixToolset.Core if (!chainSeen) { - this.Core.OnMessage(WixErrors.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "Chain")); + this.Core.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "Chain")); } if (!this.Core.EncounteredError) @@ -18278,12 +18278,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == sourceFile) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "SourceFile")); } this.Core.ParseForExtensionElements(node); @@ -18329,7 +18329,7 @@ namespace WixToolset.Core string typeString = this.Core.GetAttributeValue(sourceLineNumbers, attrib); if (!Enum.TryParse(typeString, out type)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithLegalList(sourceLineNumbers, node.Name.LocalName, "Type", typeString, "attached, detached")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithLegalList(sourceLineNumbers, node.Name.LocalName, "Type", typeString, "attached, detached")); } break; default: @@ -18352,12 +18352,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } else if (!Common.IsIdentifier(id.Id)) { - this.Core.OnMessage(WixErrors.IllegalIdentifier(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); + this.Core.Write(ErrorMessages.IllegalIdentifier(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); } } else if (null == name) @@ -18367,7 +18367,7 @@ namespace WixToolset.Core if (!String.IsNullOrEmpty(downloadUrl) && ContainerType.Detached != type) { - this.Core.OnMessage(WixErrors.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DownloadUrl", "Type", "attached")); + this.Core.Write(ErrorMessages.IllegalAttributeWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DownloadUrl", "Type", "attached")); } foreach (XElement child in node.Elements()) @@ -18449,7 +18449,7 @@ namespace WixToolset.Core // We need *either* or or even just @SourceFile on the BA... // but we just say there's a missing . // TODO: Is there a better message for this? - this.Core.OnMessage(WixErrors.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "Payload")); + this.Core.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "Payload")); } // Add the application as an attached container and if an Id was provided add that too. @@ -18527,7 +18527,7 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(id)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } else { @@ -18593,7 +18593,7 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.ExpectedAttributeInElementOrParent(sourceLineNumbers, node.Name.LocalName, "Manufacturer", node.Parent.Name.LocalName)); + this.Core.Write(ErrorMessages.ExpectedAttributeInElementOrParent(sourceLineNumbers, node.Name.LocalName, "Manufacturer", node.Parent.Name.LocalName)); } } @@ -18613,13 +18613,13 @@ namespace WixToolset.Core } else { - this.Core.OnMessage(WixErrors.ExpectedAttributeInElementOrParent(sourceLineNumbers, node.Name.LocalName, "Name", node.Parent.Name.LocalName)); + this.Core.Write(ErrorMessages.ExpectedAttributeInElementOrParent(sourceLineNumbers, node.Name.LocalName, "Name", node.Parent.Name.LocalName)); } } if (String.IsNullOrEmpty(classification)) { - this.Core.OnMessage(WixErrors.IllegalEmptyAttributeValue(sourceLineNumbers, node.Name.LocalName, "Classification", defaultClassification)); + this.Core.Write(ErrorMessages.IllegalEmptyAttributeValue(sourceLineNumbers, node.Name.LocalName, "Classification", defaultClassification)); } this.Core.ParseForExtensionElements(node); @@ -18755,13 +18755,13 @@ namespace WixToolset.Core if (CompilerCore.WixNamespace == node.Name.Namespace && node.Name.LocalName != "ExePackage") { - this.Core.OnMessage(WixErrors.RemotePayloadUnsupported(childSourceLineNumbers)); + this.Core.Write(ErrorMessages.RemotePayloadUnsupported(childSourceLineNumbers)); continue; } if (null != remotePayload) { - this.Core.OnMessage(WixErrors.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); } remotePayload = this.ParseRemotePayloadElement(child); @@ -18769,11 +18769,11 @@ namespace WixToolset.Core if (null != sourceFile && null != remotePayload) { - this.Core.OnMessage(WixErrors.UnexpectedElementWithAttribute(sourceLineNumbers, node.Name.LocalName, "RemotePayload", "SourceFile")); + this.Core.Write(ErrorMessages.UnexpectedElementWithAttribute(sourceLineNumbers, node.Name.LocalName, "RemotePayload", "SourceFile")); } else if (null == sourceFile && null == remotePayload) { - this.Core.OnMessage(WixErrors.ExpectedAttributeOrElement(sourceLineNumbers, node.Name.LocalName, "SourceFile", "RemotePayload")); + this.Core.Write(ErrorMessages.ExpectedAttributeOrElement(sourceLineNumbers, node.Name.LocalName, "SourceFile", "RemotePayload")); } else if (null == sourceFile) { @@ -18782,14 +18782,14 @@ namespace WixToolset.Core if (null == downloadUrl && null != remotePayload) { - this.Core.OnMessage(WixErrors.ExpectedAttributeWithElement(sourceLineNumbers, node.Name.LocalName, "DownloadUrl", "RemotePayload")); + this.Core.Write(ErrorMessages.ExpectedAttributeWithElement(sourceLineNumbers, node.Name.LocalName, "DownloadUrl", "RemotePayload")); } if (Compiler.BurnUXContainerId == parentId) { if (compressed == YesNoDefaultType.No) { - Core.OnMessage(WixWarnings.UxPayloadsOnlySupportEmbedding(sourceLineNumbers, sourceFile)); + Core.Write(WarningMessages.UxPayloadsOnlySupportEmbedding(sourceLineNumbers, sourceFile)); } compressed = YesNoDefaultType.Yes; @@ -18845,27 +18845,27 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(remotePayload.ProductName)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ProductName")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "ProductName")); } if (String.IsNullOrEmpty(remotePayload.Description)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Description")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Description")); } if (String.IsNullOrEmpty(remotePayload.Hash)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Hash")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Hash")); } if (0 == remotePayload.Size) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Size")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Size")); } if (String.IsNullOrEmpty(remotePayload.Version)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Version")); } return remotePayload; @@ -18947,7 +18947,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } @@ -19024,7 +19024,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -19084,7 +19084,7 @@ namespace WixToolset.Core string behaviorString = this.Core.GetAttributeValue(sourceLineNumbers, attrib); if (!Enum.TryParse(behaviorString, true, out behavior)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithLegalList(sourceLineNumbers, node.Name.LocalName, "Behavior", behaviorString, "success, error, scheduleReboot, forceReboot")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithLegalList(sourceLineNumbers, node.Name.LocalName, "Behavior", behaviorString, "success, error, scheduleReboot, forceReboot")); } break; default: @@ -19100,7 +19100,7 @@ namespace WixToolset.Core if (ExitCodeBehaviorType.NotSet == behavior) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Behavior")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Behavior")); } this.Core.ParseForExtensionElements(node); @@ -19208,7 +19208,7 @@ namespace WixToolset.Core if (null == previousId) { - this.Core.OnMessage(WixErrors.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "MsiPackage", "ExePackage", "PackageGroupRef")); + this.Core.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, node.Name.LocalName, "MsiPackage", "ExePackage", "PackageGroupRef")); } if (!this.Core.EncounteredError) @@ -19339,12 +19339,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } else if (!Common.IsIdentifier(id.Id)) { - this.Core.OnMessage(WixErrors.IllegalIdentifier(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); + this.Core.Write(ErrorMessages.IllegalIdentifier(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); } } @@ -19437,7 +19437,7 @@ namespace WixToolset.Core name = this.Core.GetAttributeLongFilename(sourceLineNumbers, attrib, false, true); if (!this.Core.IsValidLongFilename(name, false, true)) { - this.Core.OnMessage(WixErrors.IllegalLongFilename(sourceLineNumbers, node.Name.LocalName, "Name", name)); + this.Core.Write(ErrorMessages.IllegalLongFilename(sourceLineNumbers, node.Name.LocalName, "Name", name)); } break; case "SourceFile": @@ -19528,7 +19528,7 @@ namespace WixToolset.Core compressed = this.Core.GetAttributeYesNoDefaultValue(sourceLineNumbers, attrib); break; case "SuppressLooseFilePayloadGeneration": - this.Core.OnMessage(WixWarnings.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); + this.Core.Write(WarningMessages.DeprecatedAttribute(sourceLineNumbers, node.Name.LocalName, attrib.Name.LocalName)); suppressLooseFilePayloadGeneration = this.Core.GetAttributeYesNoValue(sourceLineNumbers, attrib); allowed = (packageType == WixBundlePackageType.Msi); break; @@ -19563,13 +19563,13 @@ namespace WixToolset.Core if (CompilerCore.WixNamespace == node.Name.Namespace && node.Name.LocalName != "ExePackage" && node.Name.LocalName != "MsuPackage") { - this.Core.OnMessage(WixErrors.RemotePayloadUnsupported(childSourceLineNumbers)); + this.Core.Write(ErrorMessages.RemotePayloadUnsupported(childSourceLineNumbers)); continue; } if (null != remotePayload) { - this.Core.OnMessage(WixErrors.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); + this.Core.Write(ErrorMessages.TooManyChildren(childSourceLineNumbers, node.Name.LocalName, child.Name.LocalName)); } remotePayload = this.ParseRemotePayloadElement(child); @@ -19579,7 +19579,7 @@ namespace WixToolset.Core { if (String.IsNullOrEmpty(name)) { - this.Core.OnMessage(WixErrors.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", "SourceFile")); + this.Core.Write(ErrorMessages.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "Name", "SourceFile")); } else if (null == remotePayload) { @@ -19592,13 +19592,13 @@ namespace WixToolset.Core } else if (null != remotePayload) { - this.Core.OnMessage(WixErrors.UnexpectedElementWithAttribute(sourceLineNumbers, node.Name.LocalName, "RemotePayload", "SourceFile")); + this.Core.Write(ErrorMessages.UnexpectedElementWithAttribute(sourceLineNumbers, node.Name.LocalName, "RemotePayload", "SourceFile")); } else if (sourceFile.EndsWith(Path.DirectorySeparatorChar.ToString(), StringComparison.Ordinal)) { if (String.IsNullOrEmpty(name)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name", "SourceFile", sourceFile)); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name", "SourceFile", sourceFile)); } else { @@ -19608,13 +19608,13 @@ namespace WixToolset.Core if (null == downloadUrl && null != remotePayload) { - this.Core.OnMessage(WixErrors.ExpectedAttributeWithElement(sourceLineNumbers, node.Name.LocalName, "DownloadUrl", "RemotePayload")); + this.Core.Write(ErrorMessages.ExpectedAttributeWithElement(sourceLineNumbers, node.Name.LocalName, "DownloadUrl", "RemotePayload")); } if (YesNoDefaultType.No != compressed && null != remotePayload) { compressed = YesNoDefaultType.No; - this.Core.OnMessage(WixWarnings.RemotePayloadsMustNotAlsoBeCompressed(sourceLineNumbers, node.Name.LocalName)); + this.Core.Write(WarningMessages.RemotePayloadsMustNotAlsoBeCompressed(sourceLineNumbers, node.Name.LocalName)); } if (null == id) @@ -19630,12 +19630,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } else if (!Common.IsIdentifier(id.Id)) { - this.Core.OnMessage(WixErrors.IllegalIdentifier(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); + this.Core.Write(ErrorMessages.IllegalIdentifier(sourceLineNumbers, node.Name.LocalName, "Id", id.Id)); } } @@ -19651,7 +19651,7 @@ namespace WixToolset.Core if (!String.IsNullOrEmpty(protocol) && !protocol.Equals("burn", StringComparison.Ordinal) && !protocol.Equals("netfx4", StringComparison.Ordinal) && !protocol.Equals("none", StringComparison.Ordinal)) { - this.Core.OnMessage(WixErrors.IllegalAttributeValueWithLegalList(sourceLineNumbers, node.Name.LocalName, "Protocol", protocol, "none, burn, netfx4")); + this.Core.Write(ErrorMessages.IllegalAttributeValueWithLegalList(sourceLineNumbers, node.Name.LocalName, "Protocol", protocol, "none, burn, netfx4")); } if (!String.IsNullOrEmpty(protocol) && protocol.Equals("netfx4", StringComparison.Ordinal)) @@ -19660,17 +19660,17 @@ namespace WixToolset.Core { if (null == installCommand || -1 == installCommand.IndexOf(expectedArgument, StringComparison.OrdinalIgnoreCase)) { - this.Core.OnMessage(WixWarnings.AttributeShouldContain(sourceLineNumbers, node.Name.LocalName, "InstallCommand", installCommand, expectedArgument, "Protocol", "netfx4")); + this.Core.Write(WarningMessages.AttributeShouldContain(sourceLineNumbers, node.Name.LocalName, "InstallCommand", installCommand, expectedArgument, "Protocol", "netfx4")); } if (null == repairCommand || -1 == repairCommand.IndexOf(expectedArgument, StringComparison.OrdinalIgnoreCase)) { - this.Core.OnMessage(WixWarnings.AttributeShouldContain(sourceLineNumbers, node.Name.LocalName, "RepairCommand", repairCommand, expectedArgument, "Protocol", "netfx4")); + this.Core.Write(WarningMessages.AttributeShouldContain(sourceLineNumbers, node.Name.LocalName, "RepairCommand", repairCommand, expectedArgument, "Protocol", "netfx4")); } if (null == uninstallCommand || -1 == uninstallCommand.IndexOf(expectedArgument, StringComparison.OrdinalIgnoreCase)) { - this.Core.OnMessage(WixWarnings.AttributeShouldContain(sourceLineNumbers, node.Name.LocalName, "UninstallCommand", uninstallCommand, expectedArgument, "Protocol", "netfx4")); + this.Core.Write(WarningMessages.AttributeShouldContain(sourceLineNumbers, node.Name.LocalName, "UninstallCommand", uninstallCommand, expectedArgument, "Protocol", "netfx4")); } } } @@ -19884,7 +19884,7 @@ namespace WixToolset.Core if (String.IsNullOrEmpty(condition)) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Condition")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Condition")); } this.Core.ParseForExtensionElements(node); @@ -19931,7 +19931,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); id = Identifier.Invalid; } @@ -20042,12 +20042,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null != after && ComplexReferenceParentType.Container == parentType) { - this.Core.OnMessage(WixErrors.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "After", parentId)); + this.Core.Write(ErrorMessages.IllegalAttributeWhenNested(sourceLineNumbers, node.Name.LocalName, "After", parentId)); } this.Core.ParseForExtensionElements(node); @@ -20175,12 +20175,12 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } this.Core.ParseForExtensionElements(node); @@ -20232,7 +20232,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } this.Core.ParseForExtensionElements(node); @@ -20281,7 +20281,7 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (!String.IsNullOrEmpty(action)) @@ -20298,7 +20298,7 @@ namespace WixToolset.Core case Wix.RelatedBundle.ActionType.Patch: break; default: - this.Core.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Action", action, "Detect", "Upgrade", "Addon", "Patch")); + this.Core.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, node.Name.LocalName, "Action", action, "Detect", "Upgrade", "Addon", "Patch")); break; } } @@ -20344,7 +20344,7 @@ namespace WixToolset.Core if (null == location) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Location")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Location")); } this.Core.ParseForExtensionElements(node); @@ -20409,11 +20409,11 @@ namespace WixToolset.Core if (null == name) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Name")); } else if (name.StartsWith("Wix", StringComparison.OrdinalIgnoreCase)) { - this.Core.OnMessage(WixErrors.ReservedNamespaceViolation(sourceLineNumbers, node.Name.LocalName, "Name", "Wix")); + this.Core.Write(ErrorMessages.ReservedNamespaceViolation(sourceLineNumbers, node.Name.LocalName, "Name", "Wix")); } if (null == type && null != value) @@ -20459,7 +20459,7 @@ namespace WixToolset.Core if (null == value && null != type) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, "Variable", "Value", "Type")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, "Variable", "Value", "Type")); } this.Core.ParseForExtensionElements(node); @@ -20586,12 +20586,12 @@ namespace WixToolset.Core if (null == id) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Id")); } if (null == value) { - this.Core.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); + this.Core.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, node.Name.LocalName, "Value")); } this.Core.ParseForExtensionElements(node); diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs index 26c19acc..7cb7b703 100644 --- a/src/WixToolset.Core/CompilerCore.cs +++ b/src/WixToolset.Core/CompilerCore.cs @@ -8,14 +8,11 @@ namespace WixToolset.Core using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; - using System.IO; using System.Reflection; - using System.Security.Cryptography; using System.Text; using System.Text.RegularExpressions; using System.Xml.Linq; using WixToolset.Data; - using WixToolset.Data.Tuples; using WixToolset.Extensibility; using WixToolset.Extensibility.Services; using Wix = WixToolset.Data.Serialize; @@ -128,10 +125,10 @@ namespace WixToolset.Core "REMOVE" }); - private Dictionary extensions; - private IParseHelper parseHelper; - private Intermediate intermediate; - + private readonly Dictionary extensions; + private readonly IParseHelper parseHelper; + private readonly Intermediate intermediate; + private readonly IMessaging messaging; private HashSet activeSectionInlinedDirectoryIds; private HashSet activeSectionSimpleReferences; @@ -140,11 +137,12 @@ namespace WixToolset.Core /// /// The Intermediate object representing compiled source document. /// The WiX extensions collection. - internal CompilerCore(Intermediate intermediate, IParseHelper parseHelper, Dictionary extensions) + internal CompilerCore(Intermediate intermediate, IMessaging messaging, IParseHelper parseHelper, Dictionary extensions) { this.extensions = extensions; this.parseHelper = parseHelper; this.intermediate = intermediate; + this.messaging = messaging; } /// @@ -157,7 +155,7 @@ namespace WixToolset.Core /// Gets whether the compiler core encountered an error while processing. /// /// Flag if core encountered an error during processing. - public bool EncounteredError => Messaging.Instance.EncounteredError; + public bool EncounteredError => this.messaging.EncounteredError; /// /// Gets or sets the option to show pedantic messages. @@ -511,7 +509,7 @@ namespace WixToolset.Core } catch (NotSupportedException) { - this.OnMessage(WixErrors.IllegalCodepageAttribute(sourceLineNumbers, value, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); + this.Write(ErrorMessages.IllegalCodepageAttribute(sourceLineNumbers, value, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); } return CompilerConstants.IllegalInteger; @@ -548,11 +546,11 @@ namespace WixToolset.Core catch (NotSupportedException) { // not a valid windows code page - this.OnMessage(WixErrors.IllegalCodepageAttribute(sourceLineNumbers, value, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); + this.Write(ErrorMessages.IllegalCodepageAttribute(sourceLineNumbers, value, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); } catch (WixException e) { - this.OnMessage(e.Error); + this.messaging.Write(e.Error); } return null; @@ -612,15 +610,15 @@ namespace WixToolset.Core } catch (ArgumentOutOfRangeException) { - this.OnMessage(WixErrors.InvalidDateTimeFormat(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Write(ErrorMessages.InvalidDateTimeFormat(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } catch (FormatException) { - this.OnMessage(WixErrors.InvalidDateTimeFormat(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Write(ErrorMessages.InvalidDateTimeFormat(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } catch (OverflowException) { - this.OnMessage(WixErrors.InvalidDateTimeFormat(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Write(ErrorMessages.InvalidDateTimeFormat(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } } @@ -661,11 +659,11 @@ namespace WixToolset.Core if (CompilerConstants.IntegerNotSet == integer || CompilerConstants.IllegalInteger == integer) { - this.OnMessage(WixErrors.IntegralValueSentinelCollision(sourceLineNumbers, integer)); + this.Write(ErrorMessages.IntegralValueSentinelCollision(sourceLineNumbers, integer)); } else if (minimum > integer || maximum < integer) { - this.OnMessage(WixErrors.IntegralValueOutOfRange(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, integer, minimum, maximum)); + this.Write(ErrorMessages.IntegralValueOutOfRange(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, integer, minimum, maximum)); integer = CompilerConstants.IllegalInteger; } @@ -673,11 +671,11 @@ namespace WixToolset.Core } catch (FormatException) { - this.OnMessage(WixErrors.IllegalIntegerValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Write(ErrorMessages.IllegalIntegerValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } catch (OverflowException) { - this.OnMessage(WixErrors.IllegalIntegerValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Write(ErrorMessages.IllegalIntegerValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } } } @@ -768,7 +766,7 @@ namespace WixToolset.Core // Previous code never returned 'NotSet'! break; default: - this.OnMessage(WixErrors.IllegalYesNoAlwaysValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Write(ErrorMessages.IllegalYesNoAlwaysValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); break; } } @@ -796,11 +794,11 @@ namespace WixToolset.Core { if (!this.IsValidShortFilename(value, allowWildcards) && !this.IsValidLocIdentifier(value)) { - this.OnMessage(WixErrors.IllegalShortFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Write(ErrorMessages.IllegalShortFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } else if (CompilerCore.IsAmbiguousFilename(value)) { - this.OnMessage(WixWarnings.AmbiguousFileOrDirectoryName(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Write(WarningMessages.AmbiguousFileOrDirectoryName(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } } @@ -854,12 +852,12 @@ namespace WixToolset.Core // TODO: Find a way to expose the valid values programatically! if (allowHkmu) { - this.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, + this.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, "HKMU", "HKCR", "HKCU", "HKLM", "HKU")); } else { - this.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, + this.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, "HKCR", "HKCU", "HKLM", "HKU")); } } @@ -926,7 +924,7 @@ namespace WixToolset.Core if (Wix.InstallUninstallType.IllegalValue == installUninstall) { // TODO: Find a way to expose the valid values programatically! - this.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, + this.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, "install", "uninstall", "both")); } } @@ -951,7 +949,7 @@ namespace WixToolset.Core result = Wix.ExitType.IllegalValue; // TODO: Find a way to expose the valid values programatically! - this.OnMessage(WixErrors.IllegalAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, + this.Write(ErrorMessages.IllegalAttributeValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, "success", "cancel", "error", "suspend")); } @@ -974,7 +972,7 @@ namespace WixToolset.Core if (CompilerCore.BuiltinBundleVariables.Contains(value)) { string illegalValues = CompilerCore.CreateValueList(ValueListKind.Or, CompilerCore.BuiltinBundleVariables); - this.OnMessage(WixErrors.IllegalAttributeValueWithIllegalList(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, illegalValues)); + this.Write(ErrorMessages.IllegalAttributeValueWithIllegalList(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, illegalValues)); } } @@ -997,7 +995,7 @@ namespace WixToolset.Core if (CompilerCore.DisallowedMsiProperties.Contains(value)) { string illegalValues = CompilerCore.CreateValueList(ValueListKind.Or, CompilerCore.DisallowedMsiProperties); - this.OnMessage(WixErrors.DisallowedMsiProperty(sourceLineNumbers, value, illegalValues)); + this.Write(ErrorMessages.DisallowedMsiProperty(sourceLineNumbers, value, illegalValues)); } } @@ -1099,12 +1097,12 @@ namespace WixToolset.Core } /// - /// Sends a message to the message delegate if there is one. + /// Sends a message. /// - /// Message event arguments. - public void OnMessage(MessageEventArgs e) + /// Message to write. + public void Write(Message message) { - Messaging.Instance.OnMessage(e); + this.messaging.Write(message); } /// @@ -1128,11 +1126,11 @@ namespace WixToolset.Core { if (this.GetType().Assembly.Equals(caller)) { - this.OnMessage(WixErrors.InsufficientVersion(sourceLineNumbers, versionCurrent, versionRequired)); + this.Write(ErrorMessages.InsufficientVersion(sourceLineNumbers, versionCurrent, versionRequired)); } else { - this.OnMessage(WixErrors.InsufficientVersion(sourceLineNumbers, versionCurrent, versionRequired, name.Name)); + this.Write(ErrorMessages.InsufficientVersion(sourceLineNumbers, versionCurrent, versionRequired, name.Name)); } } } diff --git a/src/WixToolset.Core/Converter.cs b/src/WixToolset.Core/Converter.cs index c0297758..fd925f7a 100644 --- a/src/WixToolset.Core/Converter.cs +++ b/src/WixToolset.Core/Converter.cs @@ -10,6 +10,7 @@ namespace WixToolset.Core using System.Xml; using System.Xml.Linq; using WixToolset.Data; + using WixToolset.Extensibility.Services; /// /// WiX source code converter. @@ -64,7 +65,7 @@ namespace WixToolset.Core /// Indentation value to use when validating leading whitespace. /// Test errors to display as warnings. /// Test errors to ignore. - public Converter(int indentationAmount, IEnumerable errorsAsWarnings = null, IEnumerable ignoreErrors = null) + public Converter(IMessaging messaging, int indentationAmount, IEnumerable errorsAsWarnings = null, IEnumerable ignoreErrors = null) { this.ConvertElementMapping = new Dictionary>() { @@ -77,6 +78,8 @@ namespace WixToolset.Core { WixElementWithoutNamespaceName, this.ConvertWixElementWithoutNamespace }, }; + this.Messaging = messaging; + this.IndentationAmount = indentationAmount; this.ErrorsAsWarnings = new HashSet(this.YieldConverterTypes(errorsAsWarnings)); @@ -90,6 +93,8 @@ namespace WixToolset.Core private HashSet IgnoreErrors { get; set; } + private IMessaging Messaging { get; } + private int IndentationAmount { get; set; } private string SourceFile { get; set; } @@ -528,9 +533,9 @@ namespace WixToolset.Core bool warning = this.ErrorsAsWarnings.Contains(converterTestType); string display = String.Format(CultureInfo.CurrentCulture, message, args); - WixGenericMessageEventArgs ea = new WixGenericMessageEventArgs(sourceLine, (int)converterTestType, warning ? MessageLevel.Warning : MessageLevel.Error, "{0} ({1})", display, converterTestType.ToString()); + var msg = new Message(sourceLine, warning ? MessageLevel.Warning : MessageLevel.Error, (int)converterTestType, "{0} ({1})", display, converterTestType.ToString()); - Messaging.Instance.OnMessage(ea); + this.Messaging.Write(msg); return true; } diff --git a/src/WixToolset.Core/Data/WixToolset.Core.Data.messages.resources b/src/WixToolset.Core/Data/WixToolset.Core.Data.messages.resources deleted file mode 100644 index 92c07940..00000000 Binary files a/src/WixToolset.Core/Data/WixToolset.Core.Data.messages.resources and /dev/null differ diff --git a/src/WixToolset.Core/Data/WixToolset.Core.WixStrings.resources b/src/WixToolset.Core/Data/WixToolset.Core.WixStrings.resources deleted file mode 100644 index 8f5a010a..00000000 Binary files a/src/WixToolset.Core/Data/WixToolset.Core.WixStrings.resources and /dev/null differ diff --git a/src/WixToolset.Core/Data/messages.cs b/src/WixToolset.Core/Data/messages.cs deleted file mode 100644 index 045565fc..00000000 --- a/src/WixToolset.Core/Data/messages.cs +++ /dev/null @@ -1,3106 +0,0 @@ -//------------------------------------------------------------------------------ -// -// This code was generated by a tool. -// Runtime Version:4.0.30319.42000 -// -// Changes to this file may cause incorrect behavior and will be lost if -// the code is regenerated. -// -//------------------------------------------------------------------------------ - -namespace WixToolset -{ - using System; - using System.Reflection; - using System.Resources; - using WixToolset.Data; - - - public class WixErrorEventArgs : MessageEventArgs - { - - private static ResourceManager resourceManager = new ResourceManager("WixToolset.Core.Data.Messages", Assembly.GetExecutingAssembly()); - - public WixErrorEventArgs(SourceLineNumber sourceLineNumbers, int id, string resourceName, params object[] messageArgs) : - base(sourceLineNumbers, id, resourceName, messageArgs) - { - base.Level = MessageLevel.Error; - base.ResourceManager = resourceManager; - } - } - - public sealed class WixErrors - { - - private WixErrors() - { - } - - public static MessageEventArgs UnexpectedException(string message, string type, string stackTrace) - { - return new WixErrorEventArgs(null, 1, "WixErrors_UnexpectedException_1", message, type, stackTrace); - } - - public static MessageEventArgs UnexpectedAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 4, "WixErrors_UnexpectedAttribute_1", elementName, attributeName); - } - - public static MessageEventArgs UnexpectedElement(SourceLineNumber sourceLineNumbers, string elementName, string childElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 5, "WixErrors_UnexpectedElement_1", elementName, childElementName); - } - - public static MessageEventArgs IllegalEmptyAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 6, "WixErrors_IllegalEmptyAttributeValue_1", elementName, attributeName); - } - - public static MessageEventArgs IllegalEmptyAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string defaultValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 6, "WixErrors_IllegalEmptyAttributeValue_2", elementName, attributeName, defaultValue); - } - - public static MessageEventArgs InsufficientVersion(SourceLineNumber sourceLineNumbers, System.Version currentVersion, System.Version requiredVersion) - { - return new WixErrorEventArgs(sourceLineNumbers, 7, "WixErrors_InsufficientVersion_1", currentVersion, requiredVersion); - } - - public static MessageEventArgs InsufficientVersion(SourceLineNumber sourceLineNumbers, System.Version currentVersion, System.Version requiredVersion, string extension) - { - return new WixErrorEventArgs(sourceLineNumbers, 7, "WixErrors_InsufficientVersion_2", currentVersion, requiredVersion, extension); - } - - public static MessageEventArgs IllegalIntegerValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 8, "WixErrors_IllegalIntegerValue_1", elementName, attributeName, value); - } - - public static MessageEventArgs IllegalGuidValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 9, "WixErrors_IllegalGuidValue_1", elementName, attributeName, value); - } - - public static MessageEventArgs ExpectedAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 10, "WixErrors_ExpectedAttribute_1", elementName, attributeName); - } - - public static MessageEventArgs ExpectedAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attribute1Name, string attribute2Name, bool eitherOr) - { - return new WixErrorEventArgs(sourceLineNumbers, 10, "WixErrors_ExpectedAttribute_2", elementName, attribute1Name, attribute2Name, eitherOr); - } - - public static MessageEventArgs ExpectedAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 10, "WixErrors_ExpectedAttribute_3", elementName, attributeName, otherAttributeName); - } - - public static MessageEventArgs ExpectedAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName, string otherAttributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 10, "WixErrors_ExpectedAttribute_4", elementName, attributeName, otherAttributeName, otherAttributeValue); - } - - public static MessageEventArgs ExpectedAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName, string otherAttributeValue, bool otherAttributeValueUnless) - { - return new WixErrorEventArgs(sourceLineNumbers, 10, "WixErrors_ExpectedAttribute_5", elementName, attributeName, otherAttributeName, otherAttributeValue, otherAttributeValueUnless); - } - - public static MessageEventArgs SecurePropertyNotUppercase(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string propertyId) - { - return new WixErrorEventArgs(sourceLineNumbers, 11, "WixErrors_SecurePropertyNotUppercase_1", elementName, attributeName, propertyId); - } - - public static MessageEventArgs SearchPropertyNotUppercase(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 12, "WixErrors_SearchPropertyNotUppercase_1", elementName, attributeName, value); - } - - public static MessageEventArgs StreamNameTooLong(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, int length, int maximumLength) - { - return new WixErrorEventArgs(sourceLineNumbers, 13, "WixErrors_StreamNameTooLong_1", elementName, attributeName, value, length, maximumLength); - } - - public static MessageEventArgs StreamNameTooLong(SourceLineNumber sourceLineNumbers, string tableName, string streamName, int streamLength) - { - return new WixErrorEventArgs(sourceLineNumbers, 13, "WixErrors_StreamNameTooLong_2", tableName, streamName, streamLength); - } - - public static MessageEventArgs IllegalIdentifier(SourceLineNumber sourceLineNumbers, string elementName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 14, "WixErrors_IllegalIdentifier_1", elementName, value); - } - - public static MessageEventArgs IllegalIdentifier(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, int disambiguator) - { - return new WixErrorEventArgs(sourceLineNumbers, 14, "WixErrors_IllegalIdentifier_2", elementName, attributeName, disambiguator); - } - - public static MessageEventArgs IllegalIdentifier(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 14, "WixErrors_IllegalIdentifier_3", elementName, attributeName, value); - } - - public static MessageEventArgs IllegalIdentifier(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string identifier) - { - return new WixErrorEventArgs(sourceLineNumbers, 14, "WixErrors_IllegalIdentifier_4", elementName, attributeName, value, identifier); - } - - public static MessageEventArgs IllegalYesNoValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 15, "WixErrors_IllegalYesNoValue_1", elementName, attributeName, value); - } - - public static MessageEventArgs CabCreationFailed(string cabName, string fileName, int error) - { - return new WixErrorEventArgs(null, 16, "WixErrors_CabCreationFailed_1", cabName, fileName, error); - } - - public static MessageEventArgs CabCreationFailed(string cabName, int error) - { - return new WixErrorEventArgs(null, 16, "WixErrors_CabCreationFailed_2", cabName, error); - } - - public static MessageEventArgs CabExtractionFailed(string cabName, string directoryName) - { - return new WixErrorEventArgs(null, 17, "WixErrors_CabExtractionFailed_1", cabName, directoryName); - } - - public static MessageEventArgs CabExtractionFailed(string cabName, string mergeModulePath, string directoryName) - { - return new WixErrorEventArgs(null, 17, "WixErrors_CabExtractionFailed_2", cabName, mergeModulePath, directoryName); - } - - public static MessageEventArgs AppIdIncompatibleAdvertiseState(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string parentValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 18, "WixErrors_AppIdIncompatibleAdvertiseState_1", elementName, attributeName, value, parentValue); - } - - public static MessageEventArgs IllegalAttributeWhenAdvertised(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 19, "WixErrors_IllegalAttributeWhenAdvertised_1", elementName, attributeName); - } - - public static MessageEventArgs ConditionExpected(SourceLineNumber sourceLineNumbers, string elementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 20, "WixErrors_ConditionExpected_1", elementName); - } - - public static MessageEventArgs IllegalAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string legalValue1) - { - return new WixErrorEventArgs(sourceLineNumbers, 21, "WixErrors_IllegalAttributeValue_1", elementName, attributeName, value, legalValue1); - } - - public static MessageEventArgs IllegalAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string legalValue1, string legalValue2) - { - return new WixErrorEventArgs(sourceLineNumbers, 21, "WixErrors_IllegalAttributeValue_2", elementName, attributeName, value, legalValue1, legalValue2); - } - - public static MessageEventArgs IllegalAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string legalValue1, string legalValue2, string legalValue3) - { - return new WixErrorEventArgs(sourceLineNumbers, 21, "WixErrors_IllegalAttributeValue_3", elementName, attributeName, value, legalValue1, legalValue2, legalValue3); - } - - public static MessageEventArgs IllegalAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string legalValue1, string legalValue2, string legalValue3, string legalValue4) - { - return new WixErrorEventArgs(sourceLineNumbers, 21, "WixErrors_IllegalAttributeValue_4", elementName, attributeName, value, legalValue1, legalValue2, legalValue3, legalValue4); - } - - public static MessageEventArgs IllegalAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string legalValue1, string legalValue2, string legalValue3, string legalValue4, string legalValue5) - { - return new WixErrorEventArgs(sourceLineNumbers, 21, "WixErrors_IllegalAttributeValue_5", elementName, attributeName, value, legalValue1, legalValue2, legalValue3, legalValue4, legalValue5); - } - - public static MessageEventArgs IllegalAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string legalValue1, string legalValue2, string legalValue3, string legalValue4, string legalValue5, string legalValue6) - { - return new WixErrorEventArgs(sourceLineNumbers, 21, "WixErrors_IllegalAttributeValue_6", elementName, attributeName, value, legalValue1, legalValue2, legalValue3, legalValue4, legalValue5, legalValue6); - } - - public static MessageEventArgs IllegalAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string legalValue1, string legalValue2, string legalValue3, string legalValue4, string legalValue5, string legalValue6, string legalValue7) - { - return new WixErrorEventArgs(sourceLineNumbers, 21, "WixErrors_IllegalAttributeValue_7", elementName, attributeName, value, legalValue1, legalValue2, legalValue3, legalValue4, legalValue5, legalValue6, legalValue7); - } - - public static MessageEventArgs IllegalAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string legalValue1, string legalValue2, string legalValue3, string legalValue4, string legalValue5, string legalValue6, string legalValue7, string legalValue8) - { - return new WixErrorEventArgs(sourceLineNumbers, 21, "WixErrors_IllegalAttributeValue_8", elementName, attributeName, value, legalValue1, legalValue2, legalValue3, legalValue4, legalValue5, legalValue6, legalValue7, legalValue8); - } - - public static MessageEventArgs IllegalAttributeValue( - SourceLineNumber sourceLineNumbers, - string elementName, - string attributeName, - string value, - string legalValue1, - string legalValue2, - string legalValue3, - string legalValue4, - string legalValue5, - string legalValue6, - string legalValue7, - string legalValue8, - string legalValue9, - string legalValue10, - string legalValue11, - string legalValue12, - string legalValue13, - string legalValue14, - string legalValue15, - string legalValue16, - string legalValue17, - string legalValue18, - string legalValue19, - string legalValue20, - string legalValue21, - string legalValue22, - string legalValue23, - string legalValue24, - string legalValue25, - string legalValue26) - { - return new WixErrorEventArgs(sourceLineNumbers, 21, "WixErrors_IllegalAttributeValue_9", elementName, attributeName, value, legalValue1, legalValue2, legalValue3, legalValue4, legalValue5, legalValue6, legalValue7, legalValue8, legalValue9, legalValue10, legalValue11, legalValue12, legalValue13, legalValue14, legalValue15, legalValue16, legalValue17, legalValue18, legalValue19, legalValue20, legalValue21, legalValue22, legalValue23, legalValue24, legalValue25, legalValue26); - } - - public static MessageEventArgs CustomActionMultipleSources(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeName1, string attributeName2, string attributeName3, string attributeName4, string attributeName5) - { - return new WixErrorEventArgs(sourceLineNumbers, 22, "WixErrors_CustomActionMultipleSources_1", elementName, attributeName, attributeName1, attributeName2, attributeName3, attributeName4, attributeName5); - } - - public static MessageEventArgs CustomActionMultipleTargets(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeName1, string attributeName2, string attributeName3, string attributeName4, string attributeName5, string attributeName6, string attributeName7) - { - return new WixErrorEventArgs(sourceLineNumbers, 23, "WixErrors_CustomActionMultipleTargets_1", elementName, attributeName, attributeName1, attributeName2, attributeName3, attributeName4, attributeName5, attributeName6, attributeName7); - } - - public static MessageEventArgs CustomActionIllegalInnerText(SourceLineNumber sourceLineNumbers, string elementName, string innerText, string attributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 24, "WixErrors_CustomActionIllegalInnerText_1", elementName, innerText, attributeName); - } - - public static MessageEventArgs DirectoryRootWithoutName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 25, "WixErrors_DirectoryRootWithoutName_1", elementName, attributeName); - } - - public static MessageEventArgs IllegalShortFilename(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 26, "WixErrors_IllegalShortFilename_1", elementName, attributeName, value); - } - - public static MessageEventArgs IllegalLongFilename(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 27, "WixErrors_IllegalLongFilename_1", elementName, attributeName, value); - } - - public static MessageEventArgs IllegalLongFilename(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string filename) - { - return new WixErrorEventArgs(sourceLineNumbers, 27, "WixErrors_IllegalLongFilename_2", elementName, attributeName, value, filename); - } - - public static MessageEventArgs TableNameTooLong(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 28, "WixErrors_TableNameTooLong_1", elementName, attributeName, value); - } - - public static MessageEventArgs FeatureConfigurableDirectoryNotUppercase(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 29, "WixErrors_FeatureConfigurableDirectoryNotUppercase_1", elementName, attributeName, value); - } - - public static MessageEventArgs FeatureCannotFavorAndDisallowAdvertise(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string otherAttributeName, string otherValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 30, "WixErrors_FeatureCannotFavorAndDisallowAdvertise_1", elementName, attributeName, value, otherAttributeName, otherValue); - } - - public static MessageEventArgs FeatureCannotFollowParentAndFavorLocalOrSource(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName, string otherValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 31, "WixErrors_FeatureCannotFollowParentAndFavorLocalOrSource_1", elementName, attributeName, otherAttributeName, otherValue); - } - - public static MessageEventArgs MediaEmbeddedCabinetNameTooLong(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, int length) - { - return new WixErrorEventArgs(sourceLineNumbers, 32, "WixErrors_MediaEmbeddedCabinetNameTooLong_1", elementName, attributeName, value, length); - } - - public static MessageEventArgs RegistrySubElementCannotBeRemoved(SourceLineNumber sourceLineNumbers, string registryElementName, string registryValueElementName, string actionAttributeName, string removeValue, string removeKeyOnInstallValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 33, "WixErrors_RegistrySubElementCannotBeRemoved_1", registryElementName, registryValueElementName, actionAttributeName, removeValue, removeKeyOnInstallValue); - } - - public static MessageEventArgs RegistryMultipleValuesWithoutMultiString(SourceLineNumber sourceLineNumbers, string registryElementName, string valueAttributeName, string registryValueElementName, string typeAttributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 34, "WixErrors_RegistryMultipleValuesWithoutMultiString_1", registryElementName, valueAttributeName, registryValueElementName, typeAttributeName); - } - - public static MessageEventArgs IllegalAttributeWithOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 35, "WixErrors_IllegalAttributeWithOtherAttribute_1", elementName, attributeName, otherAttributeName); - } - - public static MessageEventArgs IllegalAttributeWithOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName, string otherAttributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 35, "WixErrors_IllegalAttributeWithOtherAttribute_2", elementName, attributeName, otherAttributeName, otherAttributeValue); - } - - public static MessageEventArgs IllegalAttributeWithOtherAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName1, string otherAttributeName2) - { - return new WixErrorEventArgs(sourceLineNumbers, 36, "WixErrors_IllegalAttributeWithOtherAttributes_1", elementName, attributeName, otherAttributeName1, otherAttributeName2); - } - - public static MessageEventArgs IllegalAttributeWithOtherAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName1, string otherAttributeName2, string otherAttributeName3) - { - return new WixErrorEventArgs(sourceLineNumbers, 36, "WixErrors_IllegalAttributeWithOtherAttributes_2", elementName, attributeName, otherAttributeName1, otherAttributeName2, otherAttributeName3); - } - - public static MessageEventArgs IllegalAttributeWithOtherAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName1, string otherAttributeName2, string otherAttributeName3, string otherAttributeName4) - { - return new WixErrorEventArgs(sourceLineNumbers, 36, "WixErrors_IllegalAttributeWithOtherAttributes_3", elementName, attributeName, otherAttributeName1, otherAttributeName2, otherAttributeName3, otherAttributeName4); - } - - public static MessageEventArgs IllegalAttributeWithoutOtherAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 37, "WixErrors_IllegalAttributeWithoutOtherAttributes_1", elementName, attributeName, otherAttributeName); - } - - public static MessageEventArgs IllegalAttributeWithoutOtherAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName1, string otherAttributeName2) - { - return new WixErrorEventArgs(sourceLineNumbers, 37, "WixErrors_IllegalAttributeWithoutOtherAttributes_2", elementName, attributeName, otherAttributeName1, otherAttributeName2); - } - - public static MessageEventArgs IllegalAttributeWithoutOtherAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName1, string otherAttributeName2, string otherAttributeValue, bool uniquifier) - { - return new WixErrorEventArgs(sourceLineNumbers, 37, "WixErrors_IllegalAttributeWithoutOtherAttributes_3", elementName, attributeName, otherAttributeName1, otherAttributeName2, otherAttributeValue, uniquifier); - } - - public static MessageEventArgs IllegalAttributeWithoutOtherAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName1, string otherAttributeName2, string otherAttributeName3) - { - return new WixErrorEventArgs(sourceLineNumbers, 37, "WixErrors_IllegalAttributeWithoutOtherAttributes_4", elementName, attributeName, otherAttributeName1, otherAttributeName2, otherAttributeName3); - } - - public static MessageEventArgs IllegalAttributeWithoutOtherAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string otherAttributeName1, string otherAttributeName2, string otherAttributeName3, string otherAttributeName4) - { - return new WixErrorEventArgs(sourceLineNumbers, 37, "WixErrors_IllegalAttributeWithoutOtherAttributes_5", elementName, attributeName, otherAttributeName1, otherAttributeName2, otherAttributeName3, otherAttributeName4); - } - - public static MessageEventArgs IllegalAttributeValueWithoutOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue, string otherAttributeName, string otherAttributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 38, "WixErrors_IllegalAttributeValueWithoutOtherAttribute_1", elementName, attributeName, attributeValue, otherAttributeName, otherAttributeValue); - } - - public static MessageEventArgs IllegalAttributeValueWithoutOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue, string otherAttributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 38, "WixErrors_IllegalAttributeValueWithoutOtherAttribute_2", elementName, attributeName, attributeValue, otherAttributeName); - } - - public static MessageEventArgs IntegralValueSentinelCollision(SourceLineNumber sourceLineNumbers, int value) - { - return new WixErrorEventArgs(sourceLineNumbers, 39, "WixErrors_IntegralValueSentinelCollision_1", value); - } - - public static MessageEventArgs IntegralValueSentinelCollision(SourceLineNumber sourceLineNumbers, long value) - { - return new WixErrorEventArgs(sourceLineNumbers, 39, "WixErrors_IntegralValueSentinelCollision_2", value); - } - - public static MessageEventArgs ExampleGuid(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 40, "WixErrors_ExampleGuid_1", elementName, attributeName, value); - } - - public static MessageEventArgs TooManyChildren(SourceLineNumber sourceLineNumbers, string elementName, string childElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 41, "WixErrors_TooManyChildren_1", elementName, childElementName); - } - - public static MessageEventArgs ComponentMultipleKeyPaths(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string fileElementName, string registryElementName, string odbcDataSourceElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 42, "WixErrors_ComponentMultipleKeyPaths_1", elementName, attributeName, value, fileElementName, registryElementName, odbcDataSourceElementName); - } - - public static MessageEventArgs CabClosureFailed(string cabinet) - { - return new WixErrorEventArgs(null, 43, "WixErrors_CabClosureFailed_1", cabinet); - } - - public static MessageEventArgs CabClosureFailed(string cabinet, int error) - { - return new WixErrorEventArgs(null, 43, "WixErrors_CabClosureFailed_2", cabinet, error); - } - - public static MessageEventArgs ExpectedAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2) - { - return new WixErrorEventArgs(sourceLineNumbers, 44, "WixErrors_ExpectedAttributes_1", elementName, attributeName1, attributeName2); - } - - public static MessageEventArgs ExpectedAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string attributeName3) - { - return new WixErrorEventArgs(sourceLineNumbers, 44, "WixErrors_ExpectedAttributes_2", elementName, attributeName1, attributeName2, attributeName3); - } - - public static MessageEventArgs ExpectedAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string attributeName3, string attributeName4) - { - return new WixErrorEventArgs(sourceLineNumbers, 44, "WixErrors_ExpectedAttributes_3", elementName, attributeName1, attributeName2, attributeName3, attributeName4); - } - - public static MessageEventArgs ExpectedAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string attributeName3, string attributeName4, string attributeName5) - { - return new WixErrorEventArgs(sourceLineNumbers, 44, "WixErrors_ExpectedAttributes_4", elementName, attributeName1, attributeName2, attributeName3, attributeName4, attributeName5); - } - - public static MessageEventArgs ExpectedAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string attributeName3, string attributeName4, string attributeName5, string attributeName6) - { - return new WixErrorEventArgs(sourceLineNumbers, 44, "WixErrors_ExpectedAttributes_5", elementName, attributeName1, attributeName2, attributeName3, attributeName4, attributeName5, attributeName6); - } - - public static MessageEventArgs ExpectedAttributes(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string attributeName3, string attributeName4, string attributeName5, string attributeName6, string attributeName7) - { - return new WixErrorEventArgs(sourceLineNumbers, 44, "WixErrors_ExpectedAttributes_6", elementName, attributeName1, attributeName2, attributeName3, attributeName4, attributeName5, attributeName6, attributeName7); - } - - public static MessageEventArgs ExpectedAttributesWithOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2) - { - return new WixErrorEventArgs(sourceLineNumbers, 45, "WixErrors_ExpectedAttributesWithOtherAttribute_1", elementName, attributeName1, attributeName2); - } - - public static MessageEventArgs ExpectedAttributesWithOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string otherAttributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 45, "WixErrors_ExpectedAttributesWithOtherAttribute_2", elementName, attributeName1, attributeName2, otherAttributeName); - } - - public static MessageEventArgs ExpectedAttributesWithOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string otherAttributeName, string otherAttributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 45, "WixErrors_ExpectedAttributesWithOtherAttribute_3", elementName, attributeName1, attributeName2, otherAttributeName, otherAttributeValue); - } - - public static MessageEventArgs ExpectedAttributesWithoutOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2, string otherAttributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 46, "WixErrors_ExpectedAttributesWithoutOtherAttribute_1", elementName, attributeName1, attributeName2, otherAttributeName); - } - - public static MessageEventArgs MissingTypeLibFile(SourceLineNumber sourceLineNumbers, string elementName, string fileElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 47, "WixErrors_MissingTypeLibFile_1", elementName, fileElementName); - } - - public static MessageEventArgs InvalidDocumentElement(SourceLineNumber sourceLineNumbers, string elementName, string fileType, string expectedElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 48, "WixErrors_InvalidDocumentElement_1", elementName, fileType, expectedElementName); - } - - public static MessageEventArgs ExpectedAttributeInElementOrParent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string parentElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 49, "WixErrors_ExpectedAttributeInElementOrParent_1", elementName, attributeName, parentElementName); - } - - public static MessageEventArgs ExpectedAttributeInElementOrParent(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string parentElementName, string parentAttributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 49, "WixErrors_ExpectedAttributeInElementOrParent_2", elementName, attributeName, parentElementName, parentAttributeName); - } - - public static MessageEventArgs UnauthorizedAccess(string filePath) - { - return new WixErrorEventArgs(null, 50, "WixErrors_UnauthorizedAccess_1", filePath); - } - - public static MessageEventArgs IllegalModuleExclusionLanguageAttributes(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 51, "WixErrors_IllegalModuleExclusionLanguageAttributes_1"); - } - - public static MessageEventArgs NoFirstControlSpecified(SourceLineNumber sourceLineNumbers, string dialogName) - { - return new WixErrorEventArgs(sourceLineNumbers, 52, "WixErrors_NoFirstControlSpecified_1", dialogName); - } - - public static MessageEventArgs NoDataForColumn(SourceLineNumber sourceLineNumbers, string columnName, string tableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 53, "WixErrors_NoDataForColumn_1", columnName, tableName); - } - - public static MessageEventArgs ValueAndMaskMustBeSameLength(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 54, "WixErrors_ValueAndMaskMustBeSameLength_1"); - } - - public static MessageEventArgs TooManySearchElements(SourceLineNumber sourceLineNumbers, string elementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 55, "WixErrors_TooManySearchElements_1", elementName); - } - - public static MessageEventArgs IllegalAttributeExceptOnElement(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string expectedElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 56, "WixErrors_IllegalAttributeExceptOnElement_1", elementName, attributeName, expectedElementName); - } - - public static MessageEventArgs SearchElementRequired(SourceLineNumber sourceLineNumbers, string elementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 57, "WixErrors_SearchElementRequired_1", elementName); - } - - public static MessageEventArgs MultipleIdentifiersFound(SourceLineNumber sourceLineNumbers, string elementName, string identifier, string mismatchIdentifier) - { - return new WixErrorEventArgs(sourceLineNumbers, 58, "WixErrors_MultipleIdentifiersFound_1", elementName, identifier, mismatchIdentifier); - } - - public static MessageEventArgs AdvertiseStateMustMatch(SourceLineNumber sourceLineNumbers, string advertiseState, string parentAdvertiseState) - { - return new WixErrorEventArgs(sourceLineNumbers, 59, "WixErrors_AdvertiseStateMustMatch_1", advertiseState, parentAdvertiseState); - } - - public static MessageEventArgs DuplicateContextValue(SourceLineNumber sourceLineNumbers, string contextValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 60, "WixErrors_DuplicateContextValue_1", contextValue); - } - - public static MessageEventArgs RelativePathForRegistryElement(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 61, "WixErrors_RelativePathForRegistryElement_1"); - } - - public static MessageEventArgs IllegalAttributeWhenNested(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string parentElement) - { - return new WixErrorEventArgs(sourceLineNumbers, 62, "WixErrors_IllegalAttributeWhenNested_1", elementName, attributeName, parentElement); - } - - public static MessageEventArgs ExpectedElement(SourceLineNumber sourceLineNumbers, string elementName, string childName) - { - return new WixErrorEventArgs(sourceLineNumbers, 63, "WixErrors_ExpectedElement_1", elementName, childName); - } - - public static MessageEventArgs ExpectedElement(SourceLineNumber sourceLineNumbers, string elementName, string childName1, string childName2) - { - return new WixErrorEventArgs(sourceLineNumbers, 63, "WixErrors_ExpectedElement_2", elementName, childName1, childName2); - } - - public static MessageEventArgs ExpectedElement(SourceLineNumber sourceLineNumbers, string elementName, string childName1, string childName2, string childName3) - { - return new WixErrorEventArgs(sourceLineNumbers, 63, "WixErrors_ExpectedElement_3", elementName, childName1, childName2, childName3); - } - - public static MessageEventArgs ExpectedElement(SourceLineNumber sourceLineNumbers, string elementName, string childName1, string childName2, string childName3, string childName4) - { - return new WixErrorEventArgs(sourceLineNumbers, 63, "WixErrors_ExpectedElement_4", elementName, childName1, childName2, childName3, childName4); - } - - public static MessageEventArgs RegistryRootInvalid(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 64, "WixErrors_RegistryRootInvalid_1"); - } - - public static MessageEventArgs IllegalYesNoDefaultValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 65, "WixErrors_IllegalYesNoDefaultValue_1", elementName, attributeName, value); - } - - public static MessageEventArgs IllegalAttributeInMergeModule(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 66, "WixErrors_IllegalAttributeInMergeModule_1", elementName, attributeName); - } - - public static MessageEventArgs GenericReadNotAllowed(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 67, "WixErrors_GenericReadNotAllowed_1"); - } - - public static MessageEventArgs IllegalAttributeWithInnerText(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 68, "WixErrors_IllegalAttributeWithInnerText_1", elementName, attributeName); - } - - public static MessageEventArgs SearchElementRequiredWithAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 69, "WixErrors_SearchElementRequiredWithAttribute_1", elementName, attributeName, attributeValue); - } - - public static MessageEventArgs CannotAuthorSpecialProperties(SourceLineNumber sourceLineNumbers, string propertyName) - { - return new WixErrorEventArgs(sourceLineNumbers, 70, "WixErrors_CannotAuthorSpecialProperties_1", propertyName); - } - - public static MessageEventArgs NeedSequenceBeforeOrAfter(SourceLineNumber sourceLineNumbers, string elementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 72, "WixErrors_NeedSequenceBeforeOrAfter_1", elementName); - } - - public static MessageEventArgs ValueNotSupported(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 73, "WixErrors_ValueNotSupported_1", elementName, attributeName, attributeValue); - } - - public static MessageEventArgs TabbableControlNotAllowedInBillboard(SourceLineNumber sourceLineNumbers, string elementName, string controlType) - { - return new WixErrorEventArgs(sourceLineNumbers, 74, "WixErrors_TabbableControlNotAllowedInBillboard_1", elementName, controlType); - } - - public static MessageEventArgs CheckBoxValueOnlyValidWithCheckBox(SourceLineNumber sourceLineNumbers, string elementName, string controlType) - { - return new WixErrorEventArgs(sourceLineNumbers, 75, "WixErrors_CheckBoxValueOnlyValidWithCheckBox_1", elementName, controlType); - } - - public static MessageEventArgs CabFileDoesNotExist(string cabName, string mergeModulePath, string directoryName) - { - return new WixErrorEventArgs(null, 76, "WixErrors_CabFileDoesNotExist_1", cabName, mergeModulePath, directoryName); - } - - public static MessageEventArgs RadioButtonTypeInconsistent(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 77, "WixErrors_RadioButtonTypeInconsistent_1"); - } - - public static MessageEventArgs RadioButtonBitmapAndIconDisallowed(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 78, "WixErrors_RadioButtonBitmapAndIconDisallowed_1"); - } - - public static MessageEventArgs IllegalSuppressWarningId(string suppressedId) - { - return new WixErrorEventArgs(null, 79, "WixErrors_IllegalSuppressWarningId_1", suppressedId); - } - - public static MessageEventArgs PreprocessorIllegalForeachVariable(SourceLineNumber sourceLineNumbers, string variableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 80, "WixErrors_PreprocessorIllegalForeachVariable_1", variableName); - } - - public static MessageEventArgs PreprocessorMissingParameterPrefix(SourceLineNumber sourceLineNumbers, string parameterName) - { - return new WixErrorEventArgs(sourceLineNumbers, 81, "WixErrors_PreprocessorMissingParameterPrefix_1", parameterName); - } - - public static MessageEventArgs PreprocessorExtensionForParameterMissing(SourceLineNumber sourceLineNumbers, string parameterName, string parameterPrefix) - { - return new WixErrorEventArgs(sourceLineNumbers, 82, "WixErrors_PreprocessorExtensionForParameterMissing_1", parameterName, parameterPrefix); - } - - public static MessageEventArgs CannotFindFile(SourceLineNumber sourceLineNumbers, string fileId, string fileName, string filePath) - { - return new WixErrorEventArgs(sourceLineNumbers, 83, "WixErrors_CannotFindFile_1", fileId, fileName, filePath); - } - - public static MessageEventArgs BinderFileManagerMissingFile(SourceLineNumber sourceLineNumbers, string exceptionMessage) - { - return new WixErrorEventArgs(sourceLineNumbers, 84, "WixErrors_BinderFileManagerMissingFile_1", exceptionMessage); - } - - public static MessageEventArgs ReferenceLoopDetected(SourceLineNumber sourceLineNumbers, string loopList) - { - return new WixErrorEventArgs(sourceLineNumbers, 86, "WixErrors_ReferenceLoopDetected_1", loopList); - } - - public static MessageEventArgs GuidContainsLowercaseLetters(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 87, "WixErrors_GuidContainsLowercaseLetters_1", elementName, attributeName, value); - } - - public static MessageEventArgs InvalidDateTimeFormat(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 88, "WixErrors_InvalidDateTimeFormat_1", elementName, attributeName, value); - } - - public static MessageEventArgs MultipleEntrySections(SourceLineNumber sourceLineNumbers, string sectionName1, string sectionName2) - { - return new WixErrorEventArgs(sourceLineNumbers, 89, "WixErrors_MultipleEntrySections_1", sectionName1, sectionName2); - } - - public static MessageEventArgs MultipleEntrySections2(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 90, "WixErrors_MultipleEntrySections2_1"); - } - - public static MessageEventArgs DuplicateSymbol(SourceLineNumber sourceLineNumbers, string symbolName) - { - return new WixErrorEventArgs(sourceLineNumbers, 91, "WixErrors_DuplicateSymbol_1", symbolName); - } - - public static MessageEventArgs DuplicateSymbol(SourceLineNumber sourceLineNumbers, string symbolName, string referencingSourceLineNumber) - { - return new WixErrorEventArgs(sourceLineNumbers, 91, "WixErrors_DuplicateSymbol_2", symbolName, referencingSourceLineNumber); - } - - public static MessageEventArgs DuplicateSymbol2(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 92, "WixErrors_DuplicateSymbol2_1"); - } - - public static MessageEventArgs MissingEntrySection(string sectionType) - { - return new WixErrorEventArgs(null, 93, "WixErrors_MissingEntrySection_1", sectionType); - } - - public static MessageEventArgs UnresolvedReference(SourceLineNumber sourceLineNumbers, string symbolName) - { - return new WixErrorEventArgs(sourceLineNumbers, 94, "WixErrors_UnresolvedReference_1", symbolName); - } - - public static MessageEventArgs UnresolvedReference(SourceLineNumber sourceLineNumbers, string symbolName, WixToolset.Data.AccessModifier accessModifier) - { - return new WixErrorEventArgs(sourceLineNumbers, 94, "WixErrors_UnresolvedReference_2", symbolName, accessModifier); - } - - public static MessageEventArgs MultiplePrimaryReferences(SourceLineNumber sourceLineNumbers, string crefChildType, string crefChildId, string crefParentType, string crefParentId, string conflictParentType, string conflictParentId) - { - return new WixErrorEventArgs(sourceLineNumbers, 95, "WixErrors_MultiplePrimaryReferences_1", crefChildType, crefChildId, crefParentType, crefParentId, conflictParentType, conflictParentId); - } - - public static MessageEventArgs ComponentReferencedTwice(SourceLineNumber sourceLineNumbers, string crefChildId) - { - return new WixErrorEventArgs(sourceLineNumbers, 96, "WixErrors_ComponentReferencedTwice_1", crefChildId); - } - - public static MessageEventArgs DuplicateModuleFileIdentifier(SourceLineNumber sourceLineNumbers, string moduleId, string fileId) - { - return new WixErrorEventArgs(sourceLineNumbers, 97, "WixErrors_DuplicateModuleFileIdentifier_1", moduleId, fileId); - } - - public static MessageEventArgs DuplicateModuleCaseInsensitiveFileIdentifier(SourceLineNumber sourceLineNumbers, string moduleId, string fileId1, string fileId2) - { - return new WixErrorEventArgs(sourceLineNumbers, 98, "WixErrors_DuplicateModuleCaseInsensitiveFileIdentifier_1", moduleId, fileId1, fileId2); - } - - public static MessageEventArgs ImplicitComponentKeyPath(SourceLineNumber sourceLineNumbers, string componentId) - { - return new WixErrorEventArgs(sourceLineNumbers, 99, "WixErrors_ImplicitComponentKeyPath_1", componentId); - } - - public static MessageEventArgs DuplicateLocalizationIdentifier(SourceLineNumber sourceLineNumbers, string localizationId) - { - return new WixErrorEventArgs(sourceLineNumbers, 100, "WixErrors_DuplicateLocalizationIdentifier_1", localizationId); - } - - public static MessageEventArgs LocalizationVariableUnknown(SourceLineNumber sourceLineNumbers, string variableId) - { - return new WixErrorEventArgs(sourceLineNumbers, 102, "WixErrors_LocalizationVariableUnknown_1", variableId); - } - - public static MessageEventArgs FileNotFound(SourceLineNumber sourceLineNumbers, string file) - { - return new WixErrorEventArgs(sourceLineNumbers, 103, "WixErrors_FileNotFound_1", file); - } - - public static MessageEventArgs FileNotFound(SourceLineNumber sourceLineNumbers, string file, string fileType) - { - return new WixErrorEventArgs(sourceLineNumbers, 103, "WixErrors_FileNotFound_2", file, fileType); - } - - public static MessageEventArgs InvalidXml(SourceLineNumber sourceLineNumbers, string fileType, string detail) - { - return new WixErrorEventArgs(sourceLineNumbers, 104, "WixErrors_InvalidXml_1", fileType, detail); - } - - public static MessageEventArgs ProgIdNestedTooDeep(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 105, "WixErrors_ProgIdNestedTooDeep_1"); - } - - public static MessageEventArgs CanNotHaveTwoParents(SourceLineNumber sourceLineNumbers, string directorySearch, string parentAttribute, string parentElement) - { - return new WixErrorEventArgs(sourceLineNumbers, 106, "WixErrors_CanNotHaveTwoParents_1", directorySearch, parentAttribute, parentElement); - } - - public static MessageEventArgs SchemaValidationFailed(SourceLineNumber sourceLineNumbers, string validationError, int lineNumber, int linePosition) - { - return new WixErrorEventArgs(sourceLineNumbers, 107, "WixErrors_SchemaValidationFailed_1", validationError, lineNumber, linePosition); - } - - public static MessageEventArgs IllegalVersionValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 108, "WixErrors_IllegalVersionValue_1", elementName, attributeName, value); - } - - public static MessageEventArgs CustomTableNameTooLong(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 109, "WixErrors_CustomTableNameTooLong_1", elementName, attributeName, value); - } - - public static MessageEventArgs CustomTableIllegalColumnWidth(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, int value) - { - return new WixErrorEventArgs(sourceLineNumbers, 110, "WixErrors_CustomTableIllegalColumnWidth_1", elementName, attributeName, value); - } - - public static MessageEventArgs CustomTableMissingPrimaryKey(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 111, "WixErrors_CustomTableMissingPrimaryKey_1"); - } - - public static MessageEventArgs TypeSpecificationForExtensionRequired(string parameter) - { - return new WixErrorEventArgs(null, 113, "WixErrors_TypeSpecificationForExtensionRequired_1", parameter); - } - - public static MessageEventArgs FilePathRequired(string parameter) - { - return new WixErrorEventArgs(null, 114, "WixErrors_FilePathRequired_1", parameter); - } - - public static MessageEventArgs DirectoryPathRequired(string parameter) - { - return new WixErrorEventArgs(null, 115, "WixErrors_DirectoryPathRequired_1", parameter); - } - - public static MessageEventArgs FileOrDirectoryPathRequired(string parameter) - { - return new WixErrorEventArgs(null, 116, "WixErrors_FileOrDirectoryPathRequired_1", parameter); - } - - public static MessageEventArgs PathCannotContainQuote(string fileName) - { - return new WixErrorEventArgs(null, 117, "WixErrors_PathCannotContainQuote_1", fileName); - } - - public static MessageEventArgs AdditionalArgumentUnexpected(string argument) - { - return new WixErrorEventArgs(null, 118, "WixErrors_AdditionalArgumentUnexpected_1", argument); - } - - public static MessageEventArgs RegistryNameValueIncorrect(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 119, "WixErrors_RegistryNameValueIncorrect_1", elementName, attributeName, value); - } - - public static MessageEventArgs FamilyNameTooLong(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, int length) - { - return new WixErrorEventArgs(sourceLineNumbers, 120, "WixErrors_FamilyNameTooLong_1", elementName, attributeName, value, length); - } - - public static MessageEventArgs IllegalFamilyName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 121, "WixErrors_IllegalFamilyName_1", elementName, attributeName, value); - } - - public static MessageEventArgs IllegalLongValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 122, "WixErrors_IllegalLongValue_1", elementName, attributeName, value); - } - - public static MessageEventArgs IntegralValueOutOfRange(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, int value, int minimum, int maximum) - { - return new WixErrorEventArgs(sourceLineNumbers, 123, "WixErrors_IntegralValueOutOfRange_1", elementName, attributeName, value, minimum, maximum); - } - - public static MessageEventArgs IntegralValueOutOfRange(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, long value, long minimum, long maximum) - { - return new WixErrorEventArgs(sourceLineNumbers, 123, "WixErrors_IntegralValueOutOfRange_2", elementName, attributeName, value, minimum, maximum); - } - - public static MessageEventArgs DuplicateExtensionXmlSchemaNamespace(string extension, string extensionXmlSchemaNamespace, string collidingExtension) - { - return new WixErrorEventArgs(null, 125, "WixErrors_DuplicateExtensionXmlSchemaNamespace_1", extension, extensionXmlSchemaNamespace, collidingExtension); - } - - public static MessageEventArgs DuplicateExtensionTable(string extension, string tableName) - { - return new WixErrorEventArgs(null, 126, "WixErrors_DuplicateExtensionTable_1", extension, tableName); - } - - public static MessageEventArgs DuplicateExtensionPreprocessorType(string extension, string variablePrefix, string collidingExtension) - { - return new WixErrorEventArgs(null, 127, "WixErrors_DuplicateExtensionPreprocessorType_1", extension, variablePrefix, collidingExtension); - } - - public static MessageEventArgs FileInUse(SourceLineNumber sourceLineNumbers, string file) - { - return new WixErrorEventArgs(sourceLineNumbers, 128, "WixErrors_FileInUse_1", file); - } - - public static MessageEventArgs CannotOpenMergeModule(SourceLineNumber sourceLineNumbers, string mergeModuleIdentifier, string mergeModuleFile) - { - return new WixErrorEventArgs(sourceLineNumbers, 129, "WixErrors_CannotOpenMergeModule_1", mergeModuleIdentifier, mergeModuleFile); - } - - public static MessageEventArgs DuplicatePrimaryKey(SourceLineNumber sourceLineNumbers, string primaryKey, string tableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 130, "WixErrors_DuplicatePrimaryKey_1", primaryKey, tableName); - } - - public static MessageEventArgs FileIdentifierNotFound(SourceLineNumber sourceLineNumbers, string fileIdentifier) - { - return new WixErrorEventArgs(sourceLineNumbers, 131, "WixErrors_FileIdentifierNotFound_1", fileIdentifier); - } - - public static MessageEventArgs InvalidAssemblyFile(SourceLineNumber sourceLineNumbers, string assemblyFile, string moreInformation) - { - return new WixErrorEventArgs(sourceLineNumbers, 132, "WixErrors_InvalidAssemblyFile_1", assemblyFile, moreInformation); - } - - public static MessageEventArgs ExpectedEndElement(SourceLineNumber sourceLineNumbers, string elementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 133, "WixErrors_ExpectedEndElement_1", elementName); - } - - public static MessageEventArgs IllegalCodepage(int codepage) - { - return new WixErrorEventArgs(null, 134, "WixErrors_IllegalCodepage_1", codepage); - } - - public static MessageEventArgs ExpectedMediaCabinet(SourceLineNumber sourceLineNumbers, string fileId, int diskId) - { - return new WixErrorEventArgs(sourceLineNumbers, 135, "WixErrors_ExpectedMediaCabinet_1", fileId, diskId); - } - - public static MessageEventArgs InvalidIdt(SourceLineNumber sourceLineNumbers, string idtFile) - { - return new WixErrorEventArgs(sourceLineNumbers, 136, "WixErrors_InvalidIdt_1", idtFile); - } - - public static MessageEventArgs InvalidIdt(SourceLineNumber sourceLineNumbers, string idtFile, string tableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 136, "WixErrors_InvalidIdt_2", idtFile, tableName); - } - - public static MessageEventArgs InvalidSequenceTable(string sequenceTableName) - { - return new WixErrorEventArgs(null, 137, "WixErrors_InvalidSequenceTable_1", sequenceTableName); - } - - public static MessageEventArgs ExpectedDirectory(string directory) - { - return new WixErrorEventArgs(null, 138, "WixErrors_ExpectedDirectory_1", directory); - } - - public static MessageEventArgs ComponentExpectedFeature(SourceLineNumber sourceLineNumbers, string component, string type, string target) - { - return new WixErrorEventArgs(sourceLineNumbers, 139, "WixErrors_ComponentExpectedFeature_1", component, type, target); - } - - public static MessageEventArgs RecursiveAction(string action, string tableName) - { - return new WixErrorEventArgs(null, 140, "WixErrors_RecursiveAction_1", action, tableName); - } - - public static MessageEventArgs VersionMismatch(SourceLineNumber sourceLineNumbers, string fileType, string version, string expectedVersion) - { - return new WixErrorEventArgs(sourceLineNumbers, 141, "WixErrors_VersionMismatch_1", fileType, version, expectedVersion); - } - - public static MessageEventArgs UnexpectedContentNode(SourceLineNumber sourceLineNumbers, string elementName, string unexpectedNodeType) - { - return new WixErrorEventArgs(sourceLineNumbers, 142, "WixErrors_UnexpectedContentNode_1", elementName, unexpectedNodeType); - } - - public static MessageEventArgs UnexpectedColumnCount(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 143, "WixErrors_UnexpectedColumnCount_1", tableName); - } - - public static MessageEventArgs InvalidExtension(string extension) - { - return new WixErrorEventArgs(null, 144, "WixErrors_InvalidExtension_1", extension); - } - - public static MessageEventArgs InvalidExtension(string extension, string invalidReason) - { - return new WixErrorEventArgs(null, 144, "WixErrors_InvalidExtension_2", extension, invalidReason); - } - - public static MessageEventArgs InvalidExtension(string extension, string extensionType, string expectedType) - { - return new WixErrorEventArgs(null, 144, "WixErrors_InvalidExtension_3", extension, extensionType, expectedType); - } - - public static MessageEventArgs InvalidExtension(string extension, string extensionType, string expectedType1, string expectedType2) - { - return new WixErrorEventArgs(null, 144, "WixErrors_InvalidExtension_4", extension, extensionType, expectedType1, expectedType2); - } - - public static MessageEventArgs InvalidSubExpression(SourceLineNumber sourceLineNumbers, string subExpression, string expression) - { - return new WixErrorEventArgs(sourceLineNumbers, 145, "WixErrors_InvalidSubExpression_1", subExpression, expression); - } - - public static MessageEventArgs UnmatchedPreprocessorInstruction(SourceLineNumber sourceLineNumbers, string beginInstruction, string endInstruction) - { - return new WixErrorEventArgs(sourceLineNumbers, 146, "WixErrors_UnmatchedPreprocessorInstruction_1", beginInstruction, endInstruction); - } - - public static MessageEventArgs NonterminatedPreprocessorInstruction(SourceLineNumber sourceLineNumbers, string beginInstruction, string endInstruction) - { - return new WixErrorEventArgs(sourceLineNumbers, 147, "WixErrors_NonterminatedPreprocessorInstruction_1", beginInstruction, endInstruction); - } - - public static MessageEventArgs ExpectedExpressionAfterNot(SourceLineNumber sourceLineNumbers, string expression) - { - return new WixErrorEventArgs(sourceLineNumbers, 148, "WixErrors_ExpectedExpressionAfterNot_1", expression); - } - - public static MessageEventArgs InvalidPreprocessorVariable(SourceLineNumber sourceLineNumbers, string variable) - { - return new WixErrorEventArgs(sourceLineNumbers, 149, "WixErrors_InvalidPreprocessorVariable_1", variable); - } - - public static MessageEventArgs UndefinedPreprocessorVariable(SourceLineNumber sourceLineNumbers, string variableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 150, "WixErrors_UndefinedPreprocessorVariable_1", variableName); - } - - public static MessageEventArgs IllegalDefineStatement(SourceLineNumber sourceLineNumbers, string defineStatement) - { - return new WixErrorEventArgs(sourceLineNumbers, 151, "WixErrors_IllegalDefineStatement_1", defineStatement); - } - - public static MessageEventArgs VariableDeclarationCollision(SourceLineNumber sourceLineNumbers, string variableName, string variableValue, string variableCollidingValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 152, "WixErrors_VariableDeclarationCollision_1", variableName, variableValue, variableCollidingValue); - } - - public static MessageEventArgs CannotReundefineVariable(SourceLineNumber sourceLineNumbers, string variableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 153, "WixErrors_CannotReundefineVariable_1", variableName); - } - - public static MessageEventArgs IllegalForeach(SourceLineNumber sourceLineNumbers, string foreachStatement) - { - return new WixErrorEventArgs(sourceLineNumbers, 154, "WixErrors_IllegalForeach_1", foreachStatement); - } - - public static MessageEventArgs IllegalParentAttributeWhenNested(SourceLineNumber sourceLineNumbers, string parentElementName, string parentAttributeName, string childElement) - { - return new WixErrorEventArgs(sourceLineNumbers, 155, "WixErrors_IllegalParentAttributeWhenNested_1", parentElementName, parentAttributeName, childElement); - } - - public static MessageEventArgs ExpectedEndforeach(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 156, "WixErrors_ExpectedEndforeach_1"); - } - - public static MessageEventArgs UnmatchedQuotesInExpression(SourceLineNumber sourceLineNumbers, string expression) - { - return new WixErrorEventArgs(sourceLineNumbers, 158, "WixErrors_UnmatchedQuotesInExpression_1", expression); - } - - public static MessageEventArgs UnmatchedParenthesisInExpression(SourceLineNumber sourceLineNumbers, string expression) - { - return new WixErrorEventArgs(sourceLineNumbers, 159, "WixErrors_UnmatchedParenthesisInExpression_1", expression); - } - - public static MessageEventArgs ExpectedVariable(SourceLineNumber sourceLineNumbers, string expression) - { - return new WixErrorEventArgs(sourceLineNumbers, 160, "WixErrors_ExpectedVariable_1", expression); - } - - public static MessageEventArgs UnexpectedLiteral(SourceLineNumber sourceLineNumbers, string expression) - { - return new WixErrorEventArgs(sourceLineNumbers, 161, "WixErrors_UnexpectedLiteral_1", expression); - } - - public static MessageEventArgs IllegalIntegerInExpression(SourceLineNumber sourceLineNumbers, string expression) - { - return new WixErrorEventArgs(sourceLineNumbers, 162, "WixErrors_IllegalIntegerInExpression_1", expression); - } - - public static MessageEventArgs UnexpectedPreprocessorOperator(SourceLineNumber sourceLineNumbers, string @operator) - { - return new WixErrorEventArgs(sourceLineNumbers, 163, "WixErrors_UnexpectedPreprocessorOperator_1", @operator); - } - - public static MessageEventArgs UnexpectedEmptySubexpression(SourceLineNumber sourceLineNumbers, string expression) - { - return new WixErrorEventArgs(sourceLineNumbers, 164, "WixErrors_UnexpectedEmptySubexpression_1", expression); - } - - public static MessageEventArgs UnexpectedCustomTableColumn(SourceLineNumber sourceLineNumbers, string column) - { - return new WixErrorEventArgs(sourceLineNumbers, 165, "WixErrors_UnexpectedCustomTableColumn_1", column); - } - - public static MessageEventArgs UnknownCustomTableColumnType(SourceLineNumber sourceLineNumbers, string columnType) - { - return new WixErrorEventArgs(sourceLineNumbers, 166, "WixErrors_UnknownCustomTableColumnType_1", columnType); - } - - public static MessageEventArgs IllegalFileCompressionAttributes(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 167, "WixErrors_IllegalFileCompressionAttributes_1"); - } - - public static MessageEventArgs OverridableActionCollision(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName) - { - return new WixErrorEventArgs(sourceLineNumbers, 168, "WixErrors_OverridableActionCollision_1", sequenceTableName, actionName); - } - - public static MessageEventArgs OverridableActionCollision2(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 169, "WixErrors_OverridableActionCollision2_1"); - } - - public static MessageEventArgs ActionCollision(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName) - { - return new WixErrorEventArgs(sourceLineNumbers, 170, "WixErrors_ActionCollision_1", sequenceTableName, actionName); - } - - public static MessageEventArgs ActionCollision2(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 171, "WixErrors_ActionCollision2_1"); - } - - public static MessageEventArgs SuppressNonoverridableAction(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName) - { - return new WixErrorEventArgs(sourceLineNumbers, 172, "WixErrors_SuppressNonoverridableAction_1", sequenceTableName, actionName); - } - - public static MessageEventArgs SuppressNonoverridableAction2(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 173, "WixErrors_SuppressNonoverridableAction2_1"); - } - - public static MessageEventArgs CustomActionSequencedInModule(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName) - { - return new WixErrorEventArgs(sourceLineNumbers, 174, "WixErrors_CustomActionSequencedInModule_1", sequenceTableName, actionName); - } - - public static MessageEventArgs StandardActionRelativelyScheduledInModule(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName) - { - return new WixErrorEventArgs(sourceLineNumbers, 175, "WixErrors_StandardActionRelativelyScheduledInModule_1", sequenceTableName, actionName); - } - - public static MessageEventArgs ActionCircularDependency(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName1, string actionName2) - { - return new WixErrorEventArgs(sourceLineNumbers, 176, "WixErrors_ActionCircularDependency_1", sequenceTableName, actionName1, actionName2); - } - - public static MessageEventArgs ActionScheduledRelativeToTerminationAction(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName1, string actionName2) - { - return new WixErrorEventArgs(sourceLineNumbers, 177, "WixErrors_ActionScheduledRelativeToTerminationAction_1", sequenceTableName, actionName1, actionName2); - } - - public static MessageEventArgs ActionScheduledRelativeToTerminationAction2(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 178, "WixErrors_ActionScheduledRelativeToTerminationAction2_1"); - } - - public static MessageEventArgs NoUniqueActionSequenceNumber(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName1, string actionName2) - { - return new WixErrorEventArgs(sourceLineNumbers, 179, "WixErrors_NoUniqueActionSequenceNumber_1", sequenceTableName, actionName1, actionName2); - } - - public static MessageEventArgs NoUniqueActionSequenceNumber2(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 180, "WixErrors_NoUniqueActionSequenceNumber2_1"); - } - - public static MessageEventArgs ActionScheduledRelativeToItself(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 181, "WixErrors_ActionScheduledRelativeToItself_1", elementName, attributeName, attributeValue); - } - - public static MessageEventArgs MissingTableDefinition(string tableName) - { - return new WixErrorEventArgs(null, 182, "WixErrors_MissingTableDefinition_1", tableName); - } - - public static MessageEventArgs ExpectedRowInPatchCreationPackage(string tableName) - { - return new WixErrorEventArgs(null, 183, "WixErrors_ExpectedRowInPatchCreationPackage_1", tableName); - } - - public static MessageEventArgs UnexpectedTableInMergeModule(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 184, "WixErrors_UnexpectedTableInMergeModule_1", tableName); - } - - public static MessageEventArgs UnexpectedTableInPatchCreationPackage(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 185, "WixErrors_UnexpectedTableInPatchCreationPackage_1", tableName); - } - - public static MessageEventArgs MergeExcludedModule(SourceLineNumber sourceLineNumbers, string mergeId, string otherMergeId) - { - return new WixErrorEventArgs(sourceLineNumbers, 186, "WixErrors_MergeExcludedModule_1", mergeId, otherMergeId); - } - - public static MessageEventArgs MergeFeatureRequired(SourceLineNumber sourceLineNumbers, string tableName, string primaryKeys, string mergeModuleFile, string mergeId) - { - return new WixErrorEventArgs(sourceLineNumbers, 187, "WixErrors_MergeFeatureRequired_1", tableName, primaryKeys, mergeModuleFile, mergeId); - } - - public static MessageEventArgs MergeLanguageFailed(SourceLineNumber sourceLineNumbers, short language, string mergeModuleFile) - { - return new WixErrorEventArgs(sourceLineNumbers, 188, "WixErrors_MergeLanguageFailed_1", language, mergeModuleFile); - } - - public static MessageEventArgs MergeLanguageUnsupported(SourceLineNumber sourceLineNumbers, short language, string mergeModuleFile) - { - return new WixErrorEventArgs(sourceLineNumbers, 189, "WixErrors_MergeLanguageUnsupported_1", language, mergeModuleFile); - } - - public static MessageEventArgs TableDecompilationUnimplemented(string tableName) - { - return new WixErrorEventArgs(null, 190, "WixErrors_TableDecompilationUnimplemented_1", tableName); - } - - public static MessageEventArgs CannotDefaultMismatchedAdvertiseStates(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 191, "WixErrors_CannotDefaultMismatchedAdvertiseStates_1"); - } - - public static MessageEventArgs VersionIndependentProgIdsCannotHaveIcons(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 192, "WixErrors_VersionIndependentProgIdsCannotHaveIcons_1"); - } - - public static MessageEventArgs IllegalAttributeValueWithOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue, string otherAttributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 193, "WixErrors_IllegalAttributeValueWithOtherAttribute_1", elementName, attributeName, attributeValue, otherAttributeName); - } - - public static MessageEventArgs IllegalAttributeValueWithOtherAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue, string otherAttributeName, string otherAttributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 193, "WixErrors_IllegalAttributeValueWithOtherAttribute_2", elementName, attributeName, attributeValue, otherAttributeName, otherAttributeValue); - } - - public static MessageEventArgs InvalidMergeLanguage(SourceLineNumber sourceLineNumbers, string mergeId, string mergeLanguage) - { - return new WixErrorEventArgs(sourceLineNumbers, 194, "WixErrors_InvalidMergeLanguage_1", mergeId, mergeLanguage); - } - - public static MessageEventArgs WixVariableCollision(SourceLineNumber sourceLineNumbers, string variableId) - { - return new WixErrorEventArgs(sourceLineNumbers, 195, "WixErrors_WixVariableCollision_1", variableId); - } - - public static MessageEventArgs ExpectedWixVariableValue(string variableId) - { - return new WixErrorEventArgs(null, 196, "WixErrors_ExpectedWixVariableValue_1", variableId); - } - - public static MessageEventArgs WixVariableUnknown(SourceLineNumber sourceLineNumbers, string variableId) - { - return new WixErrorEventArgs(sourceLineNumbers, 197, "WixErrors_WixVariableUnknown_1", variableId); - } - - public static MessageEventArgs IllegalWixVariablePrefix(SourceLineNumber sourceLineNumbers, string variableId) - { - return new WixErrorEventArgs(sourceLineNumbers, 198, "WixErrors_IllegalWixVariablePrefix_1", variableId); - } - - public static MessageEventArgs InvalidWixXmlNamespace(SourceLineNumber sourceLineNumbers, string wixElementName, string wixNamespace) - { - return new WixErrorEventArgs(sourceLineNumbers, 199, "WixErrors_InvalidWixXmlNamespace_1", wixElementName, wixNamespace); - } - - public static MessageEventArgs InvalidWixXmlNamespace(SourceLineNumber sourceLineNumbers, string wixElementName, string elementNamespace, string wixNamespace) - { - return new WixErrorEventArgs(sourceLineNumbers, 199, "WixErrors_InvalidWixXmlNamespace_2", wixElementName, elementNamespace, wixNamespace); - } - - public static MessageEventArgs UnhandledExtensionElement(SourceLineNumber sourceLineNumbers, string elementName, string extensionElementName, string extensionNamespace) - { - return new WixErrorEventArgs(sourceLineNumbers, 200, "WixErrors_UnhandledExtensionElement_1", elementName, extensionElementName, extensionNamespace); - } - - public static MessageEventArgs UnhandledExtensionAttribute(SourceLineNumber sourceLineNumbers, string elementName, string extensionAttributeName, string extensionNamespace) - { - return new WixErrorEventArgs(sourceLineNumbers, 201, "WixErrors_UnhandledExtensionAttribute_1", elementName, extensionAttributeName, extensionNamespace); - } - - public static MessageEventArgs UnsupportedExtensionAttribute(SourceLineNumber sourceLineNumbers, string elementName, string extensionElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 202, "WixErrors_UnsupportedExtensionAttribute_1", elementName, extensionElementName); - } - - public static MessageEventArgs UnsupportedExtensionElement(SourceLineNumber sourceLineNumbers, string elementName, string extensionElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 203, "WixErrors_UnsupportedExtensionElement_1", elementName, extensionElementName); - } - - public static MessageEventArgs ValidationError(SourceLineNumber sourceLineNumbers, string ice, string message) - { - return new WixErrorEventArgs(sourceLineNumbers, 204, "WixErrors_ValidationError_1", ice, message); - } - - public static MessageEventArgs IllegalRootDirectory(SourceLineNumber sourceLineNumbers, string directoryId) - { - return new WixErrorEventArgs(sourceLineNumbers, 205, "WixErrors_IllegalRootDirectory_1", directoryId); - } - - public static MessageEventArgs IllegalTargetDirDefaultDir(SourceLineNumber sourceLineNumbers, string defaultDir) - { - return new WixErrorEventArgs(sourceLineNumbers, 206, "WixErrors_IllegalTargetDirDefaultDir_1", defaultDir); - } - - public static MessageEventArgs TooManyElements(SourceLineNumber sourceLineNumbers, string elementName, string childElementName, int expectedInstances) - { - return new WixErrorEventArgs(sourceLineNumbers, 207, "WixErrors_TooManyElements_1", elementName, childElementName, expectedInstances); - } - - public static MessageEventArgs ExpectedBinaryCategory(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 208, "WixErrors_ExpectedBinaryCategory_1"); - } - - public static MessageEventArgs RootFeatureCannotFollowParent(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 209, "WixErrors_RootFeatureCannotFollowParent_1"); - } - - public static MessageEventArgs FeatureNameTooLong(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 210, "WixErrors_FeatureNameTooLong_1", elementName, attributeName, attributeValue); - } - - public static MessageEventArgs SignedEmbeddedCabinet(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 211, "WixErrors_SignedEmbeddedCabinet_1"); - } - - public static MessageEventArgs ExpectedSignedCabinetName(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 212, "WixErrors_ExpectedSignedCabinetName_1"); - } - - public static MessageEventArgs IllegalInlineLocVariable(SourceLineNumber sourceLineNumbers, string variableName, string variableValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 213, "WixErrors_IllegalInlineLocVariable_1", variableName, variableValue); - } - - public static MessageEventArgs MergeModuleExpectedFeature(SourceLineNumber sourceLineNumbers, string mergeId) - { - return new WixErrorEventArgs(sourceLineNumbers, 215, "WixErrors_MergeModuleExpectedFeature_1", mergeId); - } - - public static MessageEventArgs Win32Exception(int nativeErrorCode, string message) - { - return new WixErrorEventArgs(null, 216, "WixErrors_Win32Exception_1", nativeErrorCode, message); - } - - public static MessageEventArgs Win32Exception(int nativeErrorCode, string file, string message) - { - return new WixErrorEventArgs(null, 216, "WixErrors_Win32Exception_2", nativeErrorCode, file, message); - } - - public static MessageEventArgs UnexpectedExternalUIMessage(string message) - { - return new WixErrorEventArgs(null, 217, "WixErrors_UnexpectedExternalUIMessage_1", message); - } - - public static MessageEventArgs UnexpectedExternalUIMessage(string message, string action) - { - return new WixErrorEventArgs(null, 217, "WixErrors_UnexpectedExternalUIMessage_2", message, action); - } - - public static MessageEventArgs IllegalCabbingThreadCount(string numThreads) - { - return new WixErrorEventArgs(null, 218, "WixErrors_IllegalCabbingThreadCount_1", numThreads); - } - - public static MessageEventArgs IllegalEnvironmentVariable(string environmentVariable, string value) - { - return new WixErrorEventArgs(null, 219, "WixErrors_IllegalEnvironmentVariable_1", environmentVariable, value); - } - - public static MessageEventArgs InvalidKeyColumn(string tableName, string columnName, string foreignTableName, int foreignColumnNumber) - { - return new WixErrorEventArgs(null, 220, "WixErrors_InvalidKeyColumn_1", tableName, columnName, foreignTableName, foreignColumnNumber); - } - - public static MessageEventArgs CollidingModularizationTypes(string tableName, string columnName, string foreignTableName, int foreignColumnNumber, string modularizationType, string foreignModularizationType) - { - return new WixErrorEventArgs(null, 221, "WixErrors_CollidingModularizationTypes_1", tableName, columnName, foreignTableName, foreignColumnNumber, modularizationType, foreignModularizationType); - } - - public static MessageEventArgs CubeFileNotFound(string cubeFile) - { - return new WixErrorEventArgs(null, 222, "WixErrors_CubeFileNotFound_1", cubeFile); - } - - public static MessageEventArgs OpenDatabaseFailed(string databaseFile) - { - return new WixErrorEventArgs(null, 223, "WixErrors_OpenDatabaseFailed_1", databaseFile); - } - - public static MessageEventArgs OutputTypeMismatch(SourceLineNumber sourceLineNumbers, string beforeOutputType, string afterOutputType) - { - return new WixErrorEventArgs(sourceLineNumbers, 224, "WixErrors_OutputTypeMismatch_1", beforeOutputType, afterOutputType); - } - - public static MessageEventArgs RealTableMissingPrimaryKeyColumn(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 225, "WixErrors_RealTableMissingPrimaryKeyColumn_1", tableName); - } - - public static MessageEventArgs IllegalColumnName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 226, "WixErrors_IllegalColumnName_1", elementName, attributeName, value); - } - - public static MessageEventArgs NoDifferencesInTransform(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 227, "WixErrors_NoDifferencesInTransform_1"); - } - - public static MessageEventArgs OutputCodepageMismatch(SourceLineNumber sourceLineNumbers, int beforeCodepage, int afterCodepage) - { - return new WixErrorEventArgs(sourceLineNumbers, 228, "WixErrors_OutputCodepageMismatch_1", beforeCodepage, afterCodepage); - } - - public static MessageEventArgs OutputCodepageMismatch2(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 229, "WixErrors_OutputCodepageMismatch2_1"); - } - - public static MessageEventArgs IllegalComponentWithAutoGeneratedGuid(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 230, "WixErrors_IllegalComponentWithAutoGeneratedGuid_1"); - } - - public static MessageEventArgs IllegalComponentWithAutoGeneratedGuid(SourceLineNumber sourceLineNumbers, bool registryKeyPath) - { - return new WixErrorEventArgs(sourceLineNumbers, 230, "WixErrors_IllegalComponentWithAutoGeneratedGuid_2", registryKeyPath); - } - - public static MessageEventArgs IllegalPathForGeneratedComponentGuid(SourceLineNumber sourceLineNumbers, string componentName, string keyFilePath) - { - return new WixErrorEventArgs(sourceLineNumbers, 231, "WixErrors_IllegalPathForGeneratedComponentGuid_1", componentName, keyFilePath); - } - - public static MessageEventArgs IllegalTerminalServerCustomActionAttributes(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 232, "WixErrors_IllegalTerminalServerCustomActionAttributes_1"); - } - - public static MessageEventArgs IllegalPropertyCustomActionAttributes(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 233, "WixErrors_IllegalPropertyCustomActionAttributes_1"); - } - - public static MessageEventArgs InvalidPreprocessorFunction(SourceLineNumber sourceLineNumbers, string variable) - { - return new WixErrorEventArgs(sourceLineNumbers, 234, "WixErrors_InvalidPreprocessorFunction_1", variable); - } - - public static MessageEventArgs UndefinedPreprocessorFunction(SourceLineNumber sourceLineNumbers, string variableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 235, "WixErrors_UndefinedPreprocessorFunction_1", variableName); - } - - public static MessageEventArgs PreprocessorExtensionEvaluateFunctionFailed(SourceLineNumber sourceLineNumbers, string prefix, string function, string args, string message) - { - return new WixErrorEventArgs(sourceLineNumbers, 236, "WixErrors_PreprocessorExtensionEvaluateFunctionFailed_1", prefix, function, args, message); - } - - public static MessageEventArgs PreprocessorExtensionGetVariableValueFailed(SourceLineNumber sourceLineNumbers, string prefix, string variable, string message) - { - return new WixErrorEventArgs(sourceLineNumbers, 237, "WixErrors_PreprocessorExtensionGetVariableValueFailed_1", prefix, variable, message); - } - - public static MessageEventArgs InvalidManifestContent(SourceLineNumber sourceLineNumbers, string fileName) - { - return new WixErrorEventArgs(sourceLineNumbers, 238, "WixErrors_InvalidManifestContent_1", fileName); - } - - public static MessageEventArgs InvalidWixTransform(string fileName) - { - return new WixErrorEventArgs(null, 239, "WixErrors_InvalidWixTransform_1", fileName); - } - - public static MessageEventArgs UnexpectedFileExtension(string fileName, string expectedExtensions) - { - return new WixErrorEventArgs(null, 240, "WixErrors_UnexpectedFileExtension_1", fileName, expectedExtensions); - } - - public static MessageEventArgs UnexpectedTableInPatch(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 241, "WixErrors_UnexpectedTableInPatch_1", tableName); - } - - public static MessageEventArgs InvalidProductVersion(SourceLineNumber sourceLineNumbers, string version) - { - return new WixErrorEventArgs(sourceLineNumbers, 242, "WixErrors_InvalidProductVersion_1", version); - } - - public static MessageEventArgs InvalidProductVersion(SourceLineNumber sourceLineNumbers, string version, string packagePath) - { - return new WixErrorEventArgs(sourceLineNumbers, 242, "WixErrors_InvalidProductVersion_2", version, packagePath); - } - - public static MessageEventArgs InvalidKeypathChange(SourceLineNumber sourceLineNumbers, string component, string transformPath) - { - return new WixErrorEventArgs(sourceLineNumbers, 243, "WixErrors_InvalidKeypathChange_1", component, transformPath); - } - - public static MessageEventArgs MissingValidatorExtension() - { - return new WixErrorEventArgs(null, 244, "WixErrors_MissingValidatorExtension_1"); - } - - public static MessageEventArgs InvalidValidatorMessageType(string type) - { - return new WixErrorEventArgs(null, 245, "WixErrors_InvalidValidatorMessageType_1", type); - } - - public static MessageEventArgs PatchWithoutTransforms() - { - return new WixErrorEventArgs(null, 246, "WixErrors_PatchWithoutTransforms_1"); - } - - public static MessageEventArgs SingleExtensionSupported() - { - return new WixErrorEventArgs(null, 247, "WixErrors_SingleExtensionSupported_1"); - } - - public static MessageEventArgs DuplicateTransform(string transform) - { - return new WixErrorEventArgs(null, 248, "WixErrors_DuplicateTransform_1", transform); - } - - public static MessageEventArgs BaselineRequired() - { - return new WixErrorEventArgs(null, 249, "WixErrors_BaselineRequired_1"); - } - - public static MessageEventArgs PreprocessorError(SourceLineNumber sourceLineNumbers, string message) - { - return new WixErrorEventArgs(sourceLineNumbers, 250, "WixErrors_PreprocessorError_1", message); - } - - public static MessageEventArgs ExpectedArgument(string argument) - { - return new WixErrorEventArgs(null, 251, "WixErrors_ExpectedArgument_1", argument); - } - - public static MessageEventArgs PatchWithoutValidTransforms() - { - return new WixErrorEventArgs(null, 252, "WixErrors_PatchWithoutValidTransforms_1"); - } - - public static MessageEventArgs ExpectedDecompiler(string identifier) - { - return new WixErrorEventArgs(null, 253, "WixErrors_ExpectedDecompiler_1", identifier); - } - - public static MessageEventArgs ExpectedTableInMergeModule(string identifier) - { - return new WixErrorEventArgs(null, 254, "WixErrors_ExpectedTableInMergeModule_1", identifier); - } - - public static MessageEventArgs UnexpectedElementWithAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string childElementName, string attribute, string attributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 255, "WixErrors_UnexpectedElementWithAttributeValue_1", elementName, childElementName, attribute, attributeValue); - } - - public static MessageEventArgs UnexpectedElementWithAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string childElementName, string attribute, string attributeValue1, string attributeValue2) - { - return new WixErrorEventArgs(sourceLineNumbers, 255, "WixErrors_UnexpectedElementWithAttributeValue_2", elementName, childElementName, attribute, attributeValue1, attributeValue2); - } - - public static MessageEventArgs ExpectedPatchIdInWixMsp() - { - return new WixErrorEventArgs(null, 256, "WixErrors_ExpectedPatchIdInWixMsp_1"); - } - - public static MessageEventArgs ExpectedMediaRowsInWixMsp() - { - return new WixErrorEventArgs(null, 257, "WixErrors_ExpectedMediaRowsInWixMsp_1"); - } - - public static MessageEventArgs WixFileNotFound(string file) - { - return new WixErrorEventArgs(null, 258, "WixErrors_WixFileNotFound_1", file); - } - - public static MessageEventArgs ExpectedClientPatchIdInWixMsp() - { - return new WixErrorEventArgs(null, 259, "WixErrors_ExpectedClientPatchIdInWixMsp_1"); - } - - public static MessageEventArgs NewRowAddedInTable(SourceLineNumber sourceLineNumbers, string productCode, string tableName, string rowId) - { - return new WixErrorEventArgs(sourceLineNumbers, 260, "WixErrors_NewRowAddedInTable_1", productCode, tableName, rowId); - } - - public static MessageEventArgs PatchNotRemovable() - { - return new WixErrorEventArgs(null, 261, "WixErrors_PatchNotRemovable_1"); - } - - public static MessageEventArgs FileTooLarge(SourceLineNumber sourceLineNumbers, string fileName) - { - return new WixErrorEventArgs(sourceLineNumbers, 263, "WixErrors_FileTooLarge_1", fileName); - } - - public static MessageEventArgs InvalidPlatformParameter(string name, string value) - { - return new WixErrorEventArgs(null, 264, "WixErrors_InvalidPlatformParameter_1", name, value); - } - - public static MessageEventArgs InvalidPlatformValue(SourceLineNumber sourceLineNumbers, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 265, "WixErrors_InvalidPlatformValue_1", value); - } - - public static MessageEventArgs IllegalValidationArguments() - { - return new WixErrorEventArgs(null, 266, "WixErrors_IllegalValidationArguments_1"); - } - - public static MessageEventArgs OrphanedComponent(SourceLineNumber sourceLineNumbers, string componentName) - { - return new WixErrorEventArgs(sourceLineNumbers, 267, "WixErrors_OrphanedComponent_1", componentName); - } - - public static MessageEventArgs IllegalCommandlineArgumentCombination(string arg1, string arg2) - { - return new WixErrorEventArgs(null, 268, "WixErrors_IllegalCommandlineArgumentCombination_1", arg1, arg2); - } - - public static MessageEventArgs ProductCodeInvalidForTransform(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 269, "WixErrors_ProductCodeInvalidForTransform_1"); - } - - public static MessageEventArgs InsertInvalidSequenceActionOrder(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionNameBefore, string actionNameAfter, string actionNameNew) - { - return new WixErrorEventArgs(sourceLineNumbers, 270, "WixErrors_InsertInvalidSequenceActionOrder_1", sequenceTableName, actionNameBefore, actionNameAfter, actionNameNew); - } - - public static MessageEventArgs InsertSequenceNoSpace(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionNameBefore, string actionNameAfter, string actionNameNew) - { - return new WixErrorEventArgs(sourceLineNumbers, 271, "WixErrors_InsertSequenceNoSpace_1", sequenceTableName, actionNameBefore, actionNameAfter, actionNameNew); - } - - public static MessageEventArgs MissingManifestForWin32Assembly(SourceLineNumber sourceLineNumbers, string file, string manifest) - { - return new WixErrorEventArgs(sourceLineNumbers, 272, "WixErrors_MissingManifestForWin32Assembly_1", file, manifest); - } - - public static MessageEventArgs UnableToOpenModule(SourceLineNumber sourceLineNumbers, string modulePath, string message) - { - return new WixErrorEventArgs(sourceLineNumbers, 273, "WixErrors_UnableToOpenModule_1", modulePath, message); - } - - public static MessageEventArgs ExpectedAttributeWhenElementNotUnderElement(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string parentElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 274, "WixErrors_ExpectedAttributeWhenElementNotUnderElement_1", elementName, attributeName, parentElementName); - } - - public static MessageEventArgs IllegalIdentifierLooksLikeFormatted(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 275, "WixErrors_IllegalIdentifierLooksLikeFormatted_1", elementName, attributeName, value); - } - - public static MessageEventArgs IllegalCodepageAttribute(SourceLineNumber sourceLineNumbers, string codepage, string elementName, string attributeName) - { - return new WixErrorEventArgs(sourceLineNumbers, 276, "WixErrors_IllegalCodepageAttribute_1", codepage, elementName, attributeName); - } - - public static MessageEventArgs IllegalCompressionLevel(string compressionLevel) - { - return new WixErrorEventArgs(null, 277, "WixErrors_IllegalCompressionLevel_1", compressionLevel); - } - - public static MessageEventArgs TransformSchemaMismatch() - { - return new WixErrorEventArgs(null, 278, "WixErrors_TransformSchemaMismatch_1"); - } - - public static MessageEventArgs DatabaseSchemaMismatch(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixErrorEventArgs(sourceLineNumbers, 279, "WixErrors_DatabaseSchemaMismatch_1", tableName); - } - - public static MessageEventArgs ExpectedDirectoryGotFile(string option, string path) - { - return new WixErrorEventArgs(null, 280, "WixErrors_ExpectedDirectoryGotFile_1", option, path); - } - - public static MessageEventArgs ExpectedFileGotDirectory(string option, string path) - { - return new WixErrorEventArgs(null, 281, "WixErrors_ExpectedFileGotDirectory_1", option, path); - } - - public static MessageEventArgs GacAssemblyNoStrongName(SourceLineNumber sourceLineNumbers, string assemblyName, string componentName) - { - return new WixErrorEventArgs(sourceLineNumbers, 282, "WixErrors_GacAssemblyNoStrongName_1", assemblyName, componentName); - } - - public static MessageEventArgs FileWriteError(string path, string error) - { - return new WixErrorEventArgs(null, 283, "WixErrors_FileWriteError_1", path, error); - } - - public static MessageEventArgs InvalidCommandLineFileName(string fileName, string error) - { - return new WixErrorEventArgs(null, 284, "WixErrors_InvalidCommandLineFileName_1", fileName, error); - } - - public static MessageEventArgs ExpectedParentWithAttribute(SourceLineNumber sourceLineNumbers, string parentElement, string attribute, string grandparentElement) - { - return new WixErrorEventArgs(sourceLineNumbers, 285, "WixErrors_ExpectedParentWithAttribute_1", parentElement, attribute, grandparentElement); - } - - public static MessageEventArgs IllegalWarningIdAsError(string warningId) - { - return new WixErrorEventArgs(null, 286, "WixErrors_IllegalWarningIdAsError_1", warningId); - } - - public static MessageEventArgs ExpectedAttributeOrElement(SourceLineNumber sourceLineNumbers, string parentElement, string attribute, string childElement) - { - return new WixErrorEventArgs(sourceLineNumbers, 287, "WixErrors_ExpectedAttributeOrElement_1", parentElement, attribute, childElement); - } - - public static MessageEventArgs DuplicateVariableDefinition(string variableName, string variableValue, string variableCollidingValue) - { - return new WixErrorEventArgs(null, 288, "WixErrors_DuplicateVariableDefinition_1", variableName, variableValue, variableCollidingValue); - } - - public static MessageEventArgs InvalidVariableDefinition(string variableDefinition) - { - return new WixErrorEventArgs(null, 289, "WixErrors_InvalidVariableDefinition_1", variableDefinition); - } - - public static MessageEventArgs DuplicateCabinetName(SourceLineNumber sourceLineNumbers, string cabinetName) - { - return new WixErrorEventArgs(sourceLineNumbers, 290, "WixErrors_DuplicateCabinetName_1", cabinetName); - } - - public static MessageEventArgs DuplicateCabinetName2(SourceLineNumber sourceLineNumbers, string cabinetName) - { - return new WixErrorEventArgs(sourceLineNumbers, 291, "WixErrors_DuplicateCabinetName2_1", cabinetName); - } - - public static MessageEventArgs InvalidAddedFileRowWithoutSequence(SourceLineNumber sourceLineNumbers, string fileRowId) - { - return new WixErrorEventArgs(sourceLineNumbers, 292, "WixErrors_InvalidAddedFileRowWithoutSequence_1", fileRowId); - } - - public static MessageEventArgs DuplicateFileId(string fileId) - { - return new WixErrorEventArgs(null, 293, "WixErrors_DuplicateFileId_1", fileId); - } - - public static MessageEventArgs FullTempDirectory(string prefix, string directory) - { - return new WixErrorEventArgs(null, 294, "WixErrors_FullTempDirectory_1", prefix, directory); - } - - public static MessageEventArgs CreateCabAddFileFailed() - { - return new WixErrorEventArgs(null, 296, "WixErrors_CreateCabAddFileFailed_1"); - } - - public static MessageEventArgs CreateCabInsufficientDiskSpace() - { - return new WixErrorEventArgs(null, 297, "WixErrors_CreateCabInsufficientDiskSpace_1"); - } - - public static MessageEventArgs UnresolvedBindReference(SourceLineNumber sourceLineNumbers, string BindRef) - { - return new WixErrorEventArgs(sourceLineNumbers, 298, "WixErrors_UnresolvedBindReference_1", BindRef); - } - - public static MessageEventArgs GACAssemblyIdentityWarning(SourceLineNumber sourceLineNumbers, string fileName, string assemblyName) - { - return new WixErrorEventArgs(sourceLineNumbers, 299, "WixErrors_GACAssemblyIdentityWarning_1", fileName, assemblyName); - } - - public static MessageEventArgs IllegalCharactersInPath(string pathName) - { - return new WixErrorEventArgs(null, 300, "WixErrors_IllegalCharactersInPath_1", pathName); - } - - public static MessageEventArgs ValidationFailedToOpenDatabase() - { - return new WixErrorEventArgs(null, 301, "WixErrors_ValidationFailedToOpenDatabase_1"); - } - - public static MessageEventArgs MustSpecifyOutputWithMoreThanOneInput() - { - return new WixErrorEventArgs(null, 302, "WixErrors_MustSpecifyOutputWithMoreThanOneInput_1"); - } - - public static MessageEventArgs IllegalSearchIdForParentDepth(SourceLineNumber sourceLineNumbers, string id, string parentId) - { - return new WixErrorEventArgs(sourceLineNumbers, 303, "WixErrors_IllegalSearchIdForParentDepth_1", id, parentId); - } - - public static MessageEventArgs IdentifierTooLongError(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, int maxLength) - { - return new WixErrorEventArgs(sourceLineNumbers, 304, "WixErrors_IdentifierTooLongError_1", elementName, attributeName, value, maxLength); - } - - public static MessageEventArgs InvalidRemoveComponent(SourceLineNumber sourceLineNumbers, string component, string feature, string transformPath) - { - return new WixErrorEventArgs(sourceLineNumbers, 305, "WixErrors_InvalidRemoveComponent_1", component, feature, transformPath); - } - - public static MessageEventArgs FinishCabFailed() - { - return new WixErrorEventArgs(null, 306, "WixErrors_FinishCabFailed_1"); - } - - public static MessageEventArgs InvalidExtensionType(string extension, string attributeType) - { - return new WixErrorEventArgs(null, 307, "WixErrors_InvalidExtensionType_1", extension, attributeType); - } - - public static MessageEventArgs InvalidExtensionType(string extension, string className, string expectedType) - { - return new WixErrorEventArgs(null, 307, "WixErrors_InvalidExtensionType_2", extension, className, expectedType); - } - - public static MessageEventArgs InvalidExtensionType(string extension, string className, string exceptionType, string exceptionMessage) - { - return new WixErrorEventArgs(null, 307, "WixErrors_InvalidExtensionType_3", extension, className, exceptionType, exceptionMessage); - } - - public static MessageEventArgs ValidationFailedDueToMultilanguageMergeModule() - { - return new WixErrorEventArgs(null, 309, "WixErrors_ValidationFailedDueToMultilanguageMergeModule_1"); - } - - public static MessageEventArgs ValidationFailedDueToInvalidPackage() - { - return new WixErrorEventArgs(null, 310, "WixErrors_ValidationFailedDueToInvalidPackage_1"); - } - - public static MessageEventArgs InvalidStringForCodepage(SourceLineNumber sourceLineNumbers, string codepage) - { - return new WixErrorEventArgs(sourceLineNumbers, 311, "WixErrors_InvalidStringForCodepage_1", codepage); - } - - public static MessageEventArgs InvalidEmbeddedUIFileName(SourceLineNumber sourceLineNumbers, string codepage) - { - return new WixErrorEventArgs(sourceLineNumbers, 312, "WixErrors_InvalidEmbeddedUIFileName_1", codepage); - } - - public static MessageEventArgs UniqueFileSearchIdRequired(SourceLineNumber sourceLineNumbers, string id, string elementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 313, "WixErrors_UniqueFileSearchIdRequired_1", id, elementName); - } - - public static MessageEventArgs IllegalAttributeValueWhenNested(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attrivuteValue, string parentElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 314, "WixErrors_IllegalAttributeValueWhenNested_1", elementName, attributeName, attrivuteValue, parentElementName); - } - - public static MessageEventArgs AdminImageRequired(string productCode) - { - return new WixErrorEventArgs(null, 315, "WixErrors_AdminImageRequired_1", productCode); - } - - public static MessageEventArgs SamePatchBaselineId(SourceLineNumber sourceLineNumbers, string id) - { - return new WixErrorEventArgs(sourceLineNumbers, 316, "WixErrors_SamePatchBaselineId_1", id); - } - - public static MessageEventArgs SameFileIdDifferentSource(SourceLineNumber sourceLineNumbers, string fileId, string sourcePath1, string sourcePath2) - { - return new WixErrorEventArgs(sourceLineNumbers, 317, "WixErrors_SameFileIdDifferentSource_1", fileId, sourcePath1, sourcePath2); - } - - public static MessageEventArgs HarvestSourceNotSpecified() - { - return new WixErrorEventArgs(null, 318, "WixErrors_HarvestSourceNotSpecified_1"); - } - - public static MessageEventArgs OutputTargetNotSpecified() - { - return new WixErrorEventArgs(null, 319, "WixErrors_OutputTargetNotSpecified_1"); - } - - public static MessageEventArgs DuplicateCommandLineOptionInExtension(string @switch) - { - return new WixErrorEventArgs(null, 320, "WixErrors_DuplicateCommandLineOptionInExtension_1", @switch); - } - - public static MessageEventArgs HarvestTypeNotFound() - { - return new WixErrorEventArgs(null, 321, "WixErrors_HarvestTypeNotFound_1"); - } - - public static MessageEventArgs HarvestTypeNotFound(string harvestType) - { - return new WixErrorEventArgs(null, 321, "WixErrors_HarvestTypeNotFound_2", harvestType); - } - - public static MessageEventArgs BothUpgradeCodesRequired() - { - return new WixErrorEventArgs(null, 322, "WixErrors_BothUpgradeCodesRequired_1"); - } - - public static MessageEventArgs IllegalBinderClassName() - { - return new WixErrorEventArgs(null, 323, "WixErrors_IllegalBinderClassName_1"); - } - - public static MessageEventArgs SpecifiedBinderNotFound(string binderClass) - { - return new WixErrorEventArgs(null, 324, "WixErrors_SpecifiedBinderNotFound_1", binderClass); - } - - public static MessageEventArgs CannotLoadBinderFileManager(string binderFileManager, string currentBinderFileManager) - { - return new WixErrorEventArgs(null, 325, "WixErrors_CannotLoadBinderFileManager_1", binderFileManager, currentBinderFileManager); - } - - public static MessageEventArgs CannotLoadLinkerExtension(string linkerExtension, string currentLinkerExtension) - { - return new WixErrorEventArgs(null, 326, "WixErrors_CannotLoadLinkerExtension_1", linkerExtension, currentLinkerExtension); - } - - public static MessageEventArgs UnableToGetAuthenticodeCertOfFile(string filePath, string moreInformation) - { - return new WixErrorEventArgs(null, 327, "WixErrors_UnableToGetAuthenticodeCertOfFile_1", filePath, moreInformation); - } - - public static MessageEventArgs UnableToGetAuthenticodeCertOfFileDownlevelOS(string filePath, string moreInformation) - { - return new WixErrorEventArgs(null, 328, "WixErrors_UnableToGetAuthenticodeCertOfFileDownlevelOS_1", filePath, moreInformation); - } - - public static MessageEventArgs ReadOnlyOutputFile(string filePath) - { - return new WixErrorEventArgs(null, 329, "WixErrors_ReadOnlyOutputFile_1", filePath); - } - - public static MessageEventArgs CannotDefaultComponentId(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 330, "WixErrors_CannotDefaultComponentId_1"); - } - - public static MessageEventArgs ParentElementAttributeRequired(SourceLineNumber sourceLineNumbers, string parentElement, string parentAttribute, string childElement) - { - return new WixErrorEventArgs(sourceLineNumbers, 331, "WixErrors_ParentElementAttributeRequired_1", parentElement, parentAttribute, childElement); - } - - public static MessageEventArgs PreprocessorExtensionPragmaFailed(SourceLineNumber sourceLineNumbers, string pragma, string message) - { - return new WixErrorEventArgs(sourceLineNumbers, 333, "WixErrors_PreprocessorExtensionPragmaFailed_1", pragma, message); - } - - public static MessageEventArgs InvalidPreprocessorPragma(SourceLineNumber sourceLineNumbers, string variable) - { - return new WixErrorEventArgs(sourceLineNumbers, 334, "WixErrors_InvalidPreprocessorPragma_1", variable); - } - - public static MessageEventArgs SmokeUnknownFileExtension() - { - return new WixErrorEventArgs(null, 335, "WixErrors_SmokeUnknownFileExtension_1"); - } - - public static MessageEventArgs SmokeUnsupportedFileExtension() - { - return new WixErrorEventArgs(null, 336, "WixErrors_SmokeUnsupportedFileExtension_1"); - } - - public static MessageEventArgs SmokeMalformedPath() - { - return new WixErrorEventArgs(null, 337, "WixErrors_SmokeMalformedPath_1"); - } - - public static MessageEventArgs InvalidStubExe(string filename) - { - return new WixErrorEventArgs(null, 338, "WixErrors_InvalidStubExe_1", filename); - } - - public static MessageEventArgs StubMissingWixburnSection(string filename) - { - return new WixErrorEventArgs(null, 339, "WixErrors_StubMissingWixburnSection_1", filename); - } - - public static MessageEventArgs StubWixburnSectionTooSmall(string filename) - { - return new WixErrorEventArgs(null, 340, "WixErrors_StubWixburnSectionTooSmall_1", filename); - } - - public static MessageEventArgs MissingBundleInformation(string data) - { - return new WixErrorEventArgs(null, 341, "WixErrors_MissingBundleInformation_1", data); - } - - public static MessageEventArgs UnexpectedGroupChild(string parentType, string parentId, string childType, string childId) - { - return new WixErrorEventArgs(null, 342, "WixErrors_UnexpectedGroupChild_1", parentType, parentId, childType, childId); - } - - public static MessageEventArgs OrderingReferenceLoopDetected(SourceLineNumber sourceLineNumbers, string loopList) - { - return new WixErrorEventArgs(sourceLineNumbers, 343, "WixErrors_OrderingReferenceLoopDetected_1", loopList); - } - - public static MessageEventArgs IdentifierNotFound(string type, string identifier) - { - return new WixErrorEventArgs(null, 344, "WixErrors_IdentifierNotFound_1", type, identifier); - } - - public static MessageEventArgs MergePlatformMismatch(SourceLineNumber sourceLineNumbers, string mergeModuleFile) - { - return new WixErrorEventArgs(sourceLineNumbers, 345, "WixErrors_MergePlatformMismatch_1", mergeModuleFile); - } - - public static MessageEventArgs IllegalRelativeLongFilename(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 346, "WixErrors_IllegalRelativeLongFilename_1", elementName, attributeName, value); - } - - public static MessageEventArgs IllegalAttributeValueWithLegalList(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string legalValueList) - { - return new WixErrorEventArgs(sourceLineNumbers, 347, "WixErrors_IllegalAttributeValueWithLegalList_1", elementName, attributeName, value, legalValueList); - } - - public static MessageEventArgs IllegalAttributeValueWithIllegalList(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string illegalValueList) - { - return new WixErrorEventArgs(sourceLineNumbers, 348, "WixErrors_IllegalAttributeValueWithIllegalList_1", elementName, attributeName, value, illegalValueList); - } - - public static MessageEventArgs InvalidSummaryInfoCodePage(SourceLineNumber sourceLineNumbers, int codePage) - { - return new WixErrorEventArgs(sourceLineNumbers, 349, "WixErrors_InvalidSummaryInfoCodePage_1", codePage); - } - - public static MessageEventArgs ValidationFailedDueToLowMsiEngine() - { - return new WixErrorEventArgs(null, 350, "WixErrors_ValidationFailedDueToLowMsiEngine_1"); - } - - public static MessageEventArgs DuplicateSourcesForOutput(string sourceList, string outputFile) - { - return new WixErrorEventArgs(null, 351, "WixErrors_DuplicateSourcesForOutput_1", sourceList, outputFile); - } - - public static MessageEventArgs UnableToReadPackageInformation(SourceLineNumber sourceLineNumbers, string packagePath, string detailedErrorMessage) - { - return new WixErrorEventArgs(sourceLineNumbers, 352, "WixErrors_UnableToReadPackageInformation_1", packagePath, detailedErrorMessage); - } - - public static MessageEventArgs MultipleFilesMatchedWithOutputSpecification(string sourceSpecification, string sourceList) - { - return new WixErrorEventArgs(null, 353, "WixErrors_MultipleFilesMatchedWithOutputSpecification_1", sourceSpecification, sourceList); - } - - public static MessageEventArgs InvalidBundle(string bundleExecutable) - { - return new WixErrorEventArgs(null, 354, "WixErrors_InvalidBundle_1", bundleExecutable); - } - - public static MessageEventArgs BundleTooNew(string bundleExecutable, long bundleVersion) - { - return new WixErrorEventArgs(null, 355, "WixErrors_BundleTooNew_1", bundleExecutable, bundleVersion); - } - - public static MessageEventArgs WrongFileExtensionForNumberOfInputs(string inputExtension, string input) - { - return new WixErrorEventArgs(null, 356, "WixErrors_WrongFileExtensionForNumberOfInputs_1", inputExtension, input); - } - - public static MessageEventArgs MediaTableCollision(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 357, "WixErrors_MediaTableCollision_1"); - } - - public static MessageEventArgs InvalidCabinetTemplate(SourceLineNumber sourceLineNumbers, string cabinetTemplate) - { - return new WixErrorEventArgs(sourceLineNumbers, 358, "WixErrors_InvalidCabinetTemplate_1", cabinetTemplate); - } - - public static MessageEventArgs MaximumUncompressedMediaSizeTooLarge(SourceLineNumber sourceLineNumbers, int maximumUncompressedMediaSize) - { - return new WixErrorEventArgs(sourceLineNumbers, 359, "WixErrors_MaximumUncompressedMediaSizeTooLarge_1", maximumUncompressedMediaSize); - } - - public static MessageEventArgs CatalogVerificationFailed(string fileName) - { - return new WixErrorEventArgs(null, 360, "WixErrors_CatalogVerificationFailed_1", fileName); - } - - public static MessageEventArgs CatalogFileHashFailed(string fileName, int errorCode) - { - return new WixErrorEventArgs(null, 361, "WixErrors_CatalogFileHashFailed_1", fileName, errorCode); - } - - public static MessageEventArgs ReservedNamespaceViolation(SourceLineNumber sourceLineNumbers, string element, string attribute, string prefix) - { - return new WixErrorEventArgs(sourceLineNumbers, 362, "WixErrors_ReservedNamespaceViolation_1", element, attribute, prefix); - } - - public static MessageEventArgs PerUserButAllUsersEquals1(SourceLineNumber sourceLineNumbers, string path) - { - return new WixErrorEventArgs(sourceLineNumbers, 363, "WixErrors_PerUserButAllUsersEquals1_1", path); - } - - public static MessageEventArgs UnsupportedAllUsersValue(SourceLineNumber sourceLineNumbers, string path, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 364, "WixErrors_UnsupportedAllUsersValue_1", path, value); - } - - public static MessageEventArgs DisallowedMsiProperty(SourceLineNumber sourceLineNumbers, string property, string illegalValueList) - { - return new WixErrorEventArgs(sourceLineNumbers, 365, "WixErrors_DisallowedMsiProperty_1", property, illegalValueList); - } - - public static MessageEventArgs MissingOrInvalidModuleInstallerVersion(SourceLineNumber sourceLineNumbers, string moduleId, string mergeModuleFile, string productInstallerVersion) - { - return new WixErrorEventArgs(sourceLineNumbers, 366, "WixErrors_MissingOrInvalidModuleInstallerVersion_1", moduleId, mergeModuleFile, productInstallerVersion); - } - - public static MessageEventArgs IllegalGeneratedGuidComponentUnversionedKeypath(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 367, "WixErrors_IllegalGeneratedGuidComponentUnversionedKeypath_1"); - } - - public static MessageEventArgs IllegalGeneratedGuidComponentVersionedNonkeypath(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 368, "WixErrors_IllegalGeneratedGuidComponentVersionedNonkeypath_1"); - } - - public static MessageEventArgs DuplicateComponentGuids(SourceLineNumber sourceLineNumbers, string componentId, string guid) - { - return new WixErrorEventArgs(sourceLineNumbers, 369, "WixErrors_DuplicateComponentGuids_1", componentId, guid); - } - - public static MessageEventArgs DuplicateProviderDependencyKey(string providerKey, string packageId) - { - return new WixErrorEventArgs(null, 370, "WixErrors_DuplicateProviderDependencyKey_1", providerKey, packageId); - } - - public static MessageEventArgs MissingDependencyVersion(string packageId) - { - return new WixErrorEventArgs(null, 371, "WixErrors_MissingDependencyVersion_1", packageId); - } - - public static MessageEventArgs UnexpectedElementWithAttribute(SourceLineNumber sourceLineNumbers, string elementName, string childElementName, string attribute) - { - return new WixErrorEventArgs(sourceLineNumbers, 372, "WixErrors_UnexpectedElementWithAttribute_1", elementName, childElementName, attribute); - } - - public static MessageEventArgs ExpectedAttributeWithElement(SourceLineNumber sourceLineNumbers, string elementName, string attribute, string childElementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 373, "WixErrors_ExpectedAttributeWithElement_1", elementName, attribute, childElementName); - } - - public static MessageEventArgs DuplicatedUiLocalization(SourceLineNumber sourceLineNumbers, string controlName, string dialogName) - { - return new WixErrorEventArgs(sourceLineNumbers, 374, "WixErrors_DuplicatedUiLocalization_1", controlName, dialogName); - } - - public static MessageEventArgs DuplicatedUiLocalization(SourceLineNumber sourceLineNumbers, string dialogName) - { - return new WixErrorEventArgs(sourceLineNumbers, 374, "WixErrors_DuplicatedUiLocalization_2", dialogName); - } - - public static MessageEventArgs MaximumCabinetSizeForLargeFileSplittingTooLarge(SourceLineNumber sourceLineNumbers, int maximumCabinetSizeForLargeFileSplitting, int maxValueOfMaxCabSizeForLargeFileSplitting) - { - return new WixErrorEventArgs(sourceLineNumbers, 375, "WixErrors_MaximumCabinetSizeForLargeFileSplittingTooLarge_1", maximumCabinetSizeForLargeFileSplitting, maxValueOfMaxCabSizeForLargeFileSplitting); - } - - public static MessageEventArgs SplitCabinetCopyRegistrationFailed(string newCabName, string firstCabName) - { - return new WixErrorEventArgs(null, 376, "WixErrors_SplitCabinetCopyRegistrationFailed_1", newCabName, firstCabName); - } - - public static MessageEventArgs SplitCabinetNameCollision(string newCabName, string firstCabName) - { - return new WixErrorEventArgs(null, 377, "WixErrors_SplitCabinetNameCollision_1", newCabName, firstCabName); - } - - public static MessageEventArgs SplitCabinetInsertionFailed(string newCabName, string firstCabName, string lastCabinetOfThisSequence) - { - return new WixErrorEventArgs(null, 378, "WixErrors_SplitCabinetInsertionFailed_1", newCabName, firstCabName, lastCabinetOfThisSequence); - } - - public static MessageEventArgs InvalidPreprocessorFunctionAutoVersion(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 379, "WixErrors_InvalidPreprocessorFunctionAutoVersion_1"); - } - - public static MessageEventArgs InvalidModuleOrBundleVersion(SourceLineNumber sourceLineNumbers, string moduleOrBundle, string version) - { - return new WixErrorEventArgs(sourceLineNumbers, 380, "WixErrors_InvalidModuleOrBundleVersion_1", moduleOrBundle, version); - } - - public static MessageEventArgs UnsupportedPlatformForElement(SourceLineNumber sourceLineNumbers, string platform, string elementName) - { - return new WixErrorEventArgs(sourceLineNumbers, 381, "WixErrors_UnsupportedPlatformForElement_1", platform, elementName); - } - - public static MessageEventArgs MissingMedia(SourceLineNumber sourceLineNumbers, int diskId) - { - return new WixErrorEventArgs(sourceLineNumbers, 382, "WixErrors_MissingMedia_1", diskId); - } - - public static MessageEventArgs RemotePayloadUnsupported(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 383, "WixErrors_RemotePayloadUnsupported_1"); - } - - public static MessageEventArgs IllegalYesNoAlwaysValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixErrorEventArgs(sourceLineNumbers, 384, "WixErrors_IllegalYesNoAlwaysValue_1", elementName, attributeName, value); - } - - public static MessageEventArgs TooDeeplyIncluded(SourceLineNumber sourceLineNumbers, int depth) - { - return new WixErrorEventArgs(sourceLineNumbers, 385, "WixErrors_TooDeeplyIncluded_1", depth); - } - - public static MessageEventArgs InlineDirectorySyntaxRequiresPath(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value, string identifier) - { - return new WixErrorEventArgs(sourceLineNumbers, 387, "WixErrors_InlineDirectorySyntaxRequiresPath_1", elementName, attributeName, value, identifier); - } - - public static MessageEventArgs InsecureBundleFilename(string filename) - { - return new WixErrorEventArgs(null, 388, "WixErrors_InsecureBundleFilename_1", filename); - } - - public static MessageEventArgs PayloadMustBeRelativeToCache(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue) - { - return new WixErrorEventArgs(sourceLineNumbers, 389, "WixErrors_PayloadMustBeRelativeToCache_1", elementName, attributeName, attributeValue); - } - - public static MessageEventArgs MsiTransactionX86BeforeX64(SourceLineNumber sourceLineNumbers) - { - return new WixErrorEventArgs(sourceLineNumbers, 390, "WixErrors_MsiTransactionX86BeforeX64_1"); - } - } - - public class WixWarningEventArgs : MessageEventArgs - { - - private static ResourceManager resourceManager = new ResourceManager("WixToolset.Core.Data.Messages", Assembly.GetExecutingAssembly()); - - public WixWarningEventArgs(SourceLineNumber sourceLineNumbers, int id, string resourceName, params object[] messageArgs) : - base(sourceLineNumbers, id, resourceName, messageArgs) - { - base.Level = MessageLevel.Warning; - base.ResourceManager = resourceManager; - } - } - - public sealed class WixWarnings - { - - private WixWarnings() - { - } - - public static MessageEventArgs IdentifierCannotBeModularized(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string identifier, int length, int maximumLength) - { - return new WixWarningEventArgs(sourceLineNumbers, 1000, "WixWarnings_IdentifierCannotBeModularized_1", elementName, attributeName, identifier, length, maximumLength); - } - - public static MessageEventArgs EmptyAttributeValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1001, "WixWarnings_EmptyAttributeValue_1", elementName, attributeName); - } - - public static MessageEventArgs UnableToFindFileFromCabOrImage(SourceLineNumber sourceLineNumbers, string existingFileSpec, string srcFileSpec) - { - return new WixWarningEventArgs(sourceLineNumbers, 1002, "WixWarnings_UnableToFindFileFromCabOrImage_1", existingFileSpec, srcFileSpec); - } - - public static MessageEventArgs CopyFileFileIdUseless(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1003, "WixWarnings_CopyFileFileIdUseless_1"); - } - - public static MessageEventArgs NestedInstall(SourceLineNumber sourceLineNumbers, string tableName, string columnName, object value) - { - return new WixWarningEventArgs(sourceLineNumbers, 1004, "WixWarnings_NestedInstall_1", tableName, columnName, value); - } - - public static MessageEventArgs OrphanedProgId(SourceLineNumber sourceLineNumbers, string progId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1005, "WixWarnings_OrphanedProgId_1", progId); - } - - public static MessageEventArgs PropertyUseless(SourceLineNumber sourceLineNumbers, string id) - { - return new WixWarningEventArgs(sourceLineNumbers, 1006, "WixWarnings_PropertyUseless_1", id); - } - - public static MessageEventArgs RemoveFileNameRequired(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1007, "WixWarnings_RemoveFileNameRequired_1"); - } - - public static MessageEventArgs SuppressAction(SourceLineNumber sourceLineNumbers, string action, string sequenceName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1008, "WixWarnings_SuppressAction_1", action, sequenceName); - } - - public static MessageEventArgs SuppressMergedAction(string action, string sequenceName) - { - return new WixWarningEventArgs(null, 1009, "WixWarnings_SuppressMergedAction_1", action, sequenceName); - } - - public static MessageEventArgs TargetDirCorrectedDefaultDir() - { - return new WixWarningEventArgs(null, 1010, "WixWarnings_TargetDirCorrectedDefaultDir_1"); - } - - public static MessageEventArgs AccessDeniedForDeletion(SourceLineNumber sourceLineNumbers, string tempFilesBasePath) - { - return new WixWarningEventArgs(sourceLineNumbers, 1011, "WixWarnings_AccessDeniedForDeletion_1", tempFilesBasePath); - } - - public static MessageEventArgs DirectoryInUse(SourceLineNumber sourceLineNumbers, string filePath) - { - return new WixWarningEventArgs(sourceLineNumbers, 1012, "WixWarnings_DirectoryInUse_1", filePath); - } - - public static MessageEventArgs AccessDeniedForSettingAttributes(SourceLineNumber sourceLineNumbers, string filePath) - { - return new WixWarningEventArgs(sourceLineNumbers, 1013, "WixWarnings_AccessDeniedForSettingAttributes_1", filePath); - } - - public static MessageEventArgs UnknownAction(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1024, "WixWarnings_UnknownAction_1", sequenceTableName, actionName); - } - - public static MessageEventArgs IdentifierTooLong(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixWarningEventArgs(sourceLineNumbers, 1026, "WixWarnings_IdentifierTooLong_1", elementName, attributeName, value); - } - - public static MessageEventArgs UnknownPermission(SourceLineNumber sourceLineNumbers, string tableName, string primaryKey, int bitPosition) - { - return new WixWarningEventArgs(sourceLineNumbers, 1030, "WixWarnings_UnknownPermission_1", tableName, primaryKey, bitPosition); - } - - public static MessageEventArgs DirectoryRedundantNames(SourceLineNumber sourceLineNumbers, string elementName, string shortNameAttributeName, string longNameAttributeName, string attributeValue) - { - return new WixWarningEventArgs(sourceLineNumbers, 1031, "WixWarnings_DirectoryRedundantNames_1", elementName, shortNameAttributeName, longNameAttributeName, attributeValue); - } - - public static MessageEventArgs DirectoryRedundantNames(SourceLineNumber sourceLineNumbers, string elementName, string sourceNameAttributeName, string longSourceAttributeName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1031, "WixWarnings_DirectoryRedundantNames_2", elementName, sourceNameAttributeName, longSourceAttributeName); - } - - public static MessageEventArgs UnableToResetAcls() - { - return new WixWarningEventArgs(null, 1032, "WixWarnings_UnableToResetAcls_1"); - } - - public static MessageEventArgs MediaExternalCabinetFilenameIllegal(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixWarningEventArgs(sourceLineNumbers, 1033, "WixWarnings_MediaExternalCabinetFilenameIllegal_1", elementName, attributeName, value); - } - - public static MessageEventArgs DeprecatedPreProcVariable(SourceLineNumber sourceLineNumbers, string oldName, string newName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1034, "WixWarnings_DeprecatedPreProcVariable_1", oldName, newName); - } - - public static MessageEventArgs FileSearchFileNameIssue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName1, string attributeName2) - { - return new WixWarningEventArgs(sourceLineNumbers, 1043, "WixWarnings_FileSearchFileNameIssue_1", elementName, attributeName1, attributeName2); - } - - public static MessageEventArgs AmbiguousFileOrDirectoryName(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixWarningEventArgs(sourceLineNumbers, 1044, "WixWarnings_AmbiguousFileOrDirectoryName_1", elementName, attributeName, value); - } - - public static MessageEventArgs PossiblyIncorrectTypelibVersion(SourceLineNumber sourceLineNumbers, string id) - { - return new WixWarningEventArgs(sourceLineNumbers, 1048, "WixWarnings_PossiblyIncorrectTypelibVersion_1", id); - } - - public static MessageEventArgs ImplicitComponentPrimaryFeature(string componentId) - { - return new WixWarningEventArgs(null, 1049, "WixWarnings_ImplicitComponentPrimaryFeature_1", componentId); - } - - public static MessageEventArgs ActionSequenceCollision(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName1, string actionName2, int sequenceNumber) - { - return new WixWarningEventArgs(sourceLineNumbers, 1050, "WixWarnings_ActionSequenceCollision_1", sequenceTableName, actionName1, actionName2, sequenceNumber); - } - - public static MessageEventArgs ActionSequenceCollision2(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1051, "WixWarnings_ActionSequenceCollision2_1"); - } - - public static MessageEventArgs SuppressAction2(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1052, "WixWarnings_SuppressAction2_1"); - } - - public static MessageEventArgs UnexpectedTableInProduct(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1053, "WixWarnings_UnexpectedTableInProduct_1", tableName); - } - - public static MessageEventArgs DeprecatedAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1054, "WixWarnings_DeprecatedAttribute_1", elementName, attributeName); - } - - public static MessageEventArgs DeprecatedAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string newAttributeName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1054, "WixWarnings_DeprecatedAttribute_2", elementName, attributeName, newAttributeName); - } - - public static MessageEventArgs DeprecatedAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string newAttributeName1, string newAttributeName2) - { - return new WixWarningEventArgs(sourceLineNumbers, 1054, "WixWarnings_DeprecatedAttribute_3", elementName, attributeName, newAttributeName1, newAttributeName2); - } - - public static MessageEventArgs MergeRescheduledAction(SourceLineNumber sourceLineNumbers, string tableName, string actionName, string mergeModuleFile) - { - return new WixWarningEventArgs(sourceLineNumbers, 1055, "WixWarnings_MergeRescheduledAction_1", tableName, actionName, mergeModuleFile); - } - - public static MessageEventArgs MergeTableFailed(SourceLineNumber sourceLineNumbers, string tableName, string primaryKeys, string mergeModuleFile) - { - return new WixWarningEventArgs(sourceLineNumbers, 1056, "WixWarnings_MergeTableFailed_1", tableName, primaryKeys, mergeModuleFile); - } - - public static MessageEventArgs DecompiledStandardActionRelativelyScheduledInModule(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1057, "WixWarnings_DecompiledStandardActionRelativelyScheduledInModule_1", sequenceTableName, actionName); - } - - public static MessageEventArgs IllegalActionInSequence(SourceLineNumber sourceLineNumbers, string sequenceTableName, string actionName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1058, "WixWarnings_IllegalActionInSequence_1", sequenceTableName, actionName); - } - - public static MessageEventArgs ExpectedForeignRow(SourceLineNumber sourceLineNumbers, string tableName, string primaryKey, string columnName, string columnValue, string foreignTableName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1059, "WixWarnings_ExpectedForeignRow_1", tableName, primaryKey, columnName, columnValue, foreignTableName); - } - - public static MessageEventArgs ExpectedForeignRow(SourceLineNumber sourceLineNumbers, string tableName, string primaryKey, string columnName1, string columnValue1, string columnName2, string columnValue2, string foreignTableName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1059, "WixWarnings_ExpectedForeignRow_2", tableName, primaryKey, columnName1, columnValue1, columnName2, columnValue2, foreignTableName); - } - - public static MessageEventArgs DecompilingAsCustomTable(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1060, "WixWarnings_DecompilingAsCustomTable_1", tableName); - } - - public static MessageEventArgs IllegalPatchCreationTable(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1061, "WixWarnings_IllegalPatchCreationTable_1", tableName); - } - - public static MessageEventArgs SkippingMergeModuleTable(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1062, "WixWarnings_SkippingMergeModuleTable_1", tableName); - } - - public static MessageEventArgs SkippingPatchCreationTable(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1063, "WixWarnings_SkippingPatchCreationTable_1", tableName); - } - - public static MessageEventArgs UnrepresentableColumnValue(SourceLineNumber sourceLineNumbers, string tableName, string columnName, object value) - { - return new WixWarningEventArgs(sourceLineNumbers, 1064, "WixWarnings_UnrepresentableColumnValue_1", tableName, columnName, value); - } - - public static MessageEventArgs DeprecatedTable(string tableName) - { - return new WixWarningEventArgs(null, 1065, "WixWarnings_DeprecatedTable_1", tableName); - } - - public static MessageEventArgs PatchTable(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1066, "WixWarnings_PatchTable_1", tableName); - } - - public static MessageEventArgs IllegalColumnValue(SourceLineNumber sourceLineNumbers, string tableName, string columnName, object value) - { - return new WixWarningEventArgs(sourceLineNumbers, 1067, "WixWarnings_IllegalColumnValue_1", tableName, columnName, value); - } - - public static MessageEventArgs DeprecatedLongNameAttribute(SourceLineNumber sourceLineNumbers, string elementName, string longNameAttributeName, string nameAttributeName, string shortNameAttributeName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1069, "WixWarnings_DeprecatedLongNameAttribute_1", elementName, longNameAttributeName, nameAttributeName, shortNameAttributeName); - } - - public static MessageEventArgs GeneratedShortFileNameConflict(SourceLineNumber sourceLineNumbers, string shortFileName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1070, "WixWarnings_GeneratedShortFileNameConflict_1", shortFileName); - } - - public static MessageEventArgs GeneratedShortFileNameConflict2(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1071, "WixWarnings_GeneratedShortFileNameConflict2_1"); - } - - public static MessageEventArgs DangerousTableInMergeModule(SourceLineNumber sourceLineNumbers, string tableName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1072, "WixWarnings_DangerousTableInMergeModule_1", tableName); - } - - public static MessageEventArgs DeprecatedLocalizationVariablePrefix(SourceLineNumber sourceLineNumbers, string variableId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1073, "WixWarnings_DeprecatedLocalizationVariablePrefix_1", variableId); - } - - public static MessageEventArgs PlaceholderValue(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixWarningEventArgs(sourceLineNumbers, 1074, "WixWarnings_PlaceholderValue_1", elementName, attributeName, value); - } - - public static MessageEventArgs MissingUpgradeCode(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1075, "WixWarnings_MissingUpgradeCode_1"); - } - - public static MessageEventArgs ValidationWarning(SourceLineNumber sourceLineNumbers, string ice, string message) - { - return new WixWarningEventArgs(sourceLineNumbers, 1076, "WixWarnings_ValidationWarning_1", ice, message); - } - - public static MessageEventArgs PropertyValueContainsPropertyReference(SourceLineNumber sourceLineNumbers, string propertyId, string otherProperty) - { - return new WixWarningEventArgs(sourceLineNumbers, 1077, "WixWarnings_PropertyValueContainsPropertyReference_1", propertyId, otherProperty); - } - - public static MessageEventArgs DeprecatedUpgradeProperty(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1078, "WixWarnings_DeprecatedUpgradeProperty_1"); - } - - public static MessageEventArgs EmptyCabinet(SourceLineNumber sourceLineNumbers, string cabinetName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1079, "WixWarnings_EmptyCabinet_1", cabinetName); - } - - public static MessageEventArgs EmptyCabinet(SourceLineNumber sourceLineNumbers, string cabinetName, bool isPatch) - { - return new WixWarningEventArgs(sourceLineNumbers, 1079, "WixWarnings_EmptyCabinet_2", cabinetName, isPatch); - } - - public static MessageEventArgs DeprecatedRegistryElement(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1080, "WixWarnings_DeprecatedRegistryElement_1"); - } - - public static MessageEventArgs IllegalRegistryKeyPath(SourceLineNumber sourceLineNumbers, string componentName, string registryId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1081, "WixWarnings_IllegalRegistryKeyPath_1", componentName, registryId); - } - - public static MessageEventArgs DeprecatedPatchSequenceTargetAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1082, "WixWarnings_DeprecatedPatchSequenceTargetAttribute_1", elementName, attributeName); - } - - public static MessageEventArgs ProductIdAuthored(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1083, "WixWarnings_ProductIdAuthored_1"); - } - - public static MessageEventArgs ImplicitMergeModulePrimaryFeature(string componentId) - { - return new WixWarningEventArgs(null, 1084, "WixWarnings_ImplicitMergeModulePrimaryFeature_1", componentId); - } - - public static MessageEventArgs DeprecatedIgnoreModularizationElement(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1085, "WixWarnings_DeprecatedIgnoreModularizationElement_1"); - } - - public static MessageEventArgs PropertyModularizationSuppressed(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1086, "WixWarnings_PropertyModularizationSuppressed_1"); - } - - public static MessageEventArgs DeprecatedPackageCompressedAttribute(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1087, "WixWarnings_DeprecatedPackageCompressedAttribute_1"); - } - - public static MessageEventArgs DeprecatedModuleGuidAttribute(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1088, "WixWarnings_DeprecatedModuleGuidAttribute_1"); - } - - public static MessageEventArgs DeprecatedQuestionMarksGuid(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1090, "WixWarnings_DeprecatedQuestionMarksGuid_1", elementName, attributeName); - } - - public static MessageEventArgs PackageCodeSet(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1091, "WixWarnings_PackageCodeSet_1"); - } - - public static MessageEventArgs InvalidModuleOrBundleVersion(SourceLineNumber sourceLineNumbers, string moduleOrBundle, string version) - { - return new WixWarningEventArgs(sourceLineNumbers, 1093, "WixWarnings_InvalidModuleOrBundleVersion_1", moduleOrBundle, version); - } - - public static MessageEventArgs InvalidRemoveFile(SourceLineNumber sourceLineNumbers, string file, string component) - { - return new WixWarningEventArgs(sourceLineNumbers, 1095, "WixWarnings_InvalidRemoveFile_1", file, component); - } - - public static MessageEventArgs PreprocessorWarning(SourceLineNumber sourceLineNumbers, string message) - { - return new WixWarningEventArgs(sourceLineNumbers, 1096, "WixWarnings_PreprocessorWarning_1", message); - } - - public static MessageEventArgs UpdateOfNonKeyPathFile(string nonKeyPathFileId, string componentId, string keyPathFileId) - { - return new WixWarningEventArgs(null, 1097, "WixWarnings_UpdateOfNonKeyPathFile_1", nonKeyPathFileId, componentId, keyPathFileId); - } - - public static MessageEventArgs UnsupportedCommandLineArgument(string arg) - { - return new WixWarningEventArgs(null, 1098, "WixWarnings_UnsupportedCommandLineArgument_1", arg); - } - - public static MessageEventArgs MajorUpgradePatchNotRecommended() - { - return new WixWarningEventArgs(null, 1099, "WixWarnings_MajorUpgradePatchNotRecommended_1"); - } - - public static MessageEventArgs RetainRangeMismatch(SourceLineNumber sourceLineNumbers, string fileId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1100, "WixWarnings_RetainRangeMismatch_1", fileId); - } - - public static MessageEventArgs DefaultLanguageUsedForVersionedFile(SourceLineNumber sourceLineNumbers, string language, string fileId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1101, "WixWarnings_DefaultLanguageUsedForVersionedFile_1", language, fileId); - } - - public static MessageEventArgs DefaultLanguageUsedForUnversionedFile(SourceLineNumber sourceLineNumbers, string language, string fileId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1102, "WixWarnings_DefaultLanguageUsedForUnversionedFile_1", language, fileId); - } - - public static MessageEventArgs DefaultVersionUsedForUnversionedFile(SourceLineNumber sourceLineNumbers, string version, string fileId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1103, "WixWarnings_DefaultVersionUsedForUnversionedFile_1", version, fileId); - } - - public static MessageEventArgs InvalidHigherInstallerVersionInModule(SourceLineNumber sourceLineNumbers, string moduleId, int moduleInstallerVersion, int productInstallerVersion) - { - return new WixWarningEventArgs(sourceLineNumbers, 1104, "WixWarnings_InvalidHigherInstallerVersionInModule_1", moduleId, moduleInstallerVersion, productInstallerVersion); - } - - public static MessageEventArgs ValidationFailedDueToSystemPolicy() - { - return new WixWarningEventArgs(null, 1105, "WixWarnings_ValidationFailedDueToSystemPolicy_1"); - } - - public static MessageEventArgs ColumnsIncompatibleWithInstallerVersion(SourceLineNumber sourceLineNumbers, string tableName, int productInstallerVersion) - { - return new WixWarningEventArgs(sourceLineNumbers, 1106, "WixWarnings_ColumnsIncompatibleWithInstallerVersion_1", tableName, productInstallerVersion); - } - - public static MessageEventArgs TableIncompatibleWithInstallerVersion(SourceLineNumber sourceLineNumbers, string tableName, int productInstallerVersion) - { - return new WixWarningEventArgs(sourceLineNumbers, 1107, "WixWarnings_TableIncompatibleWithInstallerVersion_1", tableName, productInstallerVersion); - } - - public static MessageEventArgs DeprecatedCommandLineSwitch(string oldSwitch) - { - return new WixWarningEventArgs(null, 1108, "WixWarnings_DeprecatedCommandLineSwitch_1", oldSwitch); - } - - public static MessageEventArgs DeprecatedCommandLineSwitch(string oldSwitch, string newSwitch) - { - return new WixWarningEventArgs(null, 1108, "WixWarnings_DeprecatedCommandLineSwitch_2", oldSwitch, newSwitch); - } - - public static MessageEventArgs UnexpectedEntrySection(SourceLineNumber sourceLineNumbers, string sectionType, string expectedType, string outputExtension) - { - return new WixWarningEventArgs(sourceLineNumbers, 1109, "WixWarnings_UnexpectedEntrySection_1", sectionType, expectedType, outputExtension); - } - - public static MessageEventArgs NewComponentAddedToExistingFeature(SourceLineNumber sourceLineNumbers, string component, string feature, string transformPath) - { - return new WixWarningEventArgs(sourceLineNumbers, 1110, "WixWarnings_NewComponentAddedToExistingFeature_1", component, feature, transformPath); - } - - public static MessageEventArgs DeprecatedAttributeValue(SourceLineNumber sourceLineNumbers, string attributeValue, string elementName, string attributeName, string newAttributeValue) - { - return new WixWarningEventArgs(sourceLineNumbers, 1111, "WixWarnings_DeprecatedAttributeValue_1", attributeValue, elementName, attributeName, newAttributeValue); - } - - public static MessageEventArgs InsufficientPermissionHarvestTypeLib() - { - return new WixWarningEventArgs(null, 1112, "WixWarnings_InsufficientPermissionHarvestTypeLib_1"); - } - - public static MessageEventArgs UnclearShortcut(SourceLineNumber sourceLineNumbers, string shortcutId, string fileId, string componentId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1113, "WixWarnings_UnclearShortcut_1", shortcutId, fileId, componentId); - } - - public static MessageEventArgs TooManyProgIds(SourceLineNumber sourceLineNumbers, string clsId, string progId, string otherClsId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1114, "WixWarnings_TooManyProgIds_1", clsId, progId, otherClsId); - } - - public static MessageEventArgs BadColumnDataIgnored(SourceLineNumber sourceLineNumbers, string value, string tableName, string columnName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1115, "WixWarnings_BadColumnDataIgnored_1", value, tableName, columnName); - } - - public static MessageEventArgs NullMsiAssemblyNameValue(SourceLineNumber sourceLineNumbers, string componentName, string name) - { - return new WixWarningEventArgs(sourceLineNumbers, 1116, "WixWarnings_NullMsiAssemblyNameValue_1", componentName, name); - } - - public static MessageEventArgs InvalidAttributeCombination(SourceLineNumber sourceLineNumbers, string attrib1, string attrib2, string name, string value) - { - return new WixWarningEventArgs(sourceLineNumbers, 1117, "WixWarnings_InvalidAttributeCombination_1", attrib1, attrib2, name, value); - } - - public static MessageEventArgs VariableDeclarationCollision(SourceLineNumber sourceLineNumbers, string variableName, string variableValue, string variableCollidingValue) - { - return new WixWarningEventArgs(sourceLineNumbers, 1118, "WixWarnings_VariableDeclarationCollision_1", variableName, variableValue, variableCollidingValue); - } - - public static MessageEventArgs DuplicatePrimaryKey(SourceLineNumber sourceLineNumbers, string primaryKey, string tableName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1119, "WixWarnings_DuplicatePrimaryKey_1", primaryKey, tableName); - } - - public static MessageEventArgs RequiresMsi200for64bitPackage(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1121, "WixWarnings_RequiresMsi200for64bitPackage_1"); - } - - public static MessageEventArgs ExternalCabsAreNotSigned(string databaseFile) - { - return new WixWarningEventArgs(null, 1122, "WixWarnings_ExternalCabsAreNotSigned_1", databaseFile); - } - - public static MessageEventArgs FailedToDeleteTempDir(string directory) - { - return new WixWarningEventArgs(null, 1123, "WixWarnings_FailedToDeleteTempDir_1", directory); - } - - public static MessageEventArgs StandardDirectoryConflictInMergeModule(SourceLineNumber sourceLineNumbers, string directory, string standardDirectory) - { - return new WixWarningEventArgs(sourceLineNumbers, 1124, "WixWarnings_StandardDirectoryConflictInMergeModule_1", directory, standardDirectory); - } - - public static MessageEventArgs PreprocessorUnknownPragma(SourceLineNumber sourceLineNumbers, string pragmaName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1125, "WixWarnings_PreprocessorUnknownPragma_1", pragmaName); - } - - public static MessageEventArgs DeprecatedComponentGroupId(SourceLineNumber sourceLineNumbers, string elementName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1126, "WixWarnings_DeprecatedComponentGroupId_1", elementName); - } - - public static MessageEventArgs UxPayloadsOnlySupportEmbedding(SourceLineNumber sourceLineNumbers, string sourceFile) - { - return new WixWarningEventArgs(sourceLineNumbers, 1127, "WixWarnings_UxPayloadsOnlySupportEmbedding_1", sourceFile); - } - - public static MessageEventArgs DiscardedRollbackBoundary(SourceLineNumber sourceLineNumbers, string rollbackBoundaryId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1129, "WixWarnings_DiscardedRollbackBoundary_1", rollbackBoundaryId); - } - - public static MessageEventArgs DeprecatedElement(SourceLineNumber sourceLineNumbers, string elementName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1130, "WixWarnings_DeprecatedElement_1", elementName); - } - - public static MessageEventArgs DeprecatedElement(SourceLineNumber sourceLineNumbers, string elementName, string newElementName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1130, "WixWarnings_DeprecatedElement_2", elementName, newElementName); - } - - public static MessageEventArgs DeprecatedElement(SourceLineNumber sourceLineNumbers, string elementName, string newElementName1, string newElementName2) - { - return new WixWarningEventArgs(sourceLineNumbers, 1130, "WixWarnings_DeprecatedElement_3", elementName, newElementName1, newElementName2); - } - - public static MessageEventArgs CannotUpdateCabCache(SourceLineNumber sourceLineNumbers, string cabinetPath, string detail) - { - return new WixWarningEventArgs(sourceLineNumbers, 1131, "WixWarnings_CannotUpdateCabCache_1", cabinetPath, detail); - } - - public static MessageEventArgs DownloadUrlNotSupportedForEmbeddedPayloads(SourceLineNumber sourceLineNumbers, string payloadId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1132, "WixWarnings_DownloadUrlNotSupportedForEmbeddedPayloads_1", payloadId); - } - - public static MessageEventArgs DiscouragedAllUsersValue(SourceLineNumber sourceLineNumbers, string path, string machineOrUser) - { - return new WixWarningEventArgs(sourceLineNumbers, 1133, "WixWarnings_DiscouragedAllUsersValue_1", path, machineOrUser); - } - - public static MessageEventArgs ImplicitlyPerUser(SourceLineNumber sourceLineNumbers, string path) - { - return new WixWarningEventArgs(sourceLineNumbers, 1134, "WixWarnings_ImplicitlyPerUser_1", path); - } - - public static MessageEventArgs PerUserButForcingPerMachine(SourceLineNumber sourceLineNumbers, string path) - { - return new WixWarningEventArgs(sourceLineNumbers, 1135, "WixWarnings_PerUserButForcingPerMachine_1", path); - } - - public static MessageEventArgs AttributeShouldContain(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string attributeValue, string expectedContains, string otherAttributeName, string otherAttributeValue) - { - return new WixWarningEventArgs(sourceLineNumbers, 1136, "WixWarnings_AttributeShouldContain_1", elementName, attributeName, attributeValue, expectedContains, otherAttributeName, otherAttributeValue); - } - - public static MessageEventArgs DuplicateComponentGuidsMustHaveMutuallyExclusiveConditions(SourceLineNumber sourceLineNumbers, string componentId, string guid) - { - return new WixWarningEventArgs(sourceLineNumbers, 1137, "WixWarnings_DuplicateComponentGuidsMustHaveMutuallyExclusiveConditions_1", componentId, guid); - } - - public static MessageEventArgs DeprecatedRegistryKeyActionAttribute(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1138, "WixWarnings_DeprecatedRegistryKeyActionAttribute_1"); - } - - public static MessageEventArgs NotABinaryWixlib(string wixlib) - { - return new WixWarningEventArgs(null, 1139, "WixWarnings_NotABinaryWixlib_1", wixlib); - } - - public static MessageEventArgs NoPerMachineDependencies(SourceLineNumber sourceLineNumbers, string packageId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1140, "WixWarnings_NoPerMachineDependencies_1", packageId); - } - - public static MessageEventArgs DownloadUrlNotSupportedForAttachedContainers(SourceLineNumber sourceLineNumbers, string containerId) - { - return new WixWarningEventArgs(sourceLineNumbers, 1141, "WixWarnings_DownloadUrlNotSupportedForAttachedContainers_1", containerId); - } - - public static MessageEventArgs ReservedAttribute(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1142, "WixWarnings_ReservedAttribute_1", elementName, attributeName); - } - - public static MessageEventArgs RequiresMsi500forArmPackage(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1143, "WixWarnings_RequiresMsi500forArmPackage_1"); - } - - public static MessageEventArgs RemotePayloadsMustNotAlsoBeCompressed(SourceLineNumber sourceLineNumbers, string elementName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1144, "WixWarnings_RemotePayloadsMustNotAlsoBeCompressed_1", elementName); - } - - public static MessageEventArgs AllChangesIncludedInPatch(SourceLineNumber sourceLineNumbers) - { - return new WixWarningEventArgs(sourceLineNumbers, 1145, "WixWarnings_AllChangesIncludedInPatch_1"); - } - - public static MessageEventArgs RelatedAttributeConditionallyIgnored(SourceLineNumber sourceLineNumbers, string recessiveAttribute, string dominantAttribute, string dominantValue) - { - return new WixWarningEventArgs(sourceLineNumbers, 1146, "WixWarnings_RelatedAttributeConditionallyIgnored_1", recessiveAttribute, dominantAttribute, dominantValue); - } - - public static MessageEventArgs BackslashTerminateInlineDirectorySyntax(SourceLineNumber sourceLineNumbers, string elementName, string attributeName, string value) - { - return new WixWarningEventArgs(sourceLineNumbers, 1147, "WixWarnings_BackslashTerminateInlineDirectorySyntax_1", elementName, attributeName, value); - } - - public static MessageEventArgs VersionTruncated(SourceLineNumber sourceLineNumbers, string originalVersion, string package, string truncatedVersion) - { - return new WixWarningEventArgs(sourceLineNumbers, 1148, "WixWarnings_VersionTruncated_1", originalVersion, package, truncatedVersion); - } - - public static MessageEventArgs ServiceConfigFamilyNotSupported(SourceLineNumber sourceLineNumbers, string elementName) - { - return new WixWarningEventArgs(sourceLineNumbers, 1149, "WixWarnings_ServiceConfigFamilyNotSupported_1", elementName); - } - } - - public class WixVerboseEventArgs : MessageEventArgs - { - - private static ResourceManager resourceManager = new ResourceManager("WixToolset.Core.Data.Messages", Assembly.GetExecutingAssembly()); - - public WixVerboseEventArgs(SourceLineNumber sourceLineNumbers, int id, string resourceName, params object[] messageArgs) : - base(sourceLineNumbers, id, resourceName, messageArgs) - { - base.Level = MessageLevel.Verbose; - base.ResourceManager = resourceManager; - } - } - - public sealed class WixVerboses - { - - private WixVerboses() - { - } - - public static MessageEventArgs ImportBinaryStream(string streamSource) - { - return new WixVerboseEventArgs(null, 9000, "WixVerboses_ImportBinaryStream_1", streamSource); - } - - public static MessageEventArgs ImportIconStream(string streamSource) - { - return new WixVerboseEventArgs(null, 9001, "WixVerboses_ImportIconStream_1", streamSource); - } - - public static MessageEventArgs CopyFile(string sourceFile, string destinationFile) - { - return new WixVerboseEventArgs(null, 9002, "WixVerboses_CopyFile_1", sourceFile, destinationFile); - } - - public static MessageEventArgs MoveFile(string sourceFile, string destinationFile) - { - return new WixVerboseEventArgs(null, 9003, "WixVerboses_MoveFile_1", sourceFile, destinationFile); - } - - public static MessageEventArgs CreateDirectory(string directory) - { - return new WixVerboseEventArgs(null, 9004, "WixVerboses_CreateDirectory_1", directory); - } - - public static MessageEventArgs RemoveDestinationFile(string destinationFile) - { - return new WixVerboseEventArgs(null, 9005, "WixVerboses_RemoveDestinationFile_1", destinationFile); - } - - public static MessageEventArgs CabFile(string fileId, string filePath) - { - return new WixVerboseEventArgs(null, 9006, "WixVerboses_CabFile_1", fileId, filePath); - } - - public static MessageEventArgs UpdatingFileInformation() - { - return new WixVerboseEventArgs(null, 9007, "WixVerboses_UpdatingFileInformation_1"); - } - - public static MessageEventArgs GeneratingDatabase() - { - return new WixVerboseEventArgs(null, 9008, "WixVerboses_GeneratingDatabase_1"); - } - - public static MessageEventArgs MergingModules() - { - return new WixVerboseEventArgs(null, 9009, "WixVerboses_MergingModules_1"); - } - - public static MessageEventArgs CreatingCabinetFiles() - { - return new WixVerboseEventArgs(null, 9010, "WixVerboses_CreatingCabinetFiles_1"); - } - - public static MessageEventArgs ImportingStreams() - { - return new WixVerboseEventArgs(null, 9011, "WixVerboses_ImportingStreams_1"); - } - - public static MessageEventArgs LayingOutMedia() - { - return new WixVerboseEventArgs(null, 9012, "WixVerboses_LayingOutMedia_1"); - } - - public static MessageEventArgs DecompilingTable(string tableName) - { - return new WixVerboseEventArgs(null, 9013, "WixVerboses_DecompilingTable_1", tableName); - } - - public static MessageEventArgs ValidationInfo(string ice, string message) - { - return new WixVerboseEventArgs(null, 9014, "WixVerboses_ValidationInfo_1", ice, message); - } - - public static MessageEventArgs CreateCabinet(string cabinet) - { - return new WixVerboseEventArgs(null, 9015, "WixVerboses_CreateCabinet_1", cabinet); - } - - public static MessageEventArgs ValidatingDatabase() - { - return new WixVerboseEventArgs(null, 9016, "WixVerboses_ValidatingDatabase_1"); - } - - public static MessageEventArgs OpeningMergeModule(string modulePath, short language) - { - return new WixVerboseEventArgs(null, 9017, "WixVerboses_OpeningMergeModule_1", modulePath, language); - } - - public static MessageEventArgs MergingMergeModule(string modulePath) - { - return new WixVerboseEventArgs(null, 9018, "WixVerboses_MergingMergeModule_1", modulePath); - } - - public static MessageEventArgs ConnectingMergeModule(string modulePath, string feature) - { - return new WixVerboseEventArgs(null, 9019, "WixVerboses_ConnectingMergeModule_1", modulePath, feature); - } - - public static MessageEventArgs ResequencingMergeModuleFiles() - { - return new WixVerboseEventArgs(null, 9020, "WixVerboses_ResequencingMergeModuleFiles_1"); - } - - public static MessageEventArgs BinderTempDirLocatedAt(string directory) - { - return new WixVerboseEventArgs(null, 9021, "WixVerboses_BinderTempDirLocatedAt_1", directory); - } - - public static MessageEventArgs ValidatorTempDirLocatedAt(string directory) - { - return new WixVerboseEventArgs(null, 9022, "WixVerboses_ValidatorTempDirLocatedAt_1", directory); - } - - public static MessageEventArgs GeneratingBundle(string bundleFile, string stubFile) - { - return new WixVerboseEventArgs(null, 9023, "WixVerboses_GeneratingBundle_1", bundleFile, stubFile); - } - - public static MessageEventArgs ResolvingManifest(string manifestFile) - { - return new WixVerboseEventArgs(null, 9024, "WixVerboses_ResolvingManifest_1", manifestFile); - } - - public static MessageEventArgs LoadingPayload(string payload) - { - return new WixVerboseEventArgs(null, 9025, "WixVerboses_LoadingPayload_1", payload); - } - - public static MessageEventArgs BundleGuid(string bundleGuid) - { - return new WixVerboseEventArgs(null, 9026, "WixVerboses_BundleGuid_1", bundleGuid); - } - - public static MessageEventArgs CopyingExternalPayload(string payload, string outputDirectory) - { - return new WixVerboseEventArgs(null, 9027, "WixVerboses_CopyingExternalPayload_1", payload, outputDirectory); - } - - public static MessageEventArgs EmbeddingContainer(string container, long size, string compression) - { - return new WixVerboseEventArgs(null, 9028, "WixVerboses_EmbeddingContainer_1", container, size, compression); - } - - public static MessageEventArgs SwitchingToPerUserPackage(SourceLineNumber sourceLineNumbers, string path) - { - return new WixVerboseEventArgs(sourceLineNumbers, 9029, "WixVerboses_SwitchingToPerUserPackage_1", path); - } - - public static MessageEventArgs SetCabbingThreadCount(string threads) - { - return new WixVerboseEventArgs(null, 9030, "WixVerboses_SetCabbingThreadCount_1", threads); - } - - public static MessageEventArgs ValidationSerialized() - { - return new WixVerboseEventArgs(null, 9031, "WixVerboses_ValidationSerialized_1"); - } - - public static MessageEventArgs ReusingCabCache(SourceLineNumber sourceLineNumbers, string cabinetName, string source) - { - return new WixVerboseEventArgs(sourceLineNumbers, 9032, "WixVerboses_ReusingCabCache_1", cabinetName, source); - } - - public static MessageEventArgs CabinetsSplitInParallel() - { - return new WixVerboseEventArgs(null, 9033, "WixVerboses_CabinetsSplitInParallel_1"); - } - - public static MessageEventArgs ValidatedDatabase(long size) - { - return new WixVerboseEventArgs(null, 9034, "WixVerboses_ValidatedDatabase_1", size); - } - } -} diff --git a/src/WixToolset.Core/Data/messages.xml.old b/src/WixToolset.Core/Data/messages.xml.old deleted file mode 100644 index d981e2d1..00000000 --- a/src/WixToolset.Core/Data/messages.xml.old +++ /dev/null @@ -1,3998 +0,0 @@ - - - - - - - - - {0} Exception Type: {1} Stack Trace: {2} - - - - - - - - The {0} element contains an unexpected attribute '{1}'. - - - - - - - The {0} element contains an unexpected child element '{1}'. - - - - - - - The {0}/@{1} attribute's value cannot be an empty string. If a value is not required, simply remove the entire attribute. - - - - - The {0}/@{1} attribute's value cannot be an empty string. To use the default value "{2}", simply remove the entire attribute. - - - - - - - - The current version of the toolset is {0}, but version {1} is required. - - - - - The current version of the extension '{2}' is {0}, but version {1} is required. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal integer value. Legal integer values are from -2,147,483,648 to 2,147,483,647. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal guid value. - - - - - - - - The {0}/@{1} attribute was not found; it is required. - - - - - The {0} element must have a value for exactly one of the {1} or {2} attributes. - - - - - - - The {0}/@{1} attribute was not found; it is required when attribute {2} is specified. - - - - - - The {0}/@{1} attribute was not found; it is required when attribute {2} has a value of '{3}'. - - - - - - - The {0}/@{1} attribute was not found; it is required unless the attribute {2} has a value of '{3}'. - - - - - - - - - - The {0}/@{1} attribute's value, '{2}', cannot contain lowercase characters. Since this is a secure property, it must also be a public property. This means the Property/@Id value must be completely uppercase. - - - - - - - - The {0}/@{1} attribute's value, '{2}', cannot contain lowercase characters. Since this is a search property, it must also be a public property. This means the Property/@Id value must be completely uppercase. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is {3} characters long. This is too long because it will be used to create a stream name. It cannot be more than than {4} characters long. - - - - - - - - The binary value in table '{0}' will be stored with a stream name, '{1}', that is {2} characters long. This is too long because the maximum allowed length for a stream name is 62 characters long. Since the stream name is created by concatenating the table name and values of the primary key for a row (delimited by periods), this error can be resolved by shortening a value that is part of the primary key. - - - - - - - - The {0} element's value, '{1}', is not a legal identifier. Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.). Every identifier must begin with either a letter or an underscore. - - - - - The {0}/@{1} attribute's value is not a legal identifier. Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.). Every identifier must begin with either a letter or an underscore. - - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal identifier. Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.). Every identifier must begin with either a letter or an underscore. - - - - - - The {0}/@{1} attribute's value '{2}' contains an illegal identifier '{3}'. Identifiers may contain ASCII characters A-Z, a-z, digits, underscores (_), or periods (.). Every identifier must begin with either a letter or an underscore. - - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal yes/no value. The only legal values are 'no' and 'yes'. - - - - - - - - Failed to create cab '{0}' while compressing file '{1}' with error 0x{2:X8}. - - - - - - Failed to create cab '{0}' with error 0x{1:X8}. - - - - - - - Failed to extract cab '{0}' to directory '{1}'. This is most likely due to a lack of available disk space on the destination drive. - - - - - Failed to extract cab '{0}' from merge module '{1}' to directory '{2}'. This is most likely due to a lack of available disk space on the destination drive. - - - - - - - - The {0}/@(1) attribute's value, '{2}' does not match the advertise state on its parent element: '{3}'. (Note: AppIds nested under Fragment, Module, or Product elements must be advertised.) - - - - - - - - - The {0}/@{1} attribute cannot be specified because the element is advertised. - - - - - - - The {0} element's inner text cannot be an empty string or completely whitespace. If you don't want a condition, then simply remove the entire {0} element. - - - - - - The {0}/@{1} attribute's value, '{2}', is not one of the legal options: '{3}'. - - - - - - - The {0}/@{1} attribute's value, '{2}', is not one of the legal options: '{3}', or '{4}'. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not one of the legal options: '{3}', '{4}', or '{5}'. - - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not one of the legal options: '{3}', '{4}', '{5}', or '{6}'. - - - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not one of the legal options: '{3}', '{4}', '{5}', '{6}', or '{7}'. - - - - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not one of the legal options: '{3}', '{4}', '{5}', '{6}', '{7}', or '{8}'. - - - - - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not one of the legal options: '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', or '{9}'. - - - - - - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not one of the legal options: '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', or '{10}'. - - - - - - - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not one of the legal options: '{3}', '{4}', '{5}', '{6}', '{7}', '{8}', '{9}', '{10}', '{11}', '{12}', '{13}', '{14}', '{15}', '{16}', '{17}', '{18}', '{19}', '{20}', '{21}', '{22}', '{23}', '{24}', '{25}', '{26}', '{27}', or '{28}'. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The {0}/@{1} attribute cannot coexist with a previously specified attribute on this element. The {0} element may only have one of the following source attributes specified at a time: {2}, {3}, {4}, {5}, or {6}. - - - - - - - - - - - - The {0}/@{1} attribute cannot coexist with a previously specified attribute on this element. The {0} element may only have one of the following target attributes specified at a time: {2}, {3}, {4}, {5}, {6}, {7}, or {8}. - - - - - - - - - - - - - - The {0} element contains illegal inner text: '{1}'. It may not contain inner text unless the {2} attribute is specified. - - - - - - - - The {0} element requires the {1} attribute because there is no parent {0} element. - - - - - - - The {0}/@{1} attribute's value, '{2}', is not a valid 8.3-compliant name. Legal names contain no more than 8 non-period characters followed by an optional period and extension of no more than 3 non-period characters. Any character except for the follow may be used: \ ? | > < : / * " + , ; = [ ] (space). - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not a valid filename because it contains illegal characters. Legal filenames contain no more than 260 characters and must contain at least one non-period character. Any character except for the follow may be used: \ ? | > < : / * ". - - - - - - The {0}/@{1} attribute's value '{2}' contains a invalid filename '{3}'. Legal filenames contain no more than 260 characters and must contain at least one non-period character. Any character except for the follow may be used: \ ? | > < : / * ". - - - - - - - - - The {0}/@{1} attribute's value, '{2}', is too long for a table name. It cannot be more than than 31 characters long. - - - - - - - - The {0}/@{1} attribute's value, '{2}', contains lowercase characters. Since this directory is user-configurable, it needs to be a public property. This means the value must be completely uppercase. - - - - - - - - The {0}/@{1} attribute's value, '{2}', cannot coexist with the {3} attribute's value of '{4}'. These options would ask the installer to disallow the advertised state for this feature while at the same time favoring it. - - - - - - - - - - The {0}/@{1} attribute cannot be specified if the {2} attribute's value is '{3}'. These options would ask the installer to force this feature to follow the parent installation state and simultaneously favor a particular installation state just for this feature. - - - - - - - - - The {0}/@{1} attribute's value, '{2}', is {3} characters long. The name is too long for an embedded cabinet. It cannot be more than than 62 characters long. - - - - - - - - - The {0}/{1} element cannot be specified if the {2} attribute's value is '{3}' or '{4}'. - - - - - - - - - - The {0}/@{1} attribute and a {0}/{2} element cannot both be specified. Only one may be specified if the {3} attribute's value is not 'multiString'. - - - - - - - - - The {0}/@{1} attribute cannot be specified when attribute {2} is present. - - - - - - The {0}/@{1} attribute cannot be specified when attribute {2} is present with value '{3}'. - - - - - - - - - The {0}/@{1} attribute cannot be specified when attribute {2} or {3} is also present. - - - - - - - The {0}/@{1} attribute cannot be specified when attribute {2}, {3}, or {4} is also present. - - - - - - - - The {0}/@{1} attribute cannot be specified when attribute {2}, {3}, {4}, or {5} is also present. - - - - - - - - - - - The {0}/@{1} attribute can only be specified with the following attribute {2} present. - - - - - - The {0}/@{1} attribute can only be specified with one of the following attributes: {2} or {3} present. - - - - - - - The {0}/@{1} attribute can only be specified with one of the following attributes: {2} or {3} present with value '{4}'. - - - - - - - - - The {0}/@{1} attribute can only be specified with one of the following attributes: {2}, {3}, or {4} present. - - - - - - - - The {0}/@{1} attribute can only be specified with one of the following attributes: {2}, {3}, {4}, or {5} present. - - - - - - - - - - - The {0}/@{1} attribute's value, '{2}', can only be specified with attribute {3} present with value '{4}'. - - - - - - - - The {0}/@{1} attribute's value, '{2}', cannot be specified without attribute {3} present. - - - - - - - - - The integer value {0} collides with a sentinel value in the compiler code. - - - - The long integral value {0} collides with a sentinel value in the compiler code. - - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal Guid value. A Guid needs to be generated and put in place of '{2}' in the source file. - - - - - - - - The {0} element contains multiple {1} child elements. There can only be one {1} child element per {0} element. - - - - - - - The {0} element has multiple key paths set. The key path may only be set to '{2}' in extension elements that support it or one of the following locations: {0}/@{1}, {3}/@{1}, {4}/@{1}, or {5}/@{1}. - - - - - - - - - - - Failed to close cab '{0}'. - - - - Failed to close cab '{0}', error: {1}. - - - - - - - The {0} element's {1} or {2} attribute was not found; one of these is required. - - - - - - The {0} element's {1}, {2}, or {3} attribute was not found; one of these is required. - - - - - - - The {0} element's {1}, {2}, {3}, or {4} attribute was not found; one of these is required. - - - - - - - - The {0} element's {1}, {2}, {3}, {4}, or {5} attribute was not found; one of these is required. - - - - - - - - - The {0} element's {1}, {2}, {3}, {4}, {5}, or {6} attribute was not found; one of these is required. - - - - - - - - - - The {0} element's {1}, {2}, {3}, {4}, {5}, {6}, or {7} attribute was not found; one of these is required. - - - - - - - - - - - - - The {0} element's {1} or {2} attribute was not found; at least one of these attributes must be specified. - - - - - - The {0} element's {1} or {2} attribute was not found; one of these is required when attribute {3} is present. - - - - - - - The {0} element's {1} or {2} attribute was not found; one of these is required when attribute {3} has a value of '{4}'. - - - - - - - - - - The {0} element's {1} or {2} attribute was not found; one of these is required without attribute {3} present. - - - - - - - - - The {0} element is non-advertised and therefore requires a parent {1} element. - - - - - - - The document element name '{0}' is invalid. A WiX {1} file must use '{2}' as the document element name. - - - - - - - - The {0}/@{1} attribute was not found or empty; it is required, or it can be specified in the parent {2} element. - - - - - - The {0}/@{1} attribute was not found or empty; it is required, or it can be specified in the parent {2}/@{3} attribute. - - - - - - - - - Access to the path '{0}' is denied. - - - - - Cannot set both ExcludeLanguage and ExcludeExceptLanguage attributes on a ModuleExclusion element. - - - - The '{0}' dialog element does not have a valid tabbable control. You must either have a tabbable control that is not marked TabSkip='yes', or you must mark a control TabSkip='no'. If you have a page with no tabbable controls (a progress page, for example), you might want to set the first Text control to be TabSkip='no'. - - - - - - There is no data for column '{0}' in a contained row of custom table '{1}'. A non-null value must be supplied for this column. - - - - - - - The FileTypeMask/@Value and FileTypeMask/@Mask attributes must be the same length. - - - - - Only one search element can appear under a '{0}' element. - - - - - - The {1} attribute can only be specified on the {2} element. - - - - - - - - A '{0}' element must have a search element as a child. - - - - - - Under a '{0}' element, multiple identifiers were found: '{1}' and '{2}'. All search elements under this element must have the same id. - - - - - - - - The advertise state of this element: '{0}', does not match the advertise state set on the parent element: '{1}'. - - - - - - - The context value '{0}' was duplicated. Context values must be distinct. - - - - - - Cannot convert RelativePath into Registry elements. - - - - - The {0}/@{1} attribute cannot be specified when the {0} element is nested underneath a {2} element. If this {0} is a member of a ComponentGroup where ComponentGroup/@{1} is set, then the {0}/@{1} attribute should be removed. - - - - - - - - A {0} element must have at least one child element of type {1}. - - - - - A {0} element must have at least one child element of type {1} or {2}. - - - - - - A {0} element must have at least one child element of type {1}, {2}, or {3}. - - - - - - - A {0} element must have at least one child element of type {1}, {2}, {3}, or {4}. - - - - - - - - - - Registry/@Root attribute is invalid on a nested Registry element. Either remove the Root attribute or move the Registry element so it is not nested under another Registry element. - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal yes/no/default value. The only legal values are 'default', 'no' or 'yes'. - - - - - - - - The {0}/@{1} attribute cannot be specified in a merge module. - - - - - - Permission elements cannot have GenericRead as the only permission specified. Include at least one other permission. - - - - The {0}/@{1} attribute cannot be specified when the element has body text as well. Specify either the attribute or the body, but not both. - - - - - - - A {0} element must have a search element as a child when the {0}/@{1} attribute has the value '{2}'. - - - - - - - - The {0} property was specified. Special MSI properties cannot be authored. Use the attributes on the Property element instead. - - - - - - A {0} element must have a Before attribute, After attribute, or a Sequence attribute. - - - - - - The {0}/@{1} attribute's value, '{2}, is not supported by the Windows Installer. - - - - - - - - A {0} element was specified with Type='{1}' and TabSkip='no'. Tabbable controls are not allowed in Billboards. - - - - - - - A {0} element was specified with Type='{1}' and a CheckBoxValue. Check box values can only be specified with Type='CheckBox'. - - - - - - - Attempted to extract cab '{0}' from merge module '{1}' to directory '{2}'. The cab file was not found. This usually means that you have a merge module without a cabinet inside it. - - - - - - - All RadioButton elements in a RadioButtonGroup must be consistent with their use of the Bitmap, Icon, and Text attributes. Ensure all of the RadioButton elements in this group have the same attribute specified. - - - RadioButtonGroup elements that contain RadioButton elements with Bitmap or Icon attributes set to "yes" can only be specified under a Control element. Move your RadioButtonGroup element as a child of the appropriate Control element. - - - - Illegal value '{0}' for the -sw<N> command line option. Specify a particular warning number, like '-sw6' to suppress the warning with ID 6, or '-sw' alone to suppress all warnings. - - - - - - The variable named '{0}' is not allowed in a foreach expression. - - - - - - Could not find the prefix in parameter name: '{0}'. - - - - - - Could not find the preprocessor extension for parameter '{0}'. A preprocessor extension is expected because the parameter prefix, '{1}', is not one of the standard types: 'env', 'res', 'sys', or 'var'. - - - - - - - The file with id '{0}' and name '{1}' could not be found with source path: '{2}'. - - - - - - - - {0} - - - - - - A circular reference of groups was detected. The infinite loop includes: {0}. Group references must form a directed acyclic graph. - - - - - - The {0}/@{1} attribute's value, '{2}', is a mixed-case guid. All letters in a guid value should be uppercase. - - - - - - - - The {0}/@{1} attribute's value '{2}' is not a valid date/time value. A date/time value should follow the format YYYY-MM-DDTHH:mm:ss. - - - - - - - - Multiple entry sections '{0}' and '{1}' found. Only one entry section may be present in a single target. - - - - - - Location of entry section related to previous error. - - - - Duplicate symbol '{0}' found. This typically means that an Id is duplicated. Access modifiers (internal, protected, private) cannot prevent these conflicts. Ensure all your identifiers of a given type (File, Component, Feature) are unique. - - - - Duplicate symbol '{0}' referenced by {1}. This typically means that an Id is duplicated. Ensure all your identifiers of a given type (File, Component, Feature) are unique or use an access modifier to scope the identfier. - - - - - - Location of symbol related to previous error. - - - - Could not find entry section in provided list of intermediates. Expected section of type '{0}'. - - - - - - The identifier '{0}' could not be found. Ensure you have typed the reference correctly and that all the necessary inputs are provided to the linker. - - - - The identifier '{0}' is inaccessible due to its protection level. - - - - - - - Multiple primary references were found for {0} '{1}' in {2} '{3}' and {4} '{5}'. - - - - - - - - - - - Component {0} cannot be contained in a Module twice. - - - - - - The merge module '{0}' contains a file identifier, '{1}', that is duplicated either in another merge module or in a File/@Id attribute. File identifiers must be unique. Please change one of the file identifiers to a different value. - - - - - - - The merge module '{0}' contains 2 or more file identifiers that only differ by case: '{1}' and '{2}'. The WiX toolset extracts merge module files to the file system using these identifiers. Since most file systems are not case-sensitive a collision is likely. Please contact the owner of the merge module for a fix. - - - - - - - - The component '{0}' does not have an explicit key path specified. If the ordering of the elements under the Component element changes, the key path will also change. To prevent accidental changes, the key path should be set to 'yes' in one of the following locations: Component/@KeyPath, File/@KeyPath, ODBCDataSource/@KeyPath, or Registry/@KeyPath. - - - - - - The localization identifier '{0}' has been duplicated in multiple locations. Please resolve the conflict. - - - - - - The localization variable !(loc.{0}) is unknown. Please ensure the variable is defined. - - - - - - The system cannot find the file '{0}'. - - - - The system cannot find the file '{0}' with type '{1}'. - - - - - - - Not a valid {0} file; detail: {1} - - - - - - ProgId elements may not be nested more than 1 level deep. - - - - The DirectorySearchRef {0} can not have a Parent attribute {1} and also be nested under parent element {2} - - - - - - - - Schema validation failed with the following error at line {1}, column {2}: {0} - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not a valid version. Legal version values should look like 'x.x.x.x' where x is an integer from 0 to 65534. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is too long for a table name. It cannot be more than than 31 characters long. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not a valid column width. Valid column widths are 2 or 4. - - - - - - - The CustomTable is missing a Column element with the PrimaryKey attribute set to 'yes'. At least one column must be marked as the primary key. - - - - The parameter '{0}' must be followed by the extension's type specification. The type specification should be a fully qualified class and assembly identity, for example: "MyNamespace.MyClass,myextension.dll". - - - - - - The parameter '{0}' must be followed by a file path. - - - - - - The parameter '{0}' must be followed by a directory path. - - - - - - The parameter '{0}' must be followed by a file or directory path. To specify a directory path the string must end with a backslash, for example: "C:\Path\". - - - - - - Path '{0}' contains a literal quote character. Quotes are often accidentally introduced when trying to refer to a directory path with spaces in it, such as "C:\Out Directory\" -- the backslash before the quote acts an escape character. The correct representation for that path is: "C:\Out Directory\\". - - - - - - Additional argument '{0}' was unexpected. Remove the argument and add the '-?' switch for more information. - - - - - - The {0}/@{1} attribute's value, '{2}', is incorrect. It should not contain values of '+', '-', or '*' when the {0}/@Value attribute is empty. Instead, use the proper element and attributes: for Name='+' use RegistryKey/@Action='createKey', for Name='-' use RemoveRegistryKey/@Action='removeOnUninstall', for Name='*' use RegistryKey/@Action='createAndRemoveOnUninstall'. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is {3} characters long. This is too long for a family name because the maximum allowed length is 8 characters long. - - - - - - - - - The {0}/@{1} attribute's value, '{2}', contains illegal characters for a family name. Legal values include letters, numbers, and underscores. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal long value. Legal long values are from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not in the range of legal values. Legal values for this attribute are from {3} to {4}. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not in the range of legal values. Legal values for this attribute are from {3} to {4}. - - - - - - - - - - The extension '{0}' uses the same xml schema namespace, '{1}', as previously loaded extension '{2}'. Please either remove one of the extensions or rename the xml schema namespace to avoid the collision. - - - - - - - - The extension '{0}' contains a definition for table '{1}' that collides with a previously loaded table definition. Please remove one of the conflicting extensions or rename one of the tables to avoid the collision. - - - - - - - The extension '{0}' uses the same preprocessor variable prefix, '{1}', as previously loaded extension '{2}'. Please remove one of the extensions or rename the prefix to avoid the collision. - - - - - - - - The process can not access the file '{0}' because it is being used by another process. - - - - - - Cannot open the merge module '{0}' from file '{1}'. - - - - - - - The primary key '{0}' is duplicated in table '{1}'. Please remove one of the entries or rename a part of the primary key to avoid the collision. - - - - - - - The file row with identifier '{0}' could not be found. - - - - - - The assembly file '{0}' appears to be invalid. Please ensure this is a valid assembly file and that the user has the appropriate access rights to this file. More information: {1} - - - - - - - The end element matching the '{0}' start element was not found. - - - - - - The code page '{0}' is not a valid Windows code page. Update the database's code page by modifying one of the following attributes: Product/@Codepage, Module/@Codepage, Patch/@Codepage, PatchCreation/@Codepage, or WixLocalization/@Codepage. - - - - - - The file '{0}' should be compressed but is not part of a compressed media. Files will be compressed if either the File/@Compressed or Package/@Compressed attributes are set to 'yes'. This can be fixed by setting the Media/@Cabinet attribute for media '{1}'. - - - - - - - There was an error importing the file '{0}'. - - - - There was an error importing table '{1}' from file '{0}'. - - - - - - - Found an invalid sequence table '{0}'. - - - - - - The directory '{0}' could not be found. - - - - - - The component '{0}' is not assigned to a feature. The component's {1} '{2}' requires it to be assigned to at least one feature. - - - - - - - - The action '{0}' is recursively placed in the '{1}' table. - - - - - - - The {0} file format version {1} is not compatible with the expected {0} file format version {2}. - - - - - - - - The {0} element contains an unexpected xml node of type {1}. - - - - - - - A parsed row has more fields that contain data for table '{0}' than are defined. This is potentially because a standard table is being redefined as a custom table or is based on an older table schema. - - - - - - The extension '{0}' could not be loaded. - - - - The extension '{0}' could not be loaded because of the following reason: {1} - - - - - The extension '{0}' is the wrong type: '{1}'. The expected type was '{2}'. - - - - - - The extension '{0}' is the wrong type: '{1}'. The expected type was '{2}' or '{3}'. - - - - - - - - - Found invalid subexpression '{0}' in expression '{1}'. - - - - - - - Found a <?{1}?> processing instruction without a matching <?{0}?> before it. - - - - - - - Found a <?{0}?> processing instruction without a matching <?{1}?> after it. - - - - - - - Expecting an argument for 'NOT' in expression '{0}'. - - - - - - Ill-formed preprocessor variable '$({0})'. Variables must have a prefix (like 'var.', 'env.', or 'sys.') and a name at least 1 character long. If the literal string '$({0})' is desired, use '$$({0})'. - - - - - - Undefined preprocessor variable '$({0})'. - - - - - - The define statement '<?define {0}?>' is not well-formed. Define statements should be in the form <?define variableName = "variable value"?>. - - - - - - The variable '{0}' with value '{1}' was previously declared with value '{2}'. - - - - - - - - The variable '{0}' cannot be undefined because its already undefined. - - - - - - The foreach statement '{0}' is illegal. The proper format for foreach is <?foreach varName in valueList?>. - - - - - - The {0}/@{1} attribute cannot be specified when a {2} element is nested underneath the {0} element. - - - - - - - A <?foreach?> statement was found that had no matching <?endforeach?>. - - - - The quotes don't match in the expression '{0}'. - - - - - - The parenthesis don't match in the expression '{0}'. - - - - - - A required variable was missing in the expression '{0}'. - - - - - - An unexpected literal was found in the expression '{0}'. - - - - - - An illegal number was found in the expression '{0}'. - - - - - - The operator '{0}' is unexpected. - - - - - - The empty subexpression is unexpected in the expression '{0}'. - - - - - - The custom table column '{0}' is unknown. - - - - - - Encountered an unknown custom table column type '{0}'. - - - - - Cannot have both the MsidbFileAttributesCompressed and MsidbFileAttributesNoncompressed options set in a file attributes column. - - - - The {0} table contains an action '{1}' that is declared overridable in two different locations. Please remove one of the actions or the Overridable='yes' attribute from one of the actions. - - - - - - The location of the action related to previous error. - - - - The {0} table contains an action '{1}' that is declared in two different locations. Please remove one of the actions or set the Overridable='yes' attribute on one of their elements. - - - - - - The location of the action related to previous error. - - - - The {0} table contains an action '{1}' that cannot be suppressed because it is not declared overridable in the base definition. Please stop suppressing the action or make it overridable in its base declaration. - - - - - - The location of the non-overridable definition of the action related to previous error. - - - - The {0} table contains a custom action '{1}' that has a sequence number specified. The Sequence attribute is not allowed for custom actions in a merge module. Please remove the action or use the Before or After attributes to specify where this action should be sequenced relative to another action. - - - - - - - The {0} table contains a standard action '{1}' that does not have a sequence number specified. The Sequence attribute is required for standard actions in a merge module. Please remove the action or use the Sequence attribute. - - - - - - - The {0} table contains an action '{1}' that is scheduled to come before or after action '{2}', which is also scheduled to come before or after action '{1}'. Please remove this circular dependency by changing the Before or After attribute for one of the actions. - - - - - - - - The {0} table contains an action '{1}' that is scheduled to come before or after action '{2}', which is a special action which only occurs when the installer terminates. These special actions can be identified by their negative sequence numbers. Please schedule the action '{1}' to come before or after a different action. - - - - - - - The location of the special termination action related to previous error(s). - - - - The {0} table contains an action '{1}' which cannot have a unique sequence number because it is scheduled before or after action '{2}'. There is not enough room before or after this action to assign a unique sequence number. Please schedule one of the actions differently so that it will be in a position with more sequence numbers available. Please note that sequence numbers must be an integer in the range 1 - 32767 (inclusive). - - - - - - - The location of the sequenced action related to previous error. - - - - The {0}/@{1} attribute's value '{2}' is invalid because it would make this action dependent upon itself. Please change the value to the name of a different action. - - - - - - - - Cannot find the table definitions for the '{0}' table. This is likely due to a typing error or missing extension. Please ensure all the necessary extensions are supplied on the command line with the -ext parameter. - - - - - - 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. - - - - - - An unexpected row in the '{0}' table was found in this merge module. Merge modules cannot contain the '{0}' table. - - - - - - An unexpected row in the '{0}' table was found in this patch creation package. Patch creation packages cannot contain the '{0}' table. - - - - - - The module '{0}' cannot be merged because it excludes or is excluded by the merge module with signature '{1}'. - - - - - - - The {0} table contains a row with primary key(s) '{1}' which requires a feature to properly merge from the merge module '{2}'. Nest a MergeRef element with an Id attribute set to the value '{3}' under a Feature element to fix this error. - - - - - - - - - The language '{0}' is supported but uses an invalid language transform in the merge module '{1}'. - - - - - - - Could not locate language '{0}' (or a transform for this language) in the merge module '{1}'. This is likely due to an incorrectly authored Merge/@Language attribute. - - - - - - - Decompilation of the {0} table has not been implemented by its extension. - - - - - - MIME element cannot be marked as the default when its advertise state differs from its parent element. Ensure that the advertise state of the MIME element matches its parents element or remove the Mime/@Advertise attribute completely. - - - - - Version independent ProgIds cannot have Icons. Remove the Icon and/or IconIndex attributes from your ProgId element. - - - - - The {0}/@{1} attribute's value, '{2}', cannot be specified with attribute {3} present. - - - - - - - The {0}/@{1} attribute's value, '{2}', cannot be specified with attribute {3} present with value '{4}'. - - - - - - - - - - The Merge element '{0}' specified an invalid language '{1}'. Verify that localization tokens are being properly resolved to a numeric LCID. - - - - - - - The WiX variable '{0}' is declared in more than one location. Please remove one of the declarations. - - - - - - The WiX variable '{0}' was declared without a value. Please specify a value for the variable. - - - - - - The WiX variable !(wix.{0}) is unknown. Please ensure the variable is declared on the command line for light.exe, via a WixVariable element, or inline using the syntax !(wix.{0}=some value which doesn't contain parenthesis). - - - - - - The WiX variable $(wix.{0}) uses an illegal prefix '$'. Please use the '!' prefix instead. - - - - - - The {0} element has no namespace. Please make the {0} element look like the following: <{0} xmlns="{1}">. - - - - - The {0} element has an incorrect namespace of '{1}'. Please make the {0} element look like the following: <{0} xmlns="{2}">. - - - - - - - - The {0} element contains an unhandled extension element '{1}'. Please ensure that the extension for elements in the '{2}' namespace has been provided. - - - - - - - - The {0} element contains an unhandled extension attribute '{1}'. Please ensure that the extension for attributes in the '{2}' namespace has been provided. - - - - - - - - The {0} element contains an unsupported extension attribute '{1}'. The {0} element does not currently support extension attributes. Is the {1} attribute using the correct XML namespace? - - - - - - - The {0} element contains an unsupported extension element '{1}'. The {0} element does not currently support extension elements. Is the {1} element using the correct XML namespace? - - - - - - - {0}: {1} - - - - - - - The Directory with Id '{0}' is not a valid root directory. There may only be a single root directory per product or module and its Id attribute value must be 'TARGETDIR' and its Name attribute value must be 'SourceDir'. - - - - - - The 'TARGETDIR' directory has an illegal DefaultDir value of '{0}'. The DefaultDir value is created from the *Name attributes of the Directory element. The TARGETDIR directory is a special directory which must have its Name attribute set to 'SourceDir'. - - - - - - The {0} element contains an unexpected child element '{1}'. The '{1}' element may only occur {2} time(s) under the {0} element. - - - - - - - The Column element specifies a binary column but does not have the correct Category specified. Windows Installer requires binary columns to specify their category as binary. Please set the Category attribute's value to 'Binary'. - - - The Feature element specifies a root feature with an illegal InstallDefault value of 'followParent'. Root features cannot follow their parent feature's install state because they don't have a parent feature. Please remove or change the value of the InstallDefault attribute. - - - - The {0}/@{1} attribute with value '{2}', is too long for a feature name. Due to limitations in the Windows Installer, feature names cannot be longer than 38 characters in length. - - - - - - - The DigitalSignature element cannot be nested under a Media element which specifies EmbedCab='yes'. This is because Windows Installer can only verify the digital signatures of external cabinets. Please either remove the DigitalSignature element or change the value of the Media/@EmbedCab attribute to 'no'. - - - 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. - - - - The localization variable '{0}' specifies an illegal inline default value of '{1}'. Localization variables cannot specify default values inline, instead the value should be specified in a WiX localization (.wxl) file. - - - - - - - The merge module '{0}' is not assigned to a feature. All merge modules must be assigned to at least one feature. - - - - - - An unexpected Win32 exception with error code 0x{0:X} occurred: {1} - - - - - An unexpected Win32 exception with error code 0x{0:X} occurred while accessing file '{1}': {2} - - - - - - - - Error executing unknown ICE action. The most common cause of this kind of ICE failure is an incorrectly registered scripting engine. See http://wixtoolset.org/documentation/error217/ for details and how to solve this problem. The following string format was not expected by the external UI message logger: "{0}". - - - - Error executing ICE action '{1}'. The most common cause of this kind of ICE failure is an incorrectly registered scripting engine. See http://wixtoolset.org/documentation/error217/ for details and how to solve this problem. The following string format was not expected by the external UI message logger: "{0}". - - - - - - - Illegal number of threads to create cabinets: '{0}' for -ct <N> command line option. Specify the number of threads to use like -ct 2. - - - - - - The {0} environment variable is set to an invalid value of '{1}'. - - - - - - - The definition for the '{0}' table's '{1}' column is an invalid foreign key relationship to the {2} table's column number {3}. It is not a valid foreign key table column number because it is too small (less than 1) or greater than the count of columns in the foreign table's definition. - - - - - - - - - The definition for the '{0}' table's '{1}' column is a foreign key relationship to the '{2}' table's column number {3}. The modularization types of the two column definitions differ: one is {4} and the other is {5}. Change one of the modularization types so that they match. - - - - - - - - - - - The cube file '{0}' cannot be found. This file is required for MSI validation. - - - - - - Failed to open database '{0}'. Ensure it is a valid database, and it is not open by another process. - - - - - - The types of the outputs do not match. One output's type is '{0}' while the other is '{1}'. - - - - - - - The table '{0}' does not contain any primary key columns. At least one column must be marked as the primary key to ensure this table can be patched. - - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal column name. It will collide with the sentinel values used in the _TransformView table. - - - - - - - - The transform being built did not contain any differences so it could not be created. - - - - - The code pages of the outputs do not match. One output's code page is '{0}' while the other is '{1}'. - - - - - - - The location of the mismatched code page related to the previous warning. - - - - - The Component/@Guid attribute's value '*' is not valid for this component because it does not meet the criteria for having an automatically generated guid. Components using a Directory as a KeyPath or containing ODBCDataSource child elements cannot use an automatically generated guid. Make sure your component doesn't have a Directory as the KeyPath and move any ODBCDataSource child elements to components with explicit component guids. - - - The Component/@Guid attribute's value '*' is not valid for this component because it does not meet the criteria for having an automatically generated guid. Components with registry keypaths and files cannot use an automatically generated guid. Create multiple components, each with one file and/or one registry value keypath, to use automatically generated guids. - - - - - - The component '{0}' has a key file with path '{1}'. Since this path is not rooted in one of the standard directories (like ProgramFilesFolder), this component does not fit the criteria for having an automatically generated guid. (This error may also occur if a path contains a likely standard directory such as nesting a directory with name "Common Files" under ProgramFilesFolder.) - - - - - - - The CustomAction/@TerminalServerAware attribute's value is 'yes' but the Execute attribute is not 'deferred,' 'rollback,' or 'commit.' Terminal-Server-aware custom actions must be deferred, rollback, or commit custom actions. For more information, see http://msdn.microsoft.com/library/aa372071.aspx." - - - - - The CustomAction sets a property but its Execute attribute is not 'immediate' (the default). Property-setting custom actions cannot be deferred." - - - - - Ill-formed preprocessor function '${0}'. Functions must have a prefix (like 'fun.'), a name at least 1 character long, and matching opening and closing parentheses. - - - - - - Undefined preprocessor function '$({0})'. - - - - - - In the preprocessor extension that handles prefix '{0}' while trying to call function '{1}({2})' and exception has occurred : {3} - - - - - - - - - In the preprocessor extension that handles prefix '{0}' while trying to get the value for variable '{1}' and exception has occured : {2} - - - - - - - - The manifest '{0}' does not have the required assembly/assemblyIdentity element. - - - - - - The file '{0}' is not a valid WiX Transform. - - - - - - The file '{0}' has an unexpected extension. Expected one of the following: '{1}'. - - - - - - - An unexpected row in the '{0}' table was found in this patch. Patches cannot contain the '{0}' table. - - - - - - Invalid product version '{0}'. Product version must have a major version less than 256, a minor version less than 256, and a build version less than 65536. - - - - Invalid product version '{0}' in package '{1}'. When included in a bundle, all product version fields in an MSI package must be less than 65536. - - - - - - - Component '{0}' has a changed keypath in the transform '{1}'. Patches cannot change the keypath of a component. - - - - - - - The validator requires at least one extension. Add "ValidatorExtension, Wix" for the default implementation. - - - - - Unknown validation message type '{0}'. - - - - - - No transforms were provided to attach to the patch. - - - - - Multiple extensions were specified on the command line, only a single extension is supported. - - - - - The transform {0} was included twice on the command line. Each transform can be applied to a patch only once. - - - - - - No baseline was specified for one of the transforms specified. A baseline is required for all transforms in a patch. - - - - - {0} - - - - - - {0} is expected to be followed by a value argument. - - - - - - No valid transforms were provided to attach to the patch. Check to make sure the transforms you passed on the command line have a matching baseline authored in the patch. Also, make sure there are differences between your target and upgrade. - - - - - No decompiler was provided. {0} requires a decompiler. - - - - - - The table '{0}' was expected but was missing. - - - - - - The {0} element cannot have a child element '{1}' unless attribute '{2}' is set to '{3}'. - - - - - - - The {0} element cannot have a child element '{1}' unless attribute '{2}' is set to '{3}' or '{4}'. - - - - - - - - - - The WixMsp is missing the patch ID. - - - - - The WixMsp has no media rows defined. - - - - - The file '{0}' cannot be found. - - - - - - The WixMsp is missing the client patch ID. Recompile the patch source files with the latest WiX toolset. - - - - - Product '{0}': Table '{1}' has a new row '{2}' added. This makes the patch not uninstallable. - - - - - - - - This patch is not uninstallable. The 'Patch' element's attribute 'AllowRemoval' should be set to 'no'. - - - - - '{0}' is too large, file size must be less than 2147483648. - - - - - - The parameter '{0}' is missing or has an invalid value {1}. Possible values are x86, x64, or ia64. - - - - - - - The Platform attribute has an invalid value {0}. Possible values are x86, x64, or ia64. - - - - - - You may only specify a single default type using -t or specify custom validation using -serr and -val. - - - - - Found orphaned Component '{0}'. If this is a Product, every Component must have at least one parent Feature. To include a Component in a Module, you must include it directly as a Component element of the Module element or indirectly via ComponentRef, ComponentGroup, or ComponentGroupRef elements. - - - - - - '-{0}' cannot be specfied in combination with '-{1}'. - - - - - - - The value '*' is not valid for the ProductCode when used in a transform or in a patch. Copy the ProductCode from your target product MSI into the Product/@Id attribute value for your product authoring. - - - - - Invalid order of actions {1} and {2} in sequence table {0}. Action {3} must occur after {1} and before {2}, but {2} is currently sequenced after {1}. Please fix the ordering or explicitly supply a location for the action {3}. - - - - - - - - - Not enough space exists to sequence action {3} in table {0}. It must be sequenced after {1} and before {2}, but those two actions are currently sequenced next to each other. Please move one of those actions to allow {3} to be inserted between them. - - - - - - - - - File '{0}' is marked as a Win32 assembly but it refers to assembly manifest '{1}' that is not present in this product. - - - - - - - Unable to open merge module '{0}'. Check to make sure the module language is correct. '{1}' - - - - - - - The '{0}/@{1}' attribute was not found; it is required when element '{0}' is not nested under a '{2}' element. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal identifier. The {0}/@{1} attribute does not support formatted string values, such as property names enclosed in brackets ([LIKETHIS]). The value must be the identifier of another element, such as the Directory/@Id attribute value. - - - - - - - - The code page '{0}' is not a valid Windows code page. Please check the {1}/@{2} attribute value in your source file. - - - - - - - - The compression level '{0}' is not valid. Valid values are 'none', 'low', 'medium', 'high', and 'mszip'. - - - - - The transform schema does not match the database schema. The transform may have been generated from a different database. - - - - The table definition of '{0}' in the target database does not match the table definition in the updated database. A transform requires that the target database schema match the updated database schema. - - - - - - The {0} option requires a directory, but the provided path is a file: {1} - - - - - - - The {0} option requires a file, but the provided path is a directory: {1} - - - - - - - Assembly {0} in component {1} has no strong name and has been marked to be placed in the GAC. All assemblies installed to the GAC must have a valid strong name. - - - - - - - Error writing to the path: '{0}'. Error message: '{1}' - - - - - - - Invalid file name specified on the command line: '{0}'. Error message: '{1}' - - - - - - - When the {0}/@{1} attribute is specified, the {0} element must be nested under a {2} element. - - - - - - - - Illegal value '{0}' for the -wx<N> command line option. Specify a particular warning number, like '-wx6' to display the warning with ID 6 as an error, or '-wx' alone to suppress all warnings. - - - - - - Element '{0}' missing attribute '{1}' or child element '{2}'. Exactly one of those is required. - - - - - - - - The variable '{0}' with value '{1}' was previously declared with value '{2}'. - - - - - - - - The variable definition '{0}' is not valid. Variable definitions should be in the form -dname=value where the value is optional. - - - - - - Duplicate cabinet name '{0}' found. - - - - - - Duplicate cabinet name '{0}' error related to previous error. - - - - - - A row has been added to the File table with id '{1}' that does not have a sequence number assigned to it. Create your transform from a pair of msi's instead of xml outputs to get sequences assigned to your File table's rows. - - - - - - Multiple files with ID '{0}' exist. Windows Installer does not support file IDs that differ only by case. Change the file IDs to be unique. - - - - - - Unable to create temporary file. A common cause is that too many files that have names beginning with '{0}' are present. Delete any unneeded files in the '{1}' directory and try again. - - - - - - - An error (E_FAIL) was returned while adding files to a CAB file. This most commonly happens when creating a CAB file 2 GB or larger. Either reduce the size of your installation package, raise Media/@CompressionLevel to a higher compression level, or split your installation package's files into more than one CAB file. - - - - - An error (ERROR_DISK_FULL) was returned while creating a CAB file. This means you have insufficient disk space - please clear more disk space and try this operation again. - - - - - Unresolved bind-time variable {0}. - - - - - - The destination name of file '{0}' does not match its assembly name '{1}' in your authoring. This will cause an installation failure for this assembly, because it will be installed to the Global Assembly Cache. To fix this error, update File/@Name of file '{0}' to be the actual name of the assembly. - - - - - - - Illegal characters in path '{0}'. Ensure you provided a valid path to the file. - - - - - - Failed to open the database. During validation, this most commonly happens when attempting to open a database using an unsupported code page or a file that is not a valid Windows Installer database. Please use a different code page in Module/@Codepage, Package/@SummaryCodepage, Product/@Codepage, or WixLocalization/@Codepage; or make sure you provide the path to a valid Windows Installer database. - - - - - You must specify an output file using the "-o" or "-out" switch when you provide more than one input file. - - - - - When the parent DirectorySearch/@Depth attribute is greater than 1 for the DirectorySearch '{1}', the FileSearch/@Id attribute must be absent for FileSearch '{0}' unless the parent DirectorySearch/@AssignToProperty attribute value is 'yes'. Remove the FileSearch/@Id attribute for '{0}' to resolve this issue. - - - - - - - The {0}/@{1} attribute's value, '{2}', is too long. {0}/@{1} attribute's must be {3} characters long or less. - - - - - - - - - Removing component '{0}' from feature '{1}' is not supported. Either the component was removed or the guid changed in the transform '{2}'. Add the component back, undo the change to the component guid, or remove the entire feature. - - - - - - - - An error (E_FAIL) was returned while finalizing a CAB file. This most commonly happens when creating a CAB file with more than 65535 files in it. Either reduce the number of files in your installation package or split your installation package's files into more than one CAB file using the Media element. - - - - - Either '{1}' was not defined in the assembly or the type defined in extension '{0}' could not be loaded. - - - - - The extension type '{1}' in extension '{0}' does not inherit from the expected class '{2}'. - - - - - - The type '{1}' in extension '{0}' could not be loaded. Exception type '{2}' returned the following message: {3} - - - - - - - - - Failed to open merge module for validation. The most common cause of this error is specifying that the merge module supports multiple languages (using the Package/@Languages attribute) but not including language-specific embedded transforms. To fix this error, make the merge module language-neutral, make it language-specific, embed language transforms as specified in the MSI SDK at http://msdn.microsoft.com/library/aa367799.aspx, or disable validation. - - - - - Failed to open package for validation. The most common cause of this error is validating an x64 package on an x86 system. To fix this error, run validation on an x64 system or disable validation. - - - - - A string was provided with characters that are not available in the specified database code page '{0}'. Either change these characters to ones that exist in the database's code page, or update the database's code page by modifying one of the following attributes: Product/@Codepage, Module/@Codepage, Patch/@Codepage, PatchCreation/@Codepage, or WixLocalization/@Codepage. - - - - - - The EmbeddedUI/@Name attribute value, '{0}', does not contain an extension. Windows Installer will not load an embedded UI DLL without an extension. Include an extension or just omit the Name attribute so it defaults to the file name portion of the Source attribute value. - - - - - - The DirectorySearch element '{0}' requires that the child {1} element has a unique Id when the DirectorySearch/@AssignToProperty attribute is set to 'yes'. - - - - - - - The {0}/@{1} attribute value, '{2}', cannot be specified when the {0} element is nested underneath a {3} element. - - - - - - - - - Source information is required for the product '{0}'. If you ran torch.exe with both target and updated .msi files, you must first perform an administrative installation of both .msi files then pass -a when running torch.exe. - - - - - - The PatchBaseline/@Id attribute value '{0}' is a child of multiple Media elements. This prevents transforms from being resolved to distinct media. Change the PatchBaseline/@Id attribute values to be unique. - - - - - - Two different source paths '{1}' and '{2}' were detected for the same file identifier '{0}'. You must either author these under Media elements with different Id attribute values or in different patches. - - - - - - - - A harvest source must be specified after the harvest type and can be followed by harvester arguments. - - - - - The '-out' or '-o' parameter must specify a file path. - - - - - The command line option '{0}' has already been loaded by another Heat extension. - - - - - - The harvest type was not found in the list of loaded Heat extensions. - - - The harvest type '{0}' was specified. Harvest types cannot start with a '-'. Remove the '-' to specify a valid harvest type. - - - - - - Both the target and updated product authoring must define the Product/@UpgradeCode attribute if the transform validates the UpgradeCode (default). Either define the Product/@UpgradeCode attribute in both the target and updated authoring, or set the Validate/@UpgradeCode attribute to 'no' in the patch authoring. - - - - - Illegal binder class name specified for -binder command line option. - - - - - The specified binder class '{0}' was not found in any extensions. - - - - - - Cannot load binder file manager: {0}. Light can only load one binder file manager and has already loaded binder file manager: {1}. - - - - - - - Cannot load linker extension: {0}. Light can only load one link extension and has already loaded link extension: {1}. - - - - - - - Unable to get the authenticode certificate of '{0}'. More information: {1} - - - - - - - Unable to get the authenticode certificate of '{0}'. The cryptography API has limitations on Windows XP and Windows Server 2003. More information: {1} - - - - - - - Unable to output to file '{0}' because it is marked as read-only. - - - - - - The Component/@Id attribute was not found; it is required when there is no valid keypath to use as the default id value. - - - - - The parent {0} element is missing the {1} attribute that is required for the {2} child element. - - - - - - - - Exception thrown while processing pragma '{0}'. The exception's message is: {1} - - - - - - - Malformed preprocessor pragma '{0}'. Pragmas must have a prefix, a name of at least 1 character long, and be followed by optional arguments. - - - - - - Unknown input file format - expected a .msi or .msm file. - - - - - Files with an extension of .msp are not currently supported. - - - - - Path contains one or more invalid characters. - - - - - Stub executable '{0}' is not a valid Win32 executable. - - - - - - Stub executable '{0}' does not contain a .wixburn data section. - - - - - - Stub executable '{0}' .wixburn data section is too small to store the Burn container header. - - - - - - The Bundle is missing '{0}' data, and cannot continue. - - - - - - A group parent ('{0}'/'{1}') had an unexpected child ('{2}'/'{3}'). - - - - - - - - - A circular reference of ordering dependencies was detected. The infinite loop includes: {0}. Ordering dependency references must form a directed acyclic graph. - - - - - - An expected identifier ('{1}', of type '{0}') was not found. - - - - - - - '{0}' is a 64-bit merge module but the product consuming it is 32-bit. 32-bit products can consume only 32-bit merge modules. - - - - - - The {0}/@{1} attribute's value, '{2}', is not a valid relative long name because it contains illegal characters. Legal relative long names contain no more than 260 characters and must contain at least one non-period character. Any character except for the follow may be used: ? | > < : / * ". - - - - - - - - The {0}/@{1} attribute's value, '{2}', is not one of the legal options: {3}. - - - - - - - - - The {0}/@{1} attribute's value, '{2}', is one of the illegal options: {3}. - - - - - - - - - - The code page '{0}' is invalid for summary information. You must specify an ANSI code page. - - - - - - The package being validated requires a higher version of Windows Installer than is installed on this machine. Validation cannot continue. - - - - - Multiple source files ({0}) have resulted in the same output file '{1}'. This is likely because the source files only differ in extension or path. Rename the source files to avoid this problem. - - - - - - - Unable to read package '{0}'. {1} - - - - - - - A per-source file output specification has been provided ('{0}'), but multiple source files match the source specification ({1}). Specifying a unique output requires that only a single source file match. - - - - - - - Unable to read bundle executable '{0}'. This is not a valid WiX bundle. - - - - - - Unable to read bundle executable '{0}', because this bundle was created with a newer version of WiX (bundle version '{1}'). You must use a newer version of WiX in order to read this bundle. - - - - - - - - The extension '{0}' on the input specified '{1}' does not match the number of inputs required to handle an input with this extension. Check if you are missing an input or have too many. - - - - - - - Only one of Media and MediaTemplate tables should be authored. - - - - - CabinetTemplate attribute's value '{0}' must contain '{{0}}' and should contain no more than 8 characters followed by an optional extension of no more than 3 characters. Any character except for the follow may be used: \ ? | > < : / * " + , ; = [ ] (space). The Windows Installer team has recommended following the 8.3 format for external cabinet files and any other naming scheme is officially unsupported (which means it is not guaranteed to work on all platforms). - - - - - - '{0}' is too large. Reduce the size of maximum uncompressed media size. - - - - - - File '{0}' could not be verified with a catalog file. - - - - - - Could not get hash of file '{0}'. Error: {2}. - - - - - - - The {0}/@{1} attribute's value begins with the reserved prefix '{2}'. Some prefixes are reserved by the Windows Installer and WiX toolset for well-known values. Change your attribute's value to not begin with the same prefix. - - - - - - - - The MSI '{0}' is explicitly marked to not elevate so it must be a per-user package but the ALLUSERS Property is set to '1' creating a per-machine package. Remove the Property with Id='ALLUSERS' and use Package/@InstallScope attribute to be explicit instead. - - - - - - The MSI '{0}' set the ALLUSERS Property to '{0}' which is not supported. Remove the Property with Id='ALLUSERS' and use Package/@InstallScope attribute instead. - - - - - - - The '{0}' MsiProperty is controlled by the bootstrapper and cannot be authored. (Illegal properties are: {1}.) Remove the MsiProperty element. - - - - - - - The merge module '{0}' from file '{1}' is either missing or has an invalid installer version. The value read from the installer version in module's summary information was '{2}'. This should be a numeric value representing a valid installer version such as 200 or 301. - - - - - - - - The Component/@Guid attribute's value '*' is not valid for this component because it does not meet the criteria for having an automatically generated guid. Components with more than one file cannot use an automatically generated guid unless a versioned file is the keypath and the other files are unversioned. This component's keypath is not versioned. Create multiple components to use automatically generated guids. - - - - - The Component/@Guid attribute's value '*' is not valid for this component because it does not meet the criteria for having an automatically generated guid. Components with more than one file cannot use an automatically generated guid unless a versioned file is the keypath and the other files are unversioned. This component has a non-keypath file that is versioned. Create multiple components to use automatically generated guids. - - - - - Component/@Id='{0}' has a @Guid value '{1}' that duplicates another component in this package. It is recommended to give each component its own unique GUID. - - - - - - - The provider dependency key '{0}' was already imported from the package with Id '{1}'. Please remove the Provides element with the key '{0}' from the package authoring. - - - - - - - The provider dependency version was not authored for the package with Id '{0}'. Please author the Provides/@Version attribute for this package. - - - - - - - The {0} element cannot have a child element '{1}' when attribute '{2}' is set. - - - - - - - - The {0} element must have attribute '{1}' when child element '{2}' is present. - - - - - - - - The localization for control {0} in dialog {1} is duplicated. Only one localization per control is allowed. - - - - - The localization for dialog {0} is duplicated. Only one localization per dialog is allowed. - - - - - - '{0}' is too large. Reduce the size of maximum cabinet size for large file splitting. The maximum permitted value is '{1}' MB. - - - - - - - Failed to register the copy command for cabinet '{0}' formed by splitting cabinet '{1}'. - - - - - - - The cabinet name '{0}' collides with the new cabinet formed by splitting cabinet '{1}', consider renaming cabinet '{0}'. - - - - - - - Could not find the last split cabinet '{2}' in the Media Table. So failed to add new cabinet '{0}' formed by splitting cabinet '{1}' to the installer package. - - - - - - - - Invalid AutoVersion template specified. - - - - - Invalid {0}/@Version '{1}'. {0} version has a max value of "65535.65535.65535.65535" and must be all numeric. - - - - - - - The element {1} does not support platform '{0}'. Consider removing the element or using the preprocessor to conditionally include the element based on the platform. - - - - - - - There is no media defined for disk id '{0}'. You must author either <Media Id='{0}' ...> or <MediaTemplate ...>. - - - - - - The RemotePayload element can only be used for ExePackage and MsuPackage payloads. - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal yes/no/always value. The only legal values are 'always', 'no' or 'yes'. - - - - - - - - Include files cannot be nested more deeply than {0} times. Make sure included files don't accidentally include themselves. - - - - - - The {0}/@{1} attribute's value '{2}' only specifies a directory reference. The inline directory syntax requires that at least one directory be specified in addition to the value. For example, use '{3}:\foo\' to add a 'foo' directory. - - - - - - - - - The file name '{0}' creates an insecure bundle. Windows will load unnecessary compatibility shims into a bundle with that file name. These compatibility shims can be DLL hijacked allowing attackers to compromise your customers' computer. Choose a different bundle file name. - - - - - - The {0}/@{1} attribute's value, '{2}', is not a legal path name: Payload names must be relative to their cache directory and cannot contain '..'. - - - - - - - - MSI transactions must install all x64 packages before any x86 package. - - - - - - - - The {0}/@{1} attribute's value, '{2}', is {3} characters long. It will be too long if modularized. The identifier shouldn't be longer than {4} characters long to allow for modularization (appending a guid for merge modules). - - - - - - - - - - The {0}/@{1} attribute's value cannot be an empty string. If you want the value to be null or empty, simply remove the entire attribute. - - - - - - - Unable to find existing file {0} to place in src location {1}. Will likely cause a linker break. - - - - - - Since the CopyFile/@FileId attribute was specified but none of the following attributes (DestinationName, DestinationDirectory, DestinationProperty) were specified, this authoring will not do anything. - - - - The {0}.{1} column's value, '{2}', indicates a nested install. Nested installations are not supported by the WiX team. This action will be left out of the decompiled output. - - - - - - - - ProgId '{0}' is orphaned. It has no associated component, so it will never install. Every ProgId should have either a parent Class element or child Extension element (at any distance). - - - - - - Property '{0}' does not contain a Value attribute and is not marked as Admin, Secure, or Hidden. The Property element is being ignored. - - - - - The RemoveFile/@Name attribute will soon become required. In order to match the old functionality of not specifying this attribute, please use the new RemoveFolder element instead. - - - - The action '{0}' in the {1} table is being suppressed. - - - - - - - The merged action '{0}' in the {1} table is being suppressed. - - - - - - - The Directory with Id 'TARGETDIR' must have the value 'SourceDir' in its 'DefaultDir' column. This has been automatically corrected for you in the decompiled output. - - - - - Access denied; cannot delete '{0}'. - - - - - - The directory '{0}' is in use and cannot be deleted. - - - - - - Access denied; cannot set attributes on '{0}'. - - - - - - The {0} table contains an action '{1}' which is not a known custom action, dialog, or standard action. This action will be left out of the decompiled output. - - - - - - - The {0}/@{1} attribute's value, '{2}', is too long for an identifier. Standard identifiers are 72 characters long or less. - - - - - - - - The {0} table contains a row with primary key '{1}' which has an unknown permission at bit {2}. - - - - - - - - The {0} element's {1} and {2} values are both '{3}'. This is redundant; the {2} attribute should be removed. - - - - - - - The {0} element's source and destination names are identical. This is redundant; the {1} and {2} attributes should be removed if present. - - - - - - - Unable to reset acls on destination files. - - - - The {0}/@{1} attribute's value, '{2}', is not a valid external cabinet name. Legal cabinet names should follow 8.3 format: they should contain no more than 8 characters followed by an optional extension of no more than 3 characters. Any character except for the following may be used: \ ? | > < : / * " + , ; = [ ] (space). The Windows Installer team has recommended following the 8.3 format for external cabinet files and any other naming scheme is officially unsupported (which means it is not guaranteed to work on all platforms). - - - - - - - - The built-in preprocessor variable '{0}' is deprecated. Please correct your authoring to use the new '{1}' preprocessor variable instead. - - - - - - - The {0} element's {1} and {2} attributes were found. Due to a bug with the Windows Installer, only the Name or LongName attribute should be used. Use the Name attribute for 8.3 compliant file names and the LongName attribute for longer ones. When using only the LongName attribute, ICE03 should be ignored for the Signature table's FileName column. - - - - - - - - The {0}/@{1} attribute's value '{2}' is an ambiguous short name because it ends with a '~' character followed by a number. Under some circumstances, this name could resolve to more than one file or directory name and lead to unpredictable results (for example 'MICROS~1' may correspond to 'Microsoft Shared' or 'Microsoft Foo' or literally 'Micros~1'). - - - - - - - - The Typelib table entry with Id '{0}' could have an incorrect version of '256.0'. InstallShield has a bug relating to the Typelib Version column: it will incorrectly set the value '65536' in to represent version '1.0'. However, this number actually corresponds to version '256.0'. This bug will not affect the typelib version that is registered during installation, however, it will prevent the Windows Installer from correctly identifying whether a typelib is already installed and lead to unnecessary reinstallations of the typelib. - - - - - - The component '{0}' does not have an explicit primary feature parent specified. If the source files are linked in a different order, the primary parent feature may change. To prevent accidental changes, the primary feature parent should be set to 'yes' in one of the ComponentRef/@Primary, ComponentGroupRef/@Primary, or FeatureGroupRef/@Primary locations for this component. - - - - - - The {0} table contains actions '{1}' and '{2}' which both have the same sequence number {3}. Please change the sequence number for one of these actions to avoid an ICE warning. - - - - - - - - The location of the action related to previous warning. - - - The location of the suppressed action related to previous warning. - - - - An unexpected row in the '{0}' table was found in this product. Products should not contain the '{0}' table. - - - - - - The {0}/@{1} attribute has been deprecated. - - - - - The {0}/@{1} attribute has been deprecated. Please use the {2} attribute instead. - - - - - - The {0}/@{1} attribute has been deprecated. Please use the {2} or {3} attribute instead. - - - - - - - - - The {0} table contains an action '{1}' which cannot be merged from the merge module '{2}'. This action is likely colliding with an action in the database that is being created. The colliding action may have been authored in the database or merged in from another merge module. If this is a standard action, it is likely colliding due to a difference in the condition for the action in the database and merge module. If this is a custom action, it should only be declared in the database or one merge module. - - - - - - - - The {0} table contains a row with primary key(s) '{1}' which cannot be merged from the merge module '{2}'. This is likely due to collision of rows with the same primary key(s) (but other different values in other columns) between the database and the merge module. - - - - - - - - The {0} table contains a standard action '{1}' that does not have a sequence number specified. A value in the Sequence column is required for standard actions in a merge module. Remove the action from the decompiled authoring to have WiX automatically sequence it. - - - - - - - The {0} table contains an action '{1}' which is not allowed in this table. If this is a standard action then it is not valid for this table, if it is a custom action or dialog then this table does not accept actions of that type. This action will be left out of the decompiled output. - - - - - - - The {0} table contains a row with primary key(s) '{1}' whose {2} column contains a value, '{3}', which specifies a foreign key relationship with the {4} table. However, since the expected foreign row specified by this value does not exist, this will result in some information being left out of the decompiled output. - - - - - - - - The {0} table contains a row with primary key(s) '{1}' whose {2} and {4} columns contain the values, '{3}' and '{5}', which specify a foreign key relationship with the {6} table. However, since the expected foreign row specified by this value does not exist, this will result in some information being left out of the decompiled output. - - - - - - - - - - - - The {0} table is being decompiled as a custom table. - - - - - - The {0} table is not legal in a patch creation file. The information in this table will be left out of the decompiled output. - - - - - - 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. - - - - - - 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. - - - - - - The {0}.{1} column's value, '{2}', cannot currently be represented in the WiX schema. - - - - - - - - The {0} table is not supported by the WiX toolset because it has been deprecated by the Windows Installer team. Any information in this table will be left out of the decompiled output. - - - - - - The {0} table is added to the install package by a transform from a patch package (.msp) and not authored directly into an install package (.msi). The information in this table will be left out of the decompiled output. - - - - - - The {0}.{1} column's value, '{2}', is not a recognized legal value. This information will be left out of the decompiled output. - - - - - - - - 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. - - - - - - - - - The short file name '{0}' was generated for multiple files that may be installed to the same directory. This could be due to conflicting long file names specified by the File/@Name attribute. If that is the case, please resolve the conflict in those attributes. Otherwise, please manually set the File/@ShortName attribute on the conflicting row to fix the collision. If one of the colliding files was added via a patch, that short file name should be specified manually to avoid disturbing the original short file name. - - - - - - The location of a conflicting generated short file name related to the previous warning. - - - - - Merge modules should not contain the '{0}' table because all merge conflicts cannot avoided. However, this warning can be suppressed if all of the consumers of the Merge Module agree to not duplicate identifiers in the '{0}' table. - - - - - - The localization variable $(loc.{0}) uses a deprecated prefix '$'. Please use the '!' prefix instead. Since the prefix '$' is also used by the preprocessor, it has been deprecated to avoid namespace collisions. - - - - - - The {0}/@{1} attribute's value, '{2}', is a placeholder value used in example files. Please replace this placeholder with the appropriate value. - - - - - - - The Product/@UpgradeCode attribute was not found; it is strongly recommended to ensure that this product can be upgraded. - - - - {0}: {1} - - - - - - - The '{0}' Property contains '[{1}]' in its value which is an illegal reference to another property. If this value is a string literal, not a property reference, please ignore this warning. To set a property with the value of another property, use a CustomAction with Property and Value attributes. - - - - - - Specifying a Property element as a child of an Upgrade element has been deprecated. Please specify this Property element as a child of a different element such as Product or Fragment. - - - - The cabinet '{0}' does not contain any files. If this installation contains no files, this warning can likely be safely ignored. Otherwise, please add files to the cabinet or remove it. - - - - The cabinet '{0}' does not contain any files. If this patch contains no files, this warning can likely be safely ignored. Otherwise, try passing -p to torch.exe when first building the transforms, or add a ComponentRef to your PatchFamily authoring to pull changed files into the cabinet. - - - - - - The Registry element has been deprecated. Please use one of the new elements which replaces its functionality: RegistryKey for creating registry keys, RegistryValue for writing registry values, RemoveRegistryKey for removing registry keys, and RemoveRegistryValue for removing registry values. - - - - 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. - - - - - - - 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. - - - - - - - The 'ProductID' property should not be directly authored because it will prevent the ValidateProductID standard action from performing any validation during the installation. This property will be set by the ValidateProductID standard action or control event. - - - - - The merge module '{0}' does not have an explicit primary feature parent specified. If the source files are linked in a different order, the primary parent feature may change. To prevent accidental changes, the primary feature parent should be set to 'yes' in one of the MergeRef/@Primary or FeatureGroupRef/@Primary locations for this component. - - - - - - The IgnoreModularization element has been deprecated. Use the Binary/@SuppressModularization, CustomAction/@SuppressModularization, or Property/@SuppressModularization attribute instead. - - - - - The Property/@SuppressModularization attribute has been set to 'yes'. Using this functionality is strongly discouraged; it should only be necessary as a workaround of last resort in rare scenarios. - - - - - The Package/@Compressed attribute is deprecated under the Module element because merge modules must always be compressed. - - - - - The Module/@Guid attribute is deprecated merge modules use their package code as the modularization guid. Use the Package/@Id attribute instead. - - - - - The {0}/@{1} attribute's value '????????-????-????-????-????????????' has been deprecated. Use '*' instead. - - - - - - - The Package/@Id attribute has been set. Setting this attribute will allow nonidentical .msi files to have the same package code. This may be a problem because the package code is the primary identifier used by the installer to search for and validate the correct package for a given installation. If a package is changed without changing the package code, the installer may not use the newer package if both are still accessible to the installer. Please remove the Id attribute in order to automatically generate a new package code for each new .msi file. - - - - - Invalid {0}/@Version '{1}'. {0} version has a max value of "65535.65535.65535.65535" and must be all numeric. - - - - - - - File '{0}' was removed from component '{1}'. Removing a file from a component will not result in the file being removed by a patch. You should author a RemoveFile element in your component to remove the file from the installation if you want the file to be removed. - - - - - - - {0} - - - - - - File '{0}' in Component '{1}' was changed, but the KeyPath file '{2}' was not. This file will not be patched on the target system if the REINSTALLMODE does not contain 'A'. The KeyPath file should also be changed and included in your patch. - - - - - - - - '{0}' is not a valid command line argument. - - - - - - Changing the ProductCode in a patch is not recommended because the patch cannot be uninstalled nor can it be sequenced along with other patches for the target product. See http://msdn2.microsoft.com/library/aa367571.aspx for more information. - - - - - Mismatch in RetainRangeCounts for the file '{0}' - ignoring the retain ranges. - - - - - - The DefaultLanguage '{0}' was used for file '{1}' which has no language. Specifying a language that is different from the actual file may result in unexpected versioning behavior during a repair or while patching. Either specify a value for DefaultLanguage or put the language in the version information resource to eliminate this warning. - - - - - - - The DefaultLanguage '{0}' was used for file '{1}' which has no language or version. For unversioned files, specifying a value for DefaultLanguage is not neccessary and it will not be used when determining file versions. Remove the DefaultLanguage attribute to eliminate this warning. - - - - - - - The DefaultVersion '{0}' was used for file '{1}' which has no version. No entry for this file will be placed in the MsiFileHash table. For unversioned files, specifying a version that is different from the actual file may result in unexpected versioning behavior during a repair or while patching. Version the resource to eliminate this warning. - - - - - - - Merge module '{0}' has an installer version of {1} which is greater than the product's installer version of {2}. Merging a module with a higher installer version than the product it is being merged into can result in invalid values in the resulting msi. You must set the Package/@InstallerVersion attribute to {1} or greater to merge this merge module into your product. - - - - - - - - Validation could not run due to system policy. To eliminate this warning, run the process as admin or suppress ICE validation. - - - - - Table '{0}' uses columns that require a version of Windows Installer greater than specified in your package ('{1}'). - - - - - - - Using table '{0}' requires a version of Windows Installer greater than specified in your package ('{1}'). - - - - - - - The command line switch '{0}' is deprecated. - - - - The command line switch '{0}' is deprecated. Please use '{1}' instead. - - - - - - - Found mismatched entry point <{0}>. Expected <{1}> for specified output package type {2}. - - - - - - - - Component '{0}' was added to feature '{1}' in the transform '{2}'. If you cannot guarantee that this feature will always be installed, you should consider adding new components to new top-level features to prevent prompts for source when installing this patch. - - - - - - - - The value "{0}" for the {1}/@{2} attribute has been deprecated. Please use "{3}" instead. - - - - - - - - - Not enough permissions to harvest type library. On Windows Vista, you must either run Heat elevated, or install Windows Vista SP1 (or higher). - - - - - Because it is an advertised shortcut, the target of shortcut '{0}' will be the keypath of component '{2}' rather than parent file '{1}'. To eliminate this warning, you can (1) make the Shortcut element a child of the File element that is the keypath of component '{2}', (2) make file '{1}' the keypath of component '{2}', or (3) remove the @Advertise attribute so the shortcut is a non-advertised shortcut. - - - - - - - - Class '{0}' tried to use ProgId '{1}' which has already been associated with class '{2}'. This information will be left out of the decompiled output. - - - - - - - - The value '{0}' in table '{1}', column '{2}' is invalid according to the column's validation information. The decompiled output includes a best-effort representation of this value. - - - - - - - - The assembly in component '{0}' has a null or empty {1} assembly name value. - - - - - - - It is invalid to combine attributes {0} and {1}. The decompiled output will set attribute {2} to {3}. - - - - - - - - - The variable '{0}' with value '{1}' was previously declared with value '{2}'. - - - - - - - - The primary key '{0}' is duplicated in table '{1}' and will be ignored. Please remove one of the entries or rename a part of the primary key to avoid the collision. - - - - - - - Package/@InstallerVersion must be 200 or greater for a 64-bit package. The value will be changed to 200. Please specify a value of 200 or greater in order to eliminate this warning. - - - - - The installer database '{0}' has external cabs, but at least one of them is not signed. Please ensure that all external cabs are signed, if you mean to sign them. If you don't mean to sign them, there is no need to run the insignia tool as part of your build. - - - - - - Failed to delete temporary directory: {0} - - - - - - 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. - - - - - - - The pragma '{0}' is unknown. Please ensure you have referenced the extension that defines this pragma. - - - - - - The {0}/@Id attribute contains invalid characters for an identifier. Being able to use invalid identifier characters for a {0} identifier has been deprecated. - - - - - - A UX Payload ('{0}') was marked for something other than embedded packaging, possibly because it included a @DownloadUrl attribute. At present, UX Payloads must be embedded in the Bundle, so the requested packaging is being ignored. - - - - - - The RollbackBoundary '{0}' was discarded because it was not followed by a package. Without a package the rollback boundary doesn't do anything. Verify that the RollbackBoundary element is not followed by another RollbackBoundary and that the element is not at the end of the chain. - - - - - - The {0} element has been deprecated. - - - - The {0} element has been deprecated. Please use the {1} element instead. - - - - - The {0} element has been deprecated. Please use the {1} or {2} element instead. - - - - - - - - Cannot update the timestamp of cached cabinet: '{0}'. If the timestamp is not updated, the build may rebuild more than is necessary. To fix the issue, ensure that the cabinet file is writable, error: {1} - - - - - - - The Payload '{0}' is embedded but included a @DownloadUrl attribute. Embedded Payloads cannot be downloaded so the download URL is being ignored. - - - - - - Bundles require a package to be either per-machine or per-user. The MSI '{0}' ALLUSERS Property is set to '2' which may change from per-user to per-machine at install time. The Bundle will assume the package is per-{1} and will not work correctly if that changes. If possible, remove the Property with Id='ALLUSERS' and use Package/@InstallScope attribute instead. - - - - - - - The MSI '{0}' does not explicitly indicate that it is a per-user package even though the ALLUSERS Property is blank. This suggests a per-user package so the Bundle will assume the package is per-user. If possible, use the Package/@InstallScope attribute to be explicit instead. - - - - - - The MSI '{0}' is a per-user package being forced to per-machine. Verify that the MsiPackage/@ForcePerMachine attribute is expected and that the per-user package works correctly when forced to install per-machine. - - - - - - The {0}/@{1} attribute value '{2}' should contain '{3}' when the {0}/@{4} attribute is set to '{5}'. - - - - - - - - - - - Component/@Id='{0}' has a @Guid value '{1}' that duplicates another component in this package. This is not officially supported by Windows Installer but works as long as all components have mutually-exclusive conditions. It is recommended to give each component its own unique GUID. - - - - - - - The RegistryKey/@Action attribute has been deprecated. In most cases, you can simply omit @Action. If you need to force Windows Installer to create an empty key or recursively delete the key, use the ForceCreateOnInstall or ForceDeleteOnUninstall attributes instead. - - - - - '{0}' is not a binary Wixlib and has no embedded files. - - - - - - Bundle dependencies will not be registered on per-machine package '{0}' for a per-user bundle. Either make sure that all packages are installed per-machine, or author any per-machine dependencies as permanent packages. - - - - - - The Container '{0}' is attached but included a @DownloadUrl attribute. Attached Containers cannot be downloaded so the download URL is being ignored. - - - - - - The {0}/@{1} attribute is reserved for future use and has no effect in this version of the WiX toolset. - - - - - - - Package/@InstallerVersion must be 500 or greater for an Arm package. The value will be changed to 500. Please specify a value of 500 or greater in order to eliminate this warning. - - - - - The {0}/@Compressed attribute must have value 'no' when a RemotePayload child element is present. RemotePayload indicates that a package will always be downloaded and cannot be compressed into a bundle. To eliminate this warning, explicitly set the {0}/@Compressed attribute to 'no'. - - - - - - All changes between the baseline and upgraded packages will be included in the patch except for any change to the ProductCode. The 'All' element is supported primarily for testing purposes and negates the benefits of patch families. - - - - - Ignoring attribute {0} because attribute {1} is set to {2}. - - - - - - - - Backslash terminate the {0}/@{1} attribute's inline directory value '{2}'. A backslash ensures a directory name will not be mistaken for a directory reference. - - - - - - - - Product version {0} in package '{1}' is not valid per the MSI SDK and cannot be represented in a bundle. It has been truncated to {2}. - - - - - - - - {0} functionality is documented in the Windows Installer SDK to "not [work] as expected." Consider replacing {0} with the WixUtilExtension ServiceConfig element. - - - - - - - - - Importing binary stream from '{0}'. - - - - - - Importing icon stream from '{0}'. - - - - - - Copying file '{0}' to '{1}'. - - - - - - - Moving file '{0}' to '{1}'. - - - - - - - The directory '{0}' does not exist, creating it now. - - - - - - The destination file '{0}' already exists, attempting to remove it. - - - - - - Cabbing file {0} from '{1}'. - - - - - - Updating file information. - - - Generating database. - - - Merging modules. - - - Creating cabinet files. - - - Importing streams. - - - Laying out media. - - - - Decompiling the {0} table. - - - - - - {0}: {1} - - - - - - - Creating cabinet '{0}'. - - - - - Validating database. - - - - Opening merge module '{0}' with language '{1}'. - - - - - - - Merging merge module '{0}'. - - - - - - Connecting merge module '{0}' to feature '{1}'. - - - - - - Resequencing files from all merge modules. - - - - Binder temporary directory located at '{0}'. - - - - - - Validator temporary directory located at '{0}'. - - - - - - Generating Burn bundle '{0}' from stub '{1}'. - - - - - - - Generating resolved manifest '{0}'. - - - - - - Loading payload '{0}' into container. - - - - - - Assigning bundle GUID '{0}'. - - - - - - Copying external payload from '{0}' to '{1}'. - - - - - - - Embedding container '{0}' ({1} bytes) with '{2}' compression. - - - - - - - - Bundle switching from per-machine to per-user due to addition of per-user package '{0}'. - - - - - - There will be '{0}' threads used to produce CAB files. - - - - - - Multiple packages cannot reliably be validated simultaneously. This validation will resume when the other package being validated has completed. - - - - - Reusing cabinet '{0}' from cabinet cache path: '{1}'. - - - - - - - Multiple Cabinets with Large Files are splitting simultaneously. This current cabinet is waiting on a shared resource and splitting will resume when the other splitting has completed. - - - - - Validation complete: {0:N0}ms elapsed. - - - - - diff --git a/src/WixToolset.Core/Exceptions/WixFileNotFoundException.cs b/src/WixToolset.Core/Exceptions/WixFileNotFoundException.cs deleted file mode 100644 index 14169c4c..00000000 --- a/src/WixToolset.Core/Exceptions/WixFileNotFoundException.cs +++ /dev/null @@ -1,52 +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 -{ - using System; - using WixToolset.Data; - - /// - /// WixException thrown when a file cannot be found. - /// - [Serializable] - public sealed class WixFileNotFoundException : WixException - { - /// - /// Instantiate a new WixFileNotFoundException. - /// - /// The file that could not be found. - public WixFileNotFoundException(string file) : this(null, file, null) - { - } - - /// - /// Instantiate a new WixFileNotFoundException. - /// - /// Source line information pertaining to the file that cannot be found. - /// The file that could not be found. - public WixFileNotFoundException(SourceLineNumber sourceLineNumbers, string file) : - base(WixErrors.FileNotFound(sourceLineNumbers, file)) - { - } - - /// - /// Instantiate a new WixFileNotFoundException. - /// - /// The file that could not be found. - /// The type of file that cannot be found. - public WixFileNotFoundException(string file, string fileType) : this(null, file, fileType) - { - } - - /// - /// Instantiate a new WixFileNotFoundException. - /// - /// Source line information pertaining to the file that cannot be found. - /// The file that could not be found. - /// The type of file that cannot be found. - public WixFileNotFoundException(SourceLineNumber sourceLineNumbers, string file, string fileType) : - base(WixErrors.FileNotFound(sourceLineNumbers, file, fileType)) - { - } - } -} diff --git a/src/WixToolset.Core/Extensibility/HeatExtension.cs b/src/WixToolset.Core/Extensibility/HeatExtension.cs index 2b4a6823..b0da75f1 100644 --- a/src/WixToolset.Core/Extensibility/HeatExtension.cs +++ b/src/WixToolset.Core/Extensibility/HeatExtension.cs @@ -123,13 +123,13 @@ namespace WixToolset.Core.Extensibility } else { - throw new WixException(WixErrors.InvalidExtension(assemblyName, innerE.Message)); + throw new WixException(ErrorMessages.InvalidExtension(assemblyName, innerE.Message)); } } } else { - throw new WixException(WixErrors.InvalidExtension(assemblyName, e.Message)); + throw new WixException(ErrorMessages.InvalidExtension(assemblyName, e.Message)); } } } @@ -143,7 +143,7 @@ namespace WixToolset.Core.Extensibility } catch (Exception e) { - throw new WixException(WixErrors.InvalidExtensionType(assemblyName, className, e.GetType().ToString(), e.Message)); + throw new WixException(ErrorMessages.InvalidExtensionType(assemblyName, className, e.GetType().ToString(), e.Message)); } } else @@ -157,7 +157,7 @@ namespace WixToolset.Core.Extensibility } else { - throw new WixException(WixErrors.InvalidExtensionType(assemblyName, typeof(AssemblyDefaultHeatExtensionAttribute).ToString())); + throw new WixException(ErrorMessages.InvalidExtensionType(assemblyName, typeof(AssemblyDefaultHeatExtensionAttribute).ToString())); } } } @@ -168,7 +168,7 @@ namespace WixToolset.Core.Extensibility } else { - throw new WixException(WixErrors.InvalidExtensionType(extension, extensionType.ToString(), typeof(HeatExtension).ToString())); + throw new WixException(ErrorMessages.InvalidExtensionType(extension, extensionType.ToString(), typeof(HeatExtension).ToString())); } } @@ -191,7 +191,7 @@ namespace WixToolset.Core.Extensibility } catch (Exception e) { - throw new WixException(WixErrors.InvalidExtension(assemblyName, e.Message)); + throw new WixException(ErrorMessages.InvalidExtension(assemblyName, e.Message)); } return extensionAssembly; diff --git a/src/WixToolset.Core/Extensibility/IHarvesterCore.cs b/src/WixToolset.Core/Extensibility/IHarvesterCore.cs index 9a6fd10c..a9001b46 100644 --- a/src/WixToolset.Core/Extensibility/IHarvesterCore.cs +++ b/src/WixToolset.Core/Extensibility/IHarvesterCore.cs @@ -2,22 +2,14 @@ namespace WixToolset { - using System; - using System.Diagnostics.CodeAnalysis; - using System.IO; - using WixToolset.Data; - using Wix = WixToolset.Data.Serialize; + using WixToolset.Extensibility.Services; /// /// The WiX Toolset harvester core. /// public interface IHarvesterCore { - /// - /// Gets whether the harvester core encountered an error while processing. - /// - /// Flag if core encountered an error during processing. - bool EncounteredError { get; } + IMessaging Messaging { get; set; } /// /// Gets or sets the value of the extension argument passed to heat. @@ -46,12 +38,6 @@ namespace WixToolset /// The generated identifier. string GenerateIdentifier(string prefix, params string[] args); - /// - /// Sends a message to the message delegate if there is one. - /// - /// Message event arguments. - void OnMessage(MessageEventArgs mea); - /// /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\". /// diff --git a/src/WixToolset.Core/Extensibility/IHeatCore.cs b/src/WixToolset.Core/Extensibility/IHeatCore.cs index 031c8132..1365dfaf 100644 --- a/src/WixToolset.Core/Extensibility/IHeatCore.cs +++ b/src/WixToolset.Core/Extensibility/IHeatCore.cs @@ -2,19 +2,11 @@ namespace WixToolset.Core.Extensibility { - using WixToolset.Data; - /// /// The WiX Toolset Harvester application core. /// public interface IHeatCore { - /// - /// Gets whether the mutator core encountered an error while processing. - /// - /// Flag if core encountered an error during processing. - bool EncounteredError { get; } - /// /// Gets the harvester. /// @@ -26,11 +18,5 @@ namespace WixToolset.Core.Extensibility /// /// The mutator. Mutator Mutator { get; } - - /// - /// Sends a message to the message delegate if there is one. - /// - /// Message event arguments. - void OnMessage(MessageEventArgs mea); } } diff --git a/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs b/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs new file mode 100644 index 00000000..5714701a --- /dev/null +++ b/src/WixToolset.Core/ExtensibilityServices/ExtensionManager.cs @@ -0,0 +1,113 @@ +// 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.ExtensibilityServices +{ + using System; + using System.Collections.Generic; + using System.IO; + using System.Linq; + using System.Reflection; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + + internal class ExtensionManager : IExtensionManager + { + private List extensionFactories = new List(); + private Dictionary> loadedExtensionsByType = new Dictionary>(); + + public void Add(Assembly extensionAssembly) + { + var types = extensionAssembly.GetTypes().Where(t => !t.IsAbstract && !t.IsInterface && typeof(IExtensionFactory).IsAssignableFrom(t)); + var factories = types.Select(t => (IExtensionFactory)Activator.CreateInstance(t)).ToList(); + + this.extensionFactories.AddRange(factories); + } + + public void Load(string extensionPath) + { + Assembly assembly; + + // Absolute path to an assembly which means only "load from" will work even though we'd prefer to + // use Assembly.Load (see the documentation for Assembly.LoadFrom why). + if (Path.IsPathRooted(extensionPath)) + { + assembly = ExtensionManager.ExtensionLoadFrom(extensionPath); + } + else if (ExtensionManager.TryExtensionLoad(extensionPath, out assembly)) + { + // Loaded the assembly by name from the probing path. + } + else if (ExtensionManager.TryExtensionLoad(Path.GetFileNameWithoutExtension(extensionPath), out assembly)) + { + // Loaded the assembly by filename alone along the probing path. + } + else // relative path to an assembly + { + // We want to use Assembly.Load when we can because it has some benefits over Assembly.LoadFrom + // (see the documentation for Assembly.LoadFrom). However, it may fail when the path is a relative + // path, so we should try Assembly.LoadFrom one last time. We could have detected a directory + // separator character and used Assembly.LoadFrom directly, but dealing with path canonicalization + // issues is something we don't want to deal with if we don't have to. + assembly = ExtensionManager.ExtensionLoadFrom(extensionPath); + } + + this.Add(assembly); + } + + public IEnumerable Create() where T : class + { + if (!this.loadedExtensionsByType.TryGetValue(typeof(T), out var extensions)) + { + extensions = new List(); + + foreach (var factory in this.extensionFactories) + { + if (factory.TryCreateExtension(typeof(T), out var obj) && obj is T extension) + { + extensions.Add(extension); + } + } + + this.loadedExtensionsByType.Add(typeof(T), extensions); + } + + return extensions.Cast().ToList(); + } + + private static Assembly ExtensionLoadFrom(string assemblyName) + { + try + { + return Assembly.LoadFrom(assemblyName); + } + catch (Exception e) + { + throw new WixException(ErrorMessages.InvalidExtension(assemblyName, e.Message), e); + } + } + + private static bool TryExtensionLoad(string assemblyName, out Assembly assembly) + { + try + { + assembly = Assembly.Load(assemblyName); + return true; + } + catch (IOException innerE) + { + if (innerE is FileLoadException || innerE is FileNotFoundException) + { + assembly = null; + return false; + } + + throw new WixException(ErrorMessages.InvalidExtension(assemblyName, innerE.Message), innerE); + } + catch (Exception e) + { + throw new WixException(ErrorMessages.InvalidExtension(assemblyName, e.Message), e); + } + } + } +} diff --git a/src/WixToolset.Core/ExtensibilityServices/Messaging.cs b/src/WixToolset.Core/ExtensibilityServices/Messaging.cs new file mode 100644 index 00000000..4510f264 --- /dev/null +++ b/src/WixToolset.Core/ExtensibilityServices/Messaging.cs @@ -0,0 +1,194 @@ +// 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.ExtensibilityServices +{ + using System; + using System.Collections.Generic; + using System.Globalization; + using System.Text; + using WixToolset.Data; + using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; + + internal class Messaging : IMessaging + { + private IMessageListener listener; + private HashSet suppressedWarnings = new HashSet(); + private HashSet warningsAsErrors = new HashSet(); + + public bool EncounteredError { get; private set; } + + public int LastErrorNumber { get; private set; } + + public bool ShowVerboseMessages { get; set; } + + public bool SuppressAllWarnings { get; set; } + + public bool WarningsAsError { get; set; } + + public void ElevateWarningMessage(int warningNumber) + { + this.warningsAsErrors.Add(warningNumber); + } + + public void SetListener(IMessageListener listener) + { + this.listener = listener; + } + + public void SuppressWarningMessage(int warningNumber) + { + this.suppressedWarnings.Add(warningNumber); + } + + public string FormatMessage(Message message) + { + var level = CalculateMessageLevel(message); + + if (level == MessageLevel.Nothing) + { + return String.Empty; + } + + var shortAppName = String.IsNullOrEmpty(this.listener?.ShortAppName) ? "WIX" : this.listener.ShortAppName; + var longAppName = String.IsNullOrEmpty(this.listener?.LongAppName) ? "WIX" : this.listener.LongAppName; + + var fileNames = new List(); + var errorFileName = longAppName; + for (var sln = message.SourceLineNumbers; null != sln; sln = sln.Parent) + { + if (String.IsNullOrEmpty(sln.FileName)) + { + continue; + } + else if (sln.LineNumber.HasValue) + { + if (fileNames.Count == 0) + { + errorFileName = String.Format(CultureInfo.CurrentUICulture, WixStrings.Format_FirstLineNumber, sln.FileName, sln.LineNumber); + } + + fileNames.Add(String.Format(CultureInfo.CurrentUICulture, WixStrings.Format_LineNumber, sln.FileName, sln.LineNumber)); + } + else + { + if (fileNames.Count == 0) + { + errorFileName = sln.FileName; + } + + fileNames.Add(sln.FileName); + } + } + + var levelString = String.Empty; + if (MessageLevel.Warning == level) + { + levelString = WixStrings.MessageType_Warning; + } + else if (MessageLevel.Error == level) + { + levelString = WixStrings.MessageType_Error; + } + + string formatted; + if (message.ResourceManager == null) + { + formatted = String.Format(CultureInfo.InvariantCulture, message.ResourceNameOrFormat, message.MessageArgs); + } + else + { + formatted = String.Format(CultureInfo.InvariantCulture, message.ResourceManager.GetString(message.ResourceNameOrFormat), message.MessageArgs); + } + + var builder = new StringBuilder(); + if (level == MessageLevel.Information || level == MessageLevel.Verbose) + { + builder.AppendFormat(WixStrings.Format_InfoMessage, formatted); + } + else + { + builder.AppendFormat(WixStrings.Format_NonInfoMessage, errorFileName, levelString, shortAppName, message.Id, formatted); + } + + if (fileNames.Count > 1) + { + builder.AppendFormat(WixStrings.INF_SourceTrace, Environment.NewLine); + + foreach (var fileName in fileNames) + { + builder.AppendFormat(WixStrings.INF_SourceTraceLocation, fileName, Environment.NewLine); + } + + builder.AppendLine(); + } + + return builder.ToString(); + } + + public void Write(Message message) + { + var level = CalculateMessageLevel(message); + + if (level == MessageLevel.Nothing) + { + return; + } + + if (level == MessageLevel.Error) + { + this.EncounteredError = true; + this.LastErrorNumber = message.Id; + } + + if (this.listener != null) + { + this.listener.Write(message); + } + else if (level == MessageLevel.Error) + { + throw new WixException(message); + } + } + + public void Write(string message, bool verbose = false) + { + if (!verbose || this.ShowVerboseMessages) + { + this.listener?.Write(message); + } + } + + /// + /// Determines the level of this message, when taking into account warning-as-error, + /// warning level, verbosity level and message suppressed by the caller. + /// + /// Event arguments for the message. + /// MessageLevel representing the level of this message. + private MessageLevel CalculateMessageLevel(Message message) + { + var level = message.Level; + + if (level == MessageLevel.Verbose) + { + if (!this.ShowVerboseMessages) + { + level = MessageLevel.Nothing; + } + } + else if (level == MessageLevel.Warning) + { + if (this.SuppressAllWarnings || this.suppressedWarnings.Contains(message.Id)) + { + level = MessageLevel.Nothing; + } + else if (this.WarningsAsError || this.warningsAsErrors.Contains(message.Id)) + { + level = MessageLevel.Error; + } + } + + return level; + } + } +} diff --git a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs index 8a67efe9..d2486890 100644 --- a/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/ParseHelper.cs @@ -34,10 +34,14 @@ namespace WixToolset.Core.ExtensibilityServices public ParseHelper(IServiceProvider serviceProvider) { this.ServiceProvider = serviceProvider; + + this.Messaging = serviceProvider.GetService(); } private IServiceProvider ServiceProvider { get; } + private IMessaging Messaging { get; } + private ITupleDefinitionCreator Creator { get; set; } public bool ContainsProperty(string possibleProperty) @@ -136,7 +140,7 @@ namespace WixToolset.Core.ExtensibilityServices // TODO: should overriding the parent identifier with a specific id be an error or a warning or just let it slide? //if (null != parentId) //{ - // this.core.OnMessage(WixErrors.Xxx(sourceLineNumbers)); + // this.core.Write(WixErrors.Xxx(sourceLineNumbers)); //} id = inlineSyntax[0].TrimEnd(':'); @@ -360,7 +364,7 @@ namespace WixToolset.Core.ExtensibilityServices if (ParseHelper.PutGuidHere.IsMatch(value)) { - Messaging.Instance.OnMessage(WixErrors.ExampleGuid(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(ErrorMessages.ExampleGuid(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); return CompilerConstants.IllegalGuid; } else if (value.StartsWith("!(loc", StringComparison.Ordinal) || value.StartsWith("$(loc", StringComparison.Ordinal) || value.StartsWith("!(wix", StringComparison.Ordinal)) @@ -374,14 +378,14 @@ namespace WixToolset.Core.ExtensibilityServices // TODO: This used to be a pedantic error, what should it be now? //if (uppercaseGuid != value) //{ - // Messaging.Instance.OnMessage(WixErrors.GuidContainsLowercaseLetters(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + // this.Messaging.Write(WixErrors.GuidContainsLowercaseLetters(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); //} return String.Concat("{", uppercaseGuid, "}"); } else { - Messaging.Instance.OnMessage(WixErrors.IllegalGuidValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(ErrorMessages.IllegalGuidValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } } @@ -391,7 +395,7 @@ namespace WixToolset.Core.ExtensibilityServices public Identifier GetAttributeIdentifier(SourceLineNumber sourceLineNumbers, XAttribute attribute) { var access = AccessModifier.Public; - var value = Common.GetAttributeValue(sourceLineNumbers, attribute, EmptyRule.CanBeEmpty); + var value = Common.GetAttributeValue(this.Messaging, sourceLineNumbers, attribute, EmptyRule.CanBeEmpty); var match = ParseHelper.LegalIdentifierWithAccess.Match(value); if (!match.Success) @@ -407,7 +411,7 @@ namespace WixToolset.Core.ExtensibilityServices if (Common.IsIdentifier(value) && 72 < value.Length) { - Messaging.Instance.OnMessage(WixWarnings.IdentifierTooLong(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(WarningMessages.IdentifierTooLong(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } return new Identifier(value, access); @@ -415,7 +419,7 @@ namespace WixToolset.Core.ExtensibilityServices public string GetAttributeIdentifierValue(SourceLineNumber sourceLineNumbers, XAttribute attribute) { - return Common.GetAttributeIdentifierValue(sourceLineNumbers, attribute); + return Common.GetAttributeIdentifierValue(this.Messaging, sourceLineNumbers, attribute); } public string[] GetAttributeInlineDirectorySyntax(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool resultUsedToCreateReference = false) @@ -432,12 +436,12 @@ namespace WixToolset.Core.ExtensibilityServices string id = result[0].TrimEnd(':'); if (1 == result.Length) { - Messaging.Instance.OnMessage(WixErrors.InlineDirectorySyntaxRequiresPath(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, id)); + this.Messaging.Write(ErrorMessages.InlineDirectorySyntaxRequiresPath(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, id)); return null; } else if (!this.IsValidIdentifier(id)) { - Messaging.Instance.OnMessage(WixErrors.IllegalIdentifier(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, id)); + this.Messaging.Write(ErrorMessages.IllegalIdentifier(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, id)); return null; } @@ -449,13 +453,13 @@ namespace WixToolset.Core.ExtensibilityServices { if (!this.IsValidLongFilename(result[0], false, false)) { - Messaging.Instance.OnMessage(WixErrors.IllegalLongFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, result[0])); + this.Messaging.Write(ErrorMessages.IllegalLongFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, result[0])); return null; } } else if (!this.IsValidIdentifier(result[0])) { - Messaging.Instance.OnMessage(WixErrors.IllegalIdentifier(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, result[0])); + this.Messaging.Write(ErrorMessages.IllegalIdentifier(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, result[0])); return null; } @@ -467,14 +471,14 @@ namespace WixToolset.Core.ExtensibilityServices { if (!this.IsValidLongFilename(result[i], false, false)) { - Messaging.Instance.OnMessage(WixErrors.IllegalLongFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, result[i])); + this.Messaging.Write(ErrorMessages.IllegalLongFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value, result[i])); return null; } } if (1 < result.Length && !value.EndsWith("\\")) { - Messaging.Instance.OnMessage(WixWarnings.BackslashTerminateInlineDirectorySyntax(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(WarningMessages.BackslashTerminateInlineDirectorySyntax(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } } @@ -483,7 +487,7 @@ namespace WixToolset.Core.ExtensibilityServices public int GetAttributeIntegerValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, int minimum, int maximum) { - return Common.GetAttributeIntegerValue(sourceLineNumbers, attribute, minimum, maximum); + return Common.GetAttributeIntegerValue(this.Messaging, sourceLineNumbers, attribute, minimum, maximum); } public string GetAttributeLongFilename(SourceLineNumber sourceLineNumbers, XAttribute attribute, bool allowWildcards, bool allowRelative) @@ -501,11 +505,11 @@ namespace WixToolset.Core.ExtensibilityServices { if (allowRelative) { - Messaging.Instance.OnMessage(WixErrors.IllegalRelativeLongFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(ErrorMessages.IllegalRelativeLongFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } else { - Messaging.Instance.OnMessage(WixErrors.IllegalLongFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(ErrorMessages.IllegalLongFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } } else if (allowRelative) @@ -513,12 +517,12 @@ namespace WixToolset.Core.ExtensibilityServices string normalizedPath = value.Replace('\\', '/'); if (normalizedPath.StartsWith("../", StringComparison.Ordinal) || normalizedPath.Contains("/../")) { - Messaging.Instance.OnMessage(WixErrors.PayloadMustBeRelativeToCache(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(ErrorMessages.PayloadMustBeRelativeToCache(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } } else if (CompilerCore.IsAmbiguousFilename(value)) { - Messaging.Instance.OnMessage(WixWarnings.AmbiguousFileOrDirectoryName(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(WarningMessages.AmbiguousFileOrDirectoryName(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } } @@ -539,11 +543,11 @@ namespace WixToolset.Core.ExtensibilityServices if (CompilerConstants.LongNotSet == longValue || CompilerConstants.IllegalLong == longValue) { - Messaging.Instance.OnMessage(WixErrors.IntegralValueSentinelCollision(sourceLineNumbers, longValue)); + this.Messaging.Write(ErrorMessages.IntegralValueSentinelCollision(sourceLineNumbers, longValue)); } else if (minimum > longValue || maximum < longValue) { - Messaging.Instance.OnMessage(WixErrors.IntegralValueOutOfRange(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, longValue, minimum, maximum)); + this.Messaging.Write(ErrorMessages.IntegralValueOutOfRange(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, longValue, minimum, maximum)); longValue = CompilerConstants.IllegalLong; } @@ -551,11 +555,11 @@ namespace WixToolset.Core.ExtensibilityServices } catch (FormatException) { - Messaging.Instance.OnMessage(WixErrors.IllegalLongValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(ErrorMessages.IllegalLongValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } catch (OverflowException) { - Messaging.Instance.OnMessage(WixErrors.IllegalLongValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(ErrorMessages.IllegalLongValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } } @@ -564,7 +568,7 @@ namespace WixToolset.Core.ExtensibilityServices public string GetAttributeValue(SourceLineNumber sourceLineNumbers, XAttribute attribute, EmptyRule emptyRule = EmptyRule.CanBeWhitespaceOnly) { - return Common.GetAttributeValue(sourceLineNumbers, attribute, emptyRule); + return Common.GetAttributeValue(this.Messaging, sourceLineNumbers, attribute, emptyRule); } public string GetAttributeVersionValue(SourceLineNumber sourceLineNumbers, XAttribute attribute) @@ -584,7 +588,7 @@ namespace WixToolset.Core.ExtensibilityServices return value; } - Messaging.Instance.OnMessage(WixErrors.IllegalVersionValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(ErrorMessages.IllegalVersionValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } return null; @@ -608,7 +612,7 @@ namespace WixToolset.Core.ExtensibilityServices return YesNoDefaultType.Default; default: - Messaging.Instance.OnMessage(WixErrors.IllegalYesNoDefaultValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(ErrorMessages.IllegalYesNoDefaultValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); return YesNoDefaultType.IllegalValue; } } @@ -628,7 +632,7 @@ namespace WixToolset.Core.ExtensibilityServices return YesNoType.No; default: - Messaging.Instance.OnMessage(WixErrors.IllegalYesNoValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); + this.Messaging.Write(ErrorMessages.IllegalYesNoValue(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); return YesNoType.IllegalValue; } } @@ -722,7 +726,7 @@ namespace WixToolset.Core.ExtensibilityServices else { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(element); - Messaging.Instance.OnMessage(WixErrors.UnhandledExtensionAttribute(sourceLineNumbers, element.Name.LocalName, attribute.Name.LocalName, attribute.Name.NamespaceName)); + this.Messaging.Write(ErrorMessages.UnhandledExtensionAttribute(sourceLineNumbers, element.Name.LocalName, attribute.Name.LocalName, attribute.Name.NamespaceName)); } } @@ -736,7 +740,7 @@ namespace WixToolset.Core.ExtensibilityServices else { var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(element); - Messaging.Instance.OnMessage(WixErrors.UnhandledExtensionElement(childSourceLineNumbers, parentElement.Name.LocalName, element.Name.LocalName, element.Name.NamespaceName)); + this.Messaging.Write(ErrorMessages.UnhandledExtensionElement(childSourceLineNumbers, parentElement.Name.LocalName, element.Name.LocalName, element.Name.NamespaceName)); } } @@ -751,7 +755,7 @@ namespace WixToolset.Core.ExtensibilityServices else { var childSourceLineNumbers = Preprocessor.GetSourceLineNumbers(element); - Messaging.Instance.OnMessage(WixErrors.UnhandledExtensionElement(childSourceLineNumbers, parentElement.Name.LocalName, element.Name.LocalName, element.Name.NamespaceName)); + this.Messaging.Write(ErrorMessages.UnhandledExtensionElement(childSourceLineNumbers, parentElement.Name.LocalName, element.Name.LocalName, element.Name.NamespaceName)); } return keyPath; @@ -775,13 +779,13 @@ namespace WixToolset.Core.ExtensibilityServices public void UnexpectedAttribute(XElement element, XAttribute attribute) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(element); - Common.UnexpectedAttribute(sourceLineNumbers, attribute); + Common.UnexpectedAttribute(this.Messaging, sourceLineNumbers, attribute); } public void UnexpectedElement(XElement parentElement, XElement childElement) { var sourceLineNumbers = Preprocessor.GetSourceLineNumbers(childElement); - Messaging.Instance.OnMessage(WixErrors.UnexpectedElement(sourceLineNumbers, parentElement.Name.LocalName, childElement.Name.LocalName)); + this.Messaging.Write(ErrorMessages.UnexpectedElement(sourceLineNumbers, parentElement.Name.LocalName, childElement.Name.LocalName)); } private void CreateTupleDefinitionCreator() diff --git a/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs b/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs index bcbd6a67..0e3e0bfd 100644 --- a/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs +++ b/src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs @@ -42,7 +42,7 @@ namespace WixToolset.Core.ExtensibilityServices { if (showWarning) { - context.Messaging.OnMessage(WixWarnings.VariableDeclarationCollision(context.CurrentSourceLineNumber, name, value, currentValue)); + context.Messaging.Write(WarningMessages.VariableDeclarationCollision(context.CurrentSourceLineNumber, name, value, currentValue)); } context.Variables[name] = value; @@ -56,7 +56,7 @@ namespace WixToolset.Core.ExtensibilityServices // Check to make sure there are 2 parts and neither is an empty string. if (2 != prefixParts.Length || 0 >= prefixParts[0].Length || 0 >= prefixParts[1].Length) { - throw new WixException(WixErrors.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, function)); + throw new WixException(ErrorMessages.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, function)); } var prefix = prefixParts[0]; @@ -65,7 +65,7 @@ namespace WixToolset.Core.ExtensibilityServices // Check to make sure there are 2 parts, neither is an empty string, and the second part ends with a closing paren. if (2 != functionParts.Length || 0 >= functionParts[0].Length || 0 >= functionParts[1].Length || !functionParts[1].EndsWith(")", StringComparison.Ordinal)) { - throw new WixException(WixErrors.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, function)); + throw new WixException(ErrorMessages.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, function)); } var functionName = functionParts[0]; @@ -113,7 +113,7 @@ namespace WixToolset.Core.ExtensibilityServices // Make sure the base version is specified if (args.Length == 0 || String.IsNullOrEmpty(args[0])) { - throw new WixException(WixErrors.InvalidPreprocessorFunctionAutoVersion(context.CurrentSourceLineNumber)); + throw new WixException(ErrorMessages.InvalidPreprocessorFunctionAutoVersion(context.CurrentSourceLineNumber)); } // Build = days since 1/1/2000; Revision = seconds since midnight / 2 @@ -137,7 +137,7 @@ namespace WixToolset.Core.ExtensibilityServices } catch (Exception e) { - throw new WixException(WixErrors.PreprocessorExtensionEvaluateFunctionFailed(context.CurrentSourceLineNumber, prefix, function, String.Join(",", args), e.Message)); + throw new WixException(ErrorMessages.PreprocessorExtensionEvaluateFunctionFailed(context.CurrentSourceLineNumber, prefix, function, String.Join(",", args), e.Message)); } } else @@ -165,7 +165,7 @@ namespace WixToolset.Core.ExtensibilityServices } else { - throw new WixException(WixErrors.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, variable)); + throw new WixException(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, variable)); } } else @@ -185,7 +185,7 @@ namespace WixToolset.Core.ExtensibilityServices } else { - throw new WixException(WixErrors.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, variable)); + throw new WixException(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, variable)); } } } @@ -220,7 +220,7 @@ namespace WixToolset.Core.ExtensibilityServices return context.CurrentSourceLineNumber.FileName; case "PLATFORM": - context.Messaging.OnMessage(WixWarnings.DeprecatedPreProcVariable(context.CurrentSourceLineNumber, "$(sys.PLATFORM)", "$(sys.BUILDARCH)")); + context.Messaging.Write(WarningMessages.DeprecatedPreProcVariable(context.CurrentSourceLineNumber, "$(sys.PLATFORM)", "$(sys.BUILDARCH)")); goto case "BUILDARCH"; @@ -260,7 +260,7 @@ namespace WixToolset.Core.ExtensibilityServices } catch (Exception e) { - throw new WixException(WixErrors.PreprocessorExtensionGetVariableValueFailed(context.CurrentSourceLineNumber, prefix, name, e.Message)); + throw new WixException(ErrorMessages.PreprocessorExtensionGetVariableValueFailed(context.CurrentSourceLineNumber, prefix, name, e.Message)); } } else @@ -277,7 +277,7 @@ namespace WixToolset.Core.ExtensibilityServices // Check to make sure there are 2 parts and neither is an empty string. if (2 != prefixParts.Length) { - throw new WixException(WixErrors.InvalidPreprocessorPragma(context.CurrentSourceLineNumber, pragmaName)); + throw new WixException(ErrorMessages.InvalidPreprocessorPragma(context.CurrentSourceLineNumber, pragmaName)); } var prefix = prefixParts[0]; @@ -285,7 +285,7 @@ namespace WixToolset.Core.ExtensibilityServices if (String.IsNullOrEmpty(prefix) || String.IsNullOrEmpty(pragma)) { - throw new WixException(WixErrors.InvalidPreprocessorPragma(context.CurrentSourceLineNumber, pragmaName)); + throw new WixException(ErrorMessages.InvalidPreprocessorPragma(context.CurrentSourceLineNumber, pragmaName)); } switch (prefix) @@ -295,7 +295,7 @@ namespace WixToolset.Core.ExtensibilityServices { // Add any core defined pragmas here default: - context.Messaging.OnMessage(WixWarnings.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); + context.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); break; } break; @@ -306,7 +306,7 @@ namespace WixToolset.Core.ExtensibilityServices { if (!extension.ProcessPragma(prefix, pragma, args, parent)) { - context.Messaging.OnMessage(WixWarnings.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); + context.Messaging.Write(WarningMessages.PreprocessorUnknownPragma(context.CurrentSourceLineNumber, pragmaName)); } } break; @@ -339,7 +339,7 @@ namespace WixToolset.Core.ExtensibilityServices currentPosition = remainder.IndexOf(')'); if (-1 == currentPosition) { - context.Messaging.OnMessage(WixErrors.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); + context.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); break; } @@ -385,12 +385,12 @@ namespace WixToolset.Core.ExtensibilityServices { if (isFunction) { - context.Messaging.OnMessage(WixErrors.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, remainder)); + context.Messaging.Write(ErrorMessages.InvalidPreprocessorFunction(context.CurrentSourceLineNumber, remainder)); break; } else { - context.Messaging.OnMessage(WixErrors.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); + context.Messaging.Write(ErrorMessages.InvalidPreprocessorVariable(context.CurrentSourceLineNumber, remainder)); break; } } @@ -410,12 +410,12 @@ namespace WixToolset.Core.ExtensibilityServices { if (isFunction) { - context.Messaging.OnMessage(WixErrors.UndefinedPreprocessorFunction(context.CurrentSourceLineNumber, subString)); + context.Messaging.Write(ErrorMessages.UndefinedPreprocessorFunction(context.CurrentSourceLineNumber, subString)); break; } else { - context.Messaging.OnMessage(WixErrors.UndefinedPreprocessorVariable(context.CurrentSourceLineNumber, subString)); + context.Messaging.Write(ErrorMessages.UndefinedPreprocessorVariable(context.CurrentSourceLineNumber, subString)); break; } } @@ -448,7 +448,7 @@ namespace WixToolset.Core.ExtensibilityServices { if (!context.Variables.Remove(name)) { - context.Messaging.OnMessage(WixErrors.CannotReundefineVariable(context.CurrentSourceLineNumber, name)); + context.Messaging.Write(ErrorMessages.CannotReundefineVariable(context.CurrentSourceLineNumber, name)); } } diff --git a/src/WixToolset.Core/ExtensionManager.cs b/src/WixToolset.Core/ExtensionManager.cs deleted file mode 100644 index 6a9d3b5a..00000000 --- a/src/WixToolset.Core/ExtensionManager.cs +++ /dev/null @@ -1,113 +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.IO; - using System.Linq; - using System.Reflection; - using WixToolset.Data; - using WixToolset.Extensibility; - using WixToolset.Extensibility.Services; - - internal class ExtensionManager : IExtensionManager - { - private List extensionFactories = new List(); - private Dictionary> loadedExtensionsByType = new Dictionary>(); - - public void Add(Assembly extensionAssembly) - { - var types = extensionAssembly.GetTypes().Where(t => !t.IsAbstract && !t.IsInterface && typeof(IExtensionFactory).IsAssignableFrom(t)); - var factories = types.Select(t => (IExtensionFactory)Activator.CreateInstance(t)).ToList(); - - this.extensionFactories.AddRange(factories); - } - - public void Load(string extensionPath) - { - Assembly assembly; - - // Absolute path to an assembly which means only "load from" will work even though we'd prefer to - // use Assembly.Load (see the documentation for Assembly.LoadFrom why). - if (Path.IsPathRooted(extensionPath)) - { - assembly = ExtensionManager.ExtensionLoadFrom(extensionPath); - } - else if (ExtensionManager.TryExtensionLoad(extensionPath, out assembly)) - { - // Loaded the assembly by name from the probing path. - } - else if (ExtensionManager.TryExtensionLoad(Path.GetFileNameWithoutExtension(extensionPath), out assembly)) - { - // Loaded the assembly by filename alone along the probing path. - } - else // relative path to an assembly - { - // We want to use Assembly.Load when we can because it has some benefits over Assembly.LoadFrom - // (see the documentation for Assembly.LoadFrom). However, it may fail when the path is a relative - // path, so we should try Assembly.LoadFrom one last time. We could have detected a directory - // separator character and used Assembly.LoadFrom directly, but dealing with path canonicalization - // issues is something we don't want to deal with if we don't have to. - assembly = ExtensionManager.ExtensionLoadFrom(extensionPath); - } - - this.Add(assembly); - } - - public IEnumerable Create() where T : class - { - if (!this.loadedExtensionsByType.TryGetValue(typeof(T), out var extensions)) - { - extensions = new List(); - - foreach (var factory in this.extensionFactories) - { - if (factory.TryCreateExtension(typeof(T), out var obj) && obj is T extension) - { - extensions.Add(extension); - } - } - - this.loadedExtensionsByType.Add(typeof(T), extensions); - } - - return extensions.Cast().ToList(); - } - - private static Assembly ExtensionLoadFrom(string assemblyName) - { - try - { - return Assembly.LoadFrom(assemblyName); - } - catch (Exception e) - { - throw new WixException(WixErrors.InvalidExtension(assemblyName, e.Message), e); - } - } - - private static bool TryExtensionLoad(string assemblyName, out Assembly assembly) - { - try - { - assembly = Assembly.Load(assemblyName); - return true; - } - catch (IOException innerE) - { - if (innerE is FileLoadException || innerE is FileNotFoundException) - { - assembly = null; - return false; - } - - throw new WixException(WixErrors.InvalidExtension(assemblyName, innerE.Message), innerE); - } - catch (Exception e) - { - throw new WixException(WixErrors.InvalidExtension(assemblyName, e.Message), e); - } - } - } -} diff --git a/src/WixToolset.Core/Harvester.cs b/src/WixToolset.Core/Harvester.cs index 0f79a2d6..b9c27418 100644 --- a/src/WixToolset.Core/Harvester.cs +++ b/src/WixToolset.Core/Harvester.cs @@ -57,7 +57,7 @@ namespace WixToolset if (null == this.harvesterExtension) { - throw new WixException(WixErrors.HarvestTypeNotFound()); + throw new WixException(ErrorMessages.HarvestTypeNotFound()); } this.harvesterExtension.Core = this.Core; diff --git a/src/WixToolset.Core/HarvesterCore.cs b/src/WixToolset.Core/HarvesterCore.cs index 87e3c33f..92a057d8 100644 --- a/src/WixToolset.Core/HarvesterCore.cs +++ b/src/WixToolset.Core/HarvesterCore.cs @@ -5,44 +5,26 @@ namespace WixToolset.Core using System; using System.Diagnostics.CodeAnalysis; using System.IO; - using WixToolset.Data; + using WixToolset.Extensibility.Services; /// /// The WiX Toolset harvester core. /// public sealed class HarvesterCore : IHarvesterCore { - private string extensionArgument; - private string rootDirectory; - - /// - /// Gets whether the harvester core encountered an error while processing. - /// - /// Flag if core encountered an error during processing. - public bool EncounteredError - { - get { return Messaging.Instance.EncounteredError; } - } + public IMessaging Messaging { get; set; } /// /// Gets or sets the value of the extension argument passed to heat. /// /// The extension argument. - public string ExtensionArgument - { - get { return this.extensionArgument; } - set { this.extensionArgument = value; } - } + public string ExtensionArgument { get; set; } /// /// Gets or sets the value of the root directory that is being harvested. /// /// The root directory being harvested. - public string RootDirectory - { - get { return this.rootDirectory; } - set { this.rootDirectory = value; } - } + public string RootDirectory { get; set; } /// /// Create an identifier based on passed file name @@ -66,15 +48,6 @@ namespace WixToolset.Core return Common.GenerateIdentifier(prefix, args); } - /// - /// Sends a message to the message delegate if there is one. - /// - /// Message event arguments. - public void OnMessage(MessageEventArgs mea) - { - Messaging.Instance.OnMessage(mea); - } - /// /// Resolves a file's path if the Wix.File.Source value starts with "SourceDir\". /// @@ -84,7 +57,7 @@ namespace WixToolset.Core { if (fileSource.StartsWith("SourceDir\\", StringComparison.Ordinal)) { - string file = Path.GetFullPath(this.rootDirectory); + string file = Path.GetFullPath(this.RootDirectory); if (File.Exists(file)) { return file; @@ -92,7 +65,7 @@ namespace WixToolset.Core else { fileSource = fileSource.Substring(10); - fileSource = Path.Combine(Path.GetFullPath(this.rootDirectory), fileSource); + fileSource = Path.Combine(Path.GetFullPath(this.RootDirectory), fileSource); } } diff --git a/src/WixToolset.Core/HeatCore.cs b/src/WixToolset.Core/HeatCore.cs index 2384a1ed..8e02a7b5 100644 --- a/src/WixToolset.Core/HeatCore.cs +++ b/src/WixToolset.Core/HeatCore.cs @@ -3,12 +3,11 @@ namespace WixToolset.Core { using WixToolset.Core.Extensibility; - using WixToolset.Data; /// /// The WiX Toolset Harvester application core. /// - public sealed class HeatCore : IHeatCore, IMessageHandler + public sealed class HeatCore : IHeatCore { private Harvester harvester; private Mutator mutator; @@ -23,15 +22,6 @@ namespace WixToolset.Core this.mutator = new Mutator(); } - /// - /// Gets whether the mutator core encountered an error while processing. - /// - /// Flag if core encountered an error during processing. - public bool EncounteredError - { - get { return Messaging.Instance.EncounteredError; } - } - /// /// Gets the harvester. /// @@ -49,14 +39,5 @@ namespace WixToolset.Core { get { return this.mutator; } } - - /// - /// Sends a message to the message delegate if there is one. - /// - /// Message event arguments. - public void OnMessage(MessageEventArgs mea) - { - Messaging.Instance.OnMessage(mea); - } } } diff --git a/src/WixToolset.Core/ICommand.cs b/src/WixToolset.Core/ICommand.cs deleted file mode 100644 index 957f735b..00000000 --- a/src/WixToolset.Core/ICommand.cs +++ /dev/null @@ -1,9 +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 -{ - internal interface ICommand - { - void Execute(); - } -} diff --git a/src/WixToolset.Core/IfDefEventHandler.cs b/src/WixToolset.Core/IfDefEventHandler.cs deleted file mode 100644 index 37a7206e..00000000 --- a/src/WixToolset.Core/IfDefEventHandler.cs +++ /dev/null @@ -1,46 +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 -{ - using System; - using System.Text; - using WixToolset.Data; - - public delegate void IfDefEventHandler(object sender, IfDefEventArgs e); - - public class IfDefEventArgs : EventArgs - { - private SourceLineNumber sourceLineNumbers; - private bool isIfDef; - private bool isDefined; - private string variableName; - - public IfDefEventArgs(SourceLineNumber sourceLineNumbers, bool isIfDef, bool isDefined, string variableName) - { - this.sourceLineNumbers = sourceLineNumbers; - this.isIfDef = isIfDef; - this.isDefined = isDefined; - this.variableName = variableName; - } - - public SourceLineNumber SourceLineNumbers - { - get { return this.sourceLineNumbers; } - } - - public bool IsDefined - { - get { return this.isDefined; } - } - - public bool IsIfDef - { - get { return this.isIfDef; } - } - - public string VariableName - { - get { return this.variableName; } - } - } -} diff --git a/src/WixToolset.Core/IncludedFileEventHandler.cs b/src/WixToolset.Core/IncludedFileEventHandler.cs deleted file mode 100644 index 57527e5c..00000000 --- a/src/WixToolset.Core/IncludedFileEventHandler.cs +++ /dev/null @@ -1,52 +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 -{ - using System; - using WixToolset.Data; - - /// - /// Included file event handler delegate. - /// - /// Sender of the message. - /// Arguments for the included file event. - public delegate void IncludedFileEventHandler(object sender, IncludedFileEventArgs e); - - /// - /// Event args for included file event. - /// - public class IncludedFileEventArgs : EventArgs - { - private SourceLineNumber sourceLineNumbers; - private string fullName; - - /// - /// Creates a new IncludedFileEventArgs. - /// - /// Source line numbers for the included file. - /// The full path of the included file. - public IncludedFileEventArgs(SourceLineNumber sourceLineNumbers, string fullName) - { - this.sourceLineNumbers = sourceLineNumbers; - this.fullName = fullName; - } - - /// - /// Gets the full path of the included file. - /// - /// The full path of the included file. - public string FullName - { - get { return this.fullName; } - } - - /// - /// Gets the source line numbers. - /// - /// The source line numbers. - public SourceLineNumber SourceLineNumbers - { - get { return this.sourceLineNumbers; } - } - } -} diff --git a/src/WixToolset.Core/IncribeContext.cs b/src/WixToolset.Core/IncribeContext.cs index 15dd3664..9e4e3602 100644 --- a/src/WixToolset.Core/IncribeContext.cs +++ b/src/WixToolset.Core/IncribeContext.cs @@ -3,8 +3,8 @@ namespace WixToolset.Core { using System; - using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; internal class InscribeContext : IInscribeContext { @@ -15,7 +15,7 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public Messaging Messaging { get; } = Messaging.Instance; + public IMessaging Messaging { get; set; } public string IntermediateFolder { get; set; } diff --git a/src/WixToolset.Core/Inscriber.cs b/src/WixToolset.Core/Inscriber.cs index 81781ad4..efe64ad2 100644 --- a/src/WixToolset.Core/Inscriber.cs +++ b/src/WixToolset.Core/Inscriber.cs @@ -8,7 +8,7 @@ namespace WixToolset /// /// Converts a wixout representation of an MSM database into a ComponentGroup the form of WiX source. /// - public sealed class Inscriber : IMessageHandler + public sealed class Inscriber { /// /// Gets or sets the temp files collection. @@ -433,10 +433,5 @@ namespace WixToolset #endif return true; } - - public void OnMessage(MessageEventArgs e) - { - Messaging.Instance.OnMessage(e); - } } } diff --git a/src/WixToolset.Core/InspectorCore.cs b/src/WixToolset.Core/InspectorCore.cs deleted file mode 100644 index 63b6af6e..00000000 --- a/src/WixToolset.Core/InspectorCore.cs +++ /dev/null @@ -1,32 +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 -{ - using System; - using WixToolset.Data; - using WixToolset.Extensibility; - - /// - /// Core facilities for inspector extensions. - /// - internal sealed class InspectorCore : IInspectorCore - { - /// - /// Gets whether an error occured. - /// - /// Whether an error occured. - public bool EncounteredError - { - get { return Messaging.Instance.EncounteredError; } - } - - /// - /// Logs a message to the log handler. - /// - /// The that contains information to log. - public void OnMessage(MessageEventArgs e) - { - Messaging.Instance.OnMessage(e); - } - } -} diff --git a/src/WixToolset.Core/Librarian.cs b/src/WixToolset.Core/Librarian.cs index 50357d8a..a64d77dd 100644 --- a/src/WixToolset.Core/Librarian.cs +++ b/src/WixToolset.Core/Librarian.cs @@ -67,7 +67,7 @@ namespace WixToolset.Core /// Library to validate. private Intermediate Validate(Intermediate library) { - FindEntrySectionAndLoadSymbolsCommand find = new FindEntrySectionAndLoadSymbolsCommand(library.Sections); + FindEntrySectionAndLoadSymbolsCommand find = new FindEntrySectionAndLoadSymbolsCommand(this.Context.Messaging, library.Sections); find.Execute(); // TODO: Consider bringing this sort of verification back. @@ -80,7 +80,7 @@ namespace WixToolset.Core // reportDupes.Execute(); // } - return (Messaging.Instance.EncounteredError ? null : library); + return (this.Context.Messaging.EncounteredError ? null : library); } private static Dictionary CollateLocalizations(IEnumerable localizations) @@ -130,7 +130,7 @@ namespace WixToolset.Core } else { - this.Context.Messaging.OnMessage(WixDataErrors.FileNotFound(tuple.SourceLineNumbers, pathField.Path, tuple.Definition.Name)); + this.Context.Messaging.Write(ErrorMessages.FileNotFound(tuple.SourceLineNumbers, pathField.Path, tuple.Definition.Name)); } } } diff --git a/src/WixToolset.Core/LibraryContext.cs b/src/WixToolset.Core/LibraryContext.cs index b3efbffa..c6278482 100644 --- a/src/WixToolset.Core/LibraryContext.cs +++ b/src/WixToolset.Core/LibraryContext.cs @@ -6,12 +6,13 @@ namespace WixToolset.Core using System.Collections.Generic; using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; public class LibraryContext : ILibraryContext { public IServiceProvider ServiceProvider { get; } - public Messaging Messaging { get; set; } + public IMessaging Messaging { get; set; } public bool BindFiles { get; set; } diff --git a/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs b/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs index 00613ca1..daf3e878 100644 --- a/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs +++ b/src/WixToolset.Core/Link/FindEntrySectionAndLoadSymbolsCommand.cs @@ -6,14 +6,18 @@ namespace WixToolset.Core.Link using System.Collections.Generic; using System.Linq; using WixToolset.Data; + using WixToolset.Extensibility.Services; - internal class FindEntrySectionAndLoadSymbolsCommand : ICommand + internal class FindEntrySectionAndLoadSymbolsCommand { - public FindEntrySectionAndLoadSymbolsCommand(IEnumerable sections) + public FindEntrySectionAndLoadSymbolsCommand(IMessaging messaging, IEnumerable sections) { + this.Messaging = messaging; this.Sections = sections; } + private IMessaging Messaging { get; } + private IEnumerable Sections { get; } /// @@ -55,7 +59,7 @@ namespace WixToolset.Core.Link //if (SectionType.Unknown != expectedEntrySectionType && section.Type != expectedEntrySectionType) //{ // string outputExtension = Output.GetExtension(this.ExpectedOutputType); - // Messaging.Instance.OnMessage(WixWarnings.UnexpectedEntrySection(section.SourceLineNumbers, section.Type.ToString(), expectedEntrySectionType.ToString(), outputExtension)); + // this.Messaging.Write(WixWarnings.UnexpectedEntrySection(section.SourceLineNumbers, section.Type.ToString(), expectedEntrySectionType.ToString(), outputExtension)); //} if (null == this.EntrySection) @@ -64,8 +68,8 @@ namespace WixToolset.Core.Link } else { - Messaging.Instance.OnMessage(WixErrors.MultipleEntrySections(this.EntrySection.Tuples.FirstOrDefault()?.SourceLineNumbers, this.EntrySection.Id, section.Id)); - Messaging.Instance.OnMessage(WixErrors.MultipleEntrySections2(section.Tuples.FirstOrDefault()?.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.MultipleEntrySections(this.EntrySection.Tuples.FirstOrDefault()?.SourceLineNumbers, this.EntrySection.Id, section.Id)); + this.Messaging.Write(ErrorMessages.MultipleEntrySections2(section.Tuples.FirstOrDefault()?.SourceLineNumbers)); } } diff --git a/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs b/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs index ac0dd7ec..23fac864 100644 --- a/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs +++ b/src/WixToolset.Core/Link/ReportConflictingSymbolsCommand.cs @@ -5,15 +5,19 @@ namespace WixToolset.Link using System.Collections.Generic; using System.Linq; using WixToolset.Data; + using WixToolset.Extensibility.Services; public class ReportConflictingSymbolsCommand { - public ReportConflictingSymbolsCommand(IEnumerable possibleConflicts, IEnumerable resolvedSections) + public ReportConflictingSymbolsCommand(IMessaging messaging, IEnumerable possibleConflicts, IEnumerable resolvedSections) { + this.Messaging = messaging; this.PossibleConflicts = possibleConflicts; this.ResolvedSections = resolvedSections; } + private IMessaging Messaging { get; } + private IEnumerable PossibleConflicts { get; } private IEnumerable ResolvedSections { get; } @@ -37,11 +41,11 @@ namespace WixToolset.Link if (actuallyReferencedDuplicateSymbols.Any()) { - Messaging.Instance.OnMessage(WixErrors.DuplicateSymbol(referencedDuplicateSymbol.Row.SourceLineNumbers, referencedDuplicateSymbol.Name)); + this.Messaging.Write(ErrorMessages.DuplicateSymbol(referencedDuplicateSymbol.Row.SourceLineNumbers, referencedDuplicateSymbol.Name)); foreach (Symbol duplicate in actuallyReferencedDuplicateSymbols) { - Messaging.Instance.OnMessage(WixErrors.DuplicateSymbol2(duplicate.Row.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.DuplicateSymbol2(duplicate.Row.SourceLineNumbers)); } } } diff --git a/src/WixToolset.Core/Link/ResolveReferencesCommand.cs b/src/WixToolset.Core/Link/ResolveReferencesCommand.cs index 266871bd..c05464e9 100644 --- a/src/WixToolset.Core/Link/ResolveReferencesCommand.cs +++ b/src/WixToolset.Core/Link/ResolveReferencesCommand.cs @@ -7,19 +7,21 @@ namespace WixToolset.Link using System.Linq; using WixToolset.Data; using WixToolset.Data.Tuples; + using WixToolset.Extensibility.Services; /// /// Resolves all the simple references in a section. /// - internal class ResolveReferencesCommand : ICommand + internal class ResolveReferencesCommand { private IntermediateSection entrySection; private IDictionary symbols; private HashSet referencedSymbols; private HashSet resolvedSections; - public ResolveReferencesCommand(IntermediateSection entrySection, IDictionary symbols) + public ResolveReferencesCommand(IMessaging messaging, IntermediateSection entrySection, IDictionary symbols) { + this.Messaging = messaging; this.entrySection = entrySection; this.symbols = symbols; } @@ -30,6 +32,8 @@ namespace WixToolset.Link public IEnumerable ResolvedSections { get { return this.resolvedSections; } } + private IMessaging Messaging { get; } + /// /// Resolves all the simple references in a section. /// @@ -69,14 +73,14 @@ namespace WixToolset.Link if (!this.symbols.TryGetValue(wixSimpleReferenceRow.SymbolicName, out var symbol)) { - Messaging.Instance.OnMessage(WixErrors.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName)); + this.Messaging.Write(ErrorMessages.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName)); } else // see if the symbol (and any of its duplicates) are appropriately accessible. { IList accessible = DetermineAccessibleSymbols(section, symbol); if (!accessible.Any()) { - Messaging.Instance.OnMessage(WixErrors.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName, symbol.Access)); + this.Messaging.Write(ErrorMessages.UnresolvedReference(wixSimpleReferenceRow.SourceLineNumbers, wixSimpleReferenceRow.SymbolicName, symbol.Access)); } else if (1 == accessible.Count) { @@ -95,16 +99,16 @@ namespace WixToolset.Link if (String.IsNullOrEmpty(referencingSourceLineNumber)) { - Messaging.Instance.OnMessage(WixErrors.DuplicateSymbol(accessibleSymbol.Row.SourceLineNumbers, accessibleSymbol.Name)); + this.Messaging.Write(ErrorMessages.DuplicateSymbol(accessibleSymbol.Row.SourceLineNumbers, accessibleSymbol.Name)); } else { - Messaging.Instance.OnMessage(WixErrors.DuplicateSymbol(accessibleSymbol.Row.SourceLineNumbers, accessibleSymbol.Name, referencingSourceLineNumber)); + this.Messaging.Write(ErrorMessages.DuplicateSymbol(accessibleSymbol.Row.SourceLineNumbers, accessibleSymbol.Name, referencingSourceLineNumber)); } foreach (Symbol accessibleDuplicate in accessible.Skip(1)) { - Messaging.Instance.OnMessage(WixErrors.DuplicateSymbol2(accessibleDuplicate.Row.SourceLineNumbers)); + this.Messaging.Write(ErrorMessages.DuplicateSymbol2(accessibleDuplicate.Row.SourceLineNumbers)); } } } diff --git a/src/WixToolset.Core/Link/WixGroupingOrdering.cs b/src/WixToolset.Core/Link/WixGroupingOrdering.cs index f15ebc75..50c4d8d2 100644 --- a/src/WixToolset.Core/Link/WixGroupingOrdering.cs +++ b/src/WixToolset.Core/Link/WixGroupingOrdering.cs @@ -11,13 +11,14 @@ namespace WixToolset.Core.Link using System.Text; using WixToolset.Data; using WixToolset.Data.Tuples; + using WixToolset.Extensibility.Services; /// /// Grouping and Ordering class of the WiX toolset. /// - internal sealed class WixGroupingOrdering : IMessageHandler + internal sealed class WixGroupingOrdering { - private IMessageHandler messageHandler; + private IMessaging messageHandler; private List groupTypes; private List itemTypes; private ItemCollection items; @@ -32,7 +33,7 @@ namespace WixToolset.Core.Link /// Handler for any error messages. /// Group types to include. /// Item types to include. - public WixGroupingOrdering(IntermediateSection entrySections, IMessageHandler messageHandler) + public WixGroupingOrdering(IntermediateSection entrySections, IMessaging messageHandler) { this.EntrySection = entrySections; this.messageHandler = messageHandler; @@ -58,29 +59,6 @@ namespace WixToolset.Core.Link this.loaded = false; } - /// - /// Sends a message to the message handler if there is one. - /// - /// Message event arguments. - public void OnMessage(MessageEventArgs e) - { - WixErrorEventArgs errorEventArgs = e as WixErrorEventArgs; - - if (null != errorEventArgs || MessageLevel.Error == e.Level) - { - this.encounteredError = true; - } - - if (null != this.messageHandler) - { - this.messageHandler.OnMessage(e); - } - else if (null != errorEventArgs) - { - throw new WixException(errorEventArgs); - } - } - /// /// Finds all nested items under a parent group and creates new WixGroup data for them. /// @@ -156,7 +134,7 @@ namespace WixToolset.Core.Link Item parentItem; if (!this.items.TryGetValue(parentType, parentId, out parentItem)) { - this.OnMessage(WixErrors.IdentifierNotFound(parentType, parentId)); + this.messageHandler.Write(ErrorMessages.IdentifierNotFound(parentType, parentId)); return; } @@ -257,7 +235,7 @@ namespace WixToolset.Core.Link //if (null == wixGroupTable || 0 == wixGroupTable.Rows.Count) //{ // // TODO: Change message name to make it *not* Bundle specific? - // this.OnMessage(WixErrors.MissingBundleInformation("WixGroup")); + // this.Write(WixErrors.MissingBundleInformation("WixGroup")); //} // Collect all of the groups @@ -326,7 +304,7 @@ namespace WixToolset.Core.Link if (this.FindCircularGroupReference(item, item, itemsSeen, out circularReference)) { itemsInKnownLoops.Add(itemsSeen); - this.OnMessage(WixErrors.ReferenceLoopDetected(item.Row.SourceLineNumbers, circularReference)); + this.messageHandler.Write(ErrorMessages.ReferenceLoopDetected(item.Row.SourceLineNumbers, circularReference)); } } } @@ -398,12 +376,12 @@ namespace WixToolset.Core.Link if (!this.items.TryGetValue(rowItemType, rowItemName, out var item)) { - this.OnMessage(WixErrors.IdentifierNotFound(rowItemType, rowItemName)); + this.messageHandler.Write(ErrorMessages.IdentifierNotFound(rowItemType, rowItemName)); } if (!this.items.TryGetValue(rowDependsOnType, rowDependsOnName, out var dependsOn)) { - this.OnMessage(WixErrors.IdentifierNotFound(rowDependsOnType, rowDependsOnName)); + this.messageHandler.Write(ErrorMessages.IdentifierNotFound(rowDependsOnType, rowDependsOnName)); } if (null == item || null == dependsOn) @@ -411,7 +389,7 @@ namespace WixToolset.Core.Link continue; } - item.AddAfter(dependsOn, this); + item.AddAfter(dependsOn, this.messageHandler); } } @@ -426,12 +404,12 @@ namespace WixToolset.Core.Link // ordering. foreach (Item item in this.items) { - item.PropagateAfterToChildItems(this); + item.PropagateAfterToChildItems(this.messageHandler); } foreach (Item item in this.items) { - item.FlattenAfters(this); + item.FlattenAfters(this.messageHandler); } } @@ -595,7 +573,7 @@ namespace WixToolset.Core.Link /// /// List of items to add. /// Message handler in case a circular ordering reference is found. - public void AddAfter(ItemCollection items, IMessageHandler messageHandler) + public void AddAfter(ItemCollection items, IMessaging messageHandler) { foreach (Item item in items) { @@ -608,7 +586,7 @@ namespace WixToolset.Core.Link /// /// Items to add. /// Message handler in case a circular ordering reference is found. - public void AddAfter(Item after, IMessageHandler messageHandler) + public void AddAfter(Item after, IMessaging messageHandler) { if (this.beforeItems.Contains(after)) { @@ -617,7 +595,7 @@ namespace WixToolset.Core.Link // have lost some distinction between authored and propagated ordering. string circularReference = String.Format(CultureInfo.InvariantCulture, "{0}:{1} -> {2}:{3} -> {0}:{1}", this.Type, this.Id, after.Type, after.Id); - messageHandler.OnMessage(WixErrors.OrderingReferenceLoopDetected(after.Row.SourceLineNumbers, circularReference)); + messageHandler.Write(ErrorMessages.OrderingReferenceLoopDetected(after.Row.SourceLineNumbers, circularReference)); return; } @@ -632,7 +610,7 @@ namespace WixToolset.Core.Link /// Because items don't know about their parent groups (and can, in fact, be in more /// than one group at a time), we need to propagate the 'afters' from each parent item to its children /// before we attempt to flatten the ordering. - public void PropagateAfterToChildItems(IMessageHandler messageHandler) + public void PropagateAfterToChildItems(IMessaging messageHandler) { if (this.ShouldItemPropagateChildOrdering()) { @@ -647,7 +625,7 @@ namespace WixToolset.Core.Link /// Flattens the ordering dependency for this item. /// /// Message handler in case a circular ordering reference is found. - public void FlattenAfters(IMessageHandler messageHandler) + public void FlattenAfters(IMessaging messageHandler) { if (this.flattenedAfterItems) { diff --git a/src/WixToolset.Core/LinkContext.cs b/src/WixToolset.Core/LinkContext.cs index 1384cf98..b4474ec5 100644 --- a/src/WixToolset.Core/LinkContext.cs +++ b/src/WixToolset.Core/LinkContext.cs @@ -17,7 +17,7 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public Messaging Messaging { get; set; } + public IMessaging Messaging { get; set; } public IEnumerable Extensions { get; set; } diff --git a/src/WixToolset.Core/Linker.cs b/src/WixToolset.Core/Linker.cs index ccf6f329..d980d79f 100644 --- a/src/WixToolset.Core/Linker.cs +++ b/src/WixToolset.Core/Linker.cs @@ -17,7 +17,7 @@ namespace WixToolset.Core /// /// Linker core of the WiX toolset. /// - public sealed class Linker : IMessageHandler + public sealed class Linker { private static readonly char[] colonCharacter = ":".ToCharArray(); private static readonly string emptyGuid = Guid.Empty.ToString("B"); @@ -129,14 +129,14 @@ namespace WixToolset.Core // First find the entry section and while processing all sections load all the symbols from all of the sections. // sections.FindEntrySectionAndLoadSymbols(false, this, expectedOutputType, out entrySection, out allSymbols); - var find = new FindEntrySectionAndLoadSymbolsCommand(sections); + var find = new FindEntrySectionAndLoadSymbolsCommand(this.Context.Messaging, sections); find.ExpectedOutputType = this.Context.ExpectedOutputType; find.Execute(); // Must have found the entry section by now. if (null == find.EntrySection) { - throw new WixException(WixErrors.MissingEntrySection(this.Context.ExpectedOutputType.ToString())); + throw new WixException(ErrorMessages.MissingEntrySection(this.Context.ExpectedOutputType.ToString())); } // Add the missing standard action symbols. @@ -144,12 +144,12 @@ namespace WixToolset.Core // Resolve the symbol references to find the set of sections we care about for linking. // Of course, we start with the entry section (that's how it got its name after all). - var resolve = new ResolveReferencesCommand(find.EntrySection, find.Symbols); + var resolve = new ResolveReferencesCommand(this.Context.Messaging, find.EntrySection, find.Symbols); resolve.BuildingMergeModule = (SectionType.Module == find.EntrySection.Type); resolve.Execute(); - if (Messaging.Instance.EncounteredError) + if (this.Context.Messaging.EncounteredError) { return null; } @@ -160,7 +160,7 @@ namespace WixToolset.Core this.FlattenSectionsComplexReferences(sections); - if (Messaging.Instance.EncounteredError) + if (this.Context.Messaging.EncounteredError) { return null; } @@ -172,7 +172,7 @@ namespace WixToolset.Core var modulesToFeatures = new ConnectToFeatureCollection(); this.ProcessComplexReferences(find.EntrySection, sections, referencedComponents, componentsToFeatures, featuresToFeatures, modulesToFeatures); - if (Messaging.Instance.EncounteredError) + if (this.Context.Messaging.EncounteredError) { return null; } @@ -182,15 +182,15 @@ namespace WixToolset.Core { if (!referencedComponents.Contains(symbol.Name)) { - this.OnMessage(WixErrors.OrphanedComponent(symbol.Row.SourceLineNumbers, symbol.Row.Id.Id)); + this.OnMessage(ErrorMessages.OrphanedComponent(symbol.Row.SourceLineNumbers, symbol.Row.Id.Id)); } } // Report duplicates that would ultimately end up being primary key collisions. - var reportDupes = new ReportConflictingSymbolsCommand(find.PossiblyConflictingSymbols, resolve.ResolvedSections); + var reportDupes = new ReportConflictingSymbolsCommand(this.Context.Messaging, find.PossiblyConflictingSymbols, resolve.ResolvedSections); reportDupes.Execute(); - if (Messaging.Instance.EncounteredError) + if (this.Context.Messaging.EncounteredError) { return null; } @@ -422,7 +422,7 @@ namespace WixToolset.Core } else if (!row.Overridable || (collidingRow.Overridable && row.Overridable)) { - this.OnMessage(WixErrors.WixVariableCollision(row.SourceLineNumbers, row.WixVariable)); + this.OnMessage(ErrorMessages.WixVariableCollision(row.SourceLineNumbers, row.WixVariable)); } } else @@ -691,7 +691,7 @@ namespace WixToolset.Core // Bundles have groups of data that must be flattened in a way different from other types. this.FlattenBundleTables(resolvedSection); - if (Messaging.Instance.EncounteredError) + if (this.Context.Messaging.EncounteredError) { return null; } @@ -702,7 +702,7 @@ namespace WixToolset.Core this.CheckOutputConsistency(output); #endif - return Messaging.Instance.EncounteredError ? null : output; + return this.Context.Messaging.EncounteredError ? null : output; } #if SOLVE_CUSTOM_TABLE @@ -1079,10 +1079,10 @@ namespace WixToolset.Core /// /// Sends a message to the message delegate if there is one. /// - /// Message event arguments. - public void OnMessage(MessageEventArgs e) + /// Message event arguments. + public void OnMessage(Message message) { - this.Context.Messaging.OnMessage(e); + this.Context.Messaging.Write(message); } /// @@ -1138,7 +1138,7 @@ namespace WixToolset.Core { if (connection.IsExplicitPrimaryFeature) { - this.OnMessage(WixErrors.MultiplePrimaryReferences(wixComplexReferenceRow.SourceLineNumbers, wixComplexReferenceRow.ChildType.ToString(), wixComplexReferenceRow.Child, wixComplexReferenceRow.ParentType.ToString(), wixComplexReferenceRow.Parent, (null != connection.PrimaryFeature ? "Feature" : "Product"), connection.PrimaryFeature ?? resolvedSection.Id)); + this.OnMessage(ErrorMessages.MultiplePrimaryReferences(wixComplexReferenceRow.SourceLineNumbers, wixComplexReferenceRow.ChildType.ToString(), wixComplexReferenceRow.Child, wixComplexReferenceRow.ParentType.ToString(), wixComplexReferenceRow.Parent, (null != connection.PrimaryFeature ? "Feature" : "Product"), connection.PrimaryFeature ?? resolvedSection.Id)); continue; } else @@ -1170,7 +1170,7 @@ namespace WixToolset.Core connection = featuresToFeatures[wixComplexReferenceRow.Child]; if (null != connection) { - this.OnMessage(WixErrors.MultiplePrimaryReferences(wixComplexReferenceRow.SourceLineNumbers, wixComplexReferenceRow.ChildType.ToString(), wixComplexReferenceRow.Child, wixComplexReferenceRow.ParentType.ToString(), wixComplexReferenceRow.Parent, (null != connection.PrimaryFeature ? "Feature" : "Product"), (null != connection.PrimaryFeature ? connection.PrimaryFeature : resolvedSection.Id))); + this.OnMessage(ErrorMessages.MultiplePrimaryReferences(wixComplexReferenceRow.SourceLineNumbers, wixComplexReferenceRow.ChildType.ToString(), wixComplexReferenceRow.Child, wixComplexReferenceRow.ParentType.ToString(), wixComplexReferenceRow.Parent, (null != connection.PrimaryFeature ? "Feature" : "Product"), (null != connection.PrimaryFeature ? connection.PrimaryFeature : resolvedSection.Id))); continue; } @@ -1187,7 +1187,7 @@ namespace WixToolset.Core { if (connection.IsExplicitPrimaryFeature) { - this.OnMessage(WixErrors.MultiplePrimaryReferences(wixComplexReferenceRow.SourceLineNumbers, wixComplexReferenceRow.ChildType.ToString(), wixComplexReferenceRow.Child, wixComplexReferenceRow.ParentType.ToString(), wixComplexReferenceRow.Parent, (null != connection.PrimaryFeature ? "Feature" : "Product"), (null != connection.PrimaryFeature ? connection.PrimaryFeature : resolvedSection.Id))); + this.OnMessage(ErrorMessages.MultiplePrimaryReferences(wixComplexReferenceRow.SourceLineNumbers, wixComplexReferenceRow.ChildType.ToString(), wixComplexReferenceRow.Child, wixComplexReferenceRow.ParentType.ToString(), wixComplexReferenceRow.Parent, (null != connection.PrimaryFeature ? "Feature" : "Product"), (null != connection.PrimaryFeature ? connection.PrimaryFeature : resolvedSection.Id))); continue; } else @@ -1214,7 +1214,7 @@ namespace WixToolset.Core case ComplexReferenceChildType.Component: if (componentsToModules.ContainsKey(wixComplexReferenceRow.Child)) { - this.OnMessage(WixErrors.ComponentReferencedTwice(wixComplexReferenceRow.SourceLineNumbers, wixComplexReferenceRow.Child)); + this.OnMessage(ErrorMessages.ComponentReferencedTwice(wixComplexReferenceRow.SourceLineNumbers, wixComplexReferenceRow.Child)); continue; } else @@ -1258,7 +1258,7 @@ namespace WixToolset.Core connection = featuresToFeatures[wixComplexReferenceRow.Child]; if (null != connection) { - this.OnMessage(WixErrors.MultiplePrimaryReferences(wixComplexReferenceRow.SourceLineNumbers, wixComplexReferenceRow.ChildType.ToString(), wixComplexReferenceRow.Child, wixComplexReferenceRow.ParentType.ToString(), wixComplexReferenceRow.Parent, (null != connection.PrimaryFeature ? "Feature" : "Product"), (null != connection.PrimaryFeature ? connection.PrimaryFeature : resolvedSection.Id))); + this.OnMessage(ErrorMessages.MultiplePrimaryReferences(wixComplexReferenceRow.SourceLineNumbers, wixComplexReferenceRow.ChildType.ToString(), wixComplexReferenceRow.Child, wixComplexReferenceRow.ParentType.ToString(), wixComplexReferenceRow.Parent, (null != connection.PrimaryFeature ? "Feature" : "Product"), (null != connection.PrimaryFeature ? connection.PrimaryFeature : resolvedSection.Id))); continue; } @@ -1443,7 +1443,7 @@ namespace WixToolset.Core // way up to present the loop as a directed graph. var loop = String.Join(" -> ", loopDetector); - this.OnMessage(WixErrors.ReferenceLoopDetected(wixComplexReferenceRow?.SourceLineNumbers, loop)); + this.OnMessage(ErrorMessages.ReferenceLoopDetected(wixComplexReferenceRow?.SourceLineNumbers, loop)); // Cleanup the parentGroupsNeedingProcessing and the loopDetector just like the // exit of this method does at the end because we are exiting early. @@ -1580,7 +1580,7 @@ namespace WixToolset.Core // will hold Payloads under UX, ChainPackages (references?) under Chain, // and ChainPackages/Payloads under the attached and any detatched // Containers. - var groups = new WixGroupingOrdering(entrySection, this); + var groups = new WixGroupingOrdering(entrySection, this.Context.Messaging); // Create UX payloads and Package payloads groups.UseTypes(new string[] { "Container", "Layout", "PackageGroup", "PayloadGroup", "Package" }, new string[] { "PackageGroup", "Package", "PayloadGroup", "Payload" }); @@ -1685,11 +1685,11 @@ namespace WixToolset.Core // display an error for the component or merge module as approrpriate if (null != multipleFeatureComponents) { - this.OnMessage(WixErrors.ComponentExpectedFeature(row.SourceLineNumbers, connectionId, row.Definition.Name, row.Id.Id)); + this.OnMessage(ErrorMessages.ComponentExpectedFeature(row.SourceLineNumbers, connectionId, row.Definition.Name, row.Id.Id)); } else { - this.OnMessage(WixErrors.MergeModuleExpectedFeature(row.SourceLineNumbers, connectionId)); + this.OnMessage(ErrorMessages.MergeModuleExpectedFeature(row.SourceLineNumbers, connectionId)); } } else @@ -1704,7 +1704,7 @@ namespace WixToolset.Core { if (!multipleFeatureComponents.Contains(connectionId)) { - this.OnMessage(WixWarnings.ImplicitComponentPrimaryFeature(connectionId)); + this.OnMessage(WarningMessages.ImplicitComponentPrimaryFeature(connectionId)); // remember this component so only one warning is generated for it multipleFeatureComponents[connectionId] = null; @@ -1712,7 +1712,7 @@ namespace WixToolset.Core } else { - this.OnMessage(WixWarnings.ImplicitMergeModulePrimaryFeature(connectionId)); + this.OnMessage(WarningMessages.ImplicitMergeModulePrimaryFeature(connectionId)); } } diff --git a/src/WixToolset.Core/Localizer.cs b/src/WixToolset.Core/Localizer.cs index 8265c026..d4f89e7a 100644 --- a/src/WixToolset.Core/Localizer.cs +++ b/src/WixToolset.Core/Localizer.cs @@ -9,6 +9,7 @@ namespace WixToolset.Core using WixToolset.Data.Rows; using WixToolset.Core.Native; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; /// /// Parses localization files and localizes database values. @@ -24,7 +25,7 @@ namespace WixToolset.Core /// /// Instantiate a new Localizer. /// - public Localizer(IEnumerable localizations) + public Localizer(IMessaging messaging, IEnumerable localizations) { this.Codepage = -1; this.variables = new Dictionary(); @@ -39,7 +40,7 @@ namespace WixToolset.Core foreach (var variable in localization.Variables) { - Localizer.AddWixVariable(this.variables, variable); + Localizer.AddWixVariable(messaging, this.variables, variable); } foreach (KeyValuePair localizedControl in localization.LocalizedControls) @@ -86,7 +87,7 @@ namespace WixToolset.Core /// Collection containing TableDefinitions to use when loading the localization file. /// Suppress xml schema validation while loading. /// Returns the loaded localization file. - public static Localization ParseLocalizationFile(string path) + public static Localization ParseLocalizationFile(IMessaging messaging, string path) { XElement root = XDocument.Load(path).Root; Localization localization = null; @@ -96,23 +97,23 @@ namespace WixToolset.Core { if (Localizer.WxlNamespace == root.Name.Namespace) { - localization = ParseWixLocalizationElement(root); + localization = ParseWixLocalizationElement(messaging, root); } else // invalid or missing namespace { if (null == root.Name.Namespace) { - Messaging.Instance.OnMessage(WixErrors.InvalidWixXmlNamespace(sourceLineNumbers, Localizer.XmlElementName, Localizer.WxlNamespace.NamespaceName)); + messaging.Write(ErrorMessages.InvalidWixXmlNamespace(sourceLineNumbers, Localizer.XmlElementName, Localizer.WxlNamespace.NamespaceName)); } else { - Messaging.Instance.OnMessage(WixErrors.InvalidWixXmlNamespace(sourceLineNumbers, Localizer.XmlElementName, root.Name.LocalName, Localizer.WxlNamespace.NamespaceName)); + messaging.Write(ErrorMessages.InvalidWixXmlNamespace(sourceLineNumbers, Localizer.XmlElementName, root.Name.LocalName, Localizer.WxlNamespace.NamespaceName)); } } } else { - Messaging.Instance.OnMessage(WixErrors.InvalidDocumentElement(sourceLineNumbers, root.Name.LocalName, "localization", Localizer.XmlElementName)); + messaging.Write(ErrorMessages.InvalidDocumentElement(sourceLineNumbers, root.Name.LocalName, "localization", Localizer.XmlElementName)); } return localization; @@ -123,7 +124,7 @@ namespace WixToolset.Core /// /// Dictionary of variable rows. /// Row to add to the variables dictionary. - private static void AddWixVariable(IDictionary variables, BindVariable wixVariableRow) + private static void AddWixVariable(IMessaging messaging, IDictionary variables, BindVariable wixVariableRow) { if (!variables.TryGetValue(wixVariableRow.Id, out var existingWixVariableRow) || (existingWixVariableRow.Overridable && !wixVariableRow.Overridable)) { @@ -131,7 +132,7 @@ namespace WixToolset.Core } else if (!wixVariableRow.Overridable) { - Messaging.Instance.OnMessage(WixErrors.DuplicateLocalizationIdentifier(wixVariableRow.SourceLineNumbers, wixVariableRow.Id)); + messaging.Write(ErrorMessages.DuplicateLocalizationIdentifier(wixVariableRow.SourceLineNumbers, wixVariableRow.Id)); } } @@ -139,7 +140,7 @@ namespace WixToolset.Core /// Parses the WixLocalization element. /// /// Element to parse. - private static Localization ParseWixLocalizationElement(XElement node) + private static Localization ParseWixLocalizationElement(IMessaging messaging, XElement node) { int codepage = -1; string culture = null; @@ -161,13 +162,13 @@ namespace WixToolset.Core // do nothing; @Language is used for locutil which can't convert Culture to lcid break; default: - Common.UnexpectedAttribute(sourceLineNumbers, attrib); + Common.UnexpectedAttribute(messaging, sourceLineNumbers, attrib); break; } } else { - Common.UnexpectedAttribute(sourceLineNumbers, attrib); + Common.UnexpectedAttribute(messaging, sourceLineNumbers, attrib); } } @@ -181,32 +182,32 @@ namespace WixToolset.Core switch (child.Name.LocalName) { case "String": - Localizer.ParseString(child, variables); + Localizer.ParseString(messaging, child, variables); break; case "UI": - Localizer.ParseUI(child, localizedControls); + Localizer.ParseUI(messaging, child, localizedControls); break; default: - Messaging.Instance.OnMessage(WixErrors.UnexpectedElement(sourceLineNumbers, node.Name.ToString(), child.Name.ToString())); + messaging.Write(ErrorMessages.UnexpectedElement(sourceLineNumbers, node.Name.ToString(), child.Name.ToString())); break; } } else { - Messaging.Instance.OnMessage(WixErrors.UnsupportedExtensionElement(sourceLineNumbers, node.Name.ToString(), child.Name.ToString())); + messaging.Write(ErrorMessages.UnsupportedExtensionElement(sourceLineNumbers, node.Name.ToString(), child.Name.ToString())); } } - return Messaging.Instance.EncounteredError ? null : new Localization(codepage, culture, variables, localizedControls); + return messaging.EncounteredError ? null : new Localization(codepage, culture, variables, localizedControls); } /// /// Parse a localization string into a WixVariableRow. /// /// Element to parse. - private static void ParseString(XElement node, IDictionary variables) + private static void ParseString(IMessaging messaging, XElement node, IDictionary variables) { string id = null; bool overridable = false; @@ -219,22 +220,22 @@ namespace WixToolset.Core switch (attrib.Name.LocalName) { case "Id": - id = Common.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + id = Common.GetAttributeIdentifierValue(messaging, sourceLineNumbers, attrib); break; case "Overridable": - overridable = YesNoType.Yes == Common.GetAttributeYesNoValue(sourceLineNumbers, attrib); + overridable = YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib); break; case "Localizable": ; // do nothing break; default: - Messaging.Instance.OnMessage(WixErrors.UnexpectedAttribute(sourceLineNumbers, attrib.Parent.Name.ToString(), attrib.Name.ToString())); + messaging.Write(ErrorMessages.UnexpectedAttribute(sourceLineNumbers, attrib.Parent.Name.ToString(), attrib.Name.ToString())); break; } } else { - Messaging.Instance.OnMessage(WixErrors.UnsupportedExtensionAttribute(sourceLineNumbers, attrib.Parent.Name.ToString(), attrib.Name.ToString())); + messaging.Write(ErrorMessages.UnsupportedExtensionAttribute(sourceLineNumbers, attrib.Parent.Name.ToString(), attrib.Name.ToString())); } } @@ -242,14 +243,14 @@ namespace WixToolset.Core if (null == id) { - Messaging.Instance.OnMessage(WixErrors.ExpectedAttribute(sourceLineNumbers, "String", "Id")); + messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, "String", "Id")); } else if (0 == id.Length) { - Messaging.Instance.OnMessage(WixErrors.IllegalIdentifier(sourceLineNumbers, "String", "Id", 0)); + messaging.Write(ErrorMessages.IllegalIdentifier(sourceLineNumbers, "String", "Id", 0)); } - if (!Messaging.Instance.EncounteredError) + if (!messaging.EncounteredError) { var variable = new BindVariable { @@ -259,7 +260,7 @@ namespace WixToolset.Core Value = value, }; - Localizer.AddWixVariable(variables, variable); + Localizer.AddWixVariable(messaging, variables, variable); } } @@ -268,7 +269,7 @@ namespace WixToolset.Core /// /// Element to parse. /// Dictionary of localized controls. - private static void ParseUI(XElement node, IDictionary localizedControls) + private static void ParseUI(IMessaging messaging, XElement node, IDictionary localizedControls) { string dialog = null; string control = null; @@ -287,49 +288,49 @@ namespace WixToolset.Core switch (attrib.Name.LocalName) { case "Dialog": - dialog = Common.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + dialog = Common.GetAttributeIdentifierValue(messaging, sourceLineNumbers, attrib); break; case "Control": - control = Common.GetAttributeIdentifierValue(sourceLineNumbers, attrib); + control = Common.GetAttributeIdentifierValue(messaging, sourceLineNumbers, attrib); break; case "X": - x = Common.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue); + x = Common.GetAttributeIntegerValue(messaging, sourceLineNumbers, attrib, 0, short.MaxValue); break; case "Y": - y = Common.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue); + y = Common.GetAttributeIntegerValue(messaging, sourceLineNumbers, attrib, 0, short.MaxValue); break; case "Width": - width = Common.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue); + width = Common.GetAttributeIntegerValue(messaging, sourceLineNumbers, attrib, 0, short.MaxValue); break; case "Height": - height = Common.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue); + height = Common.GetAttributeIntegerValue(messaging, sourceLineNumbers, attrib, 0, short.MaxValue); break; case "RightToLeft": - if (YesNoType.Yes == Common.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib)) { attribs |= MsiInterop.MsidbControlAttributesRTLRO; } break; case "RightAligned": - if (YesNoType.Yes == Common.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib)) { attribs |= MsiInterop.MsidbControlAttributesRightAligned; } break; case "LeftScroll": - if (YesNoType.Yes == Common.GetAttributeYesNoValue(sourceLineNumbers, attrib)) + if (YesNoType.Yes == Common.GetAttributeYesNoValue(messaging, sourceLineNumbers, attrib)) { attribs |= MsiInterop.MsidbControlAttributesLeftScroll; } break; default: - Common.UnexpectedAttribute(sourceLineNumbers, attrib); + Common.UnexpectedAttribute(messaging, sourceLineNumbers, attrib); break; } } else { - Common.UnexpectedAttribute(sourceLineNumbers, attrib); + Common.UnexpectedAttribute(messaging, sourceLineNumbers, attrib); } } @@ -339,24 +340,24 @@ namespace WixToolset.Core { if (MsiInterop.MsidbControlAttributesRTLRO == (attribs & MsiInterop.MsidbControlAttributesRTLRO)) { - Messaging.Instance.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.ToString(), "RightToLeft", "Control")); + messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.ToString(), "RightToLeft", "Control")); } else if (MsiInterop.MsidbControlAttributesRightAligned == (attribs & MsiInterop.MsidbControlAttributesRightAligned)) { - Messaging.Instance.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.ToString(), "RightAligned", "Control")); + messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.ToString(), "RightAligned", "Control")); } else if (MsiInterop.MsidbControlAttributesLeftScroll == (attribs & MsiInterop.MsidbControlAttributesLeftScroll)) { - Messaging.Instance.OnMessage(WixErrors.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.ToString(), "LeftScroll", "Control")); + messaging.Write(ErrorMessages.IllegalAttributeWithoutOtherAttributes(sourceLineNumbers, node.Name.ToString(), "LeftScroll", "Control")); } } if (String.IsNullOrEmpty(control) && String.IsNullOrEmpty(dialog)) { - Messaging.Instance.OnMessage(WixErrors.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.ToString(), "Dialog", "Control")); + messaging.Write(ErrorMessages.ExpectedAttributesWithOtherAttribute(sourceLineNumbers, node.Name.ToString(), "Dialog", "Control")); } - if (!Messaging.Instance.EncounteredError) + if (!messaging.EncounteredError) { LocalizedControl localizedControl = new LocalizedControl(dialog, control, x, y, width, height, attribs, text); string key = localizedControl.GetKey(); @@ -364,11 +365,11 @@ namespace WixToolset.Core { if (String.IsNullOrEmpty(localizedControl.Control)) { - Messaging.Instance.OnMessage(WixErrors.DuplicatedUiLocalization(sourceLineNumbers, localizedControl.Dialog)); + messaging.Write(ErrorMessages.DuplicatedUiLocalization(sourceLineNumbers, localizedControl.Dialog)); } else { - Messaging.Instance.OnMessage(WixErrors.DuplicatedUiLocalization(sourceLineNumbers, localizedControl.Dialog, localizedControl.Control)); + messaging.Write(ErrorMessages.DuplicatedUiLocalization(sourceLineNumbers, localizedControl.Dialog, localizedControl.Control)); } } else diff --git a/src/WixToolset.Core/Mutator.cs b/src/WixToolset.Core/Mutator.cs index f935b570..7f1af13a 100644 --- a/src/WixToolset.Core/Mutator.cs +++ b/src/WixToolset.Core/Mutator.cs @@ -71,7 +71,7 @@ namespace WixToolset.Core } finally { - encounteredError = this.Core.EncounteredError; + encounteredError = this.Core.Messaging.EncounteredError; } // return the Wix document element only if mutation completed successfully @@ -98,7 +98,7 @@ namespace WixToolset.Core wixString = mutatorExtension.Mutate(wixString); - if (String.IsNullOrEmpty(wixString) || this.Core.EncounteredError) + if (String.IsNullOrEmpty(wixString) || this.Core.Messaging.EncounteredError) { break; } @@ -106,7 +106,7 @@ namespace WixToolset.Core } finally { - encounteredError = this.Core.EncounteredError; + encounteredError = this.Core.Messaging.EncounteredError; } return encounteredError ? null : wixString; diff --git a/src/WixToolset.Core/Preprocess/IfDefEventHandler.cs b/src/WixToolset.Core/Preprocess/IfDefEventHandler.cs new file mode 100644 index 00000000..ff181d61 --- /dev/null +++ b/src/WixToolset.Core/Preprocess/IfDefEventHandler.cs @@ -0,0 +1,28 @@ +// 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.Preprocess +{ + using System; + using WixToolset.Data; + + public delegate void IfDefEventHandler(object sender, IfDefEventArgs e); + + public class IfDefEventArgs : EventArgs + { + public IfDefEventArgs(SourceLineNumber sourceLineNumbers, bool isIfDef, bool isDefined, string variableName) + { + this.SourceLineNumbers = sourceLineNumbers; + this.IsIfDef = isIfDef; + this.IsDefined = isDefined; + this.VariableName = variableName; + } + + public SourceLineNumber SourceLineNumbers { get; } + + public bool IsDefined { get; } + + public bool IsIfDef { get; } + + public string VariableName { get; } + } +} diff --git a/src/WixToolset.Core/Preprocess/IncludedFileEventHandler.cs b/src/WixToolset.Core/Preprocess/IncludedFileEventHandler.cs new file mode 100644 index 00000000..beba216d --- /dev/null +++ b/src/WixToolset.Core/Preprocess/IncludedFileEventHandler.cs @@ -0,0 +1,43 @@ +// 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.Preprocess +{ + using System; + using WixToolset.Data; + + /// + /// Included file event handler delegate. + /// + /// Sender of the message. + /// Arguments for the included file event. + public delegate void IncludedFileEventHandler(object sender, IncludedFileEventArgs e); + + /// + /// Event args for included file event. + /// + public class IncludedFileEventArgs : EventArgs + { + /// + /// Creates a new IncludedFileEventArgs. + /// + /// Source line numbers for the included file. + /// The full path of the included file. + public IncludedFileEventArgs(SourceLineNumber sourceLineNumbers, string fullName) + { + this.SourceLineNumbers = sourceLineNumbers; + this.FullName = fullName; + } + + /// + /// Gets the full path of the included file. + /// + /// The full path of the included file. + public string FullName { get; } + + /// + /// Gets the source line numbers. + /// + /// The source line numbers. + public SourceLineNumber SourceLineNumbers { get; } + } +} diff --git a/src/WixToolset.Core/Preprocess/ProcessedStreamEventHandler.cs b/src/WixToolset.Core/Preprocess/ProcessedStreamEventHandler.cs new file mode 100644 index 00000000..434590d2 --- /dev/null +++ b/src/WixToolset.Core/Preprocess/ProcessedStreamEventHandler.cs @@ -0,0 +1,43 @@ +// 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.Preprocess +{ + using System; + using System.Xml.Linq; + + /// + /// Preprocessed output stream event handler delegate. + /// + /// Sender of the message. + /// Arguments for the preprocessed stream event. + public delegate void ProcessedStreamEventHandler(object sender, ProcessedStreamEventArgs e); + + /// + /// Event args for preprocessed stream event. + /// + public class ProcessedStreamEventArgs : EventArgs + { + /// + /// Creates a new ProcessedStreamEventArgs. + /// + /// Source file that is preprocessed. + /// Preprocessed output document. + public ProcessedStreamEventArgs(string sourceFile, XDocument document) + { + this.SourceFile = sourceFile; + this.Document = document; + } + + /// + /// Gets the full path of the source file. + /// + /// The full path of the source file. + public string SourceFile { get; private set; } + + /// + /// Gets the preprocessed output stream. + /// + /// The the preprocessed output stream. + public XDocument Document { get; private set; } + } +} diff --git a/src/WixToolset.Core/Preprocess/ResolvedVariableEventHandler.cs b/src/WixToolset.Core/Preprocess/ResolvedVariableEventHandler.cs new file mode 100644 index 00000000..df3a7e6a --- /dev/null +++ b/src/WixToolset.Core/Preprocess/ResolvedVariableEventHandler.cs @@ -0,0 +1,25 @@ +// 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.Preprocess +{ + using System; + using WixToolset.Data; + + public delegate void ResolvedVariableEventHandler(object sender, ResolvedVariableEventArgs e); + + public class ResolvedVariableEventArgs : EventArgs + { + public ResolvedVariableEventArgs(SourceLineNumber sourceLineNumbers, string variableName, string variableValue) + { + this.SourceLineNumbers = sourceLineNumbers; + this.VariableName = variableName; + this.VariableValue = variableValue; + } + + public SourceLineNumber SourceLineNumbers { get; } + + public string VariableName { get; } + + public string VariableValue { get; } + } +} diff --git a/src/WixToolset.Core/PreprocessContext.cs b/src/WixToolset.Core/PreprocessContext.cs index c0acc31e..cb29d1ff 100644 --- a/src/WixToolset.Core/PreprocessContext.cs +++ b/src/WixToolset.Core/PreprocessContext.cs @@ -6,6 +6,7 @@ namespace WixToolset.Core using System.Collections.Generic; using WixToolset.Data; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; /// /// The preprocessor core. @@ -19,7 +20,7 @@ namespace WixToolset.Core public IServiceProvider ServiceProvider { get; } - public Messaging Messaging { get; set; } + public IMessaging Messaging { get; set; } public IEnumerable Extensions { get; set; } diff --git a/src/WixToolset.Core/Preprocessor.cs b/src/WixToolset.Core/Preprocessor.cs index 195ede9e..53d60c87 100644 --- a/src/WixToolset.Core/Preprocessor.cs +++ b/src/WixToolset.Core/Preprocessor.cs @@ -136,7 +136,7 @@ namespace WixToolset.Core } else { - this.Context.Messaging.OnMessage(WixErrors.DuplicateExtensionPreprocessorType(extension.GetType().ToString(), prefix, collidingExtension.GetType().ToString())); + this.Context.Messaging.Write(ErrorMessages.DuplicateExtensionPreprocessorType(extension.GetType().ToString(), prefix, collidingExtension.GetType().ToString())); } } } @@ -159,7 +159,7 @@ namespace WixToolset.Core catch (XmlException e) { this.UpdateCurrentLineNumber(reader, 0); - throw new WixException(WixErrors.InvalidXml(this.Context.CurrentSourceLineNumber, "source", e.Message)); + throw new WixException(ErrorMessages.InvalidXml(this.Context.CurrentSourceLineNumber, "source", e.Message)); } finally { @@ -347,12 +347,12 @@ namespace WixToolset.Core case "elseif": if (0 == ifStack.Count) { - throw new WixException(WixErrors.UnmatchedPreprocessorInstruction(sourceLineNumbers, "if", "elseif")); + throw new WixException(ErrorMessages.UnmatchedPreprocessorInstruction(sourceLineNumbers, "if", "elseif")); } if (IfState.If != ifContext.IfState && IfState.ElseIf != ifContext.IfState) { - throw new WixException(WixErrors.UnmatchedPreprocessorInstruction(sourceLineNumbers, "if", "elseif")); + throw new WixException(ErrorMessages.UnmatchedPreprocessorInstruction(sourceLineNumbers, "if", "elseif")); } ifContext.IfState = IfState.ElseIf; // we're now in an elseif @@ -370,12 +370,12 @@ namespace WixToolset.Core case "else": if (0 == ifStack.Count) { - throw new WixException(WixErrors.UnmatchedPreprocessorInstruction(sourceLineNumbers, "if", "else")); + throw new WixException(ErrorMessages.UnmatchedPreprocessorInstruction(sourceLineNumbers, "if", "else")); } if (IfState.If != ifContext.IfState && IfState.ElseIf != ifContext.IfState) { - throw new WixException(WixErrors.UnmatchedPreprocessorInstruction(sourceLineNumbers, "if", "else")); + throw new WixException(ErrorMessages.UnmatchedPreprocessorInstruction(sourceLineNumbers, "if", "else")); } ifContext.IfState = IfState.Else; // we're now in an else @@ -386,7 +386,7 @@ namespace WixToolset.Core case "endif": if (0 == ifStack.Count) { - throw new WixException(WixErrors.UnmatchedPreprocessorInstruction(sourceLineNumbers, "if", "endif")); + throw new WixException(ErrorMessages.UnmatchedPreprocessorInstruction(sourceLineNumbers, "if", "endif")); } ifContext = (IfContext)ifStack.Pop(); @@ -466,7 +466,7 @@ namespace WixToolset.Core break; case "endforeach": // endforeach is handled in PreprocessForeach, so seeing it here is an error - throw new WixException(WixErrors.UnmatchedPreprocessorInstruction(sourceLineNumbers, "foreach", "endforeach")); + throw new WixException(ErrorMessages.UnmatchedPreprocessorInstruction(sourceLineNumbers, "foreach", "endforeach")); case "pragma": this.PreprocessPragma(reader.Value, currentContainer); @@ -483,7 +483,7 @@ namespace WixToolset.Core { if ("Include" != reader.LocalName) { - this.Context.Messaging.OnMessage(WixErrors.InvalidDocumentElement(sourceLineNumbers, reader.Name, "include", "Include")); + this.Context.Messaging.Write(ErrorMessages.InvalidDocumentElement(sourceLineNumbers, reader.Name, "include", "Include")); } this.IncludeNextStack.Pop(); @@ -540,13 +540,13 @@ namespace WixToolset.Core if (0 != ifStack.Count) { - throw new WixException(WixErrors.NonterminatedPreprocessorInstruction(this.Context.CurrentSourceLineNumber, "if", "endif")); + throw new WixException(ErrorMessages.NonterminatedPreprocessorInstruction(this.Context.CurrentSourceLineNumber, "if", "endif")); } // TODO: can this actually happen? if (0 != containerStack.Count) { - throw new WixException(WixErrors.NonterminatedPreprocessorInstruction(this.Context.CurrentSourceLineNumber, "nodes", "nodes")); + throw new WixException(ErrorMessages.NonterminatedPreprocessorInstruction(this.Context.CurrentSourceLineNumber, "nodes", "nodes")); } } @@ -559,7 +559,7 @@ namespace WixToolset.Core // Resolve other variables in the error message. errorMessage = this.Helper.PreprocessString(this.Context, errorMessage); - throw new WixException(WixErrors.PreprocessorError(this.Context.CurrentSourceLineNumber, errorMessage)); + throw new WixException(ErrorMessages.PreprocessorError(this.Context.CurrentSourceLineNumber, errorMessage)); } /// @@ -571,7 +571,7 @@ namespace WixToolset.Core // Resolve other variables in the warning message. warningMessage = this.Helper.PreprocessString(this.Context, warningMessage); - this.Context.Messaging.OnMessage(WixWarnings.PreprocessorWarning(this.Context.CurrentSourceLineNumber, warningMessage)); + this.Context.Messaging.Write(WarningMessages.PreprocessorWarning(this.Context.CurrentSourceLineNumber, warningMessage)); } /// @@ -584,7 +584,7 @@ namespace WixToolset.Core if (!match.Success) { - throw new WixException(WixErrors.IllegalDefineStatement(this.Context.CurrentSourceLineNumber, originalDefine)); + throw new WixException(ErrorMessages.IllegalDefineStatement(this.Context.CurrentSourceLineNumber, originalDefine)); } var defineName = match.Groups["varName"].Value; @@ -645,7 +645,7 @@ namespace WixToolset.Core if (null == includeFile) { - throw new WixException(WixErrors.FileNotFound(sourceLineNumbers, includePath, "include")); + throw new WixException(ErrorMessages.FileNotFound(sourceLineNumbers, includePath, "include")); } using (XmlReader reader = XmlReader.Create(includeFile, DocumentXmlReaderSettings)) @@ -660,7 +660,7 @@ namespace WixToolset.Core catch (XmlException e) { this.UpdateCurrentLineNumber(reader, 0); - throw new WixException(WixErrors.InvalidXml(sourceLineNumbers, "source", e.Message)); + throw new WixException(ErrorMessages.InvalidXml(sourceLineNumbers, "source", e.Message)); } this.IncludedFile?.Invoke(this, new IncludedFileEventArgs(sourceLineNumbers, includeFile)); @@ -681,7 +681,7 @@ namespace WixToolset.Core var indexOfInToken = reader.Value.IndexOf(" in ", StringComparison.Ordinal); if (0 > indexOfInToken) { - throw new WixException(WixErrors.IllegalForeach(this.Context.CurrentSourceLineNumber, reader.Value)); + throw new WixException(ErrorMessages.IllegalForeach(this.Context.CurrentSourceLineNumber, reader.Value)); } // parse out the variable name @@ -751,7 +751,7 @@ namespace WixToolset.Core } else if (reader.NodeType == XmlNodeType.None) { - throw new WixException(WixErrors.ExpectedEndforeach(this.Context.CurrentSourceLineNumber)); + throw new WixException(ErrorMessages.ExpectedEndforeach(this.Context.CurrentSourceLineNumber)); } reader.Read(); @@ -773,7 +773,7 @@ namespace WixToolset.Core catch (XmlException e) { this.UpdateCurrentLineNumber(loopReader, offset); - throw new WixException(WixErrors.InvalidXml(this.Context.CurrentSourceLineNumber, "source", e.Message)); + throw new WixException(ErrorMessages.InvalidXml(this.Context.CurrentSourceLineNumber, "source", e.Message)); } fragmentStream.Position = 0; // seek back to the beginning for the next loop. @@ -791,7 +791,7 @@ namespace WixToolset.Core if (!match.Success) { - throw new WixException(WixErrors.InvalidPreprocessorPragma(this.Context.CurrentSourceLineNumber, pragmaText)); + throw new WixException(ErrorMessages.InvalidPreprocessorPragma(this.Context.CurrentSourceLineNumber, pragmaText)); } // resolve other variables in the pragma argument(s) @@ -803,7 +803,7 @@ namespace WixToolset.Core } catch (Exception e) { - throw new WixException(WixErrors.PreprocessorExtensionPragmaFailed(this.Context.CurrentSourceLineNumber, pragmaText, e.Message)); + throw new WixException(ErrorMessages.PreprocessorExtensionPragmaFailed(this.Context.CurrentSourceLineNumber, pragmaText, e.Message)); } } @@ -830,7 +830,7 @@ namespace WixToolset.Core int endingQuotes = expression.IndexOf('\"', 1); if (-1 == endingQuotes) { - throw new WixException(WixErrors.UnmatchedQuotesInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.UnmatchedQuotesInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); } // cut the quotes off the string @@ -864,7 +864,7 @@ namespace WixToolset.Core if (-1 == endingParen) { - throw new WixException(WixErrors.UnmatchedParenthesisInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.UnmatchedParenthesisInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); } token = expression.Substring(0, endingParen + 1); @@ -981,12 +981,12 @@ namespace WixToolset.Core else if (variable.IndexOf("(", StringComparison.Ordinal) != -1 || variable.IndexOf(")", StringComparison.Ordinal) != -1) { // make sure it doesn't contain parenthesis - throw new WixException(WixErrors.UnmatchedParenthesisInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.UnmatchedParenthesisInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); } else if (variable.IndexOf("\"", StringComparison.Ordinal) != -1) { // shouldn't contain quotes - throw new WixException(WixErrors.UnmatchedQuotesInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.UnmatchedQuotesInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); } return varValue; @@ -1017,7 +1017,7 @@ namespace WixToolset.Core { if (stringLiteral) { - throw new WixException(WixErrors.UnmatchedQuotesInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.UnmatchedQuotesInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); } rightValue = this.GetNextToken(originalExpression, ref expression, out stringLiteral); @@ -1068,7 +1068,7 @@ namespace WixToolset.Core { if (operation.Length > 0) { - throw new WixException(WixErrors.ExpectedVariable(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.ExpectedVariable(this.Context.CurrentSourceLineNumber, originalExpression)); } // false expression @@ -1083,7 +1083,7 @@ namespace WixToolset.Core } else { - throw new WixException(WixErrors.UnexpectedLiteral(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.UnexpectedLiteral(this.Context.CurrentSourceLineNumber, originalExpression)); } } else @@ -1123,11 +1123,11 @@ namespace WixToolset.Core } catch (FormatException) { - throw new WixException(WixErrors.IllegalIntegerInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.IllegalIntegerInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); } catch (OverflowException) { - throw new WixException(WixErrors.IllegalIntegerInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.IllegalIntegerInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); } // Compare the numbers @@ -1169,7 +1169,7 @@ namespace WixToolset.Core closeParenIndex = expression.IndexOf(')', closeParenIndex); if (closeParenIndex == -1) { - throw new WixException(WixErrors.UnmatchedParenthesisInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.UnmatchedParenthesisInExpression(this.Context.CurrentSourceLineNumber, originalExpression)); } if (InsideQuotes(expression, closeParenIndex)) @@ -1218,7 +1218,7 @@ namespace WixToolset.Core currentValue = !currentValue; break; default: - throw new WixException(WixErrors.UnexpectedPreprocessorOperator(this.Context.CurrentSourceLineNumber, operation.ToString())); + throw new WixException(ErrorMessages.UnexpectedPreprocessorOperator(this.Context.CurrentSourceLineNumber, operation.ToString())); } } @@ -1267,7 +1267,7 @@ namespace WixToolset.Core expression = expression.Trim(); if (expression.Length == 0) { - throw new WixException(WixErrors.UnexpectedEmptySubexpression(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.UnexpectedEmptySubexpression(this.Context.CurrentSourceLineNumber, originalExpression)); } // If the expression starts with parenthesis, evaluate it @@ -1288,7 +1288,7 @@ namespace WixToolset.Core expression = expression.Substring(3).Trim(); if (expression.Length == 0) { - throw new WixException(WixErrors.ExpectedExpressionAfterNot(this.Context.CurrentSourceLineNumber, originalExpression)); + throw new WixException(ErrorMessages.ExpectedExpressionAfterNot(this.Context.CurrentSourceLineNumber, originalExpression)); } expressionValue = this.EvaluateExpressionRecurse(originalExpression, ref expression, PreprocessorOperation.Not, true); @@ -1317,7 +1317,7 @@ namespace WixToolset.Core } else { - throw new WixException(WixErrors.InvalidSubExpression(this.Context.CurrentSourceLineNumber, expression, originalExpression)); + throw new WixException(ErrorMessages.InvalidSubExpression(this.Context.CurrentSourceLineNumber, expression, originalExpression)); } } @@ -1351,7 +1351,7 @@ namespace WixToolset.Core { if (1023 < this.CurrentFileStack.Count) { - throw new WixException(WixErrors.TooDeeplyIncluded(this.Context.CurrentSourceLineNumber, this.CurrentFileStack.Count)); + throw new WixException(ErrorMessages.TooDeeplyIncluded(this.Context.CurrentSourceLineNumber, this.CurrentFileStack.Count)); } this.CurrentFileStack.Push(fileName); diff --git a/src/WixToolset.Core/ProcessedStreamEventHandler.cs b/src/WixToolset.Core/ProcessedStreamEventHandler.cs deleted file mode 100644 index de6b5d1f..00000000 --- a/src/WixToolset.Core/ProcessedStreamEventHandler.cs +++ /dev/null @@ -1,43 +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 -{ - using System; - using System.Xml.Linq; - - /// - /// Preprocessed output stream event handler delegate. - /// - /// Sender of the message. - /// Arguments for the preprocessed stream event. - public delegate void ProcessedStreamEventHandler(object sender, ProcessedStreamEventArgs e); - - /// - /// Event args for preprocessed stream event. - /// - public class ProcessedStreamEventArgs : EventArgs - { - /// - /// Creates a new ProcessedStreamEventArgs. - /// - /// Source file that is preprocessed. - /// Preprocessed output document. - public ProcessedStreamEventArgs(string sourceFile, XDocument document) - { - this.SourceFile = sourceFile; - this.Document = document; - } - - /// - /// Gets the full path of the source file. - /// - /// The full path of the source file. - public string SourceFile { get; private set; } - - /// - /// Gets the preprocessed output stream. - /// - /// The the preprocessed output stream. - public XDocument Document { get; private set; } - } -} diff --git a/src/WixToolset.Core/ResolvedVariableEventHandler.cs b/src/WixToolset.Core/ResolvedVariableEventHandler.cs deleted file mode 100644 index 232ad9e4..00000000 --- a/src/WixToolset.Core/ResolvedVariableEventHandler.cs +++ /dev/null @@ -1,39 +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 -{ - using System; - using System.Text; - using WixToolset.Data; - - public delegate void ResolvedVariableEventHandler(object sender, ResolvedVariableEventArgs e); - - public class ResolvedVariableEventArgs : EventArgs - { - private SourceLineNumber sourceLineNumbers; - private string variableName; - private string variableValue; - - public ResolvedVariableEventArgs(SourceLineNumber sourceLineNumbers, string variableName, string variableValue) - { - this.sourceLineNumbers = sourceLineNumbers; - this.variableName = variableName; - this.variableValue = variableValue; - } - - public SourceLineNumber SourceLineNumbers - { - get { return this.sourceLineNumbers; } - } - - public string VariableName - { - get { return this.variableName; } - } - - public string VariableValue - { - get { return this.variableValue; } - } - } -} diff --git a/src/WixToolset.Core/SourceFile.cs b/src/WixToolset.Core/SourceFile.cs index 3b1e386a..f1064513 100644 --- a/src/WixToolset.Core/SourceFile.cs +++ b/src/WixToolset.Core/SourceFile.cs @@ -15,7 +15,5 @@ namespace WixToolset.Core public string OutputPath { get; set; } public string SourcePath { get; set; } - - public Stream Stream { get; set; } } } diff --git a/src/WixToolset.Core/Util.cs b/src/WixToolset.Core/Util.cs deleted file mode 100644 index 5950fe0a..00000000 --- a/src/WixToolset.Core/Util.cs +++ /dev/null @@ -1,17 +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 -{ - using System; - - /// - /// Common Wix utility methods and types. - /// - public sealed class Util - { - /// - /// Set by WixToolTasks to indicate WIX is running inside MSBuild - /// - public static bool RunningInMsBuild { get; set; } - } -} diff --git a/src/WixToolset.Core/Uuid.cs b/src/WixToolset.Core/Uuid.cs index d512d92f..0501c285 100644 --- a/src/WixToolset.Core/Uuid.cs +++ b/src/WixToolset.Core/Uuid.cs @@ -10,15 +10,8 @@ namespace WixToolset /// /// Implementation of RFC 4122 - A Universally Unique Identifier (UUID) URN Namespace. /// - public sealed class Uuid + public static class Uuid { - /// - /// Protect the constructor. - /// - private Uuid() - { - } - /// /// Creates a version 3 name-based UUID. /// diff --git a/src/WixToolset.Core/WixFileNotFoundException.cs b/src/WixToolset.Core/WixFileNotFoundException.cs new file mode 100644 index 00000000..7bffe417 --- /dev/null +++ b/src/WixToolset.Core/WixFileNotFoundException.cs @@ -0,0 +1,44 @@ +// 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 +{ + using System; + using WixToolset.Data; + + /// + /// WixException thrown when a file cannot be found. + /// + [Serializable] + public sealed class WixFileNotFoundException : WixException + { + /// + /// Instantiate a new WixFileNotFoundException. + /// + /// Source line information pertaining to the file that cannot be found. + /// The file that could not be found. + public WixFileNotFoundException(SourceLineNumber sourceLineNumbers, string file) : + base(ErrorMessages.FileNotFound(sourceLineNumbers, file)) + { + } + + /// + /// Instantiate a new WixFileNotFoundException. + /// + /// The file that could not be found. + /// The type of file that cannot be found. + public WixFileNotFoundException(string file, string fileType) : this(null, file, fileType) + { + } + + /// + /// Instantiate a new WixFileNotFoundException. + /// + /// Source line information pertaining to the file that cannot be found. + /// The file that could not be found. + /// The type of file that cannot be found. + public WixFileNotFoundException(SourceLineNumber sourceLineNumbers, string file, string fileType) : + base(ErrorMessages.FileNotFound(sourceLineNumbers, file, fileType)) + { + } + } +} diff --git a/src/WixToolset.Core/WixGenericMessageEventArgs.cs b/src/WixToolset.Core/WixGenericMessageEventArgs.cs deleted file mode 100644 index 2c1d4705..00000000 --- a/src/WixToolset.Core/WixGenericMessageEventArgs.cs +++ /dev/null @@ -1,45 +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 -{ - using System; - using System.Resources; - using WixToolset.Data; - - /// - /// Generic event args for message events. - /// - public class WixGenericMessageEventArgs : MessageEventArgs - { - /// - /// Creates a new generc message event arg. - /// - /// Source line numbers for the message. - /// Id for the message. - /// Level for the message. - /// Format message for arguments. - /// Arguments for the format string. - public WixGenericMessageEventArgs(SourceLineNumber sourceLineNumbers, int id, MessageLevel level, string format, params object[] messageArgs) - : base(sourceLineNumbers, id, format, messageArgs) - { - base.Level = level; - base.ResourceManager = new GenericResourceManager(); - } - - /// - /// Private resource manager to return our format message as the "localized" string untouched. - /// - private class GenericResourceManager : ResourceManager - { - /// - /// Passes the "resource name" through as the format string. - /// - /// Format message that is passed in as the resource name. - /// The name. - public override string GetString(string name) - { - return name; - } - } - } -} diff --git a/src/WixToolset.Core/WixStrings.Designer.cs b/src/WixToolset.Core/WixStrings.Designer.cs index 36e64267..ab98ed6a 100644 --- a/src/WixToolset.Core/WixStrings.Designer.cs +++ b/src/WixToolset.Core/WixStrings.Designer.cs @@ -37,102 +37,7 @@ namespace WixToolset { return resourceMan; } } - - /// - /// Overrides the current thread's CurrentUICulture property for all - /// resource lookups using this strongly typed resource class. - /// - [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] - internal static global::System.Globalization.CultureInfo Culture { - get { - return resourceCulture; - } - set { - resourceCulture = value; - } - } - - /// - /// Looks up a localized string similar to Cannot index into a FileRowCollection that allows duplicate FileIds. - /// - internal static string EXP_CannotIndexIntoFileRowCollection { - get { - return ResourceManager.GetString("EXP_CannotIndexIntoFileRowCollection", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The value '{0}' is not a legal identifier and therefore cannot be modularized.. - /// - internal static string EXP_CannotModularizeIllegalID { - get { - return ResourceManager.GetString("EXP_CannotModularizeIllegalID", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot set column '{0}' with value {1} because it is greater than the maximum allowed value for this column, {2}.. - /// - internal static string EXP_CannotSetColumnWithValueGreaterThanMaxValue { - get { - return ResourceManager.GetString("EXP_CannotSetColumnWithValueGreaterThanMaxValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot set column '{0}' with value {1} because it is less than the minimum allowed value for this column, {2}.. - /// - internal static string EXP_CannotSetColumnWithValueLessThanMinValue { - get { - return ResourceManager.GetString("EXP_CannotSetColumnWithValueLessThanMinValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A Merge table FileCompression column cannot be set to the invalid value '{0}'.. - /// - internal static string EXP_CannotSetMergeTableFileCompressionColumnToInvalidValue { - get { - return ResourceManager.GetString("EXP_CannotSetMergeTableFileCompressionColumnToInvalidValue", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot set column '{0}' with a null value because this is a required field.. - /// - internal static string EXP_CannotSetNullOnRequiredField { - get { - return ResourceManager.GetString("EXP_CannotSetNullOnRequiredField", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot set number column '{0}' with a value of type '{1}'.. - /// - internal static string EXP_CannotSetNumberColumnWithValueOfType { - get { - return ResourceManager.GetString("EXP_CannotSetNumberColumnWithValueOfType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Cannot set string column '{0}' with a value of type '{1}'.. - /// - internal static string EXP_CannotSetStringColumnWithValueOfType { - get { - return ResourceManager.GetString("EXP_CannotSetStringColumnWithValueOfType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Could not determine ProductCode from transform summary information. - /// - public static string EXP_CouldnotDetermineProductCodeFromTransformSummaryInfo { - get { - return ResourceManager.GetString("EXP_CouldnotDetermineProductCodeFromTransformSummaryInfo", resourceCulture); - } - } - + /// /// Looks up a localized string similar to Could not find a unique identifier for the given resource name.. /// @@ -142,24 +47,6 @@ namespace WixToolset { } } - /// - /// Looks up a localized string similar to Didn't find duplicated symbol.. - /// - internal static string EXP_DidnotFindDuplicateSymbol { - get { - return ResourceManager.GetString("EXP_DidnotFindDuplicateSymbol", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Expected ComplexReference type.. - /// - internal static string EXP_ExpectedComplexReferenceType { - get { - return ResourceManager.GetString("EXP_ExpectedComplexReferenceType", resourceCulture); - } - } - /// /// Looks up a localized string similar to Found an ActionRow with a non-existent {0} action: {1}.. /// @@ -178,33 +65,6 @@ namespace WixToolset { } } - /// - /// Looks up a localized string similar to Illegal arguments passed.. - /// - internal static string EXP_IllegalArgumentsPassed { - get { - return ResourceManager.GetString("EXP_IllegalArgumentsPassed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Invalid table name passed into GenerateIdentifier.. - /// - internal static string EXP_InvalidTableNamePassed { - get { - return ResourceManager.GetString("EXP_InvalidTableNamePassed", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to A Merge table FileCompression column contains an invalid value '{0}'.. - /// - internal static string EXP_MergeTableFileCompressionColumnContainsInvalidValue { - get { - return ResourceManager.GetString("EXP_MergeTableFileCompressionColumnContainsInvalidValue", resourceCulture); - } - } - /// /// Looks up a localized string similar to Multiple harvester extensions specified.. /// @@ -214,24 +74,6 @@ namespace WixToolset { } } - /// - /// Looks up a localized string similar to The other object is not a FileRow.. - /// - internal static string EXP_OtherObjectIsNotFileRow { - get { - return ResourceManager.GetString("EXP_OtherObjectIsNotFileRow", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Transform authored into multiple Media '{0}' and '{1}'.. - /// - public static string EXP_TransformAuthoredIntoMultipleMedia { - get { - return ResourceManager.GetString("EXP_TransformAuthoredIntoMultipleMedia", resourceCulture); - } - } - /// /// Looks up a localized string similar to Unexpected complex reference child type: {0}. /// @@ -268,78 +110,6 @@ namespace WixToolset { } } - /// - /// Looks up a localized string similar to Unknown control attribute: '{0}'.. - /// - internal static string EXP_UnknowControlAttribute { - get { - return ResourceManager.GetString("EXP_UnknowControlAttribute", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown column type: {0}. - /// - internal static string EXP_UnknownColumnType { - get { - return ResourceManager.GetString("EXP_UnknownColumnType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown compression level type: {0}. - /// - internal static string EXP_UnknownCompressionLevelType { - get { - return ResourceManager.GetString("EXP_UnknownCompressionLevelType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown custom column category '{0}'.. - /// - internal static string EXP_UnknownCustomColumnCategory { - get { - return ResourceManager.GetString("EXP_UnknownCustomColumnCategory", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown custom column modularization type '{0}'.. - /// - internal static string EXP_UnknownCustomColumnModularizationType { - get { - return ResourceManager.GetString("EXP_UnknownCustomColumnModularizationType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown custom column type '{0}'.. - /// - internal static string EXP_UnknownCustomColumnType { - get { - return ResourceManager.GetString("EXP_UnknownCustomColumnType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown output type.. - /// - internal static string EXP_UnknownOutputType { - get { - return ResourceManager.GetString("EXP_UnknownOutputType", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Unknown permission attribute '{0}'.. - /// - internal static string EXP_UnknownPermissionAttribute { - get { - return ResourceManager.GetString("EXP_UnknownPermissionAttribute", resourceCulture); - } - } - /// /// Looks up a localized string similar to Unknown platform enumeration '{0}' encountered.. /// @@ -349,24 +119,6 @@ namespace WixToolset { } } - /// - /// Looks up a localized string similar to Unknown sequence table.. - /// - internal static string EXP_UnknowSequenceTable { - get { - return ResourceManager.GetString("EXP_UnknowSequenceTable", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to The table {0} is not supported.. - /// - internal static string EXP_UnsupportedTable { - get { - return ResourceManager.GetString("EXP_UnsupportedTable", resourceCulture); - } - } - /// /// Looks up a localized string similar to {0}({1}). /// diff --git a/src/WixToolset.Core/WixStrings.resx b/src/WixToolset.Core/WixStrings.resx index 3fbf639e..47402f59 100644 --- a/src/WixToolset.Core/WixStrings.resx +++ b/src/WixToolset.Core/WixStrings.resx @@ -117,39 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Cannot index into a FileRowCollection that allows duplicate FileIds - - - The value '{0}' is not a legal identifier and therefore cannot be modularized. - - - Cannot set column '{0}' with value {1} because it is greater than the maximum allowed value for this column, {2}. - - - Cannot set column '{0}' with value {1} because it is less than the minimum allowed value for this column, {2}. - - - A Merge table FileCompression column cannot be set to the invalid value '{0}'. - - - Cannot set column '{0}' with a null value because this is a required field. - - - Cannot set number column '{0}' with a value of type '{1}'. - - - Cannot set string column '{0}' with a value of type '{1}'. - - - Could not determine ProductCode from transform summary information - Could not find a unique identifier for the given resource name. - - Didn't find duplicated symbol. - Expected ComplexReference type. @@ -159,24 +129,9 @@ Found an ActionRow with no Sequence, Before, or After column set. - - Illegal arguments passed. - - - Invalid table name passed into GenerateIdentifier. - - - A Merge table FileCompression column contains an invalid value '{0}'. - Multiple harvester extensions specified. - - The other object is not a FileRow. - - - Transform authored into multiple Media '{0}' and '{1}'. - Unexpected complex reference child type: {0} @@ -189,39 +144,9 @@ Encountered an unexpected merge error of type '{0}' for which there is currently no error message to display. More information about the merge and the failure can be found in the merge log: '{1}' - - Unknown control attribute: '{0}'. - - - Unknown column type: {0} - - - Unknown compression level type: {0} - - - Unknown custom column category '{0}'. - - - Unknown custom column modularization type '{0}'. - - - Unknown custom column type '{0}'. - - - Unknown output type. - - - Unknown permission attribute '{0}'. - - - Unknown sequence table. - Unknown platform enumeration '{0}' encountered. - - The table {0} is not supported. - {0}({1}) diff --git a/src/WixToolset.Core/WixToolsetServiceProvider.cs b/src/WixToolset.Core/WixToolsetServiceProvider.cs index c77f3813..995daa89 100644 --- a/src/WixToolset.Core/WixToolsetServiceProvider.cs +++ b/src/WixToolset.Core/WixToolsetServiceProvider.cs @@ -11,6 +11,7 @@ namespace WixToolset.Core public class WixToolsetServiceProvider : IServiceProvider { private ExtensionManager extensionManager; + private Messaging messaging; private ParseHelper parseHelper; private PreprocessHelper preprocessHelper; private TupleDefinitionCreator tupleDefinitionCreator; @@ -62,6 +63,11 @@ namespace WixToolset.Core return this.extensionManager = this.extensionManager ?? new ExtensionManager(); } + if (serviceType == typeof(IMessaging)) + { + return this.messaging = this.messaging ?? new Messaging(); + } + if (serviceType == typeof(ITupleDefinitionCreator)) { return this.tupleDefinitionCreator = this.tupleDefinitionCreator ?? new TupleDefinitionCreator(this); diff --git a/src/WixToolset.Core/WixVariableResolver.cs b/src/WixToolset.Core/WixVariableResolver.cs index c4572d33..f8bccef0 100644 --- a/src/WixToolset.Core/WixVariableResolver.cs +++ b/src/WixToolset.Core/WixVariableResolver.cs @@ -11,6 +11,7 @@ namespace WixToolset.Core using WixToolset.Data; using WixToolset.Data.Tuples; using WixToolset.Extensibility; + using WixToolset.Extensibility.Services; /// /// WiX variable resolver. @@ -22,16 +23,15 @@ namespace WixToolset.Core /// /// Instantiate a new WixVariableResolver. /// - public WixVariableResolver(Localizer localizer = null) + public WixVariableResolver(IMessaging messaging, Localizer localizer = null) { this.wixVariables = new Dictionary(); + this.Messaging = messaging; this.Localizer = localizer; } - /// - /// Gets or sets the localizer. - /// - /// The localizer. + private IMessaging Messaging { get; } + private Localizer Localizer { get; } /// @@ -52,7 +52,7 @@ namespace WixToolset.Core } catch (ArgumentException) { - Messaging.Instance.OnMessage(WixErrors.WixVariableCollision(null, name)); + this.Messaging.Write(ErrorMessages.WixVariableCollision(null, name)); } } @@ -70,7 +70,7 @@ namespace WixToolset.Core { if (!wixVariableRow.Overridable) // collision { - Messaging.Instance.OnMessage(WixErrors.WixVariableCollision(wixVariableRow.SourceLineNumbers, wixVariableRow.WixVariable)); + this.Messaging.Write(ErrorMessages.WixVariableCollision(wixVariableRow.SourceLineNumbers, wixVariableRow.WixVariable)); } } } @@ -153,7 +153,7 @@ namespace WixToolset.Core // localization variables to not support inline default values if ("loc" == variableNamespace) { - Messaging.Instance.OnMessage(WixErrors.IllegalInlineLocVariable(sourceLineNumbers, variableId, variableDefaultValue)); + this.Messaging.Write(ErrorMessages.IllegalInlineLocVariable(sourceLineNumbers, variableId, variableDefaultValue)); } } @@ -183,7 +183,7 @@ namespace WixToolset.Core // warn about deprecated syntax of $(loc.var) if ('$' == sb[matches[i].Index]) { - Messaging.Instance.OnMessage(WixWarnings.DeprecatedLocalizationVariablePrefix(sourceLineNumbers, variableId)); + this.Messaging.Write(WarningMessages.DeprecatedLocalizationVariablePrefix(sourceLineNumbers, variableId)); } resolvedValue = this.Localizer?.GetLocalizedValue(variableId); @@ -193,7 +193,7 @@ namespace WixToolset.Core // illegal syntax of $(wix.var) if ('$' == sb[matches[i].Index]) { - Messaging.Instance.OnMessage(WixErrors.IllegalWixVariablePrefix(sourceLineNumbers, variableId)); + this.Messaging.Write(ErrorMessages.IllegalWixVariablePrefix(sourceLineNumbers, variableId)); } else { @@ -225,11 +225,11 @@ namespace WixToolset.Core } else if ("loc" == variableNamespace && errorOnUnknown) // unresolved loc variable { - Messaging.Instance.OnMessage(WixErrors.LocalizationVariableUnknown(sourceLineNumbers, variableId)); + this.Messaging.Write(ErrorMessages.LocalizationVariableUnknown(sourceLineNumbers, variableId)); } else if (!localizationOnly && "wix" == variableNamespace && errorOnUnknown) // unresolved wix variable { - Messaging.Instance.OnMessage(WixErrors.WixVariableUnknown(sourceLineNumbers, variableId)); + this.Messaging.Write(ErrorMessages.WixVariableUnknown(sourceLineNumbers, variableId)); } } } @@ -321,7 +321,7 @@ namespace WixToolset.Core } else { - throw new WixException(WixErrors.UnresolvedBindReference(sourceLineNumbers, value)); + throw new WixException(ErrorMessages.UnresolvedBindReference(sourceLineNumbers, value)); } } } diff --git a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs index bd4b70da..3714f9e7 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ExtensionFixture.cs @@ -25,7 +25,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = fs.GetFolder(); var program = new Program(); - var result = program.Run(new WixToolsetServiceProvider(), new[] + var result = program.Run(new WixToolsetServiceProvider(), null, new[] { "build", Path.Combine(folder, "Package.wxs"), @@ -68,7 +68,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = fs.GetFolder(); var program = new Program(); - var result = program.Run(new WixToolsetServiceProvider(), new[] + var result = program.Run(new WixToolsetServiceProvider(), null, new[] { "build", Path.Combine(folder, "Package.wxs"), diff --git a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs index 1b7a18cf..4f34f330 100644 --- a/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/ProgramFixture.cs @@ -23,7 +23,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = fs.GetFolder(); var program = new Program(); - var result = program.Run(new WixToolsetServiceProvider(), new[] + var result = program.Run(new WixToolsetServiceProvider(), null, new[] { "build", Path.Combine(folder, "Package.wxs"), @@ -59,7 +59,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = fs.GetFolder(); var program = new Program(); - var result = program.Run(new WixToolsetServiceProvider(), new[] + var result = program.Run(new WixToolsetServiceProvider(), null, new[] { "build", Path.Combine(folder, "Package.wxs"), @@ -95,7 +95,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = fs.GetFolder(); var program = new Program(); - var result = program.Run(new WixToolsetServiceProvider(), new[] + var result = program.Run(new WixToolsetServiceProvider(), null, new[] { "build", Path.Combine(folder, "Package.wxs"), @@ -125,7 +125,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = fs.GetFolder(); var program = new Program(); - var result = program.Run(new WixToolsetServiceProvider(), new[] + var result = program.Run(new WixToolsetServiceProvider(), null, new[] { "build", Path.Combine(folder, "Package.wxs"), @@ -155,7 +155,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = fs.GetFolder(); var program = new Program(); - var result = program.Run(new WixToolsetServiceProvider(), new[] + var result = program.Run(new WixToolsetServiceProvider(), null, new[] { "build", Path.Combine(folder, "Package.wxs"), @@ -185,7 +185,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = fs.GetFolder(); var program = new Program(); - var result = program.Run(new WixToolsetServiceProvider(), new[] + var result = program.Run(new WixToolsetServiceProvider(), null, new[] { "build", Path.Combine(folder, "Module.wxs"), @@ -219,7 +219,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = fs.GetFolder(); var program = new Program(); - var result = program.Run(new WixToolsetServiceProvider(), new[] + var result = program.Run(new WixToolsetServiceProvider(), null, new[] { "build", Path.Combine(folder, "Package.wxs"), @@ -255,7 +255,7 @@ namespace WixToolsetTest.CoreIntegration var intermediateFolder = fs.GetFolder(); var program = new Program(); - var result = program.Run(new WixToolsetServiceProvider(), new[] + var result = program.Run(new WixToolsetServiceProvider(), null, new[] { "build", Path.Combine(folder, "Package.wxs"), diff --git a/src/wix/Program.cs b/src/wix/Program.cs index 21a158d2..4cfc0138 100644 --- a/src/wix/Program.cs +++ b/src/wix/Program.cs @@ -3,7 +3,11 @@ namespace WixToolset.Core { using System; + using System.Globalization; + using System.Text; + using System.Threading; using WixToolset.Data; + using WixToolset.Extensibility; using WixToolset.Extensibility.Services; /// @@ -19,12 +23,12 @@ namespace WixToolset.Core [MTAThread] public static int Main(string[] args) { - Messaging.Instance.InitializeAppName("WIX", "wix.exe"); - Messaging.Instance.Display += DisplayMessage; - var serviceProvider = new WixToolsetServiceProvider(); + + var listener = new ConsoleMessageListener("WIX", "wix.exe"); + var program = new Program(); - return program.Run(serviceProvider, args); + return program.Run(serviceProvider, listener, args); } /// @@ -33,10 +37,13 @@ namespace WixToolset.Core /// Service provider to use throughout this execution. /// Command-line arguments to execute. /// Returns the application error code. - public int Run(IServiceProvider serviceProvider, string[] args) + public int Run(IServiceProvider serviceProvider, IMessageListener listener, string[] args) { + var messaging = serviceProvider.GetService(); + messaging.SetListener(listener); + var context = serviceProvider.GetService(); - context.Messaging = Messaging.Instance; + context.Messaging = messaging; context.ExtensionManager = CreateExtensionManagerWithStandardBackends(serviceProvider); context.ParsedArguments = args; @@ -57,17 +64,50 @@ namespace WixToolset.Core return extensionManager; } - private static void DisplayMessage(object sender, DisplayEventArgs e) + private class ConsoleMessageListener : IMessageListener { - switch (e.Level) + public ConsoleMessageListener(string shortName, string longName) + { + this.ShortAppName = shortName; + this.LongAppName = longName; + + PrepareConsoleForLocalization(); + } + + public string LongAppName { get; } + + public string ShortAppName { get; } + + public void Write(Message message) { - case MessageLevel.Warning: - case MessageLevel.Error: - Console.Error.WriteLine(e.Message); - break; - default: - Console.WriteLine(e.Message); - break; + var filename = message.SourceLineNumbers?.FileName ?? this.LongAppName; + var line = message.SourceLineNumbers?.LineNumber ?? -1; + var type = message.Level.ToString().ToLowerInvariant(); + var output = message.Level >= MessageLevel.Warning ? Console.Out : Console.Error; + + if (line > 0) + { + filename = String.Concat(filename, "(", line, ")"); + } + + output.WriteLine("{0} : {1} {2}{3:0000}: {4}", filename, type, this.ShortAppName, message.Id, message.ToString()); + } + + public void Write(string message) + { + Console.Out.WriteLine(message); + } + + private static void PrepareConsoleForLocalization() + { + Thread.CurrentThread.CurrentUICulture = CultureInfo.CurrentUICulture.GetConsoleFallbackUICulture(); + + if (Console.OutputEncoding.CodePage != Encoding.UTF8.CodePage && + Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.OEMCodePage && + Console.OutputEncoding.CodePage != Thread.CurrentThread.CurrentUICulture.TextInfo.ANSICodePage) + { + Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); + } } } } -- cgit v1.2.3-55-g6feb