Skip to content

Commit

Permalink
Avoid setting null MinValues when removing rows.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson authored and robmen committed Dec 27, 2024
1 parent 05d9529 commit 6f644be
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
{
Expand Down
21 changes: 21 additions & 0 deletions src/wix/test/WixToolsetTest.CoreIntegration/PatchFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="~Test Package" Version="$(V)" Manufacturer="Example Corporation" Language="1033" UpgradeCode="{81CB1126-5796-4012-AB4D-97360EB817F1}" Scope="perMachine" ProductCode="{6CB58995-A174-4A21-823E-3A114A81AB66}">

<Component Directory="INSTALLFOLDER">
<RegistryValue Root="HKLM" Key="SOFTWARE\WiX Toolset\PatchTests" Name="GonnaRemoveRemoveFileRow" Value="1" KeyPath="yes" />

<?if $(V) = "1.0.0" ?>
<RemoveFile Name="bar.dat" On="uninstall" />
<?endif?>
</Component>

<Component Directory="INSTALLFOLDER">
<RegistryValue Root="HKLM" Key="SOFTWARE\WiX Toolset\PatchTests" Name="ButNotInThisComponent" Value="1" KeyPath="yes" />

<RemoveFile Name="foo.dat" On="uninstall" />
</Component>
</Package>
</Wix>
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<Wix xmlns='http://wixtoolset.org/schemas/v4/wxs'>
<Patch
DisplayName="~Test Patch v$(V)"
Description="~Test Small Update Patch v$(V)"
MoreInfoURL="http://www.example.com/"
Manufacturer="Example Corporation"
Classification="Update">

<Media Id="1" Cabinet="foo.cab">
<PatchBaseline Id="RTM" BaselineFile="Baseline.wixpdb" UpdateFile="Update.wixpdb" />
</Media>

<PatchFamily Id='SequenceFamily' Version='$(V)' />
</Patch>
</Wix>

0 comments on commit 6f644be

Please sign in to comment.