@joebigelow / wix / commits / d77302d9

Add support for RepairCondition on Exe, Msi and Msp packages

Rob Mensching committed Apr 10, 2021 at 15:24 UTC d77302d94b356a1db2b2b834e45c8962381eae6b
2 files changed +21
src/WixToolset.Core.Burn/Bundles/CreateBurnManifestCommand.cs
+13
@@ -399,6 +399,10 @@ namespace WixToolset.Core.Burn.Bundles
399 writer.WriteAttributeString("InstallArguments", exePackage.InstallCommand);
400 writer.WriteAttributeString("UninstallArguments", exePackage.UninstallCommand);
401 writer.WriteAttributeString("RepairArguments", exePackage.RepairCommand);
402 + if (!String.IsNullOrEmpty(exePackage.RepairCondition))
403 + {
404 + writer.WriteAttributeString("RepairCondition", exePackage.RepairCondition);
405 + }
406 writer.WriteAttributeString("Repairable", exePackage.Repairable ? "yes" : "no");
407 if (!String.IsNullOrEmpty(exePackage.ExeProtocol))
408 {
@@ -410,6 +414,10 @@ namespace WixToolset.Core.Burn.Bundles
414 writer.WriteAttributeString("ProductCode", msiPackage.ProductCode);
415 writer.WriteAttributeString("Language", msiPackage.ProductLanguage.ToString(CultureInfo.InvariantCulture));
416 writer.WriteAttributeString("Version", msiPackage.ProductVersion);
417 + if (!String.IsNullOrEmpty(msiPackage.RepairCondition))
418 + {
419 + writer.WriteAttributeString("RepairCondition", msiPackage.RepairCondition);
420 + }
421 if (!String.IsNullOrEmpty(msiPackage.UpgradeCode))
422 {
423 writer.WriteAttributeString("UpgradeCode", msiPackage.UpgradeCode);
@@ -420,6 +428,11 @@ namespace WixToolset.Core.Burn.Bundles
428 writer.WriteAttributeString("PatchCode", mspPackage.PatchCode);
429 writer.WriteAttributeString("PatchXml", mspPackage.PatchXml);
430
431 + if (!String.IsNullOrEmpty(mspPackage.RepairCondition))
432 + {
433 + writer.WriteAttributeString("RepairCondition", mspPackage.RepairCondition);
434 + }
435 +
436 // If there is still a chance that all of our patches will target a narrow set of
437 // product codes, add the patch list to the overall list.
438 if (null != targetCodes)
src/WixToolset.Core/Compiler_Bundle.cs
+8
@@ -1974,6 +1974,7 @@ namespace WixToolset.Core
1974 var perMachine = YesNoDefaultType.NotSet;
1975 string detectCondition = null;
1976 string protocol = null;
1977 + string repairCondition = null;
1978 var installSize = CompilerConstants.IntegerNotSet;
1979 string msuKB = null;
1980 var enableFeatureSelection = YesNoType.NotSet;
@@ -2093,6 +2094,10 @@ namespace WixToolset.Core
2094 protocol = this.Core.GetAttributeValue(sourceLineNumbers, attrib);
2095 allowed = (packageType == WixBundlePackageType.Exe);
2096 break;
2097 + case "RepairCondition":
2098 + repairCondition = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty);
2099 + allowed = (packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msi || packageType == WixBundlePackageType.Msp);
2100 + break;
2101 case "InstallSize":
2102 installSize = this.Core.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, Int32.MaxValue);
2103 break;
@@ -2340,6 +2345,7 @@ namespace WixToolset.Core
2345 InstallCommand = installArguments,
2346 RepairCommand = repairArguments,
2347 UninstallCommand = uninstallArguments,
2348 + RepairCondition = repairCondition,
2349 ExeProtocol = protocol
2350 });
2351 break;
@@ -2351,6 +2357,7 @@ namespace WixToolset.Core
2357
2358 this.Core.AddSymbol(new WixBundleMsiPackageSymbol(sourceLineNumbers, id)
2359 {
2360 + RepairCondition = repairCondition,
2361 Attributes = msiAttributes
2362 });
2363 break;
@@ -2361,6 +2368,7 @@ namespace WixToolset.Core
2368
2369 this.Core.AddSymbol(new WixBundleMspPackageSymbol(sourceLineNumbers, id)
2370 {
2371 + RepairCondition = repairCondition,
2372 Attributes = mspAttributes
2373 });
2374 break;