| 1 | // 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. |
| 2 | |
| 3 | namespace WixToolset.BootstrapperApplications |
| 4 | { |
| 5 | using System; |
| 6 | using System.Resources; |
| 7 | using WixToolset.Data; |
| 8 | |
| 9 | public static class BalErrors |
| 10 | { |
| 11 | public static Message AttributeRequiresPrereqPackage(SourceLineNumber sourceLineNumbers, string elementName, string attributeName) |
| 12 | { |
| 13 | return Message(sourceLineNumbers, Ids.AttributeRequiresPrereqPackage, "When the {0}/@{1} attribute is specified, the {0}/@PrereqPackage attribute must be set to \"yes\".", elementName, attributeName); |
| 14 | } |
| 15 | |
| 16 | public static Message BAFunctionsPayloadRequiredInUXContainer(SourceLineNumber sourceLineNumbers) |
| 17 | { |
| 18 | return Message(sourceLineNumbers, Ids.BAFunctionsPayloadRequiredInUXContainer, "The BAFunctions DLL Payload element must be located inside the BootstrapperApplication container."); |
| 19 | } |
| 20 | |
| 21 | public static Message IuibaNonMsiPrimaryPackage(SourceLineNumber sourceLineNumbers) |
| 22 | { |
| 23 | return Message(sourceLineNumbers, Ids.IuibaNonMsiPrimaryPackage, "When using WixInternalUIBootstrapperApplication, each primary package must be an MsiPackage."); |
| 24 | } |
| 25 | |
| 26 | public static Message IuibaNonPermanentNonPrimaryPackage(SourceLineNumber sourceLineNumbers) |
| 27 | { |
| 28 | return Message(sourceLineNumbers, Ids.IuibaNonPermanentNonPrimaryPackage, "When using WixInternalUIBootstrapperApplication, packages must either be non-permanent and have the bal:PrimaryPackageType attribute, or be permanent and have the bal:PrereqPackage attribute set to 'yes'."); |
| 29 | } |
| 30 | |
| 31 | public static Message IuibaNonPermanentPrereqPackage(SourceLineNumber sourceLineNumbers) |
| 32 | { |
| 33 | return Message(sourceLineNumbers, Ids.IuibaNonPermanentPrereqPackage, "When using WixInternalUIBootstrapperApplication and bal:PrereqPackage is set to 'yes', the package must be permanent."); |
| 34 | } |
| 35 | |
| 36 | public static Message IuibaPermanentPrimaryPackageType(SourceLineNumber sourceLineNumbers) |
| 37 | { |
| 38 | return Message(sourceLineNumbers, Ids.IuibaPermanentPrimaryPackageType, "When using WixInternalUIBootstrapperApplication, packages with the bal:PrimaryPackageType attribute must not be permanent."); |
| 39 | } |
| 40 | |
| 41 | public static Message IuibaPrimaryPackageEnableFeatureSelection(SourceLineNumber sourceLineNumbers) |
| 42 | { |
| 43 | return Message(sourceLineNumbers, Ids.IuibaPrimaryPackageEnableFeatureSelection, "When using WixInternalUIBootstrapperApplication, primary packages must not have feature selection enabled because it interferes with the user selecting feature through the MSI UI."); |
| 44 | } |
| 45 | |
| 46 | public static Message MissingPrereq(SourceLineNumber sourceLineNumbers) |
| 47 | { |
| 48 | return Message(sourceLineNumbers, Ids.MissingPrereq, "There must be at least one package with bal:PrereqPackage=\"yes\" when using the bal:WixPrerequisiteBootstrapperApplication."); |
| 49 | } |
| 50 | |
| 51 | public static Message MissingIUIPrimaryPackage(SourceLineNumber sourceLineNumbers) |
| 52 | { |
| 53 | return Message(sourceLineNumbers, Ids.MissingIUIPrimaryPackage, "When using WixInternalUIBootstrapperApplication, there must be one package with bal:PrimaryPackageType=\"default\"."); |
| 54 | } |
| 55 | |
| 56 | public static Message MultipleBAFunctions(SourceLineNumber sourceLineNumbers) |
| 57 | { |
| 58 | return Message(sourceLineNumbers, Ids.MultipleBAFunctions, "WixStandardBootstrapperApplication doesn't support multiple BAFunctions DLLs."); |
| 59 | } |
| 60 | |
| 61 | public static Message MultiplePrereqLicenses(SourceLineNumber sourceLineNumbers) |
| 62 | { |
| 63 | return Message(sourceLineNumbers, Ids.MultiplePrereqLicenses, "There may only be one package in the bundle that has either the PrereqLicenseFile attribute or the PrereqLicenseUrl attribute."); |
| 64 | } |
| 65 | |
| 66 | public static Message MultiplePrimaryPackageType(SourceLineNumber sourceLineNumbers, string primaryPackageType) |
| 67 | { |
| 68 | return Message(sourceLineNumbers, Ids.MultiplePrimaryPackageType, "There may only be one package in the bundle with PrimaryPackageType of '{0}'.", primaryPackageType); |
| 69 | } |
| 70 | |
| 71 | public static Message MultiplePrimaryPackageType2(SourceLineNumber sourceLineNumbers) |
| 72 | { |
| 73 | return Message(sourceLineNumbers, Ids.MultiplePrimaryPackageType2, "The location of the package related to the previous error."); |
| 74 | } |
| 75 | |
| 76 | public static Message OverridableVariableCollision(SourceLineNumber sourceLineNumbers, string name, string collisionName) |
| 77 | { |
| 78 | return Message(sourceLineNumbers, Ids.OverridableVariableCollision, "Overridable variable '{0}' collides with '{1}' with Bundle/@CommandLineVariables value 'caseInsensitive'.", name, collisionName); |
| 79 | } |
| 80 | |
| 81 | public static Message OverridableVariableCollision2(SourceLineNumber sourceLineNumbers) |
| 82 | { |
| 83 | return Message(sourceLineNumbers, Ids.OverridableVariableCollision2, "The location of the Variable related to the previous error."); |
| 84 | } |
| 85 | |
| 86 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) |
| 87 | { |
| 88 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); |
| 89 | } |
| 90 | |
| 91 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, ResourceManager resourceManager, string resourceName, params object[] args) |
| 92 | { |
| 93 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, resourceManager, resourceName, args); |
| 94 | } |
| 95 | |
| 96 | public enum Ids |
| 97 | { |
| 98 | AttributeRequiresPrereqPackage = 6801, |
| 99 | MissingPrereq = 6802, |
| 100 | MultiplePrereqLicenses = 6803, |
| 101 | MultipleBAFunctions = 6804, |
| 102 | BAFunctionsPayloadRequiredInUXContainer = 6805, |
| 103 | MissingIUIPrimaryPackage = 6808, |
| 104 | MultiplePrimaryPackageType = 6809, |
| 105 | MultiplePrimaryPackageType2 = 6810, |
| 106 | IuibaNonPermanentNonPrimaryPackage = 6811, |
| 107 | IuibaNonPermanentPrereqPackage = 6812, |
| 108 | IuibaPermanentPrimaryPackageType = 6813, |
| 109 | IuibaNonMsiPrimaryPackage = 6814, |
| 110 | IuibaPrimaryPackageEnableFeatureSelection = 6815, |
| 111 | OverridableVariableCollision = 6816, |
| 112 | OverridableVariableCollision2 = 6817, |
| 113 | MissingDNCBAFactoryAssembly = 6818, |
| 114 | } |
| 115 | } |
| 116 | } |