Skip to content

Commit afedf44

Browse files
committed
Issue-9189 VS 2026 Support
Update vsca.cpp to search for VS18/2026 Updated Tests to look for VS2026_ROOT_FOLDER Cloned VS2022 wixlib fragment to VS2026 and replaced 2022 with 2026.
1 parent 2ce9b1c commit afedf44

File tree

3 files changed

+217
-0
lines changed

3 files changed

+217
-0
lines changed

src/ext/VisualStudio/ca/vsca.cpp

Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ static HRESULT ProcessVS2022(
5959
__in BOOL fComplete
6060
);
6161

62+
static HRESULT ProcessVS2026(
63+
__in_opt ISetupInstance* pInstance,
64+
__in DWORD64 qwVersion,
65+
__in BOOL fComplete
66+
);
67+
6268
static HRESULT SetPropertyForComponent(
6369
__in DWORD cComponents,
6470
__in VS_COMPONENT_PROPERTY* rgComponents,
@@ -70,6 +76,7 @@ static VS_INSTANCE vrgInstances[] =
7076
{ FILEMAKEVERSION(15, 0, 0, 0), FILEMAKEVERSION(15, 0xffff, 0xffff, 0xffff), ProcessVS2017 },
7177
{ FILEMAKEVERSION(16, 0, 0, 0), FILEMAKEVERSION(16, 0xffff, 0xffff, 0xffff), ProcessVS2019 },
7278
{ FILEMAKEVERSION(17, 0, 0, 0), FILEMAKEVERSION(17, 0xffff, 0xffff, 0xffff), ProcessVS2022 },
79+
{ FILEMAKEVERSION(18, 0, 0, 0), FILEMAKEVERSION(18, 0xffff, 0xffff, 0xffff), ProcessVS2026 },
7380
};
7481

