@joebigelow / wix-1 / commits / 7ad398d4

Modernize VSExtension.

Sean Hall committed Apr 7, 2020 at 20:06 UTC 7ad398d455c42bae61f5196c3f2f66aecf9f9a1a
12 files changed +755 -204
src/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs
+15 -15
@@ -19,21 +19,21 @@ namespace WixToolsetTest.VisualStudio
19 var results = build.BuildAndQuery(Build, "CustomAction");
20 Assert.Equal(new[]
21 {
22 - "CustomAction:SetVS2010Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2010_VSIX_INSTALLER_PATH]\t0",
23 - "CustomAction:SetVS2012Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2012_VSIX_INSTALLER_PATH]\t0",
24 - "CustomAction:SetVS2013Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2013_VSIX_INSTALLER_PATH]\t0",
25 - "CustomAction:SetVS2015Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2015_VSIX_INSTALLER_PATH]\t0",
26 - "CustomAction:vimyrEjb_CFhXi3TTLayKNM2w7rvr4\t3122\tVS_VSIX_INSTALLER_PATH\t/q \"[#filzi8nwT8Ta133xcfp7qSIdGdRiC0]\" /admin\t0",
27 - "CustomAction:viuFqqe3R3R3Fh7P05ubFRhqQlCBdQ\t1074\tVS_VSIX_INSTALLER_PATH\t/q \"[#filzi8nwT8Ta133xcfp7qSIdGdRiC0]\"\t0",
28 - "CustomAction:vrmyrEjb_CFhXi3TTLayKNM2w7rvr4\t3442\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\" /admin\t0",
29 - "CustomAction:vruFqqe3R3R3Fh7P05ubFRhqQlCBdQ\t1394\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\"\t0",
30 - "CustomAction:VSFindInstances\t257\tVSCA\tFindInstances\t0",
31 - "CustomAction:vumyrEjb_CFhXi3TTLayKNM2w7rvr4\t3186\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\" /admin\t0",
32 - "CustomAction:vuuFqqe3R3R3Fh7P05ubFRhqQlCBdQ\t1138\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\"\t0",
33 - "CustomAction:Vwd2012VsixWhenVSAbsent\t51\tVS_VSIX_INSTALLER_PATH\t[VWD2012_VSIX_INSTALL_ROOT]\\Common7\\IDE\\VSIXInstaller.exe\t0",
34 - "CustomAction:Vwd2013VsixWhenVSAbsent\t51\tVS_VSIX_INSTALLER_PATH\t[VWD2013_VSIX_INSTALL_ROOT]\\Common7\\IDE\\VSIXInstaller.exe\t0",
35 - "CustomAction:Vwd2015VsixWhenVSAbsent\t51\tVS_VSIX_INSTALLER_PATH\t[VWD2015_VSIX_INSTALL_ROOT]\\Common7\\IDE\\VSIXInstaller.exe\t0",
36 - }, results.OrderBy(s => s).ToArray());
22 + "CustomAction:SetVS2010Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2010_VSIX_INSTALLER_PATH]\t",
23 + "CustomAction:SetVS2012Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2012_VSIX_INSTALLER_PATH]\t",
24 + "CustomAction:SetVS2013Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2013_VSIX_INSTALLER_PATH]\t",
25 + "CustomAction:SetVS2015Vsix\t51\tVS_VSIX_INSTALLER_PATH\t[VS2015_VSIX_INSTALLER_PATH]\t",
26 + "CustomAction:vimyrEjb_CFhXi3TTLayKNM2w7rvr4\t3122\tVS_VSIX_INSTALLER_PATH\t/q \"[#filzi8nwT8Ta133xcfp7qSIdGdRiC0]\" /admin\t",
27 + "CustomAction:viuFqqe3R3R3Fh7P05ubFRhqQlCBdQ\t1074\tVS_VSIX_INSTALLER_PATH\t/q \"[#filzi8nwT8Ta133xcfp7qSIdGdRiC0]\"\t",
28 + "CustomAction:vrmyrEjb_CFhXi3TTLayKNM2w7rvr4\t3442\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\" /admin\t",
29 + "CustomAction:vruFqqe3R3R3Fh7P05ubFRhqQlCBdQ\t1394\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\"\t",
30 + "CustomAction:VSFindInstances\t257\tVSCA\tFindInstances\t",
31 + "CustomAction:vumyrEjb_CFhXi3TTLayKNM2w7rvr4\t3186\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\" /admin\t",
32 + "CustomAction:vuuFqqe3R3R3Fh7P05ubFRhqQlCBdQ\t1138\tVS_VSIX_INSTALLER_PATH\t/q /u:\"ExampleVsix\"\t",
33 + "CustomAction:Vwd2012VsixWhenVSAbsent\t51\tVS_VSIX_INSTALLER_PATH\t[VWD2012_VSIX_INSTALL_ROOT]\\Common7\\IDE\\VSIXInstaller.exe\t",
34 + "CustomAction:Vwd2013VsixWhenVSAbsent\t51\tVS_VSIX_INSTALLER_PATH\t[VWD2013_VSIX_INSTALL_ROOT]\\Common7\\IDE\\VSIXInstaller.exe\t",
35 + "CustomAction:Vwd2015VsixWhenVSAbsent\t51\tVS_VSIX_INSTALLER_PATH\t[VWD2015_VSIX_INSTALL_ROOT]\\Common7\\IDE\\VSIXInstaller.exe\t",
36 + }, results);
37 }
38
39 private static void Build(string[] args)
src/wixext/Tuples/HelpFileToNamespaceTuple.cs new
+55
@@ -0,0 +1,55 @@
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 +
3 +namespace WixToolset.VisualStudio
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.VisualStudio.Tuples;
7 +
8 + public static partial class VSTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition HelpFileToNamespace = new IntermediateTupleDefinition(
11 + VSTupleDefinitionType.HelpFileToNamespace.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(HelpFileToNamespaceTupleFields.HelpFileRef), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(HelpFileToNamespaceTupleFields.HelpNamespaceRef), IntermediateFieldType.String),
16 + },
17 + typeof(HelpFileToNamespaceTuple));
18 + }
19 +}
20 +
21 +namespace WixToolset.VisualStudio.Tuples
22 +{
23 + using WixToolset.Data;
24 +
25 + public enum HelpFileToNamespaceTupleFields
26 + {
27 + HelpFileRef,
28 + HelpNamespaceRef,
29 + }
30 +
31 + public class HelpFileToNamespaceTuple : IntermediateTuple
32 + {
33 + public HelpFileToNamespaceTuple() : base(VSTupleDefinitions.HelpFileToNamespace, null, null)
34 + {
35 + }
36 +
37 + public HelpFileToNamespaceTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(VSTupleDefinitions.HelpFileToNamespace, sourceLineNumber, id)
38 + {
39 + }
40 +
41 + public IntermediateField this[HelpFileToNamespaceTupleFields index] => this.Fields[(int)index];
42 +
43 + public string HelpFileRef
44 + {
45 + get => this.Fields[(int)HelpFileToNamespaceTupleFields.HelpFileRef].AsString();
46 + set => this.Set((int)HelpFileToNamespaceTupleFields.HelpFileRef, value);
47 + }
48 +
49 + public string HelpNamespaceRef
50 + {
51 + get => this.Fields[(int)HelpFileToNamespaceTupleFields.HelpNamespaceRef].AsString();
52 + set => this.Set((int)HelpFileToNamespaceTupleFields.HelpNamespaceRef, value);
53 + }
54 + }
55 +}
\ No newline at end of file
src/wixext/Tuples/HelpFileTuple.cs new
+95
@@ -0,0 +1,95 @@
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 +
3 +namespace WixToolset.VisualStudio
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.VisualStudio.Tuples;
7 +
8 + public static partial class VSTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition HelpFile = new IntermediateTupleDefinition(
11 + VSTupleDefinitionType.HelpFile.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(HelpFileTupleFields.HelpFileName), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(HelpFileTupleFields.LangID), IntermediateFieldType.Number),
16 + new IntermediateFieldDefinition(nameof(HelpFileTupleFields.HxSFileRef), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(HelpFileTupleFields.HxIFileRef), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(HelpFileTupleFields.HxQFileRef), IntermediateFieldType.String),
19 + new IntermediateFieldDefinition(nameof(HelpFileTupleFields.HxRFileRef), IntermediateFieldType.String),
20 + new IntermediateFieldDefinition(nameof(HelpFileTupleFields.SamplesFileRef), IntermediateFieldType.String),
21 + },
22 + typeof(HelpFileTuple));
23 + }
24 +}
25 +
26 +namespace WixToolset.VisualStudio.Tuples
27 +{
28 + using WixToolset.Data;
29 +
30 + public enum HelpFileTupleFields
31 + {
32 + HelpFileName,
33 + LangID,
34 + HxSFileRef,
35 + HxIFileRef,
36 + HxQFileRef,
37 + HxRFileRef,
38 + SamplesFileRef,
39 + }
40 +
41 + public class HelpFileTuple : IntermediateTuple
42 + {
43 + public HelpFileTuple() : base(VSTupleDefinitions.HelpFile, null, null)
44 + {
45 + }
46 +
47 + public HelpFileTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(VSTupleDefinitions.HelpFile, sourceLineNumber, id)
48 + {
49 + }
50 +
51 + public IntermediateField this[HelpFileTupleFields index] => this.Fields[(int)index];
52 +
53 + public string HelpFileName
54 + {
55 + get => this.Fields[(int)HelpFileTupleFields.HelpFileName].AsString();
56 + set => this.Set((int)HelpFileTupleFields.HelpFileName, value);
57 + }
58 +
59 + public int LangID
60 + {
61 + get => this.Fields[(int)HelpFileTupleFields.LangID].AsNumber();
62 + set => this.Set((int)HelpFileTupleFields.LangID, value);
63 + }
64 +
65 + public string HxSFileRef
66 + {
67 + get => this.Fields[(int)HelpFileTupleFields.HxSFileRef].AsString();
68 + set => this.Set((int)HelpFileTupleFields.HxSFileRef, value);
69 + }
70 +
71 + public string HxIFileRef
72 + {
73 + get => this.Fields[(int)HelpFileTupleFields.HxIFileRef].AsString();
74 + set => this.Set((int)HelpFileTupleFields.HxIFileRef, value);
75 + }
76 +
77 + public string HxQFileRef
78 + {
79 + get => this.Fields[(int)HelpFileTupleFields.HxQFileRef].AsString();
80 + set => this.Set((int)HelpFileTupleFields.HxQFileRef, value);
81 + }
82 +
83 + public string HxRFileRef
84 + {
85 + get => this.Fields[(int)HelpFileTupleFields.HxRFileRef].AsString();
86 + set => this.Set((int)HelpFileTupleFields.HxRFileRef, value);
87 + }
88 +
89 + public string SamplesFileRef
90 + {
91 + get => this.Fields[(int)HelpFileTupleFields.SamplesFileRef].AsString();
92 + set => this.Set((int)HelpFileTupleFields.SamplesFileRef, value);
93 + }
94 + }
95 +}
\ No newline at end of file
src/wixext/Tuples/HelpFilterToNamespaceTuple.cs new
+55
@@ -0,0 +1,55 @@
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 +
3 +namespace WixToolset.VisualStudio
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.VisualStudio.Tuples;
7 +
8 + public static partial class VSTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition HelpFilterToNamespace = new IntermediateTupleDefinition(
11 + VSTupleDefinitionType.HelpFilterToNamespace.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(HelpFilterToNamespaceTupleFields.HelpFilterRef), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(HelpFilterToNamespaceTupleFields.HelpNamespaceRef), IntermediateFieldType.String),
16 + },
17 + typeof(HelpFilterToNamespaceTuple));
18 + }
19 +}
20 +
21 +namespace WixToolset.VisualStudio.Tuples
22 +{
23 + using WixToolset.Data;
24 +
25 + public enum HelpFilterToNamespaceTupleFields
26 + {
27 + HelpFilterRef,
28 + HelpNamespaceRef,
29 + }
30 +
31 + public class HelpFilterToNamespaceTuple : IntermediateTuple
32 + {
33 + public HelpFilterToNamespaceTuple() : base(VSTupleDefinitions.HelpFilterToNamespace, null, null)
34 + {
35 + }
36 +
37 + public HelpFilterToNamespaceTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(VSTupleDefinitions.HelpFilterToNamespace, sourceLineNumber, id)
38 + {
39 + }
40 +
41 + public IntermediateField this[HelpFilterToNamespaceTupleFields index] => this.Fields[(int)index];
42 +
43 + public string HelpFilterRef
44 + {
45 + get => this.Fields[(int)HelpFilterToNamespaceTupleFields.HelpFilterRef].AsString();
46 + set => this.Set((int)HelpFilterToNamespaceTupleFields.HelpFilterRef, value);
47 + }
48 +
49 + public string HelpNamespaceRef
50 + {
51 + get => this.Fields[(int)HelpFilterToNamespaceTupleFields.HelpNamespaceRef].AsString();
52 + set => this.Set((int)HelpFilterToNamespaceTupleFields.HelpNamespaceRef, value);
53 + }
54 + }
55 +}
\ No newline at end of file
src/wixext/Tuples/HelpFilterTuple.cs new
+55
@@ -0,0 +1,55 @@
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 +
3 +namespace WixToolset.VisualStudio
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.VisualStudio.Tuples;
7 +
8 + public static partial class VSTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition HelpFilter = new IntermediateTupleDefinition(
11 + VSTupleDefinitionType.HelpFilter.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(HelpFilterTupleFields.Description), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(HelpFilterTupleFields.QueryString), IntermediateFieldType.String),
16 + },
17 + typeof(HelpFilterTuple));
18 + }
19 +}
20 +
21 +namespace WixToolset.VisualStudio.Tuples
22 +{
23 + using WixToolset.Data;
24 +
25 + public enum HelpFilterTupleFields
26 + {
27 + Description,
28 + QueryString,
29 + }
30 +
31 + public class HelpFilterTuple : IntermediateTuple
32 + {
33 + public HelpFilterTuple() : base(VSTupleDefinitions.HelpFilter, null, null)
34 + {
35 + }
36 +
37 + public HelpFilterTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(VSTupleDefinitions.HelpFilter, sourceLineNumber, id)
38 + {
39 + }
40 +
41 + public IntermediateField this[HelpFilterTupleFields index] => this.Fields[(int)index];
42 +
43 + public string Description
44 + {
45 + get => this.Fields[(int)HelpFilterTupleFields.Description].AsString();
46 + set => this.Set((int)HelpFilterTupleFields.Description, value);
47 + }
48 +
49 + public string QueryString
50 + {
51 + get => this.Fields[(int)HelpFilterTupleFields.QueryString].AsString();
52 + set => this.Set((int)HelpFilterTupleFields.QueryString, value);
53 + }
54 + }
55 +}
\ No newline at end of file
src/wixext/Tuples/HelpNamespaceTuple.cs new
+63
@@ -0,0 +1,63 @@
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 +
3 +namespace WixToolset.VisualStudio
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.VisualStudio.Tuples;
7 +
8 + public static partial class VSTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition HelpNamespace = new IntermediateTupleDefinition(
11 + VSTupleDefinitionType.HelpNamespace.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(HelpNamespaceTupleFields.NamespaceName), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(HelpNamespaceTupleFields.CollectionFileRef), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(HelpNamespaceTupleFields.Description), IntermediateFieldType.String),
17 + },
18 + typeof(HelpNamespaceTuple));
19 + }
20 +}
21 +
22 +namespace WixToolset.VisualStudio.Tuples
23 +{
24 + using WixToolset.Data;
25 +
26 + public enum HelpNamespaceTupleFields
27 + {
28 + NamespaceName,
29 + CollectionFileRef,
30 + Description,
31 + }
32 +
33 + public class HelpNamespaceTuple : IntermediateTuple
34 + {
35 + public HelpNamespaceTuple() : base(VSTupleDefinitions.HelpNamespace, null, null)
36 + {
37 + }
38 +
39 + public HelpNamespaceTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(VSTupleDefinitions.HelpNamespace, sourceLineNumber, id)
40 + {
41 + }
42 +
43 + public IntermediateField this[HelpNamespaceTupleFields index] => this.Fields[(int)index];
44 +
45 + public string NamespaceName
46 + {
47 + get => this.Fields[(int)HelpNamespaceTupleFields.NamespaceName].AsString();
48 + set => this.Set((int)HelpNamespaceTupleFields.NamespaceName, value);
49 + }
50 +
51 + public string CollectionFileRef
52 + {
53 + get => this.Fields[(int)HelpNamespaceTupleFields.CollectionFileRef].AsString();
54 + set => this.Set((int)HelpNamespaceTupleFields.CollectionFileRef, value);
55 + }
56 +
57 + public string Description
58 + {
59 + get => this.Fields[(int)HelpNamespaceTupleFields.Description].AsString();
60 + set => this.Set((int)HelpNamespaceTupleFields.Description, value);
61 + }
62 + }
63 +}
\ No newline at end of file
src/wixext/Tuples/HelpPluginTuple.cs new
+79
@@ -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 +
3 +namespace WixToolset.VisualStudio
4 +{
5 + using WixToolset.Data;
6 + using WixToolset.VisualStudio.Tuples;
7 +
8 + public static partial class VSTupleDefinitions
9 + {
10 + public static readonly IntermediateTupleDefinition HelpPlugin = new IntermediateTupleDefinition(
11 + VSTupleDefinitionType.HelpPlugin.ToString(),
12 + new[]
13 + {
14 + new IntermediateFieldDefinition(nameof(HelpPluginTupleFields.HelpNamespaceRef), IntermediateFieldType.String),
15 + new IntermediateFieldDefinition(nameof(HelpPluginTupleFields.ParentHelpNamespaceRef), IntermediateFieldType.String),
16 + new IntermediateFieldDefinition(nameof(HelpPluginTupleFields.HxTFileRef), IntermediateFieldType.String),
17 + new IntermediateFieldDefinition(nameof(HelpPluginTupleFields.HxAFileRef), IntermediateFieldType.String),
18 + new IntermediateFieldDefinition(nameof(HelpPluginTupleFields.ParentHxTFileRef), IntermediateFieldType.String),
19 + },
20 + typeof(HelpPluginTuple));
21 + }
22 +}
23 +
24 +namespace WixToolset.VisualStudio.Tuples
25 +{
26 + using WixToolset.Data;
27 +
28 + public enum HelpPluginTupleFields
29 + {
30 + HelpNamespaceRef,
31 + ParentHelpNamespaceRef,
32 + HxTFileRef,
33 + HxAFileRef,
34 + ParentHxTFileRef,
35 + }
36 +
37 + public class HelpPluginTuple : IntermediateTuple
38 + {
39 + public HelpPluginTuple() : base(VSTupleDefinitions.HelpPlugin, null, null)
40 + {
41 + }
42 +
43 + public HelpPluginTuple(SourceLineNumber sourceLineNumber, Identifier id = null) : base(VSTupleDefinitions.HelpPlugin, sourceLineNumber, id)
44 + {
45 + }
46 +
47 + public IntermediateField this[HelpPluginTupleFields index] => this.Fields[(int)index];
48 +
49 + public string HelpNamespaceRef
50 + {
51 + get => this.Fields[(int)HelpPluginTupleFields.HelpNamespaceRef].AsString();
52 + set => this.Set((int)HelpPluginTupleFields.HelpNamespaceRef, value);
53 + }
54 +
55 + public string ParentHelpNamespaceRef
56 + {
57 + get => this.Fields[(int)HelpPluginTupleFields.ParentHelpNamespaceRef].AsString();
58 + set => this.Set((int)HelpPluginTupleFields.ParentHelpNamespaceRef, value);
59 + }
60 +
61 + public string HxTFileRef
62 + {
63 + get => this.Fields[(int)HelpPluginTupleFields.HxTFileRef].AsString();
64 + set => this.Set((int)HelpPluginTupleFields.HxTFileRef, value);
65 + }
66 +
67 + public string HxAFileRef
68 + {
69 + get => this.Fields[(int)HelpPluginTupleFields.HxAFileRef].AsString();
70 + set => this.Set((int)HelpPluginTupleFields.HxAFileRef, value);
71 + }
72 +
73 + public string ParentHxTFileRef
74 + {
75 + get => this.Fields[(int)HelpPluginTupleFields.ParentHxTFileRef].AsString();
76 + set => this.Set((int)HelpPluginTupleFields.ParentHxTFileRef, value);
77 + }
78 + }
79 +}
\ No newline at end of file
src/wixext/Tuples/VSTupleDefinitions.cs new
+59
@@ -0,0 +1,59 @@
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 +
3 +namespace WixToolset.VisualStudio
4 +{
5 + using System;
6 + using WixToolset.Data;
7 +
8 + public enum VSTupleDefinitionType
9 + {
10 + HelpFile,
11 + HelpFileToNamespace,
12 + HelpFilter,
13 + HelpFilterToNamespace,
14 + HelpNamespace,
15 + HelpPlugin,
16 + }
17 +
18 + public static partial class VSTupleDefinitions
19 + {
20 + public static readonly Version Version = new Version("4.0.0");
21 +
22 + public static IntermediateTupleDefinition ByName(string name)
23 + {
24 + if (!Enum.TryParse(name, out VSTupleDefinitionType type))
25 + {
26 + return null;
27 + }
28 +
29 + return ByType(type);
30 + }
31 +
32 + public static IntermediateTupleDefinition ByType(VSTupleDefinitionType type)
33 + {
34 + switch (type)
35 + {
36 + case VSTupleDefinitionType.HelpFile:
37 + return VSTupleDefinitions.HelpFile;
38 +
39 + case VSTupleDefinitionType.HelpFileToNamespace:
40 + return VSTupleDefinitions.HelpFileToNamespace;
41 +
42 + case VSTupleDefinitionType.HelpFilter:
43 + return VSTupleDefinitions.HelpFilter;
44 +
45 + case VSTupleDefinitionType.HelpFilterToNamespace:
46 + return VSTupleDefinitions.HelpFilterToNamespace;
47 +
48 + case VSTupleDefinitionType.HelpNamespace:
49 + return VSTupleDefinitions.HelpNamespace;
50 +
51 + case VSTupleDefinitionType.HelpPlugin:
52 + return VSTupleDefinitions.HelpPlugin;
53 +
54 + default:
55 + throw new ArgumentOutOfRangeException(nameof(type));
56 + }
57 + }
58 + }
59 +}
src/wixext/VSCompiler.cs
+179 -126
@@ -4,10 +4,13 @@ namespace WixToolset.VisualStudio
4 {
5 using System;
6 using System.Collections.Generic;
7 + using System.Globalization;
8 using System.Xml.Linq;
9 using WixToolset.Data;
10 + using WixToolset.Data.Tuples;
11 using WixToolset.Data.WindowsInstaller;
12 using WixToolset.Extensibility;
13 + using WixToolset.VisualStudio.Tuples;
14
15 /// <summary>
16 /// The compiler for the WiX Toolset Visual Studio Extension.
@@ -79,10 +82,10 @@ namespace WixToolset.VisualStudio
82
83 private void ParseHelpCollectionRefElement(Intermediate intermediate, IntermediateSection section, XElement element)
84 {
82 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
85 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
86 Identifier id = null;
87
85 - foreach (XAttribute attrib in element.Attributes())
88 + foreach (var attrib in element.Attributes())
89 {
90 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
91 {
@@ -90,7 +93,7 @@ namespace WixToolset.VisualStudio
93 {
94 case "Id":
95 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
93 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "HelpNamespace", id.Id);
96 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, VSTupleDefinitions.HelpNamespace, id.Id);
97 break;
98 default:
99 this.ParseHelper.UnexpectedAttribute(element, attrib);
@@ -108,11 +111,10 @@ namespace WixToolset.VisualStudio
111 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
112 }
113
111 - foreach (XElement child in element.Elements())
114 + foreach (var child in element.Elements())
115 {
116 if (this.Namespace == child.Name.Namespace)
117 {
115 - SourceLineNumber childSourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(child);
118 switch (child.Name.LocalName)
119 {
120 case "HelpFileRef":
@@ -132,13 +134,13 @@ namespace WixToolset.VisualStudio
134
135 private void ParseHelpCollectionElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileId)
136 {
135 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
137 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
138 Identifier id = null;
139 string description = null;
140 string name = null;
139 - YesNoType suppressCAs = YesNoType.No;
141 + var suppressCAs = YesNoType.No;
142
141 - foreach (XAttribute attrib in element.Attributes())
143 + foreach (var attrib in element.Attributes())
144 {
145 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
146 {
@@ -169,7 +171,7 @@ namespace WixToolset.VisualStudio
171
172 if (null == id)
173 {
172 - this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
174 + id = this.ParseHelper.CreateIdentifier("vshc", fileId, description, name);
175 }
176
177 if (null == description)
@@ -182,7 +184,7 @@ namespace WixToolset.VisualStudio
184 this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Name"));
185 }
186
185 - foreach (XElement child in element.Elements())
187 + foreach (var child in element.Elements())
188 {
189 if (this.Namespace == child.Name.Namespace)
190 {
@@ -210,31 +212,33 @@ namespace WixToolset.VisualStudio
212
213 if (!this.Messaging.EncounteredError)
214 {
213 - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "HelpNamespace", id);
214 - row.Set(1, name);
215 - row.Set(2, fileId);
216 - row.Set(3, description);
215 + section.AddTuple(new HelpNamespaceTuple(sourceLineNumbers, id)
216 + {
217 + NamespaceName = name,
218 + CollectionFileRef = fileId,
219 + Description = description,
220 + });
221
222 if (YesNoType.No == suppressCAs)
223 {
220 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "CA_RegisterMicrosoftHelp.3643236F_FC70_11D3_A536_0090278A1BB8");
224 + this.AddReferenceToRegisterMicrosoftHelp(section, sourceLineNumbers);
225 }
226 }
227 }
228
229 private void ParseHelpFileElement(Intermediate intermediate, IntermediateSection section, XElement element, string fileId)
230 {
227 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
231 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
232 Identifier id = null;
233 string name = null;
230 - int language = CompilerConstants.IntegerNotSet;
234 + var language = CompilerConstants.IntegerNotSet;
235 string hxi = null;
236 string hxq = null;
237 string hxr = null;
238 string samples = null;
235 - YesNoType suppressCAs = YesNoType.No;
239 + var suppressCAs = YesNoType.No;
240
237 - foreach (XAttribute attrib in element.Attributes())
241 + foreach (var attrib in element.Attributes())
242 {
243 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
244 {
@@ -245,11 +249,11 @@ namespace WixToolset.VisualStudio
249 break;
250 case "AttributeIndex":
251 hxr = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
248 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "File", hxr);
252 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.File, hxr);
253 break;
254 case "Index":
255 hxi = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
252 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "File", hxi);
256 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.File, hxi);
257 break;
258 case "Language":
259 language = this.ParseHelper.GetAttributeIntegerValue(sourceLineNumbers, attrib, 0, short.MaxValue);
@@ -259,11 +263,11 @@ namespace WixToolset.VisualStudio
263 break;
264 case "SampleLocation":
265 samples = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
262 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "File", samples);
266 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.File, samples);
267 break;
268 case "Search":
269 hxq = this.ParseHelper.GetAttributeIdentifierValue(sourceLineNumbers, attrib);
266 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "File", hxq);
270 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.File, hxq);
271 break;
272 case "SuppressCustomActions":
273 suppressCAs = this.ParseHelper.GetAttributeYesNoValue(sourceLineNumbers, attrib);
@@ -281,7 +285,7 @@ namespace WixToolset.VisualStudio
285
286 if (null == id)
287 {
284 - this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
288 + id = this.ParseHelper.CreateIdentifier("vshf", fileId, name, language.ToString(CultureInfo.InvariantCulture.NumberFormat));
289 }
290
291 if (null == name)
@@ -299,28 +303,30 @@ namespace WixToolset.VisualStudio
303
304 if (!this.Messaging.EncounteredError)
305 {
302 - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "HelpFile", id);
303 - row.Set(1, name);
304 - row.Set(2, language);
305 - row.Set(3, fileId);
306 - row.Set(4, hxi);
307 - row.Set(5, hxq);
308 - row.Set(6, hxr);
309 - row.Set(7, samples);
306 + section.AddTuple(new HelpFileTuple(sourceLineNumbers, id)
307 + {
308 + HelpFileName = name,
309 + LangID = language,
310 + HxSFileRef = fileId,
311 + HxIFileRef = hxi,
312 + HxQFileRef = hxq,
313 + HxRFileRef = hxr,
314 + SamplesFileRef = samples,
315 + });
316
317 if (YesNoType.No == suppressCAs)
318 {
313 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "CA_RegisterMicrosoftHelp.3643236F_FC70_11D3_A536_0090278A1BB8");
319 + this.AddReferenceToRegisterMicrosoftHelp(section, sourceLineNumbers);
320 }
321 }
322 }
323
324 private void ParseHelpFileRefElement(Intermediate intermediate, IntermediateSection section, XElement element, Identifier collectionId)
325 {
320 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
326 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
327 Identifier id = null;
328
323 - foreach (XAttribute attrib in element.Attributes())
329 + foreach (var attrib in element.Attributes())
330 {
331 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
332 {
@@ -328,7 +334,7 @@ namespace WixToolset.VisualStudio
334 {
335 case "Id":
336 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
331 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "HelpFile", id.Id);
337 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, VSTupleDefinitions.HelpFile, id.Id);
338 break;
339 default:
340 this.ParseHelper.UnexpectedAttribute(element, attrib);
@@ -350,20 +356,23 @@ namespace WixToolset.VisualStudio
356
357 if (!this.Messaging.EncounteredError)
358 {
353 - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "HelpFileToNamespace", id);
354 - row.Set(1, collectionId.Id);
359 + section.AddTuple(new HelpFileToNamespaceTuple(sourceLineNumbers, id)
360 + {
361 + HelpFileRef = id.Id,
362 + HelpNamespaceRef = collectionId.Id,
363 + });
364 }
365 }
366
367 private void ParseHelpFilterElement(Intermediate intermediate, IntermediateSection section, XElement element)
368 {
360 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
369 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
370 Identifier id = null;
371 string filterDefinition = null;
372 string name = null;
364 - YesNoType suppressCAs = YesNoType.No;
373 + var suppressCAs = YesNoType.No;
374
366 - foreach (XAttribute attrib in element.Attributes())
375 + foreach (var attrib in element.Attributes())
376 {
377 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
378 {
@@ -394,7 +403,7 @@ namespace WixToolset.VisualStudio
403
404 if (null == id)
405 {
397 - this.Messaging.Write(ErrorMessages.ExpectedAttribute(sourceLineNumbers, element.Name.LocalName, "Id"));
406 + id = this.ParseHelper.CreateIdentifier("hfl", name, filterDefinition);
407 }
408
409 if (null == name)
@@ -406,23 +415,25 @@ namespace WixToolset.VisualStudio
415
416 if (!this.Messaging.EncounteredError)
417 {
409 - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "HelpFilter", id);
410 - row.Set(1, name);
411 - row.Set(2, filterDefinition);
418 + section.AddTuple(new HelpFilterTuple(sourceLineNumbers, id)
419 + {
420 + Description = name,
421 + QueryString = filterDefinition,
422 + });
423
424 if (YesNoType.No == suppressCAs)
425 {
415 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "CA_RegisterMicrosoftHelp.3643236F_FC70_11D3_A536_0090278A1BB8");
426 + this.AddReferenceToRegisterMicrosoftHelp(section, sourceLineNumbers);
427 }
428 }
429 }
430
431 private void ParseHelpFilterRefElement(Intermediate intermediate, IntermediateSection section, XElement element, Identifier collectionId)
432 {
422 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
433 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
434 Identifier id = null;
435
425 - foreach (XAttribute attrib in element.Attributes())
436 + foreach (var attrib in element.Attributes())
437 {
438 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
439 {
@@ -430,7 +441,7 @@ namespace WixToolset.VisualStudio
441 {
442 case "Id":
443 id = this.ParseHelper.GetAttributeIdentifier(sourceLineNumbers, attrib);
433 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "HelpFilter", id.Id);
444 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, VSTupleDefinitions.HelpFilter, id.Id);
445 break;
446 default:
447 this.ParseHelper.UnexpectedAttribute(element, attrib);
@@ -452,24 +463,25 @@ namespace WixToolset.VisualStudio
463
464 if (!this.Messaging.EncounteredError)
465 {
455 - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "HelpFilterToNamespace", id);
456 - row.Set(1, collectionId.Id);
466 + section.AddTuple(new HelpFilterToNamespaceTuple(sourceLineNumbers, id)
467 + {
468 + HelpFilterRef = id.Id,
469 + HelpNamespaceRef = collectionId.Id,
470 + });
471 }
472 }
473
474 private void ParsePlugCollectionIntoElement(Intermediate intermediate, IntermediateSection section, XElement element, Identifier parentId)
475 {
462 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
476 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
477 string hxa = null;
478 string hxt = null;
479 string hxtParent = null;
480 string namespaceParent = null;
481 string feature = null;
468 - YesNoType suppressExternalNamespaces = YesNoType.No;
469 - bool pluginVS05 = false;
470 - bool pluginVS08 = false;
482 + var suppressExternalNamespaces = YesNoType.No;
483
472 - foreach (XAttribute attrib in element.Attributes())
484 + foreach (var attrib in element.Attributes())
485 {
486 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
487 {
@@ -504,8 +516,8 @@ namespace WixToolset.VisualStudio
516 }
517 }
518
507 - pluginVS05 = namespaceParent.Equals("MS_VSIPCC_v80", StringComparison.Ordinal);
508 - pluginVS08 = namespaceParent.Equals("MS.VSIPCC.v90", StringComparison.Ordinal);
519 + var pluginVS05 = namespaceParent.Equals("MS_VSIPCC_v80", StringComparison.Ordinal);
520 + var pluginVS08 = namespaceParent.Equals("MS.VSIPCC.v90", StringComparison.Ordinal);
521
522 if (null == namespaceParent)
523 {
@@ -521,11 +533,14 @@ namespace WixToolset.VisualStudio
533
534 if (!this.Messaging.EncounteredError)
535 {
524 - var row = this.ParseHelper.CreateRow(section, sourceLineNumbers, "HelpPlugin", parentId);
525 - row.Set(1, namespaceParent);
526 - row.Set(2, hxt);
527 - row.Set(3, hxa);
528 - row.Set(4, hxtParent);
536 + section.AddTuple(new HelpPluginTuple(sourceLineNumbers, parentId)
537 + {
538 + HelpNamespaceRef = parentId.Id,
539 + ParentHelpNamespaceRef = namespaceParent,
540 + HxTFileRef = hxt,
541 + HxAFileRef = hxa,
542 + ParentHxTFileRef = hxtParent,
543 + });
544
545 if (pluginVS05)
546 {
@@ -535,7 +550,7 @@ namespace WixToolset.VisualStudio
550 this.ParseHelper.CreateComplexReference(section, sourceLineNumbers, ComplexReferenceParentType.Feature, feature, String.Empty,
551 ComplexReferenceChildType.ComponentGroup, "Help2_VS2005_Namespace_Components", false);
552 // Reference CustomAction since nothing will happen without it
538 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "CA_HxMerge_VSIPCC_VSCC");
553 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, "CA_HxMerge_VSIPCC_VSCC");
554 }
555 }
556 else if (pluginVS08)
@@ -546,28 +561,28 @@ namespace WixToolset.VisualStudio
561 this.ParseHelper.CreateComplexReference(section, sourceLineNumbers, ComplexReferenceParentType.Feature, feature, String.Empty,
562 ComplexReferenceChildType.ComponentGroup, "Help2_VS2008_Namespace_Components", false);
563 // Reference CustomAction since nothing will happen without it
549 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", "CA_ScheduleExtHelpPlugin_VSCC_VSIPCC");
564 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, "CA_ScheduleExtHelpPlugin_VSCC_VSIPCC");
565 }
566 }
567 else
568 {
569 // Reference the parent namespace to enforce the foreign key relationship
555 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "HelpNamespace", namespaceParent);
570 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, VSTupleDefinitions.HelpNamespace, namespaceParent);
571 }
572 }
573 }
574
575 private void ParseVsixPackageElement(Intermediate intermediate, IntermediateSection section, XElement element, string componentId, string fileId)
576 {
562 - SourceLineNumber sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
563 - string propertyId = "VS_VSIX_INSTALLER_PATH";
577 + var sourceLineNumbers = this.ParseHelper.GetSourceLineNumbers(element);
578 + var propertyId = "VS_VSIX_INSTALLER_PATH";
579 string packageId = null;
565 - YesNoType permanent = YesNoType.NotSet;
580 + var permanent = YesNoType.NotSet;
581 string target = null;
582 string targetVersion = null;
568 - YesNoType vital = YesNoType.NotSet;
583 + var vital = YesNoType.NotSet;
584
570 - foreach (XAttribute attrib in element.Attributes())
585 + foreach (var attrib in element.Attributes())
586 {
587 if (String.IsNullOrEmpty(attrib.Name.NamespaceName) || this.Namespace == attrib.Name.Namespace)
588 {
@@ -664,98 +679,131 @@ namespace WixToolset.VisualStudio
679 if (!this.Messaging.EncounteredError)
680 {
681 // Ensure there is a reference to the AppSearch Property that will find the VsixInstaller.exe.
667 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "Property", propertyId);
682 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.Property, propertyId);
683
684 // Ensure there is a reference to the package file (even if we are a child under it).
670 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "File", fileId);
685 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.File, fileId);
686
672 - string cmdlinePrefix = "/q ";
687 + var cmdlinePrefix = "/q ";
688
689 if (!String.IsNullOrEmpty(target))
690 {
691 cmdlinePrefix = String.Format("{0} /skuName:{1} /skuVersion:{2}", cmdlinePrefix, target, targetVersion);
692 }
693
679 - string installAfter = "WriteRegistryValues"; // by default, come after the registry key registration.
680 - int installExtraBits = VSCompiler.MsidbCustomActionTypeInScript;
694 + var installAfter = "WriteRegistryValues"; // by default, come after the registry key registration.
695 +
696 + var installNamePerUser = this.ParseHelper.CreateIdentifier("viu", componentId, fileId, "per-user", target, targetVersion);
697 + var installNamePerMachine = this.ParseHelper.CreateIdentifier("vim", componentId, fileId, "per-machine", target, targetVersion);
698 + var installCmdLinePerUser = String.Format("{0} \"[#{1}]\"", cmdlinePrefix, fileId);
699 + var installCmdLinePerMachine = String.Concat(installCmdLinePerUser, " /admin");
700 + var installConditionPerUser = String.Format("NOT ALLUSERS AND ${0}=3", componentId); // only execute if the Component being installed.
701 + var installConditionPerMachine = String.Format("ALLUSERS AND ${0}=3", componentId); // only execute if the Component being installed.
702 + var installPerUserCA = new CustomActionTuple(sourceLineNumbers, installNamePerUser)
703 + {
704 + ExecutionType = CustomActionExecutionType.Deferred,
705 + Impersonate = true,
706 + };
707 + var installPerMachineCA = new CustomActionTuple(sourceLineNumbers, installNamePerMachine)
708 + {
709 + ExecutionType = CustomActionExecutionType.Deferred,
710 + Impersonate = false,
711 + };
712
713 // If the package is not vital, mark the install action as continue.
714 if (vital == YesNoType.No)
715 {
685 - installExtraBits |= VSCompiler.MsidbCustomActionTypeContinue;
716 + installPerUserCA.IgnoreResult = true;
717 + installPerMachineCA.IgnoreResult = true;
718 }
719 else // the package is vital so ensure there is a rollback action scheduled.
720 {
689 - Identifier rollbackNamePerUser = this.ParseHelper.CreateIdentifier("vru", componentId, fileId, "per-user", target ?? String.Empty, targetVersion ?? String.Empty);
690 - Identifier rollbackNamePerMachine = this.ParseHelper.CreateIdentifier("vrm", componentId, fileId, "per-machine", target ?? String.Empty, targetVersion ?? String.Empty);
691 - string rollbackCmdLinePerUser = String.Concat(cmdlinePrefix, " /u:\"", packageId, "\"");
692 - string rollbackCmdLinePerMachine = String.Concat(rollbackCmdLinePerUser, " /admin");
693 - int rollbackExtraBitsPerUser = VSCompiler.MsidbCustomActionTypeContinue | VSCompiler.MsidbCustomActionTypeRollback | VSCompiler.MsidbCustomActionTypeInScript;
694 - int rollbackExtraBitsPerMachine = rollbackExtraBitsPerUser | VSCompiler.MsidbCustomActionTypeNoImpersonate;
695 - string rollbackConditionPerUser = String.Format("NOT ALLUSERS AND NOT Installed AND ${0}=2 AND ?{0}>2", componentId); // NOT Installed && Component being installed but not installed already.
696 - string rollbackConditionPerMachine = String.Format("ALLUSERS AND NOT Installed AND ${0}=2 AND ?{0}>2", componentId); // NOT Installed && Component being installed but not installed already.
721 + var rollbackNamePerUser = this.ParseHelper.CreateIdentifier("vru", componentId, fileId, "per-user", target, targetVersion);
722 + var rollbackNamePerMachine = this.ParseHelper.CreateIdentifier("vrm", componentId, fileId, "per-machine", target, targetVersion);
723 + var rollbackCmdLinePerUser = String.Concat(cmdlinePrefix, " /u:\"", packageId, "\"");
724 + var rollbackCmdLinePerMachine = String.Concat(rollbackCmdLinePerUser, " /admin");
725 + var rollbackConditionPerUser = String.Format("NOT ALLUSERS AND NOT Installed AND ${0}=2 AND ?{0}>2", componentId); // NOT Installed && Component being installed but not installed already.
726 + var rollbackConditionPerMachine = String.Format("ALLUSERS AND NOT Installed AND ${0}=2 AND ?{0}>2", componentId); // NOT Installed && Component being installed but not installed already.
727 + var rollbackPerUserCA = new CustomActionTuple(sourceLineNumbers, rollbackNamePerUser)
728 + {
729 + ExecutionType = CustomActionExecutionType.Rollback,
730 + IgnoreResult = true,
731 + Impersonate = true,
732 + };
733 + var rollbackPerMachineCA = new CustomActionTuple(sourceLineNumbers, rollbackNamePerMachine)
734 + {
735 + ExecutionType = CustomActionExecutionType.Rollback,
736 + IgnoreResult = true,
737 + Impersonate = false,
738 + };
739
698 - this.SchedulePropertyExeAction(section, sourceLineNumbers, rollbackNamePerUser, propertyId, rollbackCmdLinePerUser, rollbackExtraBitsPerUser, rollbackConditionPerUser, null, installAfter);
699 - this.SchedulePropertyExeAction(section, sourceLineNumbers, rollbackNamePerMachine, propertyId, rollbackCmdLinePerMachine, rollbackExtraBitsPerMachine, rollbackConditionPerMachine, null, rollbackNamePerUser.Id);
740 + this.SchedulePropertyExeAction(section, sourceLineNumbers, rollbackNamePerUser, propertyId, rollbackCmdLinePerUser, rollbackPerUserCA, rollbackConditionPerUser, null, installAfter);
741 + this.SchedulePropertyExeAction(section, sourceLineNumbers, rollbackNamePerMachine, propertyId, rollbackCmdLinePerMachine, rollbackPerMachineCA, rollbackConditionPerMachine, null, rollbackNamePerUser.Id);
742
743 installAfter = rollbackNamePerMachine.Id;
744 }
745
704 - Identifier installNamePerUser = this.ParseHelper.CreateIdentifier("viu", componentId, fileId, "per-user", target ?? String.Empty, targetVersion ?? String.Empty);
705 - Identifier installNamePerMachine = this.ParseHelper.CreateIdentifier("vim", componentId, fileId, "per-machine", target ?? String.Empty, targetVersion ?? String.Empty);
706 - string installCmdLinePerUser = String.Format("{0} \"[#{1}]\"", cmdlinePrefix, fileId);
707 - string installCmdLinePerMachine = String.Concat(installCmdLinePerUser, " /admin");
708 - string installConditionPerUser = String.Format("NOT ALLUSERS AND ${0}=3", componentId); // only execute if the Component being installed.
709 - string installConditionPerMachine = String.Format("ALLUSERS AND ${0}=3", componentId); // only execute if the Component being installed.
710 -
711 - this.SchedulePropertyExeAction(section, sourceLineNumbers, installNamePerUser, propertyId, installCmdLinePerUser, installExtraBits, installConditionPerUser, null, installAfter);
712 - this.SchedulePropertyExeAction(section, sourceLineNumbers, installNamePerMachine, propertyId, installCmdLinePerMachine, installExtraBits | VSCompiler.MsidbCustomActionTypeNoImpersonate, installConditionPerMachine, null, installNamePerUser.Id);
746 + this.SchedulePropertyExeAction(section, sourceLineNumbers, installNamePerUser, propertyId, installCmdLinePerUser, installPerUserCA, installConditionPerUser, null, installAfter);
747 + this.SchedulePropertyExeAction(section, sourceLineNumbers, installNamePerMachine, propertyId, installCmdLinePerMachine, installPerMachineCA, installConditionPerMachine, null, installNamePerUser.Id);
748
749 // If not permanent, schedule the uninstall custom action.
750 if (permanent != YesNoType.Yes)
751 {
717 - Identifier uninstallNamePerUser = this.ParseHelper.CreateIdentifier("vuu", componentId, fileId, "per-user", target ?? String.Empty, targetVersion ?? String.Empty);
718 - Identifier uninstallNamePerMachine = this.ParseHelper.CreateIdentifier("vum", componentId, fileId, "per-machine", target ?? String.Empty, targetVersion ?? String.Empty);
719 - string uninstallCmdLinePerUser = String.Concat(cmdlinePrefix, " /u:\"", packageId, "\"");
720 - string uninstallCmdLinePerMachine = String.Concat(uninstallCmdLinePerUser, " /admin");
721 - int uninstallExtraBitsPerUser = VSCompiler.MsidbCustomActionTypeContinue | VSCompiler.MsidbCustomActionTypeInScript;
722 - int uninstallExtraBitsPerMachine = uninstallExtraBitsPerUser | VSCompiler.MsidbCustomActionTypeNoImpersonate;
723 - string uninstallConditionPerUser = String.Format("NOT ALLUSERS AND ${0}=2 AND ?{0}>2", componentId); // Only execute if component is being uninstalled.
724 - string uninstallConditionPerMachine = String.Format("ALLUSERS AND ${0}=2 AND ?{0}>2", componentId); // Only execute if component is being uninstalled.
752 + var uninstallNamePerUser = this.ParseHelper.CreateIdentifier("vuu", componentId, fileId, "per-user", target ?? String.Empty, targetVersion ?? String.Empty);
753 + var uninstallNamePerMachine = this.ParseHelper.CreateIdentifier("vum", componentId, fileId, "per-machine", target ?? String.Empty, targetVersion ?? String.Empty);
754 + var uninstallCmdLinePerUser = String.Concat(cmdlinePrefix, " /u:\"", packageId, "\"");
755 + var uninstallCmdLinePerMachine = String.Concat(uninstallCmdLinePerUser, " /admin");
756 + var uninstallConditionPerUser = String.Format("NOT ALLUSERS AND ${0}=2 AND ?{0}>2", componentId); // Only execute if component is being uninstalled.
757 + var uninstallConditionPerMachine = String.Format("ALLUSERS AND ${0}=2 AND ?{0}>2", componentId); // Only execute if component is being uninstalled.
758 + var uninstallPerUserCA = new CustomActionTuple(sourceLineNumbers, uninstallNamePerUser)
759 + {
760 + ExecutionType = CustomActionExecutionType.Deferred,
761 + IgnoreResult = true,
762 + Impersonate = true,
763 + };
764 + var uninstallPerMachineCA = new CustomActionTuple(sourceLineNumbers, uninstallNamePerMachine)
765 + {
766 + ExecutionType = CustomActionExecutionType.Deferred,
767 + IgnoreResult = true,
768 + Impersonate = false,
769 + };
770
726 - this.SchedulePropertyExeAction(section, sourceLineNumbers, uninstallNamePerUser, propertyId, uninstallCmdLinePerUser, uninstallExtraBitsPerUser, uninstallConditionPerUser, "InstallFinalize", null);
727 - this.SchedulePropertyExeAction(section, sourceLineNumbers, uninstallNamePerMachine, propertyId, uninstallCmdLinePerMachine, uninstallExtraBitsPerMachine, uninstallConditionPerMachine, "InstallFinalize", null);
771 + this.SchedulePropertyExeAction(section, sourceLineNumbers, uninstallNamePerUser, propertyId, uninstallCmdLinePerUser, uninstallPerUserCA, uninstallConditionPerUser, "InstallFinalize", null);
772 + this.SchedulePropertyExeAction(section, sourceLineNumbers, uninstallNamePerMachine, propertyId, uninstallCmdLinePerMachine, uninstallPerMachineCA, uninstallConditionPerMachine, "InstallFinalize", null);
773 }
774 }
775 }
776
732 - private void SchedulePropertyExeAction(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier name, string source, string cmdline, int extraBits, string condition, string beforeAction, string afterAction)
777 + private void SchedulePropertyExeAction(IntermediateSection section, SourceLineNumber sourceLineNumbers, Identifier name, string source, string cmdline, CustomActionTuple caTemplate, string condition, string beforeAction, string afterAction)
778 {
734 - const string sequence = "InstallExecuteSequence";
735 -
736 - var actionRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "CustomAction", name);
737 - actionRow.Set(1, VSCompiler.MsidbCustomActionTypeProperty | VSCompiler.MsidbCustomActionTypeExe | extraBits);
738 - actionRow.Set(2, source);
739 - actionRow.Set(3, cmdline);
740 -
741 - var sequenceRow = this.ParseHelper.CreateRow(section, sourceLineNumbers, "WixAction", new Identifier(name.Access, sequence, name.Id));
742 - sequenceRow.Set(0, sequence);
743 - sequenceRow.Set(1, name.Id);
744 - sequenceRow.Set(2, condition);
745 - // no explicit sequence
746 - sequenceRow.Set(4, beforeAction);
747 - sequenceRow.Set(5, afterAction);
748 - sequenceRow.Set(6, 0); // not overridable
779 + const SequenceTable sequence = SequenceTable.InstallExecuteSequence;
780 +
781 + caTemplate.SourceType = CustomActionSourceType.Property;
782 + caTemplate.Source = source;
783 + caTemplate.TargetType = CustomActionTargetType.Exe;
784 + caTemplate.Target = cmdline;
785 + section.AddTuple(caTemplate);
786 +
787 + section.AddTuple(new WixActionTuple(sourceLineNumbers, new Identifier(name.Access, sequence, name.Id))
788 + {
789 + SequenceTable = SequenceTable.InstallExecuteSequence,
790 + Action = name.Id,
791 + Condition = condition,
792 + // no explicit sequence
793 + Before = beforeAction,
794 + After = afterAction,
795 + Overridable = false,
796 + });
797
798 if (null != beforeAction)
799 {
800 if (WindowsInstallerStandard.IsStandardAction(beforeAction))
801 {
754 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixAction", sequence, beforeAction);
802 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.WixAction, sequence.ToString(), beforeAction);
803 }
804 else
805 {
758 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", beforeAction);
806 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, beforeAction);
807 }
808 }
809
@@ -763,13 +811,18 @@ namespace WixToolset.VisualStudio
811 {
812 if (WindowsInstallerStandard.IsStandardAction(afterAction))
813 {
766 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "WixAction", sequence, afterAction);
814 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.WixAction, sequence.ToString(), afterAction);
815 }
816 else
817 {
770 - this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, "CustomAction", afterAction);
818 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, afterAction);
819 }
820 }
821 }
822 +
823 + private void AddReferenceToRegisterMicrosoftHelp(IntermediateSection section, SourceLineNumber sourceLineNumbers)
824 + {
825 + this.ParseHelper.CreateSimpleReference(section, sourceLineNumbers, TupleDefinitions.CustomAction, "CA_RegisterMicrosoftHelp.3643236F_FC70_11D3_A536_0090278A1BB8");
826 + }
827 }
828 }
src/wixext/VSExtensionData.cs
+12
@@ -7,6 +7,18 @@ namespace WixToolset.VisualStudio
7
8 public sealed class VSExtensionData : BaseExtensionData
9 {
10 + /// <summary>
11 + /// Gets the default culture.
12 + /// </summary>
13 + /// <value>The default culture.</value>
14 + public override string DefaultCulture => "en-US";
15 +
16 + public override bool TryGetTupleDefinitionByName(string name, out IntermediateTupleDefinition tupleDefinition)
17 + {
18 + tupleDefinition = VSTupleDefinitions.ByName(name);
19 + return tupleDefinition != null;
20 + }
21 +
22 public override Intermediate GetLibrary(ITupleDefinitionCreator tupleDefinitions)
23 {
24 return Intermediate.Load(typeof(VSExtensionData).Assembly, "WixToolset.VisualStudio.vs.wixlib", tupleDefinitions);
src/wixext/VSTableDefinitions.cs
+86 -61
@@ -6,67 +6,92 @@ namespace WixToolset.VisualStudio
6
7 public static class VSTableDefinitions
8 {
9 - public static readonly TableDefinition[] Tables = new[] {
10 - new TableDefinition(
11 - "HelpFile",
12 - new[]
13 - {
14 - new ColumnDefinition("HelpFileKey", ColumnType.String, 72, true, false, ColumnCategory.Identifier, description: "Primary Key for HelpFile Table (required)."),
15 - new ColumnDefinition("HelpFileName", ColumnType.String, 0, false, false, ColumnCategory.Text, description: "Internal Microsoft Help ID for this HelpFile (required)."),
16 - new ColumnDefinition("LangID", ColumnType.Number, 2, false, true, ColumnCategory.Language, description: "Language ID for content file (optional)."),
17 - new ColumnDefinition("File_HxS", ColumnType.String, 72, false, true, ColumnCategory.Identifier, keyTable:"File", keyColumn: 1, description: "Key for HxS (Title) file (required)."),
18 - new ColumnDefinition("File_HxI", ColumnType.String, 72, false, true, ColumnCategory.Identifier, keyTable:"File", keyColumn: 1, description: "Key for HxI (Index) file (required)."),
19 - new ColumnDefinition("File_HxQ", ColumnType.String, 72, false, true, ColumnCategory.Identifier, keyTable:"File", keyColumn: 1, description: "Key for HxQ (Query) file (required)."),
20 - new ColumnDefinition("File_HxR", ColumnType.String, 72, false, true, ColumnCategory.Identifier, keyTable:"File", keyColumn: 1, description: "Key for HxR (Attributes) file (required)."),
21 - new ColumnDefinition("File_Samples", ColumnType.String, 72, false, true, ColumnCategory.Identifier, keyTable:"File", keyColumn: 1, description: "Key for a file that is in the 'root' of the samples directory for this HelpFile (optional)."),
22 - }
23 - ),
24 - new TableDefinition(
25 - "HelpFileToNamespace",
26 - new[]
27 - {
28 - new ColumnDefinition("HelpFile_", ColumnType.String, 72, true, false, ColumnCategory.Identifier, keyTable: "HelpFile", keyColumn: 1, description: "Foreign key into HelpFile table (required)."),
29 - new ColumnDefinition("HelpNamespace_", ColumnType.String, 72, true, false, ColumnCategory.Identifier, keyTable: "HelpNamespace", keyColumn: 1, description: "Foreign key into HelpNamespace table (required)."),
30 - }
31 - ),
32 - new TableDefinition(
33 - "HelpFilter",
34 - new[]
35 - {
36 - new ColumnDefinition("FilterKey", ColumnType.String, 72, true, false, ColumnCategory.Identifier, description: "Primary Key for HelpFilter (required)."),
37 - new ColumnDefinition("Description", ColumnType.Localized, 0, false, false, ColumnCategory.Text, description: "Friendly name for Filter (required)."),
38 - new ColumnDefinition("QueryString", ColumnType.String, 0, false, true, ColumnCategory.Text, description: "Query String for Help Filter (optional)."),
39 - }
40 - ),
41 - new TableDefinition(
42 - "HelpFilterToNamespace",
43 - new[]
44 - {
45 - new ColumnDefinition("HelpFilter_", ColumnType.String, 72, true, false, ColumnCategory.Identifier, keyTable: "HelpFilter", keyColumn: 1, description: "Foreign key into HelpFilter table (required)."),
46 - new ColumnDefinition("HelpNamespace_", ColumnType.String, 72, true, false, ColumnCategory.Identifier, keyTable: "HelpNamespace", keyColumn: 1, description: "Foreign key into HelpNamespace table (required)."),
47 - }
48 - ),
49 - new TableDefinition(
50 - "HelpNamespace",
51 - new[]
52 - {
53 - new ColumnDefinition("NamespaceKey", ColumnType.String, 72, true, false, ColumnCategory.Identifier, description: "Primary Key for HelpNamespace (required)."),
54 - new ColumnDefinition("NamespaceName", ColumnType.String, 0, false, false, ColumnCategory.Text, description: "Internal Microsoft Help ID for this Namespace (required)."),
55 - new ColumnDefinition("File_Collection", ColumnType.String, 72, false, false, ColumnCategory.Identifier, keyTable:"File", keyColumn: 1, description: "Key for HxC (Collection) file (required)."),
56 - new ColumnDefinition("Description", ColumnType.Localized, 0, false, true, ColumnCategory.Text, description: "Friendly name for Namespace (optional)."),
57 - }
58 - ),
59 - new TableDefinition(
60 - "HelpPlugin",
61 - new[]
62 - {
63 - new ColumnDefinition("HelpNamespace_", ColumnType.String, 72, true, false, ColumnCategory.Identifier, keyTable: "HelpNamespace", keyColumn: 1, description: "Foreign key into HelpNamespace table for the child namespace that will be plugged into the parent namespace (required)."),
64 - new ColumnDefinition("HelpNamespace_Parent", ColumnType.String, 72, true, false, ColumnCategory.Identifier, keyTable: "HelpNamespace", keyColumn: 1, description: "Foreign key into HelpNamespace table for the parent namespace into which the child will be inserted (required)."),
65 - new ColumnDefinition("File_HxT", ColumnType.String, 72, false, true, ColumnCategory.Identifier, keyTable:"File", keyColumn: 1, description: "Key for HxT file of child namespace (optional)."),
66 - new ColumnDefinition("File_HxA", ColumnType.String, 72, false, true, ColumnCategory.Identifier, keyTable:"File", keyColumn: 1, description: "Key for HxA (Attributes) file of child namespace (optional)."),
67 - new ColumnDefinition("File_ParentHxT", ColumnType.String, 72, false, true, ColumnCategory.Identifier, keyTable:"File", keyColumn: 1, description: "Key for HxT file of parent namespace that now includes the new child namespace (optional)."),
68 - }
69 - ),
9 + public static readonly TableDefinition HelpFile = new TableDefinition(
10 + "HelpFile",
11 + new[]
12 + {
13 + new ColumnDefinition("HelpFileKey", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary Key for HelpFile Table (required).", modularizeType: ColumnModularizeType.Column),
14 + new ColumnDefinition("HelpFileName", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Internal Microsoft Help ID for this HelpFile (required)."),
15 + new ColumnDefinition("LangID", ColumnType.Number, 2, primaryKey: false, nullable: true, ColumnCategory.Language, description: "Language ID for content file (optional)."),
16 + new ColumnDefinition("File_HxS", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "Key for HxS (Title) file (required).", modularizeType: ColumnModularizeType.Column),
17 + new ColumnDefinition("File_HxI", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "Key for HxI (Index) file (optional).", modularizeType: ColumnModularizeType.Column),
18 + new ColumnDefinition("File_HxQ", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "Key for HxQ (Query) file (optional).", modularizeType: ColumnModularizeType.Column),
19 + new ColumnDefinition("File_HxR", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "Key for HxR (Attributes) file (optional).", modularizeType: ColumnModularizeType.Column),
20 + new ColumnDefinition("File_Samples", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "Key for a file that is in the 'root' of the samples directory for this HelpFile (optional).", modularizeType: ColumnModularizeType.Column),
21 + },
22 + tupleDefinitionName: VSTupleDefinitions.HelpFile.Name,
23 + tupleIdIsPrimaryKey: true
24 + );
25 +
26 + public static readonly TableDefinition HelpFileToNamespace = new TableDefinition(
27 + "HelpFileToNamespace",
28 + new[]
29 + {
30 + new ColumnDefinition("HelpFile_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "HelpFile", keyColumn: 1, description: "Foreign key into HelpFile table (required).", modularizeType: ColumnModularizeType.Column),
31 + new ColumnDefinition("HelpNamespace_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "HelpNamespace", keyColumn: 1, description: "Foreign key into HelpNamespace table (required)."),
32 + },
33 + tupleDefinitionName: VSTupleDefinitions.HelpFileToNamespace.Name,
34 + tupleIdIsPrimaryKey: false
35 + );
36 +
37 + public static readonly TableDefinition HelpFilter = new TableDefinition(
38 + "HelpFilter",
39 + new[]
40 + {
41 + new ColumnDefinition("FilterKey", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary Key for HelpFilter (required).", modularizeType: ColumnModularizeType.Column),
42 + new ColumnDefinition("Description", ColumnType.Localized, 0, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Friendly name for Filter (required)."),
43 + new ColumnDefinition("QueryString", ColumnType.String, 0, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Query String for Help Filter (optional)."),
44 + },
45 + tupleDefinitionName: VSTupleDefinitions.HelpFilter.Name,
46 + tupleIdIsPrimaryKey: true
47 + );
48 +
49 + public static readonly TableDefinition HelpFilterToNamespace = new TableDefinition(
50 + "HelpFilterToNamespace",
51 + new[]
52 + {
53 + new ColumnDefinition("HelpFilter_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "HelpFilter", keyColumn: 1, description: "Foreign key into HelpFilter table (required).", modularizeType: ColumnModularizeType.Column),
54 + new ColumnDefinition("HelpNamespace_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "HelpNamespace", keyColumn: 1, description: "Foreign key into HelpNamespace table (required)."),
55 + },
56 + tupleDefinitionName: VSTupleDefinitions.HelpFilterToNamespace.Name,
57 + tupleIdIsPrimaryKey: false
58 + );
59 +
60 + public static readonly TableDefinition HelpNamespace = new TableDefinition(
61 + "HelpNamespace",
62 + new[]
63 + {
64 + new ColumnDefinition("NamespaceKey", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, description: "Primary Key for HelpNamespace (required)."),
65 + new ColumnDefinition("NamespaceName", ColumnType.String, 0, primaryKey: false, nullable: false, ColumnCategory.Text, description: "Internal Microsoft Help ID for this Namespace (required)."),
66 + new ColumnDefinition("File_Collection", ColumnType.String, 72, primaryKey: false, nullable: false, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "Key for HxC (Collection) file (required).", modularizeType: ColumnModularizeType.Column),
67 + new ColumnDefinition("Description", ColumnType.Localized, 0, primaryKey: false, nullable: true, ColumnCategory.Text, description: "Friendly name for Namespace (optional)."),
68 + },
69 + tupleDefinitionName: VSTupleDefinitions.HelpNamespace.Name,
70 + tupleIdIsPrimaryKey: true
71 + );
72 +
73 + public static readonly TableDefinition HelpPlugin = new TableDefinition(
74 + "HelpPlugin",
75 + new[]
76 + {
77 + new ColumnDefinition("HelpNamespace_", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "HelpNamespace", keyColumn: 1, description: "Foreign key into HelpNamespace table for the child namespace that will be plugged into the parent namespace (required)."),
78 + new ColumnDefinition("HelpNamespace_Parent", ColumnType.String, 72, primaryKey: true, nullable: false, ColumnCategory.Identifier, keyTable: "HelpNamespace", keyColumn: 1, description: "Foreign key into HelpNamespace table for the parent namespace into which the child will be inserted (required)."),
79 + new ColumnDefinition("File_HxT", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "Key for HxT file of child namespace (optional).", modularizeType: ColumnModularizeType.Column),
80 + new ColumnDefinition("File_HxA", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "Key for HxA (Attributes) file of child namespace (optional).", modularizeType: ColumnModularizeType.Column),
81 + new ColumnDefinition("File_ParentHxT", ColumnType.String, 72, primaryKey: false, nullable: true, ColumnCategory.Identifier, keyTable: "File", keyColumn: 1, description: "Key for HxT file of parent namespace that now includes the new child namespace (optional).", modularizeType: ColumnModularizeType.Column),
82 + },
83 + tupleDefinitionName: VSTupleDefinitions.HelpPlugin.Name,
84 + tupleIdIsPrimaryKey: false
85 + );
86 +
87 + public static readonly TableDefinition[] All = new[]
88 + {
89 + HelpFile,
90 + HelpFileToNamespace,
91 + HelpFilter,
92 + HelpFilterToNamespace,
93 + HelpNamespace,
94 + HelpPlugin,
95 };
96 }
97 }
src/wixext/VSWindowsInstallerBackendBinderExtension.cs
+2 -2
@@ -1,4 +1,4 @@
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.
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
3 namespace WixToolset.VisualStudio
4 {
@@ -8,6 +8,6 @@ namespace WixToolset.VisualStudio
8
9 public class VSWindowsInstallerBackendBinderExtension : BaseWindowsInstallerBackendBinderExtension
10 {
11 - public override IEnumerable<TableDefinition> TableDefinitions => VSTableDefinitions.Tables;
11 + public override IEnumerable<TableDefinition> TableDefinitions => VSTableDefinitions.All;
12 }
13 }