mirror of
https://github.com/electron/node-gyp.git
synced 2025-08-15 12:58:19 +02:00
feat: improve visual studio detection (#2957)
Detect visual studio installation using the VSSetup module and Get-VSSetupInstance method. It works even in systems with the Constrained language mode of PowerShell.
This commit is contained in:
parent
329873141f
commit
109e3d4245
8 changed files with 1517 additions and 51 deletions
235
test/fixtures/VSSetup_VS_2019_Professional_workload.txt
vendored
Normal file
235
test/fixtures/VSSetup_VS_2019_Professional_workload.txt
vendored
Normal file
|
@ -0,0 +1,235 @@
|
|||
[
|
||||
{
|
||||
"InstanceId": "2619cf21",
|
||||
"InstallationName": "VisualStudio/16.11.33+34407.143",
|
||||
"InstallationPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional",
|
||||
"InstallationVersion": {
|
||||
"Major": 16,
|
||||
"Minor": 11,
|
||||
"Build": 34407,
|
||||
"Revision": 143,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 143
|
||||
},
|
||||
"InstallDate": "\/Date(1706804943503)\/",
|
||||
"State": 4294967295,
|
||||
"DisplayName": "Visual Studio Professional 2019",
|
||||
"Description": "Professional IDE best suited to small teams",
|
||||
"ProductPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE\\devenv.exe",
|
||||
"Product": {
|
||||
"Id": "Microsoft.VisualStudio.Product.Professional",
|
||||
"Version": {
|
||||
"Major": 16,
|
||||
"Minor": 11,
|
||||
"Build": 34407,
|
||||
"Revision": 143,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 143
|
||||
},
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Professional,version=16.11.34407.143"
|
||||
},
|
||||
"Packages": [
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Product.Professional",
|
||||
"Version": "16.11.34407.143",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Professional,version=16.11.34407.143"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.VC.14.29.16.10.ATL",
|
||||
"Version": "16.11.31314.313",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.VC.14.29.16.10.ATL,version=16.11.31314.313"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.X64.v142",
|
||||
"Version": "16.11.31503.54",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.X64.v142,version=16.11.31503.54"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.X64",
|
||||
"Version": "16.11.31503.54",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.X64,version=16.11.31503.54"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.x86.v142",
|
||||
"Version": "16.11.31503.54",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.x86.v142,version=16.11.31503.54"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.X86",
|
||||
"Version": "16.11.31503.54",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.X86,version=16.11.31503.54"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.Base",
|
||||
"Version": "16.11.31829.152",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.Base,version=16.11.31829.152"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.Base.Resources",
|
||||
"Version": "16.11.31829.152",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.Base.Resources,version=16.11.31829.152,language=en-US"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Branding.Professional",
|
||||
"Version": "16.11.31605.320",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Branding.Professional,version=16.11.31605.320,language=en-US"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.Windows10SDK.19041",
|
||||
"Version": "16.10.31205.252",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.Windows10SDK.19041,version=16.10.31205.252"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
||||
"Version": "16.11.32406.258",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64,version=16.11.32406.258"
|
||||
}
|
||||
],
|
||||
"Properties": [
|
||||
{
|
||||
"Key": "CampaignId",
|
||||
"Value": "09"
|
||||
},
|
||||
{
|
||||
"Key": "SetupEngineFilePath",
|
||||
"Value": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe"
|
||||
},
|
||||
{
|
||||
"Key": "Nickname",
|
||||
"Value": ""
|
||||
},
|
||||
{
|
||||
"Key": "ChannelManifestId",
|
||||
"Value": "VisualStudio.16.Release/16.11.33+34407.143"
|
||||
}
|
||||
],
|
||||
"Errors": null,
|
||||
"EnginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
|
||||
"IsComplete": true,
|
||||
"IsLaunchable": true,
|
||||
"CatalogInfo": [
|
||||
{
|
||||
"Key": "Id",
|
||||
"Value": "VisualStudio/16.11.33+34407.143"
|
||||
},
|
||||
{
|
||||
"Key": "BuildBranch",
|
||||
"Value": "d16.11"
|
||||
},
|
||||
{
|
||||
"Key": "BuildVersion",
|
||||
"Value": "16.11.34407.143"
|
||||
},
|
||||
{
|
||||
"Key": "LocalBuild",
|
||||
"Value": "build-lab"
|
||||
},
|
||||
{
|
||||
"Key": "ManifestName",
|
||||
"Value": "VisualStudio"
|
||||
},
|
||||
{
|
||||
"Key": "ManifestType",
|
||||
"Value": "installer"
|
||||
},
|
||||
{
|
||||
"Key": "ProductDisplayVersion",
|
||||
"Value": "16.11.33"
|
||||
},
|
||||
{
|
||||
"Key": "ProductLine",
|
||||
"Value": "Dev16"
|
||||
},
|
||||
{
|
||||
"Key": "ProductLineVersion",
|
||||
"Value": "2019"
|
||||
},
|
||||
{
|
||||
"Key": "ProductMilestone",
|
||||
"Value": "RTW"
|
||||
},
|
||||
{
|
||||
"Key": "ProductMilestoneIsPreRelease",
|
||||
"Value": "False"
|
||||
},
|
||||
{
|
||||
"Key": "ProductName",
|
||||
"Value": "Visual Studio"
|
||||
},
|
||||
{
|
||||
"Key": "ProductPatchVersion",
|
||||
"Value": "33"
|
||||
},
|
||||
{
|
||||
"Key": "ProductPreReleaseMilestoneSuffix",
|
||||
"Value": "1.0"
|
||||
},
|
||||
{
|
||||
"Key": "ProductSemanticVersion",
|
||||
"Value": "16.11.33+34407.143"
|
||||
},
|
||||
{
|
||||
"Key": "RequiredEngineVersion",
|
||||
"Value": "2.11.72.18200"
|
||||
}
|
||||
],
|
||||
"IsPrerelease": false,
|
||||
"PSPath": "Microsoft.PowerShell.Core\\FileSystem::C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"UpdateDate": "2024-01-09T19:19:11.0115234Z",
|
||||
"ResolvedInstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"ChannelId": "VisualStudio.17.Release",
|
||||
"InstalledChannelId": "VisualStudio.17.Release",
|
||||
"ChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"InstalledChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"ReleaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.8#17.8.4",
|
||||
"ThirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288"
|
||||
}
|
||||
]
|
371
test/fixtures/VSSetup_VS_2022_VS2019_workload.txt
vendored
Normal file
371
test/fixtures/VSSetup_VS_2022_VS2019_workload.txt
vendored
Normal file
|
@ -0,0 +1,371 @@
|
|||
[
|
||||
{
|
||||
"InstanceId": "621862c0",
|
||||
"InstallationName": "VisualStudio/17.8.3+34330.188",
|
||||
"InstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"InstallationVersion": {
|
||||
"Major": 17,
|
||||
"Minor": 8,
|
||||
"Build": 34330,
|
||||
"Revision": 188,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 188
|
||||
},
|
||||
"InstallDate": "\/Date(1703254955000)\/",
|
||||
"State": 4294967295,
|
||||
"DisplayName": "Visual Studio Enterprise 2022",
|
||||
"Description": "Scalable, end-to-end solution for teams of any size",
|
||||
"ProductPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\devenv.exe",
|
||||
"Product": {
|
||||
"Id": "Microsoft.VisualStudio.Product.Enterprise",
|
||||
"Version": {
|
||||
"Major": 17,
|
||||
"Minor": 8,
|
||||
"Build": 34330,
|
||||
"Revision": 188,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 188
|
||||
},
|
||||
"Chip": "x64",
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Enterprise,version=17.8.34330.188,chip=x64"
|
||||
},
|
||||
"Packages": [
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Product.Enterprise",
|
||||
"Version": "17.8.34330.188",
|
||||
"Chip": "x64",
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Enterprise,version=17.8.34330.188,chip=x64"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64,version=17.8.34129.139"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.Windows11SDK.22000",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.Windows11SDK.22000,version=17.8.34129.139"
|
||||
},
|
||||
{
|
||||
"Id": "Win11SDK_10.0.22000",
|
||||
"Version": "10.0.22000.4",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Exe",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Win11SDK_10.0.22000,version=10.0.22000.4"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.Windows10SDK.20348",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.Windows10SDK.20348,version=17.8.34129.139"
|
||||
},
|
||||
{
|
||||
"Id": "Win10SDK_10.0.20348",
|
||||
"Version": "10.0.20348.3",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Exe",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Win10SDK_10.0.20348,version=10.0.20348.3"
|
||||
}
|
||||
],
|
||||
"Properties": [
|
||||
{
|
||||
"Key": "CampaignId",
|
||||
"Value": ""
|
||||
},
|
||||
{
|
||||
"Key": "SetupEngineFilePath",
|
||||
"Value": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe"
|
||||
},
|
||||
{
|
||||
"Key": "Nickname",
|
||||
"Value": ""
|
||||
},
|
||||
{
|
||||
"Key": "ChannelManifestId",
|
||||
"Value": "VisualStudio.17.Release/17.8.3+34330.188"
|
||||
}
|
||||
],
|
||||
"Errors": null,
|
||||
"EnginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
|
||||
"IsComplete": true,
|
||||
"IsLaunchable": true,
|
||||
"CatalogInfo": [
|
||||
{
|
||||
"Key": "Id",
|
||||
"Value": "VisualStudio/17.8.3+34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "BuildBranch",
|
||||
"Value": "d17.8"
|
||||
},
|
||||
{
|
||||
"Key": "BuildVersion",
|
||||
"Value": "17.8.34330.188"
|
||||
}
|
||||
],
|
||||
"IsPrerelease": false,
|
||||
"PSPath": "Microsoft.PowerShell.Core\\FileSystem::C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"UpdateDate": "2023-12-22T14:22:35.1818213Z",
|
||||
"ResolvedInstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"ChannelId": "VisualStudio.17.Release",
|
||||
"InstalledChannelId": "VisualStudio.17.Release",
|
||||
"ChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"InstalledChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"ReleaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.8#17.8.3",
|
||||
"ThirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288"
|
||||
},
|
||||
{
|
||||
"InstanceId": "2619cf21",
|
||||
"InstallationName": "VisualStudio/16.11.33+34407.143",
|
||||
"InstallationPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional",
|
||||
"InstallationVersion": {
|
||||
"Major": 16,
|
||||
"Minor": 11,
|
||||
"Build": 34407,
|
||||
"Revision": 143,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 143
|
||||
},
|
||||
"InstallDate": "\/Date(1706804943503)\/",
|
||||
"State": 4294967295,
|
||||
"DisplayName": "Visual Studio Professional 2019",
|
||||
"Description": "Professional IDE best suited to small teams",
|
||||
"ProductPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Professional\\Common7\\IDE\\devenv.exe",
|
||||
"Product": {
|
||||
"Id": "Microsoft.VisualStudio.Product.Professional",
|
||||
"Version": {
|
||||
"Major": 16,
|
||||
"Minor": 11,
|
||||
"Build": 34407,
|
||||
"Revision": 143,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 143
|
||||
},
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Professional,version=16.11.34407.143"
|
||||
},
|
||||
"Packages": [
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Product.Professional",
|
||||
"Version": "16.11.34407.143",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Professional,version=16.11.34407.143"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.VC.14.29.16.10.ATL",
|
||||
"Version": "16.11.31314.313",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.VC.14.29.16.10.ATL,version=16.11.31314.313"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.X64.v142",
|
||||
"Version": "16.11.31503.54",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.X64.v142,version=16.11.31503.54"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.X64",
|
||||
"Version": "16.11.31503.54",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.X64,version=16.11.31503.54"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.x86.v142",
|
||||
"Version": "16.11.31503.54",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.x86.v142,version=16.11.31503.54"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.X86",
|
||||
"Version": "16.11.31503.54",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.X86,version=16.11.31503.54"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.Base",
|
||||
"Version": "16.11.31829.152",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.Base,version=16.11.31829.152"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.MSBuild.Base.Resources",
|
||||
"Version": "16.11.31829.152",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.MSBuild.Base.Resources,version=16.11.31829.152,language=en-US"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Branding.Professional",
|
||||
"Version": "16.11.31605.320",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Branding.Professional,version=16.11.31605.320,language=en-US"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.Windows10SDK.19041",
|
||||
"Version": "16.10.31205.252",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.Windows10SDK.19041,version=16.10.31205.252"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
||||
"Version": "16.11.32406.258",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64,version=16.11.32406.258"
|
||||
}
|
||||
],
|
||||
"Properties": [
|
||||
{
|
||||
"Key": "CampaignId",
|
||||
"Value": "09"
|
||||
},
|
||||
{
|
||||
"Key": "SetupEngineFilePath",
|
||||
"Value": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe"
|
||||
},
|
||||
{
|
||||
"Key": "Nickname",
|
||||
"Value": ""
|
||||
},
|
||||
{
|
||||
"Key": "ChannelManifestId",
|
||||
"Value": "VisualStudio.16.Release/16.11.33+34407.143"
|
||||
}
|
||||
],
|
||||
"Errors": null,
|
||||
"EnginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
|
||||
"IsComplete": true,
|
||||
"IsLaunchable": true,
|
||||
"CatalogInfo": [
|
||||
{
|
||||
"Key": "Id",
|
||||
"Value": "VisualStudio/16.11.33+34407.143"
|
||||
},
|
||||
{
|
||||
"Key": "BuildBranch",
|
||||
"Value": "d16.11"
|
||||
},
|
||||
{
|
||||
"Key": "BuildVersion",
|
||||
"Value": "16.11.34407.143"
|
||||
},
|
||||
{
|
||||
"Key": "LocalBuild",
|
||||
"Value": "build-lab"
|
||||
},
|
||||
{
|
||||
"Key": "ManifestName",
|
||||
"Value": "VisualStudio"
|
||||
},
|
||||
{
|
||||
"Key": "ManifestType",
|
||||
"Value": "installer"
|
||||
},
|
||||
{
|
||||
"Key": "ProductDisplayVersion",
|
||||
"Value": "16.11.33"
|
||||
},
|
||||
{
|
||||
"Key": "ProductLine",
|
||||
"Value": "Dev16"
|
||||
},
|
||||
{
|
||||
"Key": "ProductLineVersion",
|
||||
"Value": "2019"
|
||||
},
|
||||
{
|
||||
"Key": "ProductMilestone",
|
||||
"Value": "RTW"
|
||||
},
|
||||
{
|
||||
"Key": "ProductMilestoneIsPreRelease",
|
||||
"Value": "False"
|
||||
},
|
||||
{
|
||||
"Key": "ProductName",
|
||||
"Value": "Visual Studio"
|
||||
},
|
||||
{
|
||||
"Key": "ProductPatchVersion",
|
||||
"Value": "33"
|
||||
},
|
||||
{
|
||||
"Key": "ProductPreReleaseMilestoneSuffix",
|
||||
"Value": "1.0"
|
||||
},
|
||||
{
|
||||
"Key": "ProductSemanticVersion",
|
||||
"Value": "16.11.33+34407.143"
|
||||
},
|
||||
{
|
||||
"Key": "RequiredEngineVersion",
|
||||
"Value": "2.11.72.18200"
|
||||
}
|
||||
],
|
||||
"IsPrerelease": false,
|
||||
"PSPath": "Microsoft.PowerShell.Core\\FileSystem::C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"UpdateDate": "2024-01-09T19:19:11.0115234Z",
|
||||
"ResolvedInstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"ChannelId": "VisualStudio.17.Release",
|
||||
"InstalledChannelId": "VisualStudio.17.Release",
|
||||
"ChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"InstalledChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"ReleaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.8#17.8.4",
|
||||
"ThirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288"
|
||||
}
|
||||
]
|
369
test/fixtures/VSSetup_VS_2022_multiple_install.txt
vendored
Normal file
369
test/fixtures/VSSetup_VS_2022_multiple_install.txt
vendored
Normal file
|
@ -0,0 +1,369 @@
|
|||
[
|
||||
{
|
||||
"InstanceId": "621862c0",
|
||||
"InstallationName": "VisualStudio/17.8.3+34330.188",
|
||||
"InstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"InstallationVersion": {
|
||||
"Major": 17,
|
||||
"Minor": 8,
|
||||
"Build": 34330,
|
||||
"Revision": 188,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 188
|
||||
},
|
||||
"InstallDate": "\/Date(1703254955000)\/",
|
||||
"State": 4294967295,
|
||||
"DisplayName": "Visual Studio Enterprise 2022",
|
||||
"Description": "Scalable, end-to-end solution for teams of any size",
|
||||
"ProductPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\devenv.exe",
|
||||
"Product": {
|
||||
"Id": "Microsoft.VisualStudio.Product.Enterprise",
|
||||
"Version": {
|
||||
"Major": 17,
|
||||
"Minor": 8,
|
||||
"Build": 34330,
|
||||
"Revision": 188,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 188
|
||||
},
|
||||
"Chip": "x64",
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Enterprise,version=17.8.34330.188,chip=x64"
|
||||
},
|
||||
"Packages": [
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Product.Enterprise",
|
||||
"Version": "17.8.34330.188",
|
||||
"Chip": "x64",
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Enterprise,version=17.8.34330.188,chip=x64"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64,version=17.8.34129.139"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.Windows11SDK.22000",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.Windows11SDK.22000,version=17.8.34129.139"
|
||||
},
|
||||
{
|
||||
"Id": "Win11SDK_10.0.22000",
|
||||
"Version": "10.0.22000.4",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Exe",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Win11SDK_10.0.22000,version=10.0.22000.4"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.Windows10SDK.20348",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.Windows10SDK.20348,version=17.8.34129.139"
|
||||
},
|
||||
{
|
||||
"Id": "Win10SDK_10.0.20348",
|
||||
"Version": "10.0.20348.3",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Exe",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Win10SDK_10.0.20348,version=10.0.20348.3"
|
||||
}
|
||||
],
|
||||
"Properties": [
|
||||
{
|
||||
"Key": "CampaignId",
|
||||
"Value": ""
|
||||
},
|
||||
{
|
||||
"Key": "SetupEngineFilePath",
|
||||
"Value": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe"
|
||||
},
|
||||
{
|
||||
"Key": "Nickname",
|
||||
"Value": ""
|
||||
},
|
||||
{
|
||||
"Key": "ChannelManifestId",
|
||||
"Value": "VisualStudio.17.Release/17.8.3+34330.188"
|
||||
}
|
||||
],
|
||||
"Errors": null,
|
||||
"EnginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
|
||||
"IsComplete": true,
|
||||
"IsLaunchable": true,
|
||||
"CatalogInfo": [
|
||||
{
|
||||
"Key": "Id",
|
||||
"Value": "VisualStudio/17.8.3+34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "BuildBranch",
|
||||
"Value": "d17.8"
|
||||
},
|
||||
{
|
||||
"Key": "BuildVersion",
|
||||
"Value": "17.8.34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "LocalBuild",
|
||||
"Value": "build-lab"
|
||||
},
|
||||
{
|
||||
"Key": "ManifestName",
|
||||
"Value": "VisualStudio"
|
||||
},
|
||||
{
|
||||
"Key": "ManifestType",
|
||||
"Value": "installer"
|
||||
},
|
||||
{
|
||||
"Key": "ProductDisplayVersion",
|
||||
"Value": "17.8.3"
|
||||
},
|
||||
{
|
||||
"Key": "ProductLine",
|
||||
"Value": "Dev17"
|
||||
},
|
||||
{
|
||||
"Key": "ProductLineVersion",
|
||||
"Value": "2022"
|
||||
},
|
||||
{
|
||||
"Key": "ProductMilestone",
|
||||
"Value": "RTW"
|
||||
},
|
||||
{
|
||||
"Key": "ProductMilestoneIsPreRelease",
|
||||
"Value": "False"
|
||||
},
|
||||
{
|
||||
"Key": "ProductName",
|
||||
"Value": "Visual Studio"
|
||||
},
|
||||
{
|
||||
"Key": "ProductPatchVersion",
|
||||
"Value": "3"
|
||||
},
|
||||
{
|
||||
"Key": "ProductPreReleaseMilestoneSuffix",
|
||||
"Value": "1.0"
|
||||
},
|
||||
{
|
||||
"Key": "ProductSemanticVersion",
|
||||
"Value": "17.8.3+34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "RequiredEngineVersion",
|
||||
"Value": "3.8.2112.61926"
|
||||
}
|
||||
],
|
||||
"IsPrerelease": false,
|
||||
"PSPath": "Microsoft.PowerShell.Core\\FileSystem::C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"UpdateDate": "2023-12-22T14:22:35.1818213Z",
|
||||
"ResolvedInstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"ChannelId": "VisualStudio.17.Release",
|
||||
"InstalledChannelId": "VisualStudio.17.Release",
|
||||
"ChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"InstalledChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"ReleaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.8#17.8.3",
|
||||
"ThirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288"
|
||||
},
|
||||
{
|
||||
"InstanceId": "dd50c6cc",
|
||||
"InstallationName": "VisualStudio/17.8.3+34330.188",
|
||||
"InstallationPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools",
|
||||
"InstallationVersion": {
|
||||
"Major": 17,
|
||||
"Minor": 8,
|
||||
"Build": 34330,
|
||||
"Revision": 188,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 188
|
||||
},
|
||||
"InstallDate": "\/Date(1703262914503)\/",
|
||||
"State": 4294967295,
|
||||
"DisplayName": "Visual Studio Build Tools 2022",
|
||||
"Description": "The Visual Studio Build Tools allows you to build native and managed MSBuild-based applications without requiring the Visual Studio IDE. There are options to install the Visual C++ compilers and libraries, MFC, ATL, and C++/CLI support.",
|
||||
"ProductPath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\Tools\\LaunchDevCmd.bat",
|
||||
"Product": {
|
||||
"Id": "Microsoft.VisualStudio.Product.BuildTools",
|
||||
"Version": {
|
||||
"Major": 17,
|
||||
"Minor": 8,
|
||||
"Build": 34330,
|
||||
"Revision": 188,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 188
|
||||
},
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.BuildTools,version=17.8.34330.188"
|
||||
},
|
||||
"Packages": [
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Product.BuildTools",
|
||||
"Version": "17.8.34330.188",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.BuildTools,version=17.8.34330.188"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Workload.MSBuildTools",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Workload",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Workload.MSBuildTools,version=17.8.34129.139"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.NuGet.BuildTools",
|
||||
"Version": "17.0.60800.131",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.NuGet.BuildTools,version=17.0.60800.131"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.Build.UnGAC",
|
||||
"Version": "17.8.3.2351904",
|
||||
"Chip": "neutral",
|
||||
"Branch": null,
|
||||
"Type": "Exe",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.Build.UnGAC,version=17.8.3.2351904,chip=neutral,language=neutral"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.VC.Icons",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Vsix",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.VC.Icons,version=17.8.34129.139"
|
||||
}
|
||||
],
|
||||
"Properties": [
|
||||
{
|
||||
"Key": "CampaignId",
|
||||
"Value": "09"
|
||||
},
|
||||
{
|
||||
"Key": "SetupEngineFilePath",
|
||||
"Value": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe"
|
||||
},
|
||||
{
|
||||
"Key": "Nickname",
|
||||
"Value": "2"
|
||||
},
|
||||
{
|
||||
"Key": "ChannelManifestId",
|
||||
"Value": "VisualStudio.17.Release/17.8.3+34330.188"
|
||||
}
|
||||
],
|
||||
"Errors": null,
|
||||
"EnginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
|
||||
"IsComplete": true,
|
||||
"IsLaunchable": true,
|
||||
"CatalogInfo": [
|
||||
{
|
||||
"Key": "Id",
|
||||
"Value": "VisualStudio/17.8.3+34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "BuildBranch",
|
||||
"Value": "d17.8"
|
||||
},
|
||||
{
|
||||
"Key": "BuildVersion",
|
||||
"Value": "17.8.34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "LocalBuild",
|
||||
"Value": "build-lab"
|
||||
},
|
||||
{
|
||||
"Key": "ManifestName",
|
||||
"Value": "VisualStudio"
|
||||
},
|
||||
{
|
||||
"Key": "ManifestType",
|
||||
"Value": "installer"
|
||||
},
|
||||
{
|
||||
"Key": "ProductDisplayVersion",
|
||||
"Value": "17.8.3"
|
||||
},
|
||||
{
|
||||
"Key": "ProductLine",
|
||||
"Value": "Dev17"
|
||||
},
|
||||
{
|
||||
"Key": "ProductLineVersion",
|
||||
"Value": "2022"
|
||||
},
|
||||
{
|
||||
"Key": "ProductMilestone",
|
||||
"Value": "RTW"
|
||||
},
|
||||
{
|
||||
"Key": "ProductMilestoneIsPreRelease",
|
||||
"Value": "False"
|
||||
},
|
||||
{
|
||||
"Key": "ProductName",
|
||||
"Value": "Visual Studio"
|
||||
},
|
||||
{
|
||||
"Key": "ProductPatchVersion",
|
||||
"Value": "3"
|
||||
},
|
||||
{
|
||||
"Key": "ProductPreReleaseMilestoneSuffix",
|
||||
"Value": "1.0"
|
||||
},
|
||||
{
|
||||
"Key": "ProductSemanticVersion",
|
||||
"Value": "17.8.3+34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "RequiredEngineVersion",
|
||||
"Value": "3.8.2112.61926"
|
||||
}
|
||||
],
|
||||
"IsPrerelease": false,
|
||||
"PSPath": "Microsoft.PowerShell.Core\\FileSystem::C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"UpdateDate": "2023-12-22T14:22:35.1818213Z",
|
||||
"ResolvedInstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"ChannelId": "VisualStudio.17.Release",
|
||||
"InstalledChannelId": "VisualStudio.17.Release",
|
||||
"ChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"InstalledChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"ReleaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.8#17.8.3",
|
||||
"ThirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288"
|
||||
}
|
||||
]
|
136
test/fixtures/VSSetup_VS_2022_workload.txt
vendored
Normal file
136
test/fixtures/VSSetup_VS_2022_workload.txt
vendored
Normal file
|
@ -0,0 +1,136 @@
|
|||
{
|
||||
"InstanceId": "621862c0",
|
||||
"InstallationName": "VisualStudio/17.8.3+34330.188",
|
||||
"InstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"InstallationVersion": {
|
||||
"Major": 17,
|
||||
"Minor": 8,
|
||||
"Build": 34330,
|
||||
"Revision": 188,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 188
|
||||
},
|
||||
"InstallDate": "\/Date(1703254955000)\/",
|
||||
"State": 4294967295,
|
||||
"DisplayName": "Visual Studio Enterprise 2022",
|
||||
"Description": "Scalable, end-to-end solution for teams of any size",
|
||||
"ProductPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\devenv.exe",
|
||||
"Product": {
|
||||
"Id": "Microsoft.VisualStudio.Product.Enterprise",
|
||||
"Version": {
|
||||
"Major": 17,
|
||||
"Minor": 8,
|
||||
"Build": 34330,
|
||||
"Revision": 188,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 188
|
||||
},
|
||||
"Chip": "x64",
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Enterprise,version=17.8.34330.188,chip=x64"
|
||||
},
|
||||
"Packages": [
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Product.Enterprise",
|
||||
"Version": "17.8.34330.188",
|
||||
"Chip": "x64",
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Enterprise,version=17.8.34330.188,chip=x64"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64,version=17.8.34129.139"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.Windows11SDK.22000",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.Windows11SDK.22000,version=17.8.34129.139"
|
||||
},
|
||||
{
|
||||
"Id": "Win11SDK_10.0.22000",
|
||||
"Version": "10.0.22000.4",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Exe",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Win11SDK_10.0.22000,version=10.0.22000.4"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.Windows10SDK.20348",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.Windows10SDK.20348,version=17.8.34129.139"
|
||||
},
|
||||
{
|
||||
"Id": "Win10SDK_10.0.20348",
|
||||
"Version": "10.0.20348.3",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Exe",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Win10SDK_10.0.20348,version=10.0.20348.3"
|
||||
}
|
||||
],
|
||||
"Properties": [
|
||||
{
|
||||
"Key": "CampaignId",
|
||||
"Value": ""
|
||||
},
|
||||
{
|
||||
"Key": "SetupEngineFilePath",
|
||||
"Value": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe"
|
||||
},
|
||||
{
|
||||
"Key": "Nickname",
|
||||
"Value": ""
|
||||
},
|
||||
{
|
||||
"Key": "ChannelManifestId",
|
||||
"Value": "VisualStudio.17.Release/17.8.3+34330.188"
|
||||
}
|
||||
],
|
||||
"Errors": null,
|
||||
"EnginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
|
||||
"IsComplete": true,
|
||||
"IsLaunchable": true,
|
||||
"CatalogInfo": [
|
||||
{
|
||||
"Key": "Id",
|
||||
"Value": "VisualStudio/17.8.3+34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "BuildBranch",
|
||||
"Value": "d17.8"
|
||||
},
|
||||
{
|
||||
"Key": "BuildVersion",
|
||||
"Value": "17.8.34330.188"
|
||||
}
|
||||
],
|
||||
"IsPrerelease": false,
|
||||
"PSPath": "Microsoft.PowerShell.Core\\FileSystem::C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"UpdateDate": "2023-12-22T14:22:35.1818213Z",
|
||||
"ResolvedInstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"ChannelId": "VisualStudio.17.Release",
|
||||
"InstalledChannelId": "VisualStudio.17.Release",
|
||||
"ChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"InstalledChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"ReleaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.8#17.8.3",
|
||||
"ThirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288"
|
||||
}
|
152
test/fixtures/VSSetup_VS_2022_workload_missing_sdk.txt
vendored
Normal file
152
test/fixtures/VSSetup_VS_2022_workload_missing_sdk.txt
vendored
Normal file
|
@ -0,0 +1,152 @@
|
|||
{
|
||||
"InstanceId": "621862c0",
|
||||
"InstallationName": "VisualStudio/17.8.3+34330.188",
|
||||
"InstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"InstallationVersion": {
|
||||
"Major": 17,
|
||||
"Minor": 8,
|
||||
"Build": 34330,
|
||||
"Revision": 188,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 188
|
||||
},
|
||||
"InstallDate": "\/Date(1703254955000)\/",
|
||||
"State": 4294967295,
|
||||
"DisplayName": "Visual Studio Enterprise 2022",
|
||||
"Description": "Scalable, end-to-end solution for teams of any size",
|
||||
"ProductPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\devenv.exe",
|
||||
"Product": {
|
||||
"Id": "Microsoft.VisualStudio.Product.Enterprise",
|
||||
"Version": {
|
||||
"Major": 17,
|
||||
"Minor": 8,
|
||||
"Build": 34330,
|
||||
"Revision": 188,
|
||||
"MajorRevision": 0,
|
||||
"MinorRevision": 188
|
||||
},
|
||||
"Chip": "x64",
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Enterprise,version=17.8.34330.188,chip=x64"
|
||||
},
|
||||
"Packages": [
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Product.Enterprise",
|
||||
"Version": "17.8.34330.188",
|
||||
"Chip": "x64",
|
||||
"Branch": null,
|
||||
"Type": "Product",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Product.Enterprise,version=17.8.34330.188,chip=x64"
|
||||
},
|
||||
{
|
||||
"Id": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64",
|
||||
"Version": "17.8.34129.139",
|
||||
"Chip": null,
|
||||
"Branch": null,
|
||||
"Type": "Component",
|
||||
"IsExtension": false,
|
||||
"UniqueId": "Microsoft.VisualStudio.Component.VC.Tools.x86.x64,version=17.8.34129.139"
|
||||
},
|
||||
],
|
||||
"Properties": [
|
||||
{
|
||||
"Key": "CampaignId",
|
||||
"Value": ""
|
||||
},
|
||||
{
|
||||
"Key": "SetupEngineFilePath",
|
||||
"Value": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe"
|
||||
},
|
||||
{
|
||||
"Key": "Nickname",
|
||||
"Value": ""
|
||||
},
|
||||
{
|
||||
"Key": "ChannelManifestId",
|
||||
"Value": "VisualStudio.17.Release/17.8.3+34330.188"
|
||||
}
|
||||
],
|
||||
"Errors": null,
|
||||
"EnginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
|
||||
"IsComplete": true,
|
||||
"IsLaunchable": true,
|
||||
"CatalogInfo": [
|
||||
{
|
||||
"Key": "Id",
|
||||
"Value": "VisualStudio/17.8.3+34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "BuildBranch",
|
||||
"Value": "d17.8"
|
||||
},
|
||||
{
|
||||
"Key": "BuildVersion",
|
||||
"Value": "17.8.34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "LocalBuild",
|
||||
"Value": "build-lab"
|
||||
},
|
||||
{
|
||||
"Key": "ManifestName",
|
||||
"Value": "VisualStudio"
|
||||
},
|
||||
{
|
||||
"Key": "ManifestType",
|
||||
"Value": "installer"
|
||||
},
|
||||
{
|
||||
"Key": "ProductDisplayVersion",
|
||||
"Value": "17.8.3"
|
||||
},
|
||||
{
|
||||
"Key": "ProductLine",
|
||||
"Value": "Dev17"
|
||||
},
|
||||
{
|
||||
"Key": "ProductLineVersion",
|
||||
"Value": "2022"
|
||||
},
|
||||
{
|
||||
"Key": "ProductMilestone",
|
||||
"Value": "RTW"
|
||||
},
|
||||
{
|
||||
"Key": "ProductMilestoneIsPreRelease",
|
||||
"Value": "False"
|
||||
},
|
||||
{
|
||||
"Key": "ProductName",
|
||||
"Value": "Visual Studio"
|
||||
},
|
||||
{
|
||||
"Key": "ProductPatchVersion",
|
||||
"Value": "3"
|
||||
},
|
||||
{
|
||||
"Key": "ProductPreReleaseMilestoneSuffix",
|
||||
"Value": "1.0"
|
||||
},
|
||||
{
|
||||
"Key": "ProductSemanticVersion",
|
||||
"Value": "17.8.3+34330.188"
|
||||
},
|
||||
{
|
||||
"Key": "RequiredEngineVersion",
|
||||
"Value": "3.8.2112.61926"
|
||||
}
|
||||
],
|
||||
"IsPrerelease": false,
|
||||
"PSPath": "Microsoft.PowerShell.Core\\FileSystem::C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"UpdateDate": "2023-12-22T14:22:35.1818213Z",
|
||||
"ResolvedInstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
|
||||
"ChannelId": "VisualStudio.17.Release",
|
||||
"InstalledChannelId": "VisualStudio.17.Release",
|
||||
"ChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"InstalledChannelUri": "https://aka.ms/vs/17/release/channel",
|
||||
"ReleaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.8#17.8.3",
|
||||
"ThirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288"
|
||||
}
|
|
@ -22,9 +22,18 @@ class TestVisualStudioFinder extends VisualStudioFinder {
|
|||
}
|
||||
|
||||
describe('find-visualstudio', function () {
|
||||
this.beforeAll(function () {
|
||||
// Condition to skip the test suite
|
||||
if (process.env.SystemRoot === undefined) {
|
||||
process.env.SystemRoot = '/'
|
||||
}
|
||||
})
|
||||
|
||||
it('VS2013', async function () {
|
||||
const finder = new TestVisualStudioFinder(semverV1, null)
|
||||
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
return finder.parseData(new Error(), '', '')
|
||||
}
|
||||
|
@ -69,10 +78,15 @@ describe('find-visualstudio', function () {
|
|||
patch: 0
|
||||
}, null)
|
||||
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
const file = path.join(__dirname, 'fixtures', 'VS_2017_Unusable.txt')
|
||||
const data = fs.readFileSync(file)
|
||||
return finder.parseData(null, data, '')
|
||||
const vsInfo = finder.parseData(null, data, '', { checkIsArray: true })
|
||||
return finder.processData(vsInfo)
|
||||
}
|
||||
finder.regSearchKeys = async (keys, value, addOpts) => {
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
|
@ -96,6 +110,10 @@ describe('find-visualstudio', function () {
|
|||
it('VS2015', async function () {
|
||||
const finder = new TestVisualStudioFinder(semverV1, null)
|
||||
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
return finder.parseData(new Error(), '', '')
|
||||
}
|
||||
|
@ -132,52 +150,49 @@ describe('find-visualstudio', function () {
|
|||
it('error from PowerShell', async function () {
|
||||
const finder = new TestVisualStudioFinder(semverV1, null, null)
|
||||
|
||||
finder.parseData(new Error(), '', '', (info) => {
|
||||
assert.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error')
|
||||
assert.ok(!info, 'no data')
|
||||
})
|
||||
const vsInfo = finder.parseData(new Error('Error msg'), '', '')
|
||||
assert.ok(/use PowerShell/i.test(finder.errorLog[0]), `expect error, output: ${finder.errorLog[0]}`)
|
||||
assert.ok(/error msg/i.test(finder.errorLog[0]), `expect error, output: ${finder.errorLog[0]}`)
|
||||
assert.equal(vsInfo, null)
|
||||
})
|
||||
|
||||
it('empty output from PowerShell', async function () {
|
||||
const finder = new TestVisualStudioFinder(semverV1, null, null)
|
||||
|
||||
finder.parseData(null, '', '', (info) => {
|
||||
assert.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error')
|
||||
assert.ok(!info, 'no data')
|
||||
})
|
||||
const vsInfo = finder.parseData(null, '', '', { checkIsArray: true })
|
||||
assert.ok(/use PowerShell/i.test(finder.errorLog[0]), `expect error, output: ${finder.errorLog[0]}`)
|
||||
assert.equal(vsInfo, null)
|
||||
})
|
||||
|
||||
it('output from PowerShell not JSON', async function () {
|
||||
const finder = new TestVisualStudioFinder(semverV1, null, null)
|
||||
|
||||
finder.parseData(null, 'AAAABBBB', '', (info) => {
|
||||
assert.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error')
|
||||
assert.ok(!info, 'no data')
|
||||
})
|
||||
const vsInfo = finder.parseData(null, 'AAAABBBB', '', { checkIsArray: true })
|
||||
assert.ok(/use PowerShell/i.test(finder.errorLog[0]), `expect error, output: ${finder.errorLog[0]}`)
|
||||
assert.equal(vsInfo, null)
|
||||
})
|
||||
|
||||
it('wrong JSON from PowerShell', async function () {
|
||||
const finder = new TestVisualStudioFinder(semverV1, null, null)
|
||||
|
||||
finder.parseData(null, '{}', '', (info) => {
|
||||
assert.ok(/use PowerShell/i.test(finder.errorLog[0]), 'expect error')
|
||||
assert.ok(!info, 'no data')
|
||||
})
|
||||
const vsInfo = finder.parseData(null, '{}', '', { checkIsArray: true })
|
||||
assert.ok(/use PowerShell/i.test(finder.errorLog[0]), `expect error, output: ${finder.errorLog[0]}`)
|
||||
assert.ok(/expected array/i.test(finder.errorLog[0]), `expect error, output: ${finder.errorLog[0]}`)
|
||||
assert.equal(vsInfo, null)
|
||||
})
|
||||
|
||||
it('empty JSON from PowerShell', async function () {
|
||||
const finder = new TestVisualStudioFinder(semverV1, null, null)
|
||||
|
||||
finder.parseData(null, '[]', '', (info) => {
|
||||
assert.ok(/find .* Visual Studio/i.test(finder.errorLog[0]), 'expect error')
|
||||
assert.ok(!info, 'no data')
|
||||
})
|
||||
const vsInfo = finder.parseData(null, '[]', '', { checkIsArray: true })
|
||||
assert.equal(finder.errorLog.length, 0)
|
||||
assert.equal(vsInfo.length, 0)
|
||||
})
|
||||
|
||||
it('future version', async function () {
|
||||
const finder = new TestVisualStudioFinder(semverV1, null, null)
|
||||
|
||||
finder.parseData(null, JSON.stringify([{
|
||||
const vsInfo = finder.parseData(null, JSON.stringify([{
|
||||
packages: [
|
||||
'Microsoft.VisualStudio.Component.VC.Tools.x86.x64',
|
||||
'Microsoft.VisualStudio.Component.Windows10SDK.17763',
|
||||
|
@ -185,11 +200,9 @@ describe('find-visualstudio', function () {
|
|||
],
|
||||
path: 'C:\\VS',
|
||||
version: '9999.9999.9999.9999'
|
||||
}]), '', (info) => {
|
||||
assert.ok(/unknown version/i.test(finder.errorLog[0]), 'expect error')
|
||||
assert.ok(/find .* Visual Studio/i.test(finder.errorLog[1]), 'expect error')
|
||||
assert.ok(!info, 'no data')
|
||||
})
|
||||
}]), '', { checkIsArray: true })
|
||||
assert.equal(finder.errorLog.length, 0)
|
||||
assert.equal(vsInfo[0].packages.length, 3)
|
||||
})
|
||||
|
||||
it('single unusable VS2017', async function () {
|
||||
|
@ -197,22 +210,27 @@ describe('find-visualstudio', function () {
|
|||
|
||||
const file = path.join(__dirname, 'fixtures', 'VS_2017_Unusable.txt')
|
||||
const data = fs.readFileSync(file)
|
||||
finder.parseData(null, data, '', (info) => {
|
||||
assert.ok(/checking/i.test(finder.errorLog[0]), 'expect error')
|
||||
assert.ok(/find .* Visual Studio/i.test(finder.errorLog[2]), 'expect error')
|
||||
assert.ok(!info, 'no data')
|
||||
})
|
||||
const vsInfo = finder.parseData(null, data, '', { checkIsArray: true })
|
||||
assert.equal(finder.errorLog.length, 0)
|
||||
assert.equal(vsInfo.length, 1)
|
||||
assert.equal(vsInfo[0].InstallationPath, undefined)
|
||||
assert.notEqual(vsInfo[0].path, undefined)
|
||||
assert.ok(vsInfo[0].packages.length > 1)
|
||||
})
|
||||
|
||||
it('minimal VS2017 Build Tools', async function () {
|
||||
const finder = new TestVisualStudioFinder(semverV1, null)
|
||||
|
||||
poison(finder, 'regSearchKeys')
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
const file = path.join(__dirname, 'fixtures',
|
||||
'VS_2017_BuildTools_minimal.txt')
|
||||
const data = fs.readFileSync(file)
|
||||
return finder.parseData(null, data, '')
|
||||
const vsInfo = finder.parseData(null, data, '', { checkIsArray: true })
|
||||
return finder.processData(vsInfo)
|
||||
}
|
||||
const { err, info } = await finder.findVisualStudio()
|
||||
assert.strictEqual(err, null)
|
||||
|
@ -234,11 +252,15 @@ describe('find-visualstudio', function () {
|
|||
const finder = new TestVisualStudioFinder(semverV1, null)
|
||||
|
||||
poison(finder, 'regSearchKeys')
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
const file = path.join(__dirname, 'fixtures',
|
||||
'VS_2017_Community_workload.txt')
|
||||
const data = fs.readFileSync(file)
|
||||
return finder.parseData(null, data, '')
|
||||
const vsInfo = finder.parseData(null, data, '', { checkIsArray: true })
|
||||
return finder.processData(vsInfo)
|
||||
}
|
||||
const { err, info } = await finder.findVisualStudio()
|
||||
assert.strictEqual(err, null)
|
||||
|
@ -260,10 +282,14 @@ describe('find-visualstudio', function () {
|
|||
const finder = new TestVisualStudioFinder(semverV1, null)
|
||||
|
||||
poison(finder, 'regSearchKeys')
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
const file = path.join(__dirname, 'fixtures', 'VS_2017_Express.txt')
|
||||
const data = fs.readFileSync(file)
|
||||
return finder.parseData(null, data, '')
|
||||
const vsInfo = finder.parseData(null, data, '', { checkIsArray: true })
|
||||
return finder.processData(vsInfo)
|
||||
}
|
||||
const { err, info } = await finder.findVisualStudio()
|
||||
assert.strictEqual(err, null)
|
||||
|
@ -285,11 +311,15 @@ describe('find-visualstudio', function () {
|
|||
const finder = new TestVisualStudioFinder(semverV1, null)
|
||||
|
||||
poison(finder, 'regSearchKeys')
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
const file = path.join(__dirname, 'fixtures',
|
||||
'VS_2019_Preview.txt')
|
||||
const data = fs.readFileSync(file)
|
||||
return finder.parseData(null, data, '')
|
||||
const vsInfo = finder.parseData(null, data, '', { checkIsArray: true })
|
||||
return finder.processData(vsInfo)
|
||||
}
|
||||
const { err, info } = await finder.findVisualStudio()
|
||||
assert.strictEqual(err, null)
|
||||
|
@ -311,11 +341,15 @@ describe('find-visualstudio', function () {
|
|||
const finder = new TestVisualStudioFinder(semverV1, null)
|
||||
|
||||
poison(finder, 'regSearchKeys')
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
const file = path.join(__dirname, 'fixtures',
|
||||
'VS_2019_BuildTools_minimal.txt')
|
||||
const data = fs.readFileSync(file)
|
||||
return finder.parseData(null, data, '')
|
||||
const vsInfo = finder.parseData(null, data, '', { checkIsArray: true })
|
||||
return finder.processData(vsInfo)
|
||||
}
|
||||
const { err, info } = await finder.findVisualStudio()
|
||||
assert.strictEqual(err, null)
|
||||
|
@ -337,11 +371,15 @@ describe('find-visualstudio', function () {
|
|||
const finder = new TestVisualStudioFinder(semverV1, null)
|
||||
|
||||
poison(finder, 'regSearchKeys')
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
const file = path.join(__dirname, 'fixtures',
|
||||
'VS_2019_Community_workload.txt')
|
||||
const data = fs.readFileSync(file)
|
||||
return finder.parseData(null, data, '')
|
||||
const vsInfo = finder.parseData(null, data, '', { checkIsArray: true })
|
||||
return finder.processData(vsInfo)
|
||||
}
|
||||
const { err, info } = await finder.findVisualStudio()
|
||||
assert.strictEqual(err, null)
|
||||
|
@ -372,11 +410,15 @@ describe('find-visualstudio', function () {
|
|||
finder.msBuildPathExists = (path) => {
|
||||
return true
|
||||
}
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
const file = path.join(__dirname, 'fixtures',
|
||||
'VS_2022_Community_workload.txt')
|
||||
const data = fs.readFileSync(file)
|
||||
return finder.parseData(null, data, '')
|
||||
const vsInfo = finder.parseData(null, data, '', { checkIsArray: true })
|
||||
return finder.processData(vsInfo)
|
||||
}
|
||||
const { err, info } = await finder.findVisualStudio()
|
||||
assert.strictEqual(err, null)
|
||||
|
@ -393,7 +435,97 @@ describe('find-visualstudio', function () {
|
|||
})
|
||||
})
|
||||
|
||||
it('VSSetup: VS2022 with C++ workload without SDK', async function () {
|
||||
const finder = new TestVisualStudioFinder(semverV1, null)
|
||||
finder.msBuildPathExists = (path) => {
|
||||
return true
|
||||
}
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
return null
|
||||
}
|
||||
finder.findOldVS = async (info) => {
|
||||
return null
|
||||
}
|
||||
setupExecFixture(finder, 'VSSetup_VS_2022_workload_missing_sdk.txt')
|
||||
const { err, info } = await finder.findVisualStudio()
|
||||
assert.match(err.message, /could not find/i)
|
||||
assert.strictEqual(info, null)
|
||||
})
|
||||
|
||||
it('VSSetup: VS2019 with C++ workload', async function () {
|
||||
await verifyVSSetupData('VSSetup_VS_2019_Professional_workload.txt', 'Professional', 2019,
|
||||
'10.0.19041.0', 'v142', '16.11.34407.143', 'Program Files (x86)')
|
||||
})
|
||||
|
||||
it('VSSetup: VS2022 with C++ workload', async function () {
|
||||
await verifyVSSetupData('VSSetup_VS_2022_workload.txt', 'Enterprise', 2022,
|
||||
'10.0.22000.0', 'v143', '17.8.34330.188', 'Program Files')
|
||||
})
|
||||
|
||||
it('VSSetup: VS2022 and VS2019 with C++ workload', async function () {
|
||||
await verifyVSSetupData('VSSetup_VS_2022_VS2019_workload.txt', 'Enterprise', 2022,
|
||||
'10.0.22000.0', 'v143', '17.8.34330.188', 'Program Files')
|
||||
})
|
||||
|
||||
it('VSSetup: VS2022 with multiple installations', async function () {
|
||||
await verifyVSSetupData('VSSetup_VS_2022_multiple_install.txt', 'Enterprise', 2022,
|
||||
'10.0.22000.0', 'v143', '17.8.34330.188', 'Program Files')
|
||||
})
|
||||
|
||||
async function verifyVSSetupData (fixtureName, vsType, vsYear, sdkVersion, toolsetVersion, vsVersion, expectedProgramFilesPath) {
|
||||
const msBuildPath = process.arch === 'arm64'
|
||||
? `C:\\${expectedProgramFilesPath}\\Microsoft Visual Studio\\${vsYear}\\` +
|
||||
`${vsType}\\MSBuild\\Current\\Bin\\arm64\\MSBuild.exe`
|
||||
: `C:\\${expectedProgramFilesPath}\\Microsoft Visual Studio\\${vsYear}\\` +
|
||||
`${vsType}\\MSBuild\\Current\\Bin\\MSBuild.exe`
|
||||
|
||||
const finder = new TestVisualStudioFinder(semverV1, null)
|
||||
|
||||
poison(finder, 'regSearchKeys')
|
||||
const expectedVSPath = `C:\\${expectedProgramFilesPath}\\Microsoft Visual Studio\\${vsYear}\\${vsType}`
|
||||
finder.msBuildPathExists = (path) => {
|
||||
if (path.startsWith(expectedVSPath) && path.endsWith('MSBuild.exe')) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
throw new Error("findVisualStudio2017OrNewer shouldn't be called")
|
||||
}
|
||||
setupExecFixture(finder, fixtureName)
|
||||
const { err, info } = await finder.findVisualStudio()
|
||||
assert.strictEqual(err, null)
|
||||
const vsVersionTokens = vsVersion.split('.')
|
||||
assert.deepStrictEqual(info, {
|
||||
msBuild: msBuildPath,
|
||||
path:
|
||||
`C:\\${expectedProgramFilesPath}\\Microsoft Visual Studio\\${vsYear}\\${vsType}`,
|
||||
sdk: sdkVersion,
|
||||
toolset: toolsetVersion,
|
||||
version: vsVersion,
|
||||
versionMajor: parseInt(vsVersionTokens[0]),
|
||||
versionMinor: parseInt(vsVersionTokens[1]),
|
||||
versionYear: vsYear
|
||||
})
|
||||
}
|
||||
|
||||
function setupExecFixture (finder, fixtureName) {
|
||||
finder.execFile = async (exec, args) => {
|
||||
if (args.length > 2 && args[2].includes('Get-Module')) {
|
||||
return [null, '1.0.0', '']
|
||||
} else if (args.length > 2 && args.at(-1).includes('Get-VSSetupInstance')) {
|
||||
const file = path.join(__dirname, 'fixtures', fixtureName)
|
||||
return [null, fs.readFileSync(file), '']
|
||||
}
|
||||
return [new Error(), '', '']
|
||||
}
|
||||
}
|
||||
|
||||
function allVsVersions (finder) {
|
||||
finder.findVisualStudio2017OrNewerUsingSetupModule = async () => {
|
||||
return null
|
||||
}
|
||||
|
||||
finder.findVisualStudio2017OrNewer = async () => {
|
||||
const data0 = JSON.parse(fs.readFileSync(path.join(__dirname, 'fixtures',
|
||||
'VS_2017_Unusable.txt')))
|
||||
|
@ -413,7 +545,8 @@ describe('find-visualstudio', function () {
|
|||
'VS_2022_Community_workload.txt')))
|
||||
const data = JSON.stringify(data0.concat(data1, data2, data3, data4,
|
||||
data5, data6, data7))
|
||||
return finder.parseData(null, data, '')
|
||||
const parsedData = finder.parseData(null, data, '', { checkIsArray: true })
|
||||
return finder.processData(parsedData)
|
||||
}
|
||||
finder.regSearchKeys = async (keys, value, addOpts) => {
|
||||
for (let i = 0; i < keys.length; ++i) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue