VS2019 Support
Painter, Christopher P committed
Dec 20, 2018 at 13:57 UTC
fd7f8754b3c8807d39dcf8295a12ff32ec0264b4
3 files changed
+225
src/ca/vsca.cpp
+81
@@ -47,6 +47,12 @@ static HRESULT ProcessVS2017(
47
__in BOOL fComplete
48
);
49
50
+static HRESULT ProcessVS2019(
51
+ __in_opt ISetupInstance* pInstance,
52
+ __in DWORD64 qwVersion,
53
+ __in BOOL fComplete
54
+);
55
+
56
static HRESULT SetPropertyForComponent(
57
__in DWORD cComponents,
58
__in VS_COMPONENT_PROPERTY* rgComponents,
@@ -56,6 +62,7 @@ static HRESULT SetPropertyForComponent(
62
static VS_INSTANCE vrgInstances[] =
63
{
64
{ FILEMAKEVERSION(15, 0, 0, 0), FILEMAKEVERSION(15, 0xffff, 0xffff, 0xffff), ProcessVS2017 },
65
+ { FILEMAKEVERSION(16, 0, 0, 0), FILEMAKEVERSION(16, 0xffff, 0xffff, 0xffff), ProcessVS2019 },
66
};
67
68
/******************************************************************
@@ -407,6 +414,80 @@ LExit:
414
return hr;
415
}
416
417
+static HRESULT ProcessVS2019(
418
+ __in_opt ISetupInstance* pInstance,
419
+ __in DWORD64 qwVersion,
420
+ __in BOOL fComplete
421
+)
422
+{
423
+ static ISetupInstance* pLatest = NULL;
424
+ static DWORD64 qwLatest = 0;
425
+
426
+ static LPCWSTR rgwzProducts[] =
427
+ {
428
+ L"Microsoft.VisualStudio.Product.Community",
429
+ L"Microsoft.VisualStudio.Product.Professional",
430
+ L"Microsoft.VisualStudio.Product.Enterprise",
431
+ };
432
+
433
+ // TODO: Consider making table-driven with these defaults per-version for easy customization.
434
+ static VS_COMPONENT_PROPERTY rgComponents[] =
435
+ {
436
+ { L"Microsoft.VisualStudio.Component.FSharp", L"VS2019_IDE_FSHARP_PROJECTSYSTEM_INSTALLED" },
437
+ { L"Microsoft.VisualStudio.Component.Roslyn.LanguageServices", L"VS2019_IDE_VB_PROJECTSYSTEM_INSTALLED" },
438
+ { L"Microsoft.VisualStudio.Component.Roslyn.LanguageServices", L"VS2019_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" },
439
+ { L"Microsoft.VisualStudio.Component.TestTools.Core", L"VS2019_IDE_VSTS_TESTSYSTEM_INSTALLED" },
440
+ { L"Microsoft.VisualStudio.Component.VC.CoreIde", L"VS2019_IDE_VC_PROJECTSYSTEM_INSTALLED" },
441
+ { L"Microsoft.VisualStudio.Component.Web", L"VS2019_IDE_VWD_PROJECTSYSTEM_INSTALLED" },
442
+ { L"Microsoft.VisualStudio.PackageGroup.DslRuntime", L"VS2019_IDE_MODELING_PROJECTSYSTEM_INSTALLED" },
443
+ };
444
+
445
+ HRESULT hr = S_OK;
446
+
447
+ if (fComplete)
448
+ {
449
+ if (pLatest)
450
+ {
451
+ hr = ProcessInstance(pLatest, L"VS2019_ROOT_FOLDER", countof(rgComponents), rgComponents);
452
+ ExitOnFailure(hr, "Failed to process VS2019 instance.");
453
+ }
454
+ }
455
+ else if (pInstance)
456
+ {
457
+ hr = InstanceInProducts(pInstance, countof(rgwzProducts), rgwzProducts);
458
+ ExitOnFailure(hr, "Failed to compare product IDs.");
459
+
460
+ if (S_FALSE == hr)
461
+ {
462
+ ExitFunction();
463
+ }
464
+
465
+ hr = InstanceIsGreater(pLatest, qwLatest, pInstance, qwVersion);
466
+ ExitOnFailure(hr, "Failed to compare instances.");
467
+
468
+ if (S_FALSE == hr)
469
+ {
470
+ ExitFunction();
471
+ }
472
+
473
+ ReleaseNullObject(pLatest);
474
+
475
+ pLatest = pInstance;
476
+ qwLatest = qwVersion;
477
+
478
+ // Caller will do a final Release() otherwise.
479
+ pLatest->AddRef();
480
+ }
481
+
482
+LExit:
483
+ if (fComplete)
484
+ {
485
+ ReleaseObject(pLatest);
486
+ }
487
+
488
+ return hr;
489
+}
490
+
491
static HRESULT SetPropertyForComponent(
492
__in DWORD cComponents,
493
__in VS_COMPONENT_PROPERTY* rgComponents,
src/wixlib/VS2019.wxs
new
+143
@@ -0,0 +1,143 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<!-- 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. -->
3
+
4
+
5
+<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
6
+ <Fragment>
7
+ <Property Id="VS2019_ROOT_FOLDER" Secure="yes" />
8
+
9
+ <!-- Currently supported only on x86 -->
10
+ <CustomActionRef Id="VSFindInstances" />
11
+ </Fragment>
12
+
13
+ <Fragment>
14
+ <PropertyRef Id="VS2019_ROOT_FOLDER" />
15
+ <Property Id="VS2019_IDE_DIR" Secure="yes">
16
+ <DirectorySearch Id="VS2019DirectorySearch" Path="[VS2019_ROOT_FOLDER]">
17
+ <DirectorySearch Id="VS2019EnvironmentDirectorySearch" Path="Common7\IDE" Depth="1" />
18
+ </DirectorySearch>
19
+ </Property>
20
+ </Fragment>
21
+
22
+ <Fragment>
23
+ <Property Id="VS2019_EXTENSIONS_DIR" Secure="yes">
24
+ <DirectorySearchRef Id="VS2019EnvironmentDirectorySearch" Parent="VS2019DirectorySearch" Path="Common7\IDE">
25
+ <DirectorySearch Id="VS2019ExtensionsDirectorySearch" Path="Extensions" Depth="1" />
26
+ </DirectorySearchRef>
27
+ </Property>
28
+ </Fragment>
29
+
30
+ <Fragment>
31
+ <Property Id="VS2019_PROJECTTEMPLATES_DIR" Secure="yes">
32
+ <DirectorySearchRef Id="VS2019EnvironmentDirectorySearch" Parent="VS2019DirectorySearch" Path="Common7\IDE">
33
+ <DirectorySearch Id="VS2019ProjectTemplatesDirectorySearch" Path="ProjectTemplates" Depth="1" />
34
+ </DirectorySearchRef>
35
+ </Property>
36
+ </Fragment>
37
+
38
+ <Fragment>
39
+ <PropertyRef Id="VS2019_ROOT_FOLDER" />
40
+ <Property Id="VS2019_SCHEMAS_DIR" Secure="yes">
41
+ <DirectorySearch Id="VS2019XmlDirectorySearch" Path="[VS2019_ROOT_FOLDER]\Xml" Depth="1">
42
+ <DirectorySearch Id="VS2019XmlSchemasDirectorySearch" Path="Schemas" Depth="1" />
43
+ </DirectorySearch>
44
+ </Property>
45
+ </Fragment>
46
+
47
+ <Fragment>
48
+ <Property Id="VS2019_ITEMTEMPLATES_DIR" Secure="yes">
49
+ <DirectorySearchRef Id="VS2019EnvironmentDirectorySearch" Parent="VS2019DirectorySearch" Path="Common7\IDE">
50
+ <DirectorySearch Id="VS2019ItemTemplatesDirectorySearch" Path="ItemTemplates" Depth="1" />
51
+ </DirectorySearchRef>
52
+ </Property>
53
+ </Fragment>
54
+
55
+ <Fragment>
56
+ <PropertyRef Id="VS2019_ROOT_FOLDER" />
57
+ <Property Id="VS2019_BOOTSTRAPPER_PACKAGE_FOLDER" Secure="yes">
58
+ <DirectorySearch Id="VS2019SDKDirectorySearch" Path="[VS2019_ROOT_FOLDER]\SDK" Depth="1">
59
+ <DirectorySearch Id="SearchForVS2019BootstrapperPackageDirectory" Path="Bootstrapper" Depth="1" />
60
+ </DirectorySearch>
61
+ </Property>
62
+ </Fragment>
63
+
64
+ <Fragment>
65
+ <Property Id="VS2019DEVENV" Secure="yes">
66
+ <DirectorySearchRef Id="VS2019EnvironmentDirectorySearch" Parent="VS2019DirectorySearch" Path="Common7\IDE">
67
+ <FileSearch Id="VS2019DevEnvSearch" Name="devenv.exe" />
68
+ </DirectorySearchRef>
69
+ </Property>
70
+ </Fragment>
71
+
72
+ <Fragment>
73
+ <CustomAction Id="VS2019Setup" Property="VS2019DEVENV" ExeCommand="/setup" Execute="deferred" Return="ignore" Impersonate="no" />
74
+ <PropertyRef Id="VS2019DEVENV" />
75
+
76
+ <InstallExecuteSequence>
77
+ <Custom Action="VS2019Setup" Before="InstallFinalize" Overridable="yes">VS2019DEVENV</Custom>
78
+ </InstallExecuteSequence>
79
+ </Fragment>
80
+
81
+ <Fragment>
82
+ <CustomAction Id="VS2019InstallVSTemplates" Property="VS2019DEVENV" ExeCommand="/InstallVSTemplates" Execute="deferred" Return="ignore" Impersonate="no" />
83
+ <PropertyRef Id="VS2019DEVENV" />
84
+
85
+ <InstallExecuteSequence>
86
+ <Custom Action="VS2019InstallVSTemplates" Before="InstallFinalize" Overridable="yes">VS2019DEVENV</Custom>
87
+ </InstallExecuteSequence>
88
+ </Fragment>
89
+
90
+ <!-- Indicates whether the Visual C# project system is installed as a part of -->
91
+ <!-- Visual Studio 2019 standard or higher. If this property is set, that -->
92
+ <!-- means Visual Studio 2019 standard or higher is installed and the Visual -->
93
+ <!-- C# language tools were installed as a part of VS 2019 setup. -->
94
+ <Fragment>
95
+ <Property Id="VS2019_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
96
+ <CustomActionRef Id="VSFindInstances" />
97
+ </Fragment>
98
+
99
+ <!-- Indicates whether the Visual Basic project system is installed as a part of -->
100
+ <!-- Visual Studio 2019 standard or higher. If this property is set, that -->
101
+ <!-- means Visual Studio 2019 standard or higher is installed and the Visual -->
102
+ <!-- Basic language tools were installed as a part of VS 2019 setup. -->
103
+ <Fragment>
104
+ <Property Id="VS2019_IDE_VB_PROJECTSYSTEM_INSTALLED" Secure="yes" />
105
+ <CustomActionRef Id="VSFindInstances" />
106
+ </Fragment>
107
+
108
+ <!-- Indicates whether the Visual Web Developer project system is installed as a part of -->
109
+ <!-- Visual Studio 2019 standard or higher. If this property is set, that -->
110
+ <!-- means Visual Studio 2019 standard or higher is installed and the Visual -->
111
+ <!-- Web Developer language tools were installed as a part of VS 2019 setup. -->
112
+ <Fragment>
113
+ <Property Id="VS2019_IDE_VWD_PROJECTSYSTEM_INSTALLED" Secure="yes" />
114
+ <CustomActionRef Id="VSFindInstances" />
115
+ </Fragment>
116
+
117
+ <!-- Indicates whether the Visual C++ project system is installed as a part of -->
118
+ <!-- Visual Studio 2019 standard or higher. If this property is set, that -->
119
+ <!-- means Visual Studio 2019 standard or higher is installed and the Visual -->
120
+ <!-- C++ language tools were installed as a part of VS 2019 setup. -->
121
+ <Fragment>
122
+ <Property Id="VS2019_IDE_VC_PROJECTSYSTEM_INSTALLED" Secure="yes" />
123
+ <CustomActionRef Id="VSFindInstances" />
124
+ </Fragment>
125
+
126
+ <!-- Indicates whether the Visual Studio 2019 Team Test project system is installed -->
127
+ <Fragment>
128
+ <Property Id="VS2019_IDE_VSTS_TESTSYSTEM_INSTALLED" Secure="yes" />
129
+ <CustomActionRef Id="VSFindInstances" />
130
+ </Fragment>
131
+
132
+ <!-- Indicates whether the Visual Studio Modeling project system is installed -->
133
+ <Fragment>
134
+ <Property Id="VS2019_IDE_MODELING_PROJECTSYSTEM_INSTALLED" Secure="yes" />
135
+ <CustomActionRef Id="VSFindInstances" />
136
+ </Fragment>
137
+
138
+ <!-- Indicates whether the Visual Studio F# project system is installed -->
139
+ <Fragment>
140
+ <Property Id="VS2019_IDE_FSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
141
+ <CustomActionRef Id="VSFindInstances" />
142
+ </Fragment>
143
+</Wix>
src/wixlib/vs.wixproj
+1
@@ -23,6 +23,7 @@
23
<Compile Include="VS14.wxs" />
24
<Compile Include="VS2015.wxs" />
25
<Compile Include="VS2017.wxs" />
26
+ <Compile Include="VS2019.wxs" />
27
<Compile Include="VSExtension_x86.wxs" />
28
<Compile Include="VsixPackage.wxs" />
29
<Compile Include="vs2005\vs2005_VSIPCC_Collection_Files_RTL.wxs" />