aboutsummaryrefslogtreecommitdiff
path: root/src/WixToolset.Core/Compiler_Bundle.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/WixToolset.Core/Compiler_Bundle.cs')
-rw-r--r--src/WixToolset.Core/Compiler_Bundle.cs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/WixToolset.Core/Compiler_Bundle.cs b/src/WixToolset.Core/Compiler_Bundle.cs
index 40b44bbd..1bee3823 100644
--- a/src/WixToolset.Core/Compiler_Bundle.cs
+++ b/src/WixToolset.Core/Compiler_Bundle.cs
@@ -2232,7 +2232,7 @@ namespace WixToolset.Core
2232 allowed = (packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msp); 2232 allowed = (packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msp);
2233 break; 2233 break;
2234 case "DetectCondition": 2234 case "DetectCondition":
2235 detectCondition = this.Core.GetAttributeValue(sourceLineNumbers, attrib); 2235 detectCondition = this.Core.GetAttributeValue(sourceLineNumbers, attrib, EmptyRule.CanBeEmpty);
2236 allowed = (packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msu); 2236 allowed = (packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msu);
2237 break; 2237 break;
2238 case "Protocol": 2238 case "Protocol":
@@ -2394,6 +2394,20 @@ namespace WixToolset.Core
2394 perMachine = YesNoDefaultType.Default; 2394 perMachine = YesNoDefaultType.Default;
2395 } 2395 }
2396 2396
2397 // Detect condition is recommended or required for Exe and Msu packages
2398 // (depending on whether uninstall arguments were provided).
2399 if ((packageType == WixBundlePackageType.Exe || packageType == WixBundlePackageType.Msu) && String.IsNullOrEmpty(detectCondition))
2400 {
2401 if (String.IsNullOrEmpty(uninstallCommand))
2402 {
2403 this.Core.Write(WarningMessages.DetectConditionRecommended(sourceLineNumbers, node.Name.LocalName));
2404 }
2405 else
2406 {
2407 this.Core.Write(ErrorMessages.ExpectedAttributeWithValueWithOtherAttribute(sourceLineNumbers, node.Name.LocalName, "DetectCondition", "UninstallCommand"));
2408 }
2409 }
2410
2397 // Now that the package ID is known, we can parse the extension attributes... 2411 // Now that the package ID is known, we can parse the extension attributes...
2398 var contextValues = new Dictionary<string, string>() { { "PackageId", id.Id } }; 2412 var contextValues = new Dictionary<string, string>() { { "PackageId", id.Id } };
2399 foreach (var attribute in extensionAttributes) 2413 foreach (var attribute in extensionAttributes)