Clean up upgrade properties; support <?ifdef $()?>
Bob Arnson committed
Nov 10, 2019 at 18:19 UTC
df709d87c25945c10b9d29273dd90b6df6359a99
3 files changed
+4
-8
src/WixToolset.Core/Compiler.cs
-6
@@ -7137,9 +7137,6 @@ namespace WixToolset.Core
7137
7138
this.Core.AddTuple(tuple);
7139
7140
- // Ensure the action property is secure.
7141
- this.AddWixPropertyRow(sourceLineNumbers, new Identifier(AccessModifier.Public, Common.UpgradeDetectedProperty), false, true, false);
7142
-
7140
// Add launch condition that blocks upgrades
7141
if (blockUpgrades)
7142
{
@@ -7167,9 +7164,6 @@ namespace WixToolset.Core
7164
7165
this.Core.AddTuple(upgradeTuple);
7166
7170
- // Ensure the action property is secure.
7171
- this.AddWixPropertyRow(sourceLineNumbers, new Identifier(AccessModifier.Public, Common.DowngradeDetectedProperty), false, true, false);
7172
-
7167
var conditionTuple = new LaunchConditionTuple(sourceLineNumbers)
7168
{
7169
Condition = Common.DowngradePreventedCondition,
src/WixToolset.Core/ExtensibilityServices/PreprocessHelper.cs
+2
-2
@@ -154,10 +154,10 @@ namespace WixToolset.Core.ExtensibilityServices
154
155
public string GetVariableValue(IPreprocessContext context, string variable, bool allowMissingPrefix)
156
{
157
- // Strip the "$(" off the front.
157
+ // Strip the "$(" off the front and the ")" off the back.
158
if (variable.StartsWith("$(", StringComparison.Ordinal))
159
{
160
- variable = variable.Substring(2);
160
+ variable = variable.Substring(2, variable.Length - 3);
161
}
162
163
var parts = variable.Split(VariableSplitter, 2);
src/test/WixToolsetTest.CoreIntegration/TestData/Variables/Package.wxs
+2
@@ -6,9 +6,11 @@
6
<?define Bar = "Bar" ?>
7
<?define Bar = "Baz" ?>
8
9
+<?ifdef $(sys.WIXVERSION) ?>
10
<?if $(sys.WIXMAJORVERSION) >= 4 AND $(sys.WIXMAJORVERSION) < 5 ?>
11
<?warning WiX v4 is in effect! ?>
12
<?endif?>
13
+<?endif?>
14
15
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
16
<Product Id="*" Name="MsiPackage" Language="1033" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a">