aboutsummaryrefslogtreecommitdiff
path: root/src/ext/VisualStudio
diff options
context:
space:
mode:
authorDavid Čížek <DavidCizek@seznam.cz>2026-06-22 16:10:08 +0200
committerBob Arnson <github@bobs.org>2026-08-18 10:16:53 -0400
commit1ce9c79d4334aa9b689624f0c5a4b822c6ad2187 (patch)
tree24c7418ca62465918e0abc4e3f2d35a7adcc53c3 /src/ext/VisualStudio
parentae17aca4c7816f2927c3ccb78e3bfbe264326b8d (diff)
downloadwix-1ce9c79d4334aa9b689624f0c5a4b822c6ad2187.tar.gz
wix-1ce9c79d4334aa9b689624f0c5a4b822c6ad2187.tar.bz2
wix-1ce9c79d4334aa9b689624f0c5a4b822c6ad2187.zip
vsca.cpp updated to search for VS2026.
Updated tests. Added VS2026 wixlib fragment.
Diffstat (limited to 'src/ext/VisualStudio')
-rw-r--r--src/ext/VisualStudio/ca/vsca.cpp81
-rw-r--r--src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/TestData/UsingVsixPackage/Package.wxs3
-rw-r--r--src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs1
-rw-r--r--src/ext/VisualStudio/wixlib/VS2026.wxs134
4 files changed, 218 insertions, 1 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
62static HRESULT ProcessVS2026(
63 __in_opt ISetupInstance* pInstance,
64 __in DWORD64 qwVersion,
65 __in BOOL fComplete
66);
67
62static HRESULT SetPropertyForComponent( 68static 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
576static 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
641LExit:
642 if (fComplete)
643 {
644 ReleaseObject(pLatest);
645 }
646
647 return hr;
648}
649
569static HRESULT SetPropertyForComponent( 650static HRESULT SetPropertyForComponent(
570 __in DWORD cComponents, 651 __in DWORD cComponents,
571 __in VS_COMPONENT_PROPERTY* rgComponents, 652 __in VS_COMPONENT_PROPERTY* rgComponents,
diff --git a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/TestData/UsingVsixPackage/Package.wxs b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/TestData/UsingVsixPackage/Package.wxs
index d56674e3..ff7cb2fb 100644
--- a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/TestData/UsingVsixPackage/Package.wxs
+++ b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/TestData/UsingVsixPackage/Package.wxs
@@ -6,8 +6,9 @@
6 <PropertyRef Id="VS2017DEVENV" /> 6 <PropertyRef Id="VS2017DEVENV" />
7 <PropertyRef Id="VS2019_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" /> 7 <PropertyRef Id="VS2019_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED" />
8 <PropertyRef Id="VS2022_ROOT_FOLDER" /> 8 <PropertyRef Id="VS2022_ROOT_FOLDER" />
9 <PropertyRef Id="VS2026_ROOT_FOLDER" />
9 10
10 <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)"> 11 <Feature Id="ProductFeature" Title="!(loc.FeatureTitle)">
11 <ComponentGroupRef Id="ProductComponents" /> 12 <ComponentGroupRef Id="ProductComponents" />
12 </Feature> 13 </Feature>
13 </Package> 14 </Package>
diff --git a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs
index 361f5274..199eb472 100644
--- a/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs
+++ b/src/ext/VisualStudio/test/WixToolsetTest.VisualStudio/VisualStudioExtensionFixture.cs
@@ -80,6 +80,7 @@ namespace WixToolsetTest.VisualStudio
80 "VS2017DEVENV", 80 "VS2017DEVENV",
81 "VS2019_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED", 81 "VS2019_IDE_VCSHARP_PROJECTSYSTEM_INSTALLED",
82 "VS2022_ROOT_FOLDER", 82 "VS2022_ROOT_FOLDER",
83 "VS2026_ROOT_FOLDER",
83 "WIX_DOWNGRADE_DETECTED", 84 "WIX_DOWNGRADE_DETECTED",
84 "WIX_UPGRADE_DETECTED", 85 "WIX_UPGRADE_DETECTED",
85 }, propertyResults); 86 }, propertyResults);
diff --git a/src/ext/VisualStudio/wixlib/VS2026.wxs b/src/ext/VisualStudio/wixlib/VS2026.wxs
new file mode 100644
index 00000000..2cc78845
--- /dev/null
+++ b/src/ext/VisualStudio/wixlib/VS2026.wxs
@@ -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 2026 standard or higher. If this property is set, that -->
90 <!-- means Visual Studio 2026 standard or higher is installed and the Visual -->
91 <!-- C# language tools were installed as a part of VS 2026 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 2026 standard or higher. If this property is set, that -->
98 <!-- means Visual Studio 2026 standard or higher is installed and the Visual -->
99 <!-- Basic language tools were installed as a part of VS 2026 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 2026 standard or higher. If this property is set, that -->
106 <!-- means Visual Studio 2026 standard or higher is installed and the Visual -->
107 <!-- Web Developer language tools were installed as a part of VS 2026 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 2026 standard or higher. If this property is set, that -->
114 <!-- means Visual Studio 2026 standard or higher is installed and the Visual -->
115 <!-- C++ language tools were installed as a part of VS 2026 setup. -->
116 <Fragment>
117 <Property Id="VS2026_IDE_VC_PROJECTSYSTEM_INSTALLED" Secure="yes" />
118 </Fragment>
119
120 <!-- Indicates whether the Visual Studio 2026 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 2026 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 2026 F# project system is installed -->
131 <Fragment>
132 <Property Id="VS2026_IDE_FSHARP_PROJECTSYSTEM_INSTALLED" Secure="yes" />
133 </Fragment>
134</Wix>