summaryrefslogtreecommitdiff
path: root/src/ext/UI/wixext/UICompiler.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ext/UI/wixext/UICompiler.cs')
-rw-r--r--src/ext/UI/wixext/UICompiler.cs40
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 {