Skip to content

Commit

Permalink
Test/sample for default major upgrade message.
Browse files Browse the repository at this point in the history
  • Loading branch information
barnson committed Feb 17, 2024
1 parent 3fa1761 commit 5218b9a
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
<Package Name="MajorUpgradeDowngradeMessage" Language="1033" Version="2.0.0" Manufacturer="Example Corporation" UpgradeCode="7ab24276-c628-43db-9e65-a184d052909b" Scope="perMachine">
<Feature Id="ProductFeature" Title="MsiPackageTitle">
</Feature>
</Package>

<Fragment>
<StandardDirectory Id="ProgramFiles6432Folder">
<Directory Id="INSTALLFOLDER" Name="MsiPackage" />
</StandardDirectory>
</Fragment>
</Wix>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<WixLocalization xmlns="http://wixtoolset.org/schemas/v4/wxl" Culture="en-US">
<String Id="WixDowngradePreventedMessage" Value="[ProductName] does not support downgrading." />
</WixLocalization>
13 changes: 13 additions & 0 deletions src/wix/test/WixToolsetTest.CoreIntegration/UpgradeFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,19 @@ public void DefaultMajorUpgradePopulatesUpgradeRowsAsExpected()
}, results);
}

[Fact]
public void CanOverrideDefaultMajorUpgradeLaunchConditionMessage()
{
var folder = TestData.Get("TestData", "DefaultMajorUpgradeOverride");
var build = new Builder(folder, new Type[] { }, new[] { folder });

var results = build.BuildAndQuery(Build, "LaunchCondition");
WixAssert.CompareLineByLine(new[]
{
"LaunchCondition:NOT WIX_DOWNGRADE_DETECTED\t[ProductName] does not support downgrading.",
}, results);
}

[Fact]
public void UpgradeStrategyNoneDoesNotCreateDefaultMajorUpgrade()
{
Expand Down

0 comments on commit 5218b9a

Please sign in to comment.