diff options
author | Bob Arnson <bob@firegiant.com> | 2022-11-21 16:57:23 -0500 |
---|---|---|
committer | Bob Arnson <github@bobs.org> | 2022-12-06 15:16:20 -0500 |
commit | c4ffb9967e4e4f7d67f5925208e3e0a885e903c5 (patch) | |
tree | 3f34ca158b1bc39d5b6aaee2a4bb2f93dae0d365 /src/ext/UI/wixext | |
parent | 0af946e794ec85801dc542edd9905f9e9e18e7ed (diff) | |
download | wix-c4ffb9967e4e4f7d67f5925208e3e0a885e903c5.tar.gz wix-c4ffb9967e4e4f7d67f5925208e3e0a885e903c5.tar.bz2 wix-c4ffb9967e4e4f7d67f5925208e3e0a885e903c5.zip |
Better solution to the UI custom action "problem."
Add platform-specific fragments that are referenced by the compiler
extension. That makes it easier to customize: Just copy the dialog set
authoring and rename, like in v3.
Diffstat (limited to 'src/ext/UI/wixext')
-rw-r--r-- | src/ext/UI/wixext/UICompiler.cs | 40 |
1 files changed, 2 insertions, 38 deletions
diff --git a/src/ext/UI/wixext/UICompiler.cs b/src/ext/UI/wixext/UICompiler.cs index 6fdb5bd9..8b527454 100644 --- a/src/ext/UI/wixext/UICompiler.cs +++ b/src/ext/UI/wixext/UICompiler.cs | |||
@@ -17,11 +17,6 @@ namespace WixToolset.UI | |||
17 | public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/ui"; | 17 | public override XNamespace Namespace => "http://wixtoolset.org/schemas/v4/wxs/ui"; |
18 | 18 | ||
19 | /// <summary> | 19 | /// <summary> |
20 | /// Flag to prevent custom action symbols duplication. | ||
21 | /// </summary> | ||
22 | private bool customActionsAdded = false; | ||
23 | |||
24 | /// <summary> | ||
25 | /// Processes an element for the Compiler. | 20 | /// Processes an element for the Compiler. |
26 | /// </summary> | 21 | /// </summary> |
27 | /// <param name="sourceLineNumbers">Source line number for the parent element.</param> | 22 | /// <param name="sourceLineNumbers">Source line number for the parent element.</param> |
@@ -91,40 +86,9 @@ namespace WixToolset.UI | |||
91 | } | 86 | } |
92 | else | 87 | else |
93 | { | 88 | { |
89 | var platform = this.Context.Platform == Platform.ARM64 ? "A64" : this.Context.Platform.ToString(); | ||
94 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixUI, id); | 90 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixUI, id); |
95 | 91 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.WixUI, $"{id}_{platform}"); | |
96 | if (!customActionsAdded) | ||
97 | { | ||
98 | // Because these custom actions are "scheduled" via `DoAction` control events, we have to create the | ||
99 | // custom action definitions here, so the `DoAction` references are static and the targets are | ||
100 | // dynamically created to properly reflect the platform-specific DLL and avoid having duplicate ids | ||
101 | // in the UI .wixlib. | ||
102 | var platform = this.Context.Platform == Platform.ARM64 ? "A64" : this.Context.Platform.ToString(); | ||
103 | var source = $"WixUiCa_{platform}"; | ||
104 | this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, SymbolDefinitions.Binary, source); | ||
105 | |||
106 | section.AddSymbol(new CustomActionSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixUIPrintEula")) | ||
107 | { | ||
108 | TargetType = CustomActionTargetType.Dll, | ||
109 | Target = "PrintEula", | ||
110 | SourceType = CustomActionSourceType.Binary, | ||
111 | Source = source, | ||
112 | IgnoreResult = true, | ||
113 | ExecutionType = CustomActionExecutionType.Immediate, | ||
114 | }); | ||
115 | |||
116 | section.AddSymbol(new CustomActionSymbol(sourceLineNumbers, new Identifier(AccessModifier.Global, "WixUIValidatePath")) | ||
117 | { | ||
118 | TargetType = CustomActionTargetType.Dll, | ||
119 | Target = "ValidatePath", | ||
120 | SourceType = CustomActionSourceType.Binary, | ||
121 | Source = source, | ||
122 | IgnoreResult = true, | ||
123 | ExecutionType = CustomActionExecutionType.Immediate, | ||
124 | }); | ||
125 | |||
126 | customActionsAdded = true; | ||
127 | } | ||
128 | 92 | ||
129 | if (installDirectory != null) | 93 | if (installDirectory != null) |
130 | { | 94 | { |