diff options
| author | Bob Arnson <bob@firegiant.com> | 2019-11-05 19:27:06 -0500 |
|---|---|---|
| committer | Bob Arnson <bob@firegiant.com> | 2019-11-05 19:32:42 -0500 |
| commit | 0f65aaaca2faf1b6fc233c445216d547f08c6fa5 (patch) | |
| tree | 656e070ac1fe3b8e609002196f325386f6220731 /src | |
| parent | e6f381b0ce2011ced88697ca7ddaae8a053b57d7 (diff) | |
| download | wix-0f65aaaca2faf1b6fc233c445216d547f08c6fa5.tar.gz wix-0f65aaaca2faf1b6fc233c445216d547f08c6fa5.tar.bz2 wix-0f65aaaca2faf1b6fc233c445216d547f08c6fa5.zip | |
Move creation of hidden properties...
...for deferred CAs with HideTarget="yes" to the MSI backend where it belongs.
Diffstat (limited to 'src')
4 files changed, 20 insertions, 13 deletions
diff --git a/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs b/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs index e6c089a1..8f769904 100644 --- a/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs +++ b/src/WixToolset.Core.WindowsInstaller/Bind/CreateSpecialPropertiesCommand.cs | |||
| @@ -20,9 +20,9 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 20 | public void Execute() | 20 | public void Execute() |
| 21 | { | 21 | { |
| 22 | // Create lists of the properties that contribute to the special lists of properties. | 22 | // Create lists of the properties that contribute to the special lists of properties. |
| 23 | SortedSet<string> adminProperties = new SortedSet<string>(); | 23 | var adminProperties = new SortedSet<string>(); |
| 24 | SortedSet<string> secureProperties = new SortedSet<string>(); | 24 | var secureProperties = new SortedSet<string>(); |
| 25 | SortedSet<string> hiddenProperties = new SortedSet<string>(); | 25 | var hiddenProperties = new SortedSet<string>(); |
| 26 | 26 | ||
| 27 | foreach (var wixPropertyRow in this.Section.Tuples.OfType<WixPropertyTuple>()) | 27 | foreach (var wixPropertyRow in this.Section.Tuples.OfType<WixPropertyTuple>()) |
| 28 | { | 28 | { |
| @@ -42,6 +42,15 @@ namespace WixToolset.Core.WindowsInstaller.Bind | |||
| 42 | } | 42 | } |
| 43 | } | 43 | } |
| 44 | 44 | ||
| 45 | // Hide properties for in-script custom actions that have HideTarget set. | ||
| 46 | var hideTargetCustomActions = this.Section.Tuples.OfType<CustomActionTuple>().Where( | ||
| 47 | ca => ca.Hidden | ||
| 48 | && (ca.ExecutionType == CustomActionExecutionType.Deferred | ||
| 49 | || ca.ExecutionType == CustomActionExecutionType.Commit | ||
| 50 | || ca.ExecutionType == CustomActionExecutionType.Rollback)) | ||
| 51 | .Select(ca => ca.Id.Id); | ||
| 52 | hiddenProperties.UnionWith(hideTargetCustomActions); | ||
| 53 | |||
| 45 | if (0 < adminProperties.Count) | 54 | if (0 < adminProperties.Count) |
| 46 | { | 55 | { |
| 47 | var tuple = new PropertyTuple(null, new Identifier(AccessModifier.Private, "AdminProperties")); | 56 | var tuple = new PropertyTuple(null, new Identifier(AccessModifier.Private, "AdminProperties")); |
diff --git a/src/WixToolset.Core/Compiler.cs b/src/WixToolset.Core/Compiler.cs index ee460edc..b983981b 100644 --- a/src/WixToolset.Core/Compiler.cs +++ b/src/WixToolset.Core/Compiler.cs | |||
| @@ -3561,6 +3561,7 @@ namespace WixToolset.Core | |||
| 3561 | PatchUninstall = patchUninstall, | 3561 | PatchUninstall = patchUninstall, |
| 3562 | TSAware = tsAware, | 3562 | TSAware = tsAware, |
| 3563 | Win64 = win64, | 3563 | Win64 = win64, |
| 3564 | Hidden = hidden, | ||
| 3564 | }; | 3565 | }; |
| 3565 | 3566 | ||
| 3566 | this.Core.AddTuple(tuple); | 3567 | this.Core.AddTuple(tuple); |
| @@ -3569,15 +3570,6 @@ namespace WixToolset.Core | |||
| 3569 | { | 3570 | { |
| 3570 | this.Core.AddTuple(new WixSuppressModularizationTuple(sourceLineNumbers, id)); | 3571 | this.Core.AddTuple(new WixSuppressModularizationTuple(sourceLineNumbers, id)); |
| 3571 | } | 3572 | } |
| 3572 | |||
| 3573 | // For deferred CAs that specify HideTarget we should also hide the CA data property for the action. | ||
| 3574 | if (hidden && | ||
| 3575 | (CustomActionExecutionType.Deferred == executionType || | ||
| 3576 | CustomActionExecutionType.Commit == executionType || | ||
| 3577 | CustomActionExecutionType.Rollback == executionType)) | ||
| 3578 | { | ||
| 3579 | this.AddWixPropertyRow(sourceLineNumbers, id, false, false, hidden); | ||
| 3580 | } | ||
| 3581 | } | 3573 | } |
| 3582 | } | 3574 | } |
| 3583 | 3575 | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs index fff37618..febf3b62 100644 --- a/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs +++ b/src/test/WixToolsetTest.CoreIntegration/MsiQueryFixture.cs | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | namespace WixToolsetTest.CoreIntegration | 3 | namespace WixToolsetTest.CoreIntegration |
| 4 | { | 4 | { |
| 5 | using System.IO; | 5 | using System.IO; |
| 6 | using System.Linq; | ||
| 6 | using WixBuildTools.TestSupport; | 7 | using WixBuildTools.TestSupport; |
| 7 | using WixToolset.Core.TestPackage; | 8 | using WixToolset.Core.TestPackage; |
| 8 | using Xunit; | 9 | using Xunit; |
| @@ -281,8 +282,12 @@ namespace WixToolsetTest.CoreIntegration | |||
| 281 | { | 282 | { |
| 282 | "Binary:Binary1\t[Binary data]", | 283 | "Binary:Binary1\t[Binary data]", |
| 283 | "CustomAction:CustomAction1\t1\tBinary1\tInvalidEntryPoint\t", | 284 | "CustomAction:CustomAction1\t1\tBinary1\tInvalidEntryPoint\t", |
| 285 | "CustomAction:CustomActionWithHiddenTarget\t9217\tBinary1\tInvalidEntryPoint\t", | ||
| 284 | "CustomAction:DiscardOptimismAllBeingsWhoProceed\t19\t\tAbandon hope all ye who enter here.\t", | 286 | "CustomAction:DiscardOptimismAllBeingsWhoProceed\t19\t\tAbandon hope all ye who enter here.\t", |
| 285 | }, results); | 287 | }, results); |
| 288 | var properties = Query.QueryDatabase(msiPath, new[] { "Property" }); | ||
| 289 | var hiddenProperties = properties.Where(q => q.StartsWith("Property:MsiHiddenProperties")).Single(); | ||
| 290 | Assert.Equal("Property:MsiHiddenProperties\tCustomActionWithHiddenTarget", hiddenProperties); | ||
| 286 | } | 291 | } |
| 287 | } | 292 | } |
| 288 | 293 | ||
diff --git a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomAction/UnscheduledCustomAction.wxs b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomAction/UnscheduledCustomAction.wxs index e4b066e9..00ac2810 100644 --- a/src/test/WixToolsetTest.CoreIntegration/TestData/CustomAction/UnscheduledCustomAction.wxs +++ b/src/test/WixToolsetTest.CoreIntegration/TestData/CustomAction/UnscheduledCustomAction.wxs | |||
| @@ -6,7 +6,8 @@ | |||
| 6 | </ComponentGroup> | 6 | </ComponentGroup> |
| 7 | 7 | ||
| 8 | <Binary Id="Binary1" SourceFile="test.txt"></Binary> | 8 | <Binary Id="Binary1" SourceFile="test.txt"></Binary> |
| 9 | <CustomAction Id="CustomAction1" BinaryKey="Binary1" DllEntry="InvalidEntryPoint"></CustomAction> | 9 | <CustomAction Id="CustomAction1" BinaryKey="Binary1" DllEntry="InvalidEntryPoint" /> |
| 10 | <CustomAction Id="DiscardOptimismAllBeingsWhoProceed" Error="Abandon hope all ye who enter here." /> | 10 | <CustomAction Id="DiscardOptimismAllBeingsWhoProceed" Error="Abandon hope all ye who enter here." /> |
| 11 | <CustomAction Id="CustomActionWithHiddenTarget" BinaryKey="Binary1" DllEntry="InvalidEntryPoint" Execute="deferred" HideTarget="yes" /> | ||
| 11 | </Fragment> | 12 | </Fragment> |
| 12 | </Wix> | 13 | </Wix> |