7582
/******************************************************************
@@ -566,6 +573,81 @@ static HRESULT ProcessVS2022(
566573
return hr;
567574
}
568575

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+
650+
569651
static HRESULT SetPropertyForComponent(
570652
__in DWORD cComponents,
571653
__in VS_COMPONENT_PROPERTY* rgComponents,

src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public void CanBuildUsingVsixPackageOnArm64()
8080
"VS2017DEVENV",
8181
"VS2019_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED",
8282
"VS2022_ROOT_FOLDER",
83+
"VS2026_ROOT_FOLDER",
8384
"WIX_DOWNGRADE_DETECTED",
8485
"WIX_UPGRADE_DETECTED",
8586
}, propertyResults);
Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,134 @@
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+
4+
<Wix xmlns="http://wixtoolset.org/schemas/v4/wxs">
5+
<?include ..\..\caDecor.wxi ?>
6+
7+
<Fragment>
8+
<Property Id="VS2026_ROOT_FOLDER" Secure="yes" />
9+
</Fragment>
10+
11+
<Fragment>
12+
<PropertyRef Id="VS2026_ROOT_FOLDER" />
13+
<Property Id="VS2026_IDE_DIR" Secure="yes">
14+
<DirectorySearch Id="VS2026DirectorySearch" Path="[VS2026_ROOT_FOLDER]">
15+
<DirectorySearch Id="VS2026EnvironmentDirectorySearch" Path="Common7\IDE" Depth="1" />
16+
</DirectorySearch>
17+
</Property>
18+
</Fragment>
19+
20+
<Fragment>
21+
<Property Id="VS2026_EXTENSIONS_DIR" Secure="yes">
22+
<DirectorySearchRef Id="VS2026EnvironmentDirectorySearch" Parent="VS2026DirectorySearch" Path="Common7\IDE">
23+
<DirectorySearch Id="VS2026ExtensionsDirectorySearch" Path="Extensions" Depth="1" />
24+
</DirectorySearchRef>
25+
</Property>
26+
</Fragment>
27+
28+
<Fragment>
29+
<Property Id="VS2026_PROJECTTEMPLATES_DIR" Secure="yes">
30+
<DirectorySearchRef Id="VS2026EnvironmentDirectorySearch" Parent="VS2026DirectorySearch" Path="Common7\IDE">
31+
<DirectorySearch Id="VS2026ProjectTemplatesDirectorySearch" Path="ProjectTemplates" Depth="1" />
32+
</DirectorySearchRef>
33+
</Property>
34+
</Fragment>
35+
36+
<Fragment>
37+
<PropertyRef Id="VS2026_ROOT_FOLDER" />
38+
<Property Id="VS2026_SCHEMAS_DIR" Secure="yes">
39+
<DirectorySearch Id="VS2026XmlDirectorySearch" Path="[VS2026_ROOT_FOLDER]\Xml" Depth="1">
40+
<DirectorySearch Id="VS2026XmlSchemasDirectorySearch" Path="Schemas" Depth="1" />
41+
</DirectorySearch>
42+
</Property>
43+
</Fragment>
44+
45+
<Fragment>
46+
<Property Id="VS2026_ITEMTEMPLATES_DIR" Secure="yes">
47+
<DirectorySearchRef Id="VS2026EnvironmentDirectorySearch" Parent="VS2026DirectorySearch" Path="Common7\IDE">
48+
<DirectorySearch Id="VS2026ItemTemplatesDirectorySearch" Path="ItemTemplates" Depth="1" />
49+
</DirectorySearchRef>
50+
</Property>
51+
</Fragment>
52+
53+
<Fragment>
54+
<PropertyRef Id="VS2026_ROOT_FOLDER" />
55+
<Property Id="VS2026_BOOTSTRAPPER_PACKAGE_FOLDER" Secure="yes">
56+
<DirectorySearch Id="VS2026SDKDirectorySearch" Path="[VS2026_ROOT_FOLDER]\SDK" Depth="1">
57+
<DirectorySearch Id="SearchForVS2026BootstrapperPackageDirectory" Path="Bootstrapper" Depth="1" />
58+
</DirectorySearch>
59+
</Property>
60+
</Fragment>
61+
62+
<Fragment>
63+
<Property Id="VS2026DEVENV" Secure="yes">
64+
<DirectorySearchRef Id="VS2026EnvironmentDirectorySearch" Parent="VS2026DirectorySearch" Path="Common7\IDE">
65+
<FileSearch Id="VS2026DevEnvSearch" Name="devenv.exe" />
66+
</DirectorySearchRef>
67+
</Property>
68+
</Fragment>
69+
70+
<Fragment>
71+
<CustomAction Id="VS2026Setup" Property="VS2026DEVENV" ExeCommand="/setup" Execute="deferred" Return="ignore" Impersonate="no" />
72+
<PropertyRef Id="VS2026DEVENV" />
73+
74+
<InstallExecuteSequence>
75+
<Custom Action="VS2026Setup" Before="InstallFinalize" Overridable="yes" Condition="VS2026DEVENV" />
76+
</InstallExecuteSequence>
77+
</Fragment>
78+
79+
<Fragment>
80+
<CustomAction Id="VS2026InstallVSTemplates" Property="VS2026DEVENV" ExeCommand="/InstallVSTemplates" Execute="deferred" Return="ignore" Impersonate="no" />
81+
<PropertyRef Id="VS2026DEVENV" />
82+
83+
<InstallExecuteSequence>
84+
<Custom Action="VS2026InstallVSTemplates" Before="InstallFinalize" Overridable="yes" Condition="VS2026DEVENV" />
85+
</InstallExecuteSequence>
86+
</Fragment>
87+
88+
<!-- Indicates whether the Visual C# project system is installed as a part of -->
89+
<!-- Visual Studio 2019 standard or higher. If this property is set, that -->
90+
<!-- means Visual Studio 2019 standard or higher is installed and the Visual -->
91+
<!-- C# language tools were installed as a part of VS 2019 setup. -->
92+
<Fragment>
93+
<Property Id="VS2026_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
94+
</Fragment>
95+
96+
<!-- Indicates whether the Visual Basic project system is installed as a part of -->
97+
<!-- Visual Studio 2019 standard or higher. If this property is set, that -->
98+
<!-- means Visual Studio 2019 standard or higher is installed and the Visual -->
99+
<!-- Basic language tools were installed as a part of VS 2019 setup. -->
100+
<Fragment>
101+
<Property Id="VS2026_IDE_VB_PROJECTSYSTEM_INSTALLED" Secure="yes" />
102+
</Fragment>
103+
104+
<!-- Indicates whether the Visual Web Developer project system is installed as a part of -->
105+
<!-- Visual Studio 2019 standard or higher. If this property is set, that -->
106+
<!-- means Visual Studio 2019 standard or higher is installed and the Visual -->
107+
<!-- Web Developer language tools were installed as a part of VS 2019 setup. -->
108+
<Fragment>
109+
<Property Id="VS2026_IDE_VWD_PROJECTSYSTEM_INSTALLED" Secure="yes" />
110+
</Fragment>
111+
112+
<!-- Indicates whether the Visual C++ project system is installed as a part of -->
113+
<!-- Visual Studio 2019 standard or higher. If this property is set, that -->
114+
<!-- means Visual Studio 2019 standard or higher is installed and the Visual -->
115+
<!-- C++ language tools were installed as a part of VS 2019 setup. -->
116+
<Fragment>
117+
<Property Id="VS2026_IDE_VC_PROJECTSYSTEM_INSTALLED" Secure="yes" />
118+
</Fragment>
119+
120+
<!-- Indicates whether the Visual Studio 2019 Team Test project system is installed -->
121+
<Fragment>
122+
<Property Id="VS2026_IDE_VSTS_TESTSYSTEM_INSTALLED" Secure="yes" />
123+
</Fragment>
124+
125+
<!-- Indicates whether the Visual Studio Modeling project system is installed -->
126+
<Fragment>
127+
<Property Id="VS2026_IDE_MODELING_PROJECTSYSTEM_INSTALLED" Secure="yes" />
128+
</Fragment>
129+
130+
<!-- Indicates whether the Visual Studio F# project system is installed -->
131+
<Fragment>
132+
<Property Id="VS2026_IDE_FSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
133+
</Fragment>
134+
</Wix>

0 commit comments

Comments
 (0)