diff --git a/src/wix/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs b/src/wix/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs
index 95cc18cde..b37c7b952 100644
--- a/src/wix/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs
+++ b/src/wix/WixToolset.Core.WindowsInstaller/Bind/BindTransformCommand.cs
@@ -268,7 +268,7 @@ public void Execute()
{
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 0ce4674d9..e75571494 100644
--- a/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs
@@ -336,6 +336,27 @@ public void CanBuildPatchFromProductWithFilesFromWixlib()
}
}
+ [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 000000000..e802e323a
--- /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 000000000..278615390
--- /dev/null
+++ b/src/wix/test/WixToolsetTest.CoreIntegration/TestData/PatchWithRemovedRemoveFileRows/Patch.wxs
@@ -0,0 +1,15 @@
+
+
+
+
+
+
+
+
+
+