diff options
author | Sean Hall <r.sean.hall@gmail.com> | 2019-01-06 20:36:01 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-01-06 20:36:01 -0600 |
commit | ffc71665d46608d39dd414dee8a0be2c742df046 (patch) | |
tree | cccf97d55409a03bc459efa1113fa8476183b263 | |
parent | dc7b9a12716a68d9f994a33c00fe7c558429bba7 (diff) | |
parent | fd7f8754b3c8807d39dcf8295a12ff32ec0264b4 (diff) | |
download | wix-ffc71665d46608d39dd414dee8a0be2c742df046.tar.gz wix-ffc71665d46608d39dd414dee8a0be2c742df046.tar.bz2 wix-ffc71665d46608d39dd414dee8a0be2c742df046.zip |
Merge pull request #3 from chrpai/master
VSExtension support VS 2019 #5923
-rw-r--r-- | src/ca/vsca.cpp | 81 | ||||
-rw-r--r-- | src/wixlib/VS2019.wxs | 143 | ||||
-rw-r--r-- | src/wixlib/vs.wixproj | 1 |
3 files changed, 225 insertions, 0 deletions
diff --git a/src/ca/vsca.cpp b/src/ca/vsca.cpp index 30174672..ac045db8 100644 --- a/src/ca/vsca.cpp +++ b/src/ca/vsca.cpp | |||
@@ -47,6 +47,12 @@ static HRESULT ProcessVS2017( | |||
47 | __in BOOL fComplete | 47 | __in BOOL fComplete |
48 | ); | 48 | ); |
49 | 49 | ||
50 | static HRESULT ProcessVS2019( | ||
51 | __in_opt ISetupInstance* pInstance, | ||
52 | __in DWORD64 qwVersion, | ||
53 | __in BOOL fComplete | ||
54 | ); | ||
55 | |||
50 | static HRESULT SetPropertyForComponent( | 56 | static HRESULT SetPropertyForComponent( |
51 | __in DWORD cComponents, | 57 | __in DWORD cComponents, |
52 | __in VS_COMPONENT_PROPERTY* rgComponents, | 58 | __in VS_COMPONENT_PROPERTY* rgComponents, |
@@ -56,6 +62,7 @@ static HRESULT SetPropertyForComponent( | |||
56 | static VS_INSTANCE vrgInstances[] = | 62 | static VS_INSTANCE vrgInstances[] = |
57 | { | 63 | { |
58 | { FILEMAKEVERSION(15, 0, 0, 0), FILEMAKEVERSION(15, 0xffff, 0xffff, 0xffff), ProcessVS2017 }, | 64 | { FILEMAKEVERSION(15, 0, 0, 0), FILEMAKEVERSION(15, 0xffff, 0xffff, 0xffff), ProcessVS2017 }, |
65 | { FILEMAKEVERSION(16, 0, 0, 0), FILEMAKEVERSION(16, 0xffff, 0xffff, 0xffff), ProcessVS2019 }, | ||
59 | }; | 66 | }; |
60 | 67 | ||
61 | /****************************************************************** | 68 | /****************************************************************** |
@@ -407,6 +414,80 @@ LExit: | |||
407 | return hr; | 414 | return hr; |
408 | } | 415 | } |
409 | 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 | |||
410 | static HRESULT SetPropertyForComponent( | 491 | static HRESULT SetPropertyForComponent( |
411 | __in DWORD cComponents, | 492 | __in DWORD cComponents, |
412 | __in VS_COMPONENT_PROPERTY* rgComponents, | 493 | __in VS_COMPONENT_PROPERTY* rgComponents, |
diff --git a/src/wixlib/VS2019.wxs b/src/wixlib/VS2019.wxs new file mode 100644 index 00000000..57ae6168 --- /dev/null +++ b/src/wixlib/VS2019.wxs | |||
@@ -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> | ||
diff --git a/src/wixlib/vs.wixproj b/src/wixlib/vs.wixproj index f283e6ef..e18a52cd 100644 --- a/src/wixlib/vs.wixproj +++ b/src/wixlib/vs.wixproj | |||
@@ -23,6 +23,7 @@ | |||
23 | <Compile Include="VS14.wxs" /> | 23 | <Compile Include="VS14.wxs" /> |
24 | <Compile Include="VS2015.wxs" /> | 24 | <Compile Include="VS2015.wxs" /> |
25 | <Compile Include="VS2017.wxs" /> | 25 | <Compile Include="VS2017.wxs" /> |
26 | <Compile Include="VS2019.wxs" /> | ||
26 | <Compile Include="VSExtension_x86.wxs" /> | 27 | <Compile Include="VSExtension_x86.wxs" /> |
27 | <Compile Include="VsixPackage.wxs" /> | 28 | <Compile Include="VsixPackage.wxs" /> |
28 | <Compile Include="vs2005\vs2005_VSIPCC_Collection_Files_RTL.wxs" /> | 29 | <Compile Include="vs2005\vs2005_VSIPCC_Collection_Files_RTL.wxs" /> |