aboutsummaryrefslogtreecommitdiff
path: root/src/ext/VisualStudio/ca
diff options
context:
space:
mode:
authorBob Arnson <bob@firegiant.com>2021-12-22 23:52:40 -0500
committerBob Arnson <github@bobs.org>2021-12-23 12:32:16 -0500
commitb9c712f26d921f7ffe0509d1cc45456680e8139f (patch)
tree0cb80095c6c9ffe0c01ab9a723c25fd228a48649 /src/ext/VisualStudio/ca
parent2f744bf58cc4edb5a712bfff8e7e42baba81768d (diff)
downloadwix-b9c712f26d921f7ffe0509d1cc45456680e8139f.tar.gz
wix-b9c712f26d921f7ffe0509d1cc45456680e8139f.tar.bz2
wix-b9c712f26d921f7ffe0509d1cc45456680e8139f.zip
Version extension ids.
https://github.com/wixtoolset/issues/issues/5933 - Add support for detecting VS2022. - Add x64 custom actions. - Remove ancient Help 2.0 support. - Update WixCop to add the new element to trigger custom action.
Diffstat (limited to 'src/ext/VisualStudio/ca')
-rw-r--r--src/ext/VisualStudio/ca/vsca.cpp81
-rw-r--r--src/ext/VisualStudio/ca/vsca.vcxproj8
2 files changed, 89 insertions, 0 deletions
diff --git a/src/ext/VisualStudio/ca/vsca.cpp b/src/ext/VisualStudio/ca/vsca.cpp
index 54a54a34..736add1f 100644
--- a/src/ext/VisualStudio/ca/vsca.cpp
+++ b/src/ext/VisualStudio/ca/vsca.cpp
@@ -53,6 +53,12 @@ static HRESULT ProcessVS2019(
53 __in BOOL fComplete 53 __in BOOL fComplete
54 ); 54 );
55 55
56static HRESULT ProcessVS2022(
57 __in_opt ISetupInstance* pInstance,
58 __in DWORD64 qwVersion,
59 __in BOOL fComplete
60 );
61
56static HRESULT SetPropertyForComponent( 62static HRESULT SetPropertyForComponent(
57 __in DWORD cComponents, 63 __in DWORD cComponents,
58 __in VS_COMPONENT_PROPERTY* rgComponents, 64 __in VS_COMPONENT_PROPERTY* rgComponents,
@@ -63,6 +69,7 @@ static VS_INSTANCE vrgInstances[] =
63{ 69{
64 { FILEMAKEVERSION(15, 0, 0, 0), FILEMAKEVERSION(15, 0xffff, 0xffff, 0xffff), ProcessVS2017 }, 70 { FILEMAKEVERSION(15, 0, 0, 0), FILEMAKEVERSION(15, 0xffff, 0xffff, 0xffff), ProcessVS2017 },
65 { FILEMAKEVERSION(16, 0, 0, 0), FILEMAKEVERSION(16, 0xffff, 0xffff, 0xffff), ProcessVS2019 }, 71 { FILEMAKEVERSION(16, 0, 0, 0), FILEMAKEVERSION(16, 0xffff, 0xffff, 0xffff), ProcessVS2019 },
72 { FILEMAKEVERSION(17, 0, 0, 0), FILEMAKEVERSION(17, 0xffff, 0xffff, 0xffff), ProcessVS2022 },
66}; 73};
67 74
68/****************************************************************** 75/******************************************************************
@@ -485,6 +492,80 @@ LExit:
485 return hr; 492 return hr;
486} 493}
487 494
495static HRESULT ProcessVS2022(
496 __in_opt ISetupInstance* pInstance,
497 __in DWORD64 qwVersion,
498 __in BOOL fComplete
499 )
500{
501 static ISetupInstance* pLatest = NULL;
502 static DWORD64 qwLatest = 0;
503
504 static LPCWSTR rgwzProducts[] =
505 {
506 L"Microsoft.VisualStudio.Product.Community",
507 L"Microsoft.VisualStudio.Product.Professional",
508 L"Microsoft.VisualStudio.Product.Enterprise",
509 };
510
511 // TODO: Consider making table-driven with these defaults per-version for easy customization.
512 static VS_COMPONENT_PROPERTY rgComponents[] =
513 {
514 { L"Microsoft.VisualStudio.Component.FSharp", L"VS2022_IDE_FSHARP_PROJECTSYSTEM_INSTALLED" },
515 { L"Microsoft.VisualStudio.Component.Roslyn.LanguageServices", L"VS2022_IDE_VB_PROJECTSYSTEM_INSTALLED" },
516 { L"Microsoft.VisualStudio.Component.Roslyn.LanguageServices", L"VS2022_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" },
517 { L"Microsoft.VisualStudio.PackageGroup.TestTools.Core", L"VS2022_IDE_VSTS_TESTSYSTEM_INSTALLED" },
518 { L"Microsoft.VisualStudio.Component.VC.CoreIde", L"VS2022_IDE_VC_PROJECTSYSTEM_INSTALLED" },
519 { L"Microsoft.VisualStudio.Component.Web", L"VS2022_IDE_VWD_PROJECTSYSTEM_INSTALLED" },
520 { L"Microsoft.VisualStudio.PackageGroup.DslRuntime", L"VS2022_IDE_MODELING_PROJECTSYSTEM_INSTALLED" },
521 };
522
523 HRESULT hr = S_OK;
524
525 if (fComplete)
526 {
527 if (pLatest)
528 {
529 hr = ProcessInstance(pLatest, L"VS2022_ROOT_FOLDER", countof(rgComponents), rgComponents);
530 ExitOnFailure(hr, "Failed to process VS2022 instance.");
531 }
532 }
533 else if (pInstance)
534 {
535 hr = InstanceInProducts(pInstance, countof(rgwzProducts), rgwzProducts);
536 ExitOnFailure(hr, "Failed to compare product IDs.");
537
538 if (S_FALSE == hr)
539 {
540 ExitFunction();
541 }
542
543 hr = InstanceIsGreater(pLatest, qwLatest, pInstance, qwVersion);
544 ExitOnFailure(hr, "Failed to compare instances.");
545
546 if (S_FALSE == hr)
547 {
548 ExitFunction();
549 }
550
551 ReleaseNullObject(pLatest);
552
553 pLatest = pInstance;
554 qwLatest = qwVersion;
555
556 // Caller will do a final Release() otherwise.
557 pLatest->AddRef();
558 }
559
560LExit:
561 if (fComplete)
562 {
563 ReleaseObject(pLatest);
564 }
565
566 return hr;
567}
568
488static HRESULT SetPropertyForComponent( 569static HRESULT SetPropertyForComponent(
489 __in DWORD cComponents, 570 __in DWORD cComponents,
490 __in VS_COMPONENT_PROPERTY* rgComponents, 571 __in VS_COMPONENT_PROPERTY* rgComponents,
diff --git a/src/ext/VisualStudio/ca/vsca.vcxproj b/src/ext/VisualStudio/ca/vsca.vcxproj
index 8d6a3500..0b838b82 100644
--- a/src/ext/VisualStudio/ca/vsca.vcxproj
+++ b/src/ext/VisualStudio/ca/vsca.vcxproj
@@ -11,6 +11,14 @@
11 <Configuration>Release</Configuration> 11 <Configuration>Release</Configuration>
12 <Platform>Win32</Platform> 12 <Platform>Win32</Platform>
13 </ProjectConfiguration> 13 </ProjectConfiguration>
14 <ProjectConfiguration Include="Debug|x64">
15 <Configuration>Debug</Configuration>
16 <Platform>x64</Platform>
17 </ProjectConfiguration>
18 <ProjectConfiguration Include="Release|x64">
19 <Configuration>Release</Configuration>
20 <Platform>x64</Platform>
21 </ProjectConfiguration>
14 </ItemGroup> 22 </ItemGroup>
15 23
16 <PropertyGroup Label="Globals"> 24 <PropertyGroup Label="Globals">