diff options
author | Rob Mensching <rob@firegiant.com> | 2019-11-05 22:33:33 -0800 |
---|---|---|
committer | Rob Mensching <rob@firegiant.com> | 2019-11-05 22:39:16 -0800 |
commit | 97a70bbc1b90cb26f8c77d83e703689d15d08761 (patch) | |
tree | c4d05ae10cb907f522c1df476cb1d5df7604cd14 /src | |
parent | 0f65aaaca2faf1b6fc233c445216d547f08c6fa5 (diff) | |
download | wix-97a70bbc1b90cb26f8c77d83e703689d15d08761.tar.gz wix-97a70bbc1b90cb26f8c77d83e703689d15d08761.tar.bz2 wix-97a70bbc1b90cb26f8c77d83e703689d15d08761.zip |
Fix resolution of !(bind.ProductVersion.MsiId) bind variables
Fixes wixtoolset/issues#4830
Diffstat (limited to 'src')
4 files changed, 15 insertions, 5 deletions
diff --git a/src/WixToolset.Core.Burn/Bundles/ProcessMsiPackageCommand.cs b/src/WixToolset.Core.Burn/Bundles/ProcessMsiPackageCommand.cs index 5fcf172f..7e65a9cf 100644 --- a/src/WixToolset.Core.Burn/Bundles/ProcessMsiPackageCommand.cs +++ b/src/WixToolset.Core.Burn/Bundles/ProcessMsiPackageCommand.cs | |||
@@ -135,6 +135,11 @@ namespace WixToolset.Core.Burn.Bundles | |||
135 | this.Facade.PackageTuple.Description = ProcessMsiPackageCommand.GetProperty(db, "ARPCOMMENTS"); | 135 | this.Facade.PackageTuple.Description = ProcessMsiPackageCommand.GetProperty(db, "ARPCOMMENTS"); |
136 | } | 136 | } |
137 | 137 | ||
138 | if (String.IsNullOrEmpty(this.Facade.PackageTuple.Version)) | ||
139 | { | ||
140 | this.Facade.PackageTuple.Version = msiPackage.ProductVersion; | ||
141 | } | ||
142 | |||
138 | var payloadNames = this.GetPayloadTargetNames(packagePayload.Id.Id); | 143 | var payloadNames = this.GetPayloadTargetNames(packagePayload.Id.Id); |
139 | 144 | ||
140 | var msiPropertyNames = this.GetMsiPropertyNames(packagePayload.Id.Id); | 145 | var msiPropertyNames = this.GetMsiPropertyNames(packagePayload.Id.Id); |
diff --git a/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs b/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs index 22710aca..be0e4578 100644 --- a/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs +++ b/src/WixToolset.Core/Bind/ResolveDelayedFieldsCommand.cs | |||
@@ -153,12 +153,11 @@ namespace WixToolset.Core.Bind | |||
153 | } | 153 | } |
154 | else | 154 | else |
155 | { | 155 | { |
156 | string key = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", variableId, variableScope).ToLower(CultureInfo.InvariantCulture); | 156 | var key = String.Format(CultureInfo.InvariantCulture, "{0}.{1}", variableId, variableScope).ToLower(CultureInfo.InvariantCulture); |
157 | string resolvedValue = variableDefaultValue; | ||
158 | 157 | ||
159 | if (resolutionData.ContainsKey(key)) | 158 | if (!resolutionData.TryGetValue(key, out var resolvedValue)) |
160 | { | 159 | { |
161 | resolvedValue = resolutionData[key]; | 160 | resolvedValue = variableDefaultValue; |
162 | } | 161 | } |
163 | 162 | ||
164 | if ("bind" == variableNamespace) | 163 | if ("bind" == variableNamespace) |
diff --git a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs index 554f4b17..f32208a4 100644 --- a/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/BundleFixture.cs | |||
@@ -44,6 +44,12 @@ namespace WixToolsetTest.CoreIntegration | |||
44 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); | 44 | var intermediate = Intermediate.Load(Path.Combine(intermediateFolder, @"test.wir")); |
45 | var section = intermediate.Sections.Single(); | 45 | var section = intermediate.Sections.Single(); |
46 | 46 | ||
47 | var bundleTuple = section.Tuples.OfType<WixBundleTuple>().Single(); | ||
48 | Assert.Equal("1.0.0.0", bundleTuple.Version); | ||
49 | |||
50 | var previousVersion = bundleTuple.Fields[(int)WixBundleTupleFields.Version].PreviousValue; | ||
51 | Assert.Equal("!(bind.packageVersion.test.msi)", previousVersion.AsString()); | ||
52 | |||
47 | var msiTuple = section.Tuples.OfType<WixBundlePackageTuple>().Single(); | 53 | var msiTuple = section.Tuples.OfType<WixBundlePackageTuple>().Single(); |
48 | Assert.Equal("test.msi", msiTuple.Id.Id ); | 54 | Assert.Equal("test.msi", msiTuple.Id.Id ); |
49 | } | 55 | } |
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs index 89dbb503..7ef1fc05 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/SimpleBundle/Bundle.wxs | |||
@@ -1,6 +1,6 @@ | |||
1 | <?xml version="1.0" encoding="utf-8"?> | 1 | <?xml version="1.0" encoding="utf-8"?> |
2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | 2 | <Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> |
3 | <Bundle Name="!(loc.BundleName)" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> | 3 | <Bundle Name="!(loc.BundleName)" Version="!(bind.packageVersion.test.msi)" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a"> |
4 | <BootstrapperApplication SourceFile="fakeba.dll" /> | 4 | <BootstrapperApplication SourceFile="fakeba.dll" /> |
5 | <Chain> | 5 | <Chain> |
6 | <MsiPackage SourceFile="test.msi"> | 6 | <MsiPackage SourceFile="test.msi"> |