@joebigelow / wix / commits / 7e1597b3

Clean up MediaTemplate and tweak a bit.

Bob Arnson committed Oct 26, 2020 at 21:51 UTC 7e1597b3d7600ed6d0437334e817b9202e6e8b30
2 files changed +16 -2
src/WixToolset.Converters/FixupCommandBase.cs
+2 -1
@@ -69,7 +69,7 @@ namespace WixToolset.Converters
69 return true;
70
71 case "n":
72 - case "--dry-run":
72 + case "-dry-run":
73 this.DryRun = true;
74 return true;
75
@@ -81,6 +81,7 @@ namespace WixToolset.Converters
81 case "s":
82 case "r":
83 case "-recurse":
84 + case "-recursive":
85 this.Recurse = true;
86 return true;
87
src/WixToolset.Converters/WixConverter.cs
+14 -1
@@ -88,6 +88,7 @@ namespace WixToolset.Converters
88 private static readonly XName Include3ElementName = Wix3Namespace + "Include";
89 private static readonly XName IncludeElementWithoutNamespaceName = XNamespace.None + "Include";
90 private static readonly XName SummaryInformationElementName = WixNamespace + "SummaryInformation";
91 + private static readonly XName MediaTemplateElementName = WixNamespace + "MediaTemplate";
92
93 private static readonly Dictionary<string, XNamespace> OldToNewNamespaceMapping = new Dictionary<string, XNamespace>()
94 {
@@ -730,6 +731,13 @@ namespace WixToolset.Converters
731 }
732 }
733
734 + var xMediaTemplate = element.Element(MediaTemplateElementName);
735 + if (xMediaTemplate?.HasAttributes == false
736 + && this.OnError(ConverterTestType.DefaultMediaTemplate, element, "A MediaTemplate with no attributes set is now provided by default. Remove the element."))
737 + {
738 + xMediaTemplate.Remove();
739 + }
740 +
741 if (this.OnError(ConverterTestType.ProductAndPackageRenamed, element, "The Product and Package elements have been renamed and reorganized for simplicity."))
742 {
743 var xPackage = element;
@@ -742,7 +750,7 @@ namespace WixToolset.Converters
750
751 RemoveAttribute(xSummaryInformation, "AdminImage");
752 RemoveAttribute(xSummaryInformation, "Comments");
745 - MoveAttribute(xSummaryInformation, "Compressed", xPackage);
753 + MoveAttribute(xSummaryInformation, "Compressed", xPackage, defaultValue: "no");
754 RemoveAttribute(xSummaryInformation, "Id");
755 MoveAttribute(xSummaryInformation, "InstallerVersion", xPackage, defaultValue: "500");
756 MoveAttribute(xSummaryInformation, "InstallScope", xPackage, "Scope", defaultValue: "perMachine");
@@ -1409,6 +1417,11 @@ namespace WixToolset.Converters
1417 /// The Module and Package elements have been renamed and reorganized.
1418 /// </summary>
1419 ModuleAndPackageRenamed,
1420 +
1421 + /// <summary>
1422 + /// A MediaTemplate with no attributes set is now provided by default.
1423 + /// </summary>
1424 + DefaultMediaTemplate,
1425 }
1426 }
1427 }