-
Notifications
You must be signed in to change notification settings - Fork 288
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scheduling standard actions must override virtual definitions from st…
…dlib Fixes 8115
- Loading branch information
Showing
5 changed files
with
162 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
124 changes: 124 additions & 0 deletions
124
src/wix/test/WixToolsetTest.CoreIntegration/StandardActionFixture.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
// Copyright (c) .NET Foundation and contributors. All rights reserved. Licensed under the Microsoft Reciprocal License. See LICENSE.TXT file in the project root for full license information. | ||
|
||
namespace WixToolsetTest.CoreIntegration | ||
{ | ||
using System.IO; | ||
using System.Linq; | ||
using WixInternal.Core.TestPackage; | ||
using WixInternal.TestSupport; | ||
using Xunit; | ||
|
||
public class StandardActionFixture | ||
{ | ||
[Fact] | ||
public void CanCompileSpecialActionWithOverride() | ||
{ | ||
using var fs = new DisposableFileSystem(); | ||
|
||
var results = BuildAndQueryMsi(fs, "SpecialActionOverride.wxs"); | ||
|
||
WixAssert.CompareLineByLine(new[] | ||
{ | ||
"InstallExecuteSequence:AppSearch\t\t99", | ||
"InstallExecuteSequence:CostFinalize\t\t1000", | ||
"InstallExecuteSequence:CostInitialize\t\t800", | ||
"InstallExecuteSequence:CreateFolders\t\t3700", | ||
"InstallExecuteSequence:FileCost\t\t900", | ||
"InstallExecuteSequence:FindRelatedProducts\t\t98", | ||
"InstallExecuteSequence:InstallFiles\t\t4000", | ||
"InstallExecuteSequence:InstallFinalize\t\t6600", | ||
"InstallExecuteSequence:InstallInitialize\t\t1500", | ||
"InstallExecuteSequence:InstallValidate\t\t1400", | ||
"InstallExecuteSequence:LaunchConditions\t\t100", | ||
"InstallExecuteSequence:MigrateFeatureStates\t\t1200", | ||
"InstallExecuteSequence:ProcessComponents\t\t1600", | ||
"InstallExecuteSequence:PublishFeatures\t\t6300", | ||
"InstallExecuteSequence:PublishProduct\t\t6400", | ||
"InstallExecuteSequence:RegisterProduct\t\t6100", | ||
"InstallExecuteSequence:RegisterUser\t\t6000", | ||
"InstallExecuteSequence:RemoveExistingProducts\t\t1401", | ||
"InstallExecuteSequence:RemoveFiles\t\t3500", | ||
"InstallExecuteSequence:RemoveFolders\t\t3600", | ||
"InstallExecuteSequence:UnpublishFeatures\t\t1800", | ||
"InstallExecuteSequence:ValidateProductID\t\t700", | ||
"InstallUISequence:CostFinalize\t\t1000", | ||
"InstallUISequence:CostInitialize\t\t800", | ||
"InstallUISequence:ExecuteAction\t\t1300", | ||
"InstallUISequence:FileCost\t\t900", | ||
"InstallUISequence:FindRelatedProducts\t\t25", | ||
"InstallUISequence:LaunchConditions\t\t100", | ||
"InstallUISequence:MigrateFeatureStates\t\t1200", | ||
"InstallUISequence:ValidateProductID\t\t700", | ||
}, results); | ||
} | ||
|
||
[Fact] | ||
public void CanCompileStandardActionWithOverride() | ||
{ | ||
using var fs = new DisposableFileSystem(); | ||
|
||
var results = BuildAndQueryMsi(fs, "StandardActionOverride.wxs"); | ||
|
||
WixAssert.CompareLineByLine(new[] | ||
{ | ||
"InstallExecuteSequence:CostFinalize\t\t1000", | ||
"InstallExecuteSequence:CostInitialize\t\t800", | ||
"InstallExecuteSequence:CreateFolders\t\t3700", | ||
"InstallExecuteSequence:FileCost\t\t900", | ||
"InstallExecuteSequence:FindRelatedProducts\t\t25", | ||
"InstallExecuteSequence:InstallFiles\tTEST_CONDITION\t4000", | ||
"InstallExecuteSequence:InstallFinalize\t\t6600", | ||
"InstallExecuteSequence:InstallInitialize\t\t1500", | ||
"InstallExecuteSequence:InstallValidate\t\t1400", | ||
"InstallExecuteSequence:LaunchConditions\t\t100", | ||
"InstallExecuteSequence:MigrateFeatureStates\t\t1200", | ||
"InstallExecuteSequence:ProcessComponents\t\t1600", | ||
"InstallExecuteSequence:PublishFeatures\t\t6300", | ||
"InstallExecuteSequence:PublishProduct\t\t6400", | ||
"InstallExecuteSequence:RegisterProduct\t\t6100", | ||
"InstallExecuteSequence:RegisterUser\t\t6000", | ||
"InstallExecuteSequence:RemoveExistingProducts\t\t1401", | ||
"InstallExecuteSequence:RemoveFiles\t\t3500", | ||
"InstallExecuteSequence:RemoveFolders\t\t3600", | ||
"InstallExecuteSequence:UnpublishFeatures\t\t1800", | ||
"InstallExecuteSequence:ValidateProductID\t\t700", | ||
"InstallUISequence:CostFinalize\t\t1000", | ||
"InstallUISequence:CostInitialize\t\t800", | ||
"InstallUISequence:ExecuteAction\t\t1300", | ||
"InstallUISequence:FileCost\t\t900", | ||
"InstallUISequence:FindRelatedProducts\t\t25", | ||
"InstallUISequence:LaunchConditions\t\t100", | ||
"InstallUISequence:MigrateFeatureStates\t\t1200", | ||
"InstallUISequence:ValidateProductID\t\t700", | ||
}, results); | ||
} | ||
|
||
private static string[] BuildAndQueryMsi(DisposableFileSystem fs, string sourceFile) | ||
{ | ||
var folder = TestData.Get(@"TestData"); | ||
|
||
var baseFolder = fs.GetFolder(); | ||
var intermediateFolder = Path.Combine(baseFolder, "obj"); | ||
var msiPath = Path.Combine(baseFolder, "bin", "test.msi"); | ||
|
||
var result = WixRunner.Execute(new[] | ||
{ | ||
"build", | ||
Path.Combine(folder, "StandardAction", sourceFile), | ||
"-bindpath", Path.Combine(folder, "SingleFile", "data"), | ||
"-intermediateFolder", intermediateFolder, | ||
"-o", msiPath | ||
}); | ||
|
||
result.AssertSuccess(); | ||
|
||
var results = Query.QueryDatabase(msiPath, new[] | ||
{ | ||
"InstallExecuteSequence", | ||
"InstallUISequence" | ||
}).ToArray(); | ||
|
||
return results; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...wix/test/WixToolsetTest.CoreIntegration/TestData/StandardAction/SpecialActionOverride.wxs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
<Package Name="~SpecialActionOverride" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" | ||
Compressed="no"> | ||
<File Source="test.txt" /> | ||
|
||
<InstallExecuteSequence> | ||
<FindRelatedProducts Before="LaunchConditions" /> | ||
<AppSearch After="FindRelatedProducts" /> | ||
</InstallExecuteSequence> | ||
</Package> | ||
</Wix> |
10 changes: 10 additions & 0 deletions
10
...ix/test/WixToolsetTest.CoreIntegration/TestData/StandardAction/StandardActionOverride.wxs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs"> | ||
<Package Name="~StandardActionOverride" Version="1.0.0.0" Manufacturer="Example Corporation" UpgradeCode="047730a5-30fe-4a62-a520-da9381b8226a" | ||
Compressed="no"> | ||
<File Source="test.txt" /> | ||
|
||
<InstallExecuteSequence> | ||
<InstallFiles Condition="TEST_CONDITION" /> | ||
</InstallExecuteSequence> | ||
</Package> | ||
</Wix> |