From 6f644be25a7981c61d6a91977f5f82a849beb60e Mon Sep 17 00:00:00 2001 From: Bob Arnson Date: Sat, 31 Aug 2024 23:11:20 -0400 Subject: Avoid setting null MinValues when removing rows. - Fixes https://github.com/wixtoolset/issues/issues/8689 --- .../Bind/BindTransformCommand.cs | 2 +- .../WixToolsetTest.CoreIntegration/PatchFixture.cs | 21 +++++++++++++++++++++ .../PatchWithRemovedRemoveFileRows/Package.wxs | 18 ++++++++++++++++++ .../PatchWithRemovedRemoveFileRows/Patch.wxs | 15 +++++++++++++++ 4 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithRemovedRemoveFileRows/Package.wxs create mode 100644 src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithRemovedRemoveFileRows/Patch.wxs (limited to 'src') diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs b/src/wix/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs index 95cc18cd..b37c7b95 100644 --- a/src/wix/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs +++ b/src/wix/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs @@ -268,7 +268,7 @@ namespace WixToolset.Core.WindowsInstaller.Bind { if (ColumnType.Number == field.Column.Type && !field.Column.IsLocalizable) { - field.Data = field.Column.MinValue; + field.Data = field.Column.MinValue ?? 0; } else if (ColumnType.Object == field.Column.Type) { diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs index 0ce4674d..e7557149 100644 --- a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs +++ b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs @@ -336,6 +336,27 @@ namespace WixToolsetTest.CoreIntegration } } + [Fact] + public void CanBuildPatchFromProductWithAddedRemoveFileRows() + { + var sourceFolder = TestData.Get(@"TestData", "PatchWithRemovedRemoveFileRows"); + + using (var fs = new DisposableFileSystem()) + { + var baseFolder = fs.GetFolder(); + var tempFolderBaseline = Path.Combine(baseFolder, "baseline"); + var tempFolderUpdate = Path.Combine(baseFolder, "update"); + var tempFolderPatch = Path.Combine(baseFolder, "patch"); + + var baselinePath = BuildMsi("Baseline.msi", sourceFolder, tempFolderBaseline, "1.0.0", "1.0.0", "1.0.0"); + var updatePath = BuildMsi("Update.msi", sourceFolder, tempFolderUpdate, "1.0.1", "1.0.1", "1.0.1"); + var patchPath = BuildMsp("Patch1.msp", sourceFolder, tempFolderPatch, "1.0.1", bindpaths: new[] { Path.GetDirectoryName(baselinePath), Path.GetDirectoryName(updatePath) }, hasNoFiles: true); + + var doc = GetExtractPatchXml(patchPath); + WixAssert.StringEqual("{6CB58995-A174-4A21-823E-3A114A81AB66}", doc.Root.Element(TargetProductCodeName).Value); + } + } + [Fact] public void CanBuildBundleWithNonSpecificPatches() { diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithRemovedRemoveFileRows/Package.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithRemovedRemoveFileRows/Package.wxs new file mode 100644 index 00000000..e802e323 --- /dev/null +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithRemovedRemoveFileRows/Package.wxs @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithRemovedRemoveFileRows/Patch.wxs b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithRemovedRemoveFileRows/Patch.wxs new file mode 100644 index 00000000..27861539 --- /dev/null +++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithRemovedRemoveFileRows/Patch.wxs @@ -0,0 +1,15 @@ + + + + + + + + + + -- cgit v1.2.3-55-g6feb