Very minor cleanup
Rob Mensching committed
Nov 7, 2022 at 23:05 UTC
86146e8c044a1aea2ea162701b1fc344d19e4dc3
6 files changed
+16
-19
src/ext/Http/wixext/HttpCompiler.cs
+1
-2
@@ -81,7 +81,6 @@ namespace WixToolset.Http
81
string store = null;
82
string thumbprint = null;
83
var handleExisting = HandleExisting.Replace;
84
- string handleExistingValue = null;
84
85
foreach (var attrib in node.Attributes())
86
{
@@ -96,7 +95,7 @@ namespace WixToolset.Http
95
appId = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
96
break;
97
case "HandleExisting":
99
- handleExistingValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
98
+ var handleExistingValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
99
switch (handleExistingValue)
100
{
101
case "replace":
src/ext/Iis/wixext/IIsCompiler.cs
+1
-3
@@ -67,7 +67,6 @@ namespace WixToolset.Iis
67
{
68
case "Component":
69
var componentId = context["ComponentId"];
70
- var directoryId = context["DirectoryId"];
70
71
switch (element.Name.LocalName)
72
{
@@ -265,7 +264,6 @@ namespace WixToolset.Iis
264
}
265
}
266
268
-
267
if (null == id)
268
{
269
id = this.ParseHelper.CreateIdentifier("crt", componentId, binaryRef, certificatePath);
@@ -351,7 +349,7 @@ namespace WixToolset.Iis
349
350
if (null == id)
351
{
354
- id = this.ParseHelper.CreateIdentifier("wsc", webId);
352
+ this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
353
}
354
355
this.ParseHelper.ParseForExtensionElements(this.Context.Extensions, intermediate, section, element);
src/ext/NetFx/wixext/NetFxCompiler.cs
+1
-1
@@ -425,7 +425,7 @@ namespace WixToolset.Netfx
425
break;
426
case "RollForward":
427
rollForward = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
428
- switch (rollForward.ToLower())
428
+ switch (rollForward.ToLowerInvariant())
429
{
430
case "latestmajor":
431
rollForward = "LatestMajor";
src/ext/Util/wixext/UtilCompiler.cs
+9
-6
@@ -1232,10 +1232,7 @@ namespace WixToolset.Util
1232
this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
1233
}
1234
1235
- if (!element.Elements().Any())
1236
- {
1237
- this.Messaging.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, element.Name.LocalName, "FileSharePermission"));
1238
- }
1235
+ var fileSharePermissionCount = 0;
1236
1237
foreach (var child in element.Elements())
1238
{
@@ -1245,6 +1242,7 @@ namespace WixToolset.Util
1242
{
1243
case "FileSharePermission":
1244
this.ParseFileSharePermissionElement(intermediate, section, child, id);
1245
+ ++fileSharePermissionCount;
1246
break;
1247
default:
1248
this.ParseHelper.UnexpectedElement(element, child);
@@ -1257,6 +1255,11 @@ namespace WixToolset.Util
1255
}
1256
}
1257
1258
+ if (fileSharePermissionCount == 0)
1259
+ {
1260
+ this.Messaging.Write(ErrorMessages.ExpectedElement(sourceLineNumbers, element.Name.LocalName, "FileSharePermission"));
1261
+ }
1262
+
1263
this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix4ConfigureSmbInstall", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM64);
1264
this.ParseHelper.CreateCustomActionReference(sourceLineNumbers, section, "Wix4ConfigureSmbUninstall", this.Context.Platform, CustomActionPlatforms.X86 | CustomActionPlatforms.X64 | CustomActionPlatforms.ARM64);
1265
@@ -3521,7 +3524,7 @@ namespace WixToolset.Util
3524
}
3525
break;
3526
case "SelectionLanguage":
3524
- string selectionLanguage = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3527
+ var selectionLanguage = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3528
switch (selectionLanguage)
3529
{
3530
case "XPath":
@@ -3653,7 +3656,7 @@ namespace WixToolset.Util
3656
}
3657
else
3658
{
3656
- string actionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3659
+ var actionValue = this.ParseHelper.GetAttributeValue(sourceLineNumbers, attrib);
3660
switch (actionValue)
3661
{
3662
case "create":
src/wix/WixToolset.Core/Compiler_Bundle.cs
+2
-5
@@ -11,7 +11,6 @@ namespace WixToolset.Core
11
using WixToolset.Data;
12
using WixToolset.Data.Burn;
13
using WixToolset.Data.Symbols;
14
- using WixToolset.Extensibility;
14
15
/// <summary>
16
/// Compiler of the WiX toolset.
@@ -278,7 +277,7 @@ namespace WixToolset.Core
277
case "ProviderKey":
278
this.ParseBundleProviderKeyAttribute(sourceLineNumbers, node, attrib);
279
break;
281
- // Unknown attributes were reported earlier.
280
+ // Unknown attributes were reported earlier.
281
}
282
}
283
else
@@ -852,8 +851,6 @@ namespace WixToolset.Core
851
}
852
}
853
855
-
856
-
854
/// <summary>
855
/// Parses a BundleCustomData element.
856
/// </summary>
@@ -1940,7 +1937,7 @@ namespace WixToolset.Core
1937
logPathVariable = String.Concat("WixBundleLog_", id.Id);
1938
}
1939
}
1943
- else if (logPathVariable != null)
1940
+ else if (logPathVariable != null)
1941
{
1942
this.Core.Write(ErrorMessages.IllegalAttributeValueWithoutOtherAttribute(sourceLineNumbers, node.Name.LocalName, "LogPathVariable", logPathVariable, "Transaction"));
1943
}
src/wix/WixToolset.Core/LocalizationParser.cs
+2
-2
@@ -97,10 +97,10 @@ namespace WixToolset.Core
97
switch (attrib.Name.LocalName)
98
{
99
case "Codepage":
100
- codepage = Common.GetValidCodePage(attrib.Value, true, false, sourceLineNumbers);
100
+ codepage = Common.GetValidCodePage(attrib.Value, allowNoChange: true, onlyAnsi: false, sourceLineNumbers);
101
break;
102
case "SummaryInformationCodepage":
103
- summaryInformationCodepage = Common.GetValidCodePage(attrib.Value, true, false, sourceLineNumbers);
103
+ summaryInformationCodepage = Common.GetValidCodePage(attrib.Value, allowNoChange: true, onlyAnsi: false, sourceLineNumbers);
104
break;
105
case "Culture":
106
culture = attrib.Value;