diff options
Diffstat (limited to 'src/ext/VisualStudio/ca/vsca.cpp')
| -rw-r--r-- | src/ext/VisualStudio/ca/vsca.cpp | 81 |
1 files changed, 81 insertions, 0 deletions
diff --git a/src/ext/VisualStudio/ca/vsca.cpp b/src/ext/VisualStudio/ca/vsca.cpp index 681187d6..8524629b 100644 --- a/src/ext/VisualStudio/ca/vsca.cpp +++ b/src/ext/VisualStudio/ca/vsca.cpp | |||
| @@ -59,6 +59,12 @@ static HRESULT ProcessVS2022( | |||
| 59 | __in BOOL fComplete | 59 | __in BOOL fComplete |
| 60 | ); | 60 | ); |
| 61 | 61 | ||
| 62 | static HRESULT ProcessVS2026( | ||
| 63 | __in_opt ISetupInstance* pInstance, | ||
| 64 | __in DWORD64 qwVersion, | ||
| 65 | __in BOOL fComplete | ||
| 66 | ); | ||
| 67 | |||
| 62 | static HRESULT SetPropertyForComponent( | 68 | static HRESULT SetPropertyForComponent( |
| 63 | __in DWORD cComponents, | 69 | __in DWORD cComponents, |
| 64 | __in VS_COMPONENT_PROPERTY* rgComponents, | 70 | __in VS_COMPONENT_PROPERTY* rgComponents, |
| @@ -70,6 +76,7 @@ static VS_INSTANCE vrgInstances[] = | |||
| 70 | { FILEMAKEVERSION(15, 0, 0, 0), FILEMAKEVERSION(15, 0xffff, 0xffff, 0xffff), ProcessVS2017 }, | 76 | { FILEMAKEVERSION(15, 0, 0, 0), FILEMAKEVERSION(15, 0xffff, 0xffff, 0xffff), ProcessVS2017 }, |
| 71 | { FILEMAKEVERSION(16, 0, 0, 0), FILEMAKEVERSION(16, 0xffff, 0xffff, 0xffff), ProcessVS2019 }, | 77 | { FILEMAKEVERSION(16, 0, 0, 0), FILEMAKEVERSION(16, 0xffff, 0xffff, 0xffff), ProcessVS2019 }, |
| 72 | { FILEMAKEVERSION(17, 0, 0, 0), FILEMAKEVERSION(17, 0xffff, 0xffff, 0xffff), ProcessVS2022 }, | 78 | { FILEMAKEVERSION(17, 0, 0, 0), FILEMAKEVERSION(17, 0xffff, 0xffff, 0xffff), ProcessVS2022 }, |
| 79 | { FILEMAKEVERSION(18, 0, 0, 0), FILEMAKEVERSION(18, 0xffff, 0xffff, 0xffff), ProcessVS2026 }, | ||
| 73 | }; | 80 | }; |
| 74 | 81 | ||
| 75 | /****************************************************************** | 82 | /****************************************************************** |
| @@ -566,6 +573,80 @@ LExit: | |||
| 566 | return hr; | 573 | return hr; |
| 567 | } | 574 | } |
| 568 | 575 | ||
| 576 | static HRESULT ProcessVS2026( | ||
| 577 | __in_opt ISetupInstance* pInstance, | ||
| 578 | __in DWORD64 qwVersion, | ||
| 579 | __in BOOL fComplete | ||
| 580 | ) | ||
| 581 | { | ||
| 582 | static ISetupInstance* pLatest = NULL; | ||
| 583 | static DWORD64 qwLatest = 0; | ||
| 584 | |||
| 585 | static LPCWSTR rgwzProducts[] = | ||
| 586 | { | ||
| 587 | L"Microsoft.VisualStudio.Product.Community", | ||
| 588 | L"Microsoft.VisualStudio.Product.Professional", | ||
| 589 | L"Microsoft.VisualStudio.Product.Enterprise", | ||
| 590 | }; | ||
| 591 | |||
| 592 | // TODO: Consider making table-driven with these defaults per-version for easy customization. | ||
| 593 | static VS_COMPONENT_PROPERTY rgComponents[] = | ||
| 594 | { | ||
| 595 | { L"Microsoft.VisualStudio.Component.FSharp", L"VS2026_IDE_FSHARP_PROJECTSYSTEM_INSTALLED" }, | ||
| 596 | { L"Microsoft.VisualStudio.Component.Roslyn.LanguageServices", L"VS2026_IDE_VB_PROJECTSYSTEM_INSTALLED" }, | ||
| 597 | { L"Microsoft.VisualStudio.Component.Roslyn.LanguageServices", L"VS2026_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" }, | ||
| 598 | { L"Microsoft.VisualStudio.PackageGroup.TestTools.Core", L"VS2026_IDE_VSTS_TESTSYSTEM_INSTALLED" }, | ||
| 599 | { L"Microsoft.VisualStudio.Component.VC.CoreIde", L"VS2026_IDE_VC_PROJECTSYSTEM_INSTALLED" }, | ||
| 600 | { L"Microsoft.VisualStudio.Component.Web", L"VS2026_IDE_VWD_PROJECTSYSTEM_INSTALLED" }, | ||
| 601 | { L"Microsoft.VisualStudio.PackageGroup.DslRuntime", L"VS2026_IDE_MODELING_PROJECTSYSTEM_INSTALLED" }, | ||
| 602 | }; | ||
| 603 | |||
| 604 | HRESULT hr = S_OK; | ||
| 605 | |||
| 606 | if (fComplete) | ||
| 607 | { | ||
| 608 | if (pLatest) | ||
| 609 | { | ||
| 610 | hr = ProcessInstance(pLatest, L"VS2026_ROOT_FOLDER", countof(rgComponents), rgComponents); | ||
| 611 | ExitOnFailure(hr, "Failed to process VS2026 instance."); | ||
| 612 | } | ||
| 613 | } | ||
| 614 | else if (pInstance) | ||
| 615 | { | ||
| 616 | hr = InstanceInProducts(pInstance, countof(rgwzProducts), rgwzProducts); | ||
| 617 | ExitOnFailure(hr, "Failed to compare product IDs."); | ||
| 618 | |||
| 619 | if (S_FALSE == hr) | ||
| 620 | { | ||
| 621 | ExitFunction(); | ||
| 622 | } | ||
| 623 | |||
| 624 | hr = InstanceIsGreater(pLatest, qwLatest, pInstance, qwVersion); | ||
| 625 | ExitOnFailure(hr, "Failed to compare instances."); | ||
| 626 | |||
| 627 | if (S_FALSE == hr) | ||
| 628 | { | ||
| 629 | ExitFunction(); | ||
| 630 | } | ||
| 631 | |||
| 632 | ReleaseNullObject(pLatest); | ||
| 633 | |||
| 634 | pLatest = pInstance; | ||
| 635 | qwLatest = qwVersion; | ||
| 636 | |||
| 637 | // Caller will do a final Release() otherwise. | ||
| 638 | pLatest->AddRef(); | ||
| 639 | } | ||
| 640 | |||
| 641 | LExit: | ||
| 642 | if (fComplete) | ||
| 643 | { | ||
| 644 | ReleaseObject(pLatest); | ||
| 645 | } | ||
| 646 | |||
| 647 | return hr; | ||
| 648 | } | ||
| 649 | |||
| 569 | static HRESULT SetPropertyForComponent( | 650 | static HRESULT SetPropertyForComponent( |
| 570 | __in DWORD cComponents, | 651 | __in DWORD cComponents, |
| 571 | __in VS_COMPONENT_PROPERTY* rgComponents, | 652 | __in VS_COMPONENT_PROPERTY* rgComponents, |
