| 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.Core.WindowsInstaller |
| 4 | { |
| 5 | using System; |
| 6 | using WixToolset.Data; |
| 7 | |
| 8 | internal static class WindowsInstallerBackendErrors |
| 9 | { |
| 10 | public static Message CannotLoadWixoutAsTransform(SourceLineNumber sourceLineNumbers, Exception exception) |
| 11 | { |
| 12 | var additionalDetail = exception == null ? String.Empty : ", detail: " + exception.Message; |
| 13 | |
| 14 | return Message(sourceLineNumbers, Ids.CannotLoadWixoutAsTransform, "Could not load wixout file as a transform{1}", additionalDetail); |
| 15 | } |
| 16 | |
| 17 | internal static Message ExceededMaximumAllowedComponentsInMsi(int maximumAllowedComponentsInMsi, int componentCount) |
| 18 | { |
| 19 | return Message(null, Ids.ExceededMaximumAllowedComponentsInMsi, "Maximum number of Components allowed in an MSI was exceeded. An MSI cannot contain more than {0} Components. The MSI contains {1} Components.", maximumAllowedComponentsInMsi, componentCount); |
| 20 | } |
| 21 | |
| 22 | internal static Message ExceededMaximumAllowedFeatureDepthInMsi(SourceLineNumber sourceLineNumbers, int maximumAllowedFeatureDepthInMsi, string featureId, int featureDepth) |
| 23 | { |
| 24 | return Message(sourceLineNumbers, Ids.ExceededMaximumAllowedFeatureDepthInMsi, "Maximum depth of the Feature tree allowed in an MSI was exceeded. An MSI does not support a Feature tree with depth greater than {0}. The Feature '{1}' is at depth {2}.", maximumAllowedFeatureDepthInMsi, featureId, featureDepth); |
| 25 | } |
| 26 | |
| 27 | public static Message InvalidModuleVersion(SourceLineNumber originalLineNumber, string version) |
| 28 | { |
| 29 | return Message(originalLineNumber, Ids.InvalidModuleVersion, "The Module/@Version was not be able to be used as a four-part version. A valid four-part version has a max value of \"65535.65535.65535.65535\" and must be all numeric.", version); |
| 30 | } |
| 31 | |
| 32 | public static Message InvalidWindowsInstallerWixpdbForValidation(string wixpdbPath) |
| 33 | { |
| 34 | return Message(null, Ids.InvalidWindowsInstallerWixpdbForValidation, "The validation .wixpdb file: {0} was not from a Windows Installer database build (.msi or .msm). Verify that the output type was actually an MSI Package or Merge Module.", wixpdbPath); |
| 35 | } |
| 36 | |
| 37 | public static Message UnknownDecompileType(string decompileType, string filePath) |
| 38 | { |
| 39 | return Message(null, Ids.UnknownDecompileType, "Unknown decompile type '{0}' from input: {1}", decompileType, filePath); |
| 40 | } |
| 41 | |
| 42 | public static Message UnknownValidationTargetFileExtension(string fileExtension) |
| 43 | { |
| 44 | return Message(null, Ids.UnknownValidationTargetFileExtension, "Unknown file extension: {0}. Use the -cub switch to specify the path to the ICE CUBe file", fileExtension); |
| 45 | } |
| 46 | |
| 47 | private static Message Message(SourceLineNumber sourceLineNumber, Ids id, string format, params object[] args) |
| 48 | { |
| 49 | return new Message(sourceLineNumber, MessageLevel.Error, (int)id, format, args); |
| 50 | } |
| 51 | |
| 52 | public enum Ids |
| 53 | { |
| 54 | CannotLoadWixoutAsTransform = 7500, |
| 55 | InvalidModuleVersion = 7501, |
| 56 | ExceededMaximumAllowedComponentsInMsi = 7502, |
| 57 | ExceededMaximumAllowedFeatureDepthInMsi = 7503, |
| 58 | UnknownDecompileType = 7504, |
| 59 | UnknownValidationTargetFileExtension = 7505, |
| 60 | InvalidWindowsInstallerWixpdbForValidation = 7506, |
| 61 | } // last available is 7999. 8000 is BurnBackendErrors. |
| 62 | } |
| 63 | } |