Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid setting null MinValues when removing rows. #564

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -309,6 +309,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>
Loading