Handle util:PermissionEx/@Inheritable
Sean Hall committed
May 23, 2020 at 21:59 UTC
a783c83bc1e1efaf054d957c8a097386cb8f6b4a
1 file changed
+25
-1
src/WixToolset.Converters/Wix3Converter.cs
+25
-1
@@ -24,7 +24,9 @@ namespace WixToolset.Converters
24
25
private const char XDocumentNewLine = '\n'; // XDocument normalizes "\r\n" to just "\n".
26
private static readonly XNamespace WixNamespace = "http://wixtoolset.org/schemas/v4/wxs";
27
+ private static readonly XNamespace WixUtilNamespace = "http://wixtoolset.org/schemas/v4/wxs/util";
28
29
+ private static readonly XName CreateFolderElementName = WixNamespace + "CreateFolder";
30
private static readonly XName CustomTableElementName = WixNamespace + "CustomTable";
31
private static readonly XName DirectoryElementName = WixNamespace + "Directory";
32
private static readonly XName FileElementName = WixNamespace + "File";
@@ -33,6 +35,7 @@ namespace WixToolset.Converters
35
private static readonly XName MspPackageElementName = WixNamespace + "MspPackage";
36
private static readonly XName MsuPackageElementName = WixNamespace + "MsuPackage";
37
private static readonly XName PayloadElementName = WixNamespace + "Payload";
38
+ private static readonly XName UtilPermissionExElementName = WixUtilNamespace + "PermissionEx";
39
private static readonly XName CustomActionElementName = WixNamespace + "CustomAction";
40
private static readonly XName PropertyElementName = WixNamespace + "Property";
41
private static readonly XName WixElementWithoutNamespaceName = XNamespace.None + "Wix";
@@ -52,7 +55,7 @@ namespace WixToolset.Converters
55
{ "http://schemas.microsoft.com/wix/PSExtension", "http://wixtoolset.org/schemas/v4/wxs/powershell" },
56
{ "http://schemas.microsoft.com/wix/SqlExtension", "http://wixtoolset.org/schemas/v4/wxs/sql" },
57
{ "http://schemas.microsoft.com/wix/TagExtension", "http://wixtoolset.org/schemas/v4/wxs/tag" },
55
- { "http://schemas.microsoft.com/wix/UtilExtension", "http://wixtoolset.org/schemas/v4/wxs/util" },
58
+ { "http://schemas.microsoft.com/wix/UtilExtension", WixUtilNamespace },
59
{ "http://schemas.microsoft.com/wix/VSExtension", "http://wixtoolset.org/schemas/v4/wxs/vs" },
60
{ "http://wixtoolset.org/schemas/thmutil/2010", "http://wixtoolset.org/schemas/v4/thmutil" },
61
{ "http://schemas.microsoft.com/wix/2009/Lux", "http://wixtoolset.org/schemas/v4/lux" },
@@ -88,6 +91,7 @@ namespace WixToolset.Converters
91
{ Wix3Converter.MsuPackageElementName, this.ConvertSuppressSignatureValidation },
92
{ Wix3Converter.PayloadElementName, this.ConvertSuppressSignatureValidation },
93
{ Wix3Converter.CustomActionElementName, this.ConvertCustomActionElement },
94
+ { Wix3Converter.UtilPermissionExElementName, this.ConvertUtilPermissionExElement },
95
{ Wix3Converter.PropertyElementName, this.ConvertPropertyElement },
96
{ Wix3Converter.WixElementWithoutNamespaceName, this.ConvertElementWithoutNamespace },
97
{ Wix3Converter.IncludeElementWithoutNamespaceName, this.ConvertElementWithoutNamespace },
@@ -417,6 +421,21 @@ namespace WixToolset.Converters
421
}
422
}
423
424
+ private void ConvertUtilPermissionExElement(XElement element)
425
+ {
426
+ if (null == element.Attribute("Inheritable"))
427
+ {
428
+ var inheritable = element.Parent.Name == CreateFolderElementName;
429
+ if (!inheritable)
430
+ {
431
+ if (this.OnError(ConverterTestType.AssignPermissionExInheritable, element, "The PermissionEx Inheritable attribute is being set to 'no' to ensure it remains the same as the v3 default"))
432
+ {
433
+ element.Add(new XAttribute("Inheritable", "no"));
434
+ }
435
+ }
436
+ }
437
+ }
438
+
439
/// <summary>
440
/// Converts a Wix element.
441
/// </summary>
@@ -675,6 +694,11 @@ namespace WixToolset.Converters
694
/// BootstrapperApplicationData attribute is deprecated and replaced with Unreal.
695
/// </summary>
696
BootstrapperApplicationDataDeprecated,
697
+
698
+ /// <summary>
699
+ /// Inheritable is new and is now defaulted to 'yes' which is a change in behavior for all but children of CreateFolder.
700
+ /// </summary>
701
+ AssignPermissionExInheritable,
702
}
703
}
704
}