summaryrefslogtreecommitdiff
path: root/src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs
diff options
context:
space:
mode:
authorStefanStojanovic <StefanStojanovic@users.noreply.github.com>2022-10-25 22:40:36 +0200
committerGitHub <noreply@github.com>2022-10-25 20:40:36 +0000
commit321c30138c82390ea5ad6b0a612dff294203a877 (patch)
tree2f27ca578d9b162eac11f0c8bee460b17138b531 /src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs
parent98080672cdbbde00ea40a96c1ce38e8a52f24fee (diff)
downloadwix-321c30138c82390ea5ad6b0a612dff294203a877.tar.gz
wix-321c30138c82390ea5ad6b0a612dff294203a877.tar.bz2
wix-321c30138c82390ea5ad6b0a612dff294203a877.zip
Add NetFx .NET compatibility check for MSI (#262)
Adds new custom element in NetFx extension for running NetCoreCheck.exe tool from within the MSI installer - `<netfx:DotNetCompatibilityCheck />`. The checks are run before evaluating launch conditions, so their results can be used in those conditions. There is no limitation on the number of checks that can be run, so installer may query various runtimes on different platforms and versions and with different roll forward policies. Fixes https://github.com/wixtoolset/issues/issues/6264
Diffstat (limited to 'src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs')
-rw-r--r--src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs79
1 files changed, 79 insertions, 0 deletions
diff --git a/src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs b/src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs
new file mode 100644
index 00000000..a46cf17f
--- /dev/null
+++ b/src/ext/NetFx/wixext/Symbols/NetFxDotNetCompatibilityCheckSymbol.cs
@@ -0,0 +1,79 @@
1// 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.
2
3namespace WixToolset.Netfx
4{
5 using WixToolset.Data;
6 using WixToolset.Netfx.Symbols;
7
8 public static partial class NetfxSymbolDefinitions
9 {
10 public static readonly IntermediateSymbolDefinition NetFxDotNetCompatibilityCheck = new IntermediateSymbolDefinition(
11 NetfxSymbolDefinitionType.NetFxDotNetCompatibilityCheck.ToString(),
12 new[]
13 {
14 new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbollFields.RuntimeType), IntermediateFieldType.String),
15 new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbollFields.Platform), IntermediateFieldType.String),
16 new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbollFields.Version), IntermediateFieldType.String),
17 new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbollFields.RollForward), IntermediateFieldType.String),
18 new IntermediateFieldDefinition(nameof(NetFxDotNetCompatibilityCheckSymbollFields.Property), IntermediateFieldType.String),
19 },
20 typeof(NetFxDotNetCompatibilityCheckSymbol));
21 }
22}
23
24namespace WixToolset.Netfx.Symbols
25{
26 using WixToolset.Data;
27
28 public enum NetFxDotNetCompatibilityCheckSymbollFields
29 {
30 RuntimeType,
31 Platform,
32 Version,
33 RollForward,
34 Property,
35 }
36
37 public class NetFxDotNetCompatibilityCheckSymbol : IntermediateSymbol
38 {
39 public NetFxDotNetCompatibilityCheckSymbol() : base(NetfxSymbolDefinitions.NetFxDotNetCompatibilityCheck, null, null)
40 {
41 }
42
43 public NetFxDotNetCompatibilityCheckSymbol(SourceLineNumber sourceLineNumber, Identifier id = null) : base(NetfxSymbolDefinitions.NetFxDotNetCompatibilityCheck, sourceLineNumber, id)
44 {
45 }
46
47 public IntermediateField this[NetFxDotNetCompatibilityCheckSymbollFields index] => this.Fields[(int)index];
48
49 public string RuntimeType
50 {
51 get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbollFields.RuntimeType].AsString();
52 set => this.Set((int)NetFxDotNetCompatibilityCheckSymbollFields.RuntimeType, value);
53 }
54
55 public string Platform
56 {
57 get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbollFields.Platform].AsString();
58 set => this.Set((int)NetFxDotNetCompatibilityCheckSymbollFields.Platform, value);
59 }
60
61 public string Version
62 {
63 get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbollFields.Version].AsString();
64 set => this.Set((int)NetFxDotNetCompatibilityCheckSymbollFields.Version, value);
65 }
66
67 public string RollForward
68 {
69 get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbollFields.RollForward].AsString();
70 set => this.Set((int)NetFxDotNetCompatibilityCheckSymbollFields.RollForward, value);
71 }
72
73 public string Property
74 {
75 get => this.Fields[(int)NetFxDotNetCompatibilityCheckSymbollFields.Property].AsString();
76 set => this.Set((int)NetFxDotNetCompatibilityCheckSymbollFields.Property, value);
77 }
78 }
79}