@joebigelow / wix / commits / 7d1e5dee

Remove lingering uses of .resx from WixToolset.Core

Rob Mensching committed Dec 26, 2018 at 17:14 UTC 7d1e5deed7304612eccfa9cb57b0decf083a868c
9 files changed +23 -197
src/WixToolset.Core.WindowsInstaller/Bind/MergeModulesCommand.cs
+2 -2
@@ -171,14 +171,14 @@ namespace WixToolset.Core.WindowsInstaller.Bind
171 this.Messaging.Write(ErrorMessages.MergePlatformMismatch(wixMergeRow.SourceLineNumbers, wixMergeRow.SourceFile));
172 break;
173 default:
174 - this.Messaging.Write(ErrorMessages.UnexpectedException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedMergerErrorWithType, Enum.GetName(typeof(MsmErrorType), mergeError.Type), logPath), "InvalidOperationException", Environment.StackTrace));
174 + this.Messaging.Write(ErrorMessages.UnexpectedException(String.Format(CultureInfo.CurrentUICulture, "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}'", Enum.GetName(typeof(MsmErrorType), mergeError.Type), logPath), "InvalidOperationException", Environment.StackTrace));
175 break;
176 }
177 }
178
179 if (0 >= mergeErrors.Count && !commit)
180 {
181 - this.Messaging.Write(ErrorMessages.UnexpectedException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedMergerErrorInSourceFile, wixMergeRow.SourceFile, logPath), "InvalidOperationException", Environment.StackTrace));
181 + this.Messaging.Write(ErrorMessages.UnexpectedException(String.Format(CultureInfo.CurrentUICulture, "Encountered an unexpected error while merging '{0}'. More information about the merge and the failure can be found in the merge log: '{1}'", wixMergeRow.SourceFile, logPath), "InvalidOperationException", Environment.StackTrace));
182 }
183
184 if (moduleOpen)
src/WixToolset.Core.WindowsInstaller/Bind/SequenceActionsCommand.cs
+3 -3
@@ -88,7 +88,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
88 }
89 else // not a supported unscheduled action.
90 {
91 - throw new InvalidOperationException(WixStrings.EXP_FoundActionRowWithNoSequenceBeforeOrAfterColumnSet);
91 + throw new InvalidOperationException("Found an ActionRow with no Sequence, Before, or After column set.");
92 }
93 }
94
@@ -575,7 +575,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
575 }
576 else if (actionRow.Before == null)
577 {
578 - throw new InvalidOperationException(WixStrings.EXP_FoundActionRowWithNoSequenceBeforeOrAfterColumnSet);
578 + throw new InvalidOperationException("Found an ActionRow with no Sequence, Before, or After column set.");
579 }
580
581 var parentActionName = (after ? actionRow.After : actionRow.Before);
@@ -593,7 +593,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind
593 }
594 else
595 {
596 - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_FoundActionRowWinNonExistentAction, (after ? "After" : "Before"), parentActionName));
596 + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, "Found an ActionRow with a non-existent {0} action: {1}.", (after ? "After" : "Before"), parentActionName));
597 }
598 }
599 else if (actionRow == parentActionRow || this.ContainsChildActionRow(actionRow, parentActionRow)) // cycle detected
src/WixToolset.Core/Compiler.cs
+1 -1
@@ -10757,7 +10757,7 @@ namespace WixToolset.Core
10757 msiVersion = 500;
10758 break;
10759 default:
10760 - throw new ArgumentException(WixStrings.EXP_UnknownPlatformEnum, this.CurrentPlatform.ToString());
10760 + throw new ArgumentException("Unknown platform enumeration '{0}' encountered.", this.CurrentPlatform.ToString());
10761 }
10762
10763 foreach (var attrib in node.Attributes())
src/WixToolset.Core/Extensibility/MutatorExtension.cs
+1 -1
@@ -151,7 +151,7 @@ namespace WixToolset.Core.Extensibility
151 }
152 }
153
154 - throw new InvalidOperationException(WixStrings.EXP_CouldnotFileUniqueIDForResourceName);
154 + throw new InvalidOperationException("Could not find a unique identifier for the given resource name.");
155 }
156
157 /// <summary>
src/WixToolset.Core/ExtensibilityServices/Messaging.cs
+8 -8
@@ -65,10 +65,10 @@ namespace WixToolset.Core.ExtensibilityServices
65 {
66 if (fileNames.Count == 0)
67 {
68 - errorFileName = String.Format(CultureInfo.CurrentUICulture, WixStrings.Format_FirstLineNumber, sln.FileName, sln.LineNumber);
68 + errorFileName = String.Format(CultureInfo.CurrentUICulture, "{0}({1})", sln.FileName, sln.LineNumber);
69 }
70
71 - fileNames.Add(String.Format(CultureInfo.CurrentUICulture, WixStrings.Format_LineNumber, sln.FileName, sln.LineNumber));
71 + fileNames.Add(String.Format(CultureInfo.CurrentUICulture, "{0}: line {1}", sln.FileName, sln.LineNumber));
72 }
73 else
74 {
@@ -84,11 +84,11 @@ namespace WixToolset.Core.ExtensibilityServices
84 var levelString = String.Empty;
85 if (MessageLevel.Warning == level)
86 {
87 - levelString = WixStrings.MessageType_Warning;
87 + levelString = "warning";
88 }
89 else if (MessageLevel.Error == level)
90 {
91 - levelString = WixStrings.MessageType_Error;
91 + levelString = "error";
92 }
93
94 string formatted;
@@ -104,20 +104,20 @@ namespace WixToolset.Core.ExtensibilityServices
104 var builder = new StringBuilder();
105 if (level == MessageLevel.Information || level == MessageLevel.Verbose)
106 {
107 - builder.AppendFormat(WixStrings.Format_InfoMessage, formatted);
107 + builder.Append(formatted);
108 }
109 else
110 {
111 - builder.AppendFormat(WixStrings.Format_NonInfoMessage, errorFileName, levelString, shortAppName, message.Id, formatted);
111 + builder.AppendFormat("{0} : {1} {2}{3:0000} : {4}", errorFileName, levelString, shortAppName, message.Id, formatted);
112 }
113
114 if (fileNames.Count > 1)
115 {
116 - builder.AppendFormat(WixStrings.INF_SourceTrace, Environment.NewLine);
116 + builder.AppendFormat("Source trace:{0}", Environment.NewLine);
117
118 foreach (var fileName in fileNames)
119 {
120 - builder.AppendFormat(WixStrings.INF_SourceTraceLocation, fileName, Environment.NewLine);
120 + builder.AppendFormat("Source trace:{0}", fileName, Environment.NewLine);
121 }
122
123 builder.AppendLine();
src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs
+2 -2
@@ -1,4 +1,4 @@
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.
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.ExtensibilityServices
4 {
@@ -245,7 +245,7 @@ namespace WixToolset.Core.ExtensibilityServices
245 return "arm";
246
247 default:
248 - throw new ArgumentException(WixStrings.EXP_UnknownPlatformEnum, context.Platform.ToString());
248 + throw new ArgumentException("Unknown platform enumeration '{0}' encountered.", context.Platform.ToString());
249 }
250
251 default:
src/WixToolset.Core/Harvester.cs
+1 -1
@@ -35,7 +35,7 @@ namespace WixToolset.Core
35 {
36 if (null != this.harvesterExtension)
37 {
38 - throw new InvalidOperationException(WixStrings.EXP_MultipleHarvesterExtensionsSpecified);
38 + throw new InvalidOperationException("Multiple harvester extensions specified.");
39 }
40
41 this.harvesterExtension = value;
src/WixToolset.Core/Linker.cs
+5 -5
@@ -1229,7 +1229,7 @@ namespace WixToolset.Core
1229 break;
1230
1231 default:
1232 - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedComplexReferenceChildType, Enum.GetName(typeof(ComplexReferenceChildType), wixComplexReferenceRow.ChildType)));
1232 + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, "Unexpected complex reference child type: {0}", Enum.GetName(typeof(ComplexReferenceChildType), wixComplexReferenceRow.ChildType)));
1233 }
1234 break;
1235
@@ -1260,7 +1260,7 @@ namespace WixToolset.Core
1260 break;
1261
1262 default:
1263 - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedComplexReferenceChildType, Enum.GetName(typeof(ComplexReferenceChildType), wixComplexReferenceRow.ChildType)));
1263 + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, "Unexpected complex reference child type: {0}", Enum.GetName(typeof(ComplexReferenceChildType), wixComplexReferenceRow.ChildType)));
1264 }
1265 break;
1266
@@ -1272,7 +1272,7 @@ namespace WixToolset.Core
1272 break;
1273
1274 default:
1275 - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedComplexReferenceChildType, Enum.GetName(typeof(ComplexReferenceChildType), wixComplexReferenceRow.ChildType)));
1275 + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, "Unexpected complex reference child type: {0}", Enum.GetName(typeof(ComplexReferenceChildType), wixComplexReferenceRow.ChildType)));
1276 }
1277 break;
1278
@@ -1291,13 +1291,13 @@ namespace WixToolset.Core
1291 break;
1292
1293 default:
1294 - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedComplexReferenceChildType, Enum.GetName(typeof(ComplexReferenceChildType), wixComplexReferenceRow.ChildType)));
1294 + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, "Unexpected complex reference child type: {0}", Enum.GetName(typeof(ComplexReferenceChildType), wixComplexReferenceRow.ChildType)));
1295 }
1296 break;
1297
1298 default:
1299 // Note: Groups have been processed before getting here so they are not handled by any case above.
1300 - throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, WixStrings.EXP_UnexpectedComplexReferenceChildType, Enum.GetName(typeof(ComplexReferenceParentType), wixComplexReferenceRow.ParentType)));
1300 + throw new InvalidOperationException(String.Format(CultureInfo.CurrentUICulture, "Unexpected complex reference child type: {0}", Enum.GetName(typeof(ComplexReferenceParentType), wixComplexReferenceRow.ParentType)));
1301 }
1302 }
1303
src/WixToolset.Core/WixStrings.resx deleted
-174
@@ -1,174 +0,0 @@
1 -<?xml version="1.0" encoding="utf-8"?>
2 -<root>
3 - <!--
4 - Microsoft ResX Schema
5 -
6 - Version 2.0
7 -
8 - The primary goals of this format is to allow a simple XML format
9 - that is mostly human readable. The generation and parsing of the
10 - various data types are done through the TypeConverter classes
11 - associated with the data types.
12 -
13 - Example:
14 -
15 - ... ado.net/XML headers & schema ...
16 - <resheader name="resmimetype">text/microsoft-resx</resheader>
17 - <resheader name="version">2.0</resheader>
18 - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
19 - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
20 - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
21 - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
22 - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
23 - <value>[base64 mime encoded serialized .NET Framework object]</value>
24 - </data>
25 - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
26 - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
27 - <comment>This is a comment</comment>
28 - </data>
29 -
30 - There are any number of "resheader" rows that contain simple
31 - name/value pairs.
32 -
33 - Each data row contains a name, and value. The row also contains a
34 - type or mimetype. Type corresponds to a .NET class that support
35 - text/value conversion through the TypeConverter architecture.
36 - Classes that don't support this are serialized and stored with the
37 - mimetype set.
38 -
39 - The mimetype is used for serialized objects, and tells the
40 - ResXResourceReader how to depersist the object. This is currently not
41 - extensible. For a given mimetype the value must be set accordingly:
42 -
43 - Note - application/x-microsoft.net.object.binary.base64 is the format
44 - that the ResXResourceWriter will generate, however the reader can
45 - read any of the formats listed below.
46 -
47 - mimetype: application/x-microsoft.net.object.binary.base64
48 - value : The object must be serialized with
49 - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
50 - : and then encoded with base64 encoding.
51 -
52 - mimetype: application/x-microsoft.net.object.soap.base64
53 - value : The object must be serialized with
54 - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
55 - : and then encoded with base64 encoding.
56 -
57 - mimetype: application/x-microsoft.net.object.bytearray.base64
58 - value : The object must be serialized into a byte array
59 - : using a System.ComponentModel.TypeConverter
60 - : and then encoded with base64 encoding.
61 - -->
62 - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
63 - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
64 - <xsd:element name="root" msdata:IsDataSet="true">
65 - <xsd:complexType>
66 - <xsd:choice maxOccurs="unbounded">
67 - <xsd:element name="metadata">
68 - <xsd:complexType>
69 - <xsd:sequence>
70 - <xsd:element name="value" type="xsd:string" minOccurs="0" />
71 - </xsd:sequence>
72 - <xsd:attribute name="name" use="required" type="xsd:string" />
73 - <xsd:attribute name="type" type="xsd:string" />
74 - <xsd:attribute name="mimetype" type="xsd:string" />
75 - <xsd:attribute ref="xml:space" />
76 - </xsd:complexType>
77 - </xsd:element>
78 - <xsd:element name="assembly">
79 - <xsd:complexType>
80 - <xsd:attribute name="alias" type="xsd:string" />
81 - <xsd:attribute name="name" type="xsd:string" />
82 - </xsd:complexType>
83 - </xsd:element>
84 - <xsd:element name="data">
85 - <xsd:complexType>
86 - <xsd:sequence>
87 - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
88 - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
89 - </xsd:sequence>
90 - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
91 - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
92 - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
93 - <xsd:attribute ref="xml:space" />
94 - </xsd:complexType>
95 - </xsd:element>
96 - <xsd:element name="resheader">
97 - <xsd:complexType>
98 - <xsd:sequence>
99 - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
100 - </xsd:sequence>
101 - <xsd:attribute name="name" type="xsd:string" use="required" />
102 - </xsd:complexType>
103 - </xsd:element>
104 - </xsd:choice>
105 - </xsd:complexType>
106 - </xsd:element>
107 - </xsd:schema>
108 - <resheader name="resmimetype">
109 - <value>text/microsoft-resx</value>
110 - </resheader>
111 - <resheader name="version">
112 - <value>2.0</value>
113 - </resheader>
114 - <resheader name="reader">
115 - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
116 - </resheader>
117 - <resheader name="writer">
118 - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
119 - </resheader>
120 - <data name="EXP_CouldnotFileUniqueIDForResourceName" xml:space="preserve">
121 - <value>Could not find a unique identifier for the given resource name.</value>
122 - </data>
123 - <data name="EXP_ExpectedComplexReferenceType" xml:space="preserve">
124 - <value>Expected ComplexReference type.</value>
125 - </data>
126 - <data name="EXP_FoundActionRowWinNonExistentAction" xml:space="preserve">
127 - <value>Found an ActionRow with a non-existent {0} action: {1}.</value>
128 - </data>
129 - <data name="EXP_FoundActionRowWithNoSequenceBeforeOrAfterColumnSet" xml:space="preserve">
130 - <value>Found an ActionRow with no Sequence, Before, or After column set.</value>
131 - </data>
132 - <data name="EXP_MultipleHarvesterExtensionsSpecified" xml:space="preserve">
133 - <value>Multiple harvester extensions specified.</value>
134 - </data>
135 - <data name="EXP_UnexpectedComplexReferenceChildType" xml:space="preserve">
136 - <value>Unexpected complex reference child type: {0}</value>
137 - </data>
138 - <data name="EXP_UnexpectedEntrySectionType" xml:space="preserve">
139 - <value>Unexpected entry section type: {0}</value>
140 - </data>
141 - <data name="EXP_UnexpectedMergerErrorInSourceFile" xml:space="preserve">
142 - <value>Encountered an unexpected error while merging '{0}'. More information about the merge and the failure can be found in the merge log: '{1}'</value>
143 - </data>
144 - <data name="EXP_UnexpectedMergerErrorWithType" xml:space="preserve">
145 - <value>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}'</value>
146 - </data>
147 - <data name="EXP_UnknownPlatformEnum" xml:space="preserve">
148 - <value>Unknown platform enumeration '{0}' encountered.</value>
149 - </data>
150 - <data name="Format_FirstLineNumber" xml:space="preserve">
151 - <value>{0}({1})</value>
152 - </data>
153 - <data name="Format_InfoMessage" xml:space="preserve">
154 - <value>{0}</value>
155 - </data>
156 - <data name="Format_LineNumber" xml:space="preserve">
157 - <value>{0}: line {1}</value>
158 - </data>
159 - <data name="Format_NonInfoMessage" xml:space="preserve">
160 - <value>{0} : {1} {2}{3:0000} : {4}</value>
161 - </data>
162 - <data name="INF_SourceTrace" xml:space="preserve">
163 - <value>Source trace:{0}</value>
164 - </data>
165 - <data name="INF_SourceTraceLocation" xml:space="preserve">
166 - <value>at {0}{1}</value>
167 - </data>
168 - <data name="MessageType_Error" xml:space="preserve">
169 - <value>error</value>
170 - </data>
171 - <data name="MessageType_Warning" xml:space="preserve">
172 - <value>warning</value>
173 - </data>
174 -</root>
\ No newline at end of file