Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

findVisualStudio 可以使用 vswhere.exe 获取 #602

Open
jingjingxyk opened this issue Feb 6, 2025 · 1 comment
Open

findVisualStudio 可以使用 vswhere.exe 获取 #602

jingjingxyk opened this issue Feb 6, 2025 · 1 comment
Labels
kind/dependency Issues related to dependencies new feature New feature or request os/windows Things only for Windows

Comments

@jingjingxyk
Copy link
Contributor

jingjingxyk commented Feb 6, 2025

https://github.com/crazywhalecc/static-php-cli/blob/main/src/SPC/builder/windows/SystemUtil.php#L42
可以使用vswhere.exe 获取

vswhere.exe 位置:https://github.com/php/php-sdk-binary-tools/tree/master/bin

git config --global core.autocrlf false

git clone -b master https://github.com/php/php-sdk-binary-tools.git
set "__PROJECT__=%cd%"
set "PATH=%PATH%;%__PROJECT__%\php-sdk-binary-tools\bin\;%__PROJECT__%\php-sdk-binary-tools\msys2\usr\bin\;"
vswhere.exe
vswhere.exe -legacy -prerelease -format json

结果:


instanceId: 92dd1288
installDate: 2/3/2025 10:01:36 PM
installationName: VisualStudio/17.12.4+35707.178
installationPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise
installationVersion: 17.12.35707.178
productId: Microsoft.VisualStudio.Product.Enterprise
productPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\IDE\devenv.exe
state: 4294967295
isComplete: 1
isLaunchable: 1
isPrerelease: 0
isRebootRequired: 0
displayName: Visual Studio Enterprise 2022
description: Scalable, end-to-end solution for teams of any size
channelId: VisualStudio.17.Release
channelUri: https://aka.ms/vs/17/release/channel
enginePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service
installedChannelId: VisualStudio.17.Release
installedChannelUri: https://aka.ms/vs/17/release/channel
releaseNotes: https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.12#17.12.4
resolvedInstallationPath: C:\Program Files\Microsoft Visual Studio\2022\Enterprise
thirdPartyNotices: https://go.microsoft.com/fwlink/?LinkId=661288
updateDate: 2025-02-03T22:01:36.6495796Z
catalog_buildBranch: d17.12
catalog_buildVersion: 17.12.35707.178
catalog_id: VisualStudio/17.12.4+35707.178
catalog_localBuild: build-lab
catalog_manifestName: VisualStudio
catalog_manifestType: installer
catalog_productDisplayVersion: 17.12.4
catalog_productLine: Dev17
catalog_productLineVersion: 2022
catalog_productMilestone: RTW
catalog_productMilestoneIsPreRelease: False
catalog_productName: Visual Studio
catalog_productPatchVersion: 4
catalog_productPreReleaseMilestoneSuffix: 1.0
catalog_productSemanticVersion: 17.12.4+35707.178
catalog_requiredEngineVersion: 3.12.2320.19252
properties_campaignId: 
properties_channelManifestId: VisualStudio.17.Release/17.12.4+35707.178
properties_includeRecommended: 1
properties_nickname: 
properties_setupEngineFilePath: C:\Program Files (x86)\Microsoft Visual Studio\Installer\setup.exe
[
  {
    "instanceId": "92dd1288",
    "installDate": "2025-02-03T22:01:36Z",
    "installationName": "VisualStudio/17.12.4+35707.178",
    "installationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
    "installationVersion": "17.12.35707.178",
    "productId": "Microsoft.VisualStudio.Product.Enterprise",
    "productPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Common7\\IDE\\devenv.exe",
    "state": 4294967295,
    "isComplete": true,
    "isLaunchable": true,
    "isPrerelease": false,
    "isRebootRequired": false,
    "displayName": "Visual Studio Enterprise 2022",
    "description": "Scalable, end-to-end solution for teams of any size",
    "channelId": "VisualStudio.17.Release",
    "channelUri": "https://aka.ms/vs/17/release/channel",
    "enginePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\resources\\app\\ServiceHub\\Services\\Microsoft.VisualStudio.Setup.Service",
    "installedChannelId": "VisualStudio.17.Release",
    "installedChannelUri": "https://aka.ms/vs/17/release/channel",
    "releaseNotes": "https://docs.microsoft.com/en-us/visualstudio/releases/2022/release-notes-v17.12#17.12.4",
    "resolvedInstallationPath": "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise",
    "thirdPartyNotices": "https://go.microsoft.com/fwlink/?LinkId=661288",
    "updateDate": "2025-02-03T22:01:36.6495796Z",
    "catalog": {
      "buildBranch": "d17.12",
      "buildVersion": "17.12.35707.178",
      "id": "VisualStudio/17.12.4+35707.178",
      "localBuild": "build-lab",
      "manifestName": "VisualStudio",
      "manifestType": "installer",
      "productDisplayVersion": "17.12.4",
      "productLine": "Dev17",
      "productLineVersion": "2022",
      "productMilestone": "RTW",
      "productMilestoneIsPreRelease": "False",
      "productName": "Visual Studio",
      "productPatchVersion": "4",
      "productPreReleaseMilestoneSuffix": "1.0",
      "productSemanticVersion": "17.12.4+35707.178",
      "requiredEngineVersion": "3.12.2320.19252"
    },
    "properties": {
      "campaignId": "",
      "channelManifestId": "VisualStudio.17.Release/17.12.4+35707.178",
      "includeRecommended": "1",
      "nickname": "",
      "setupEngineFilePath": "C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\setup.exe"
    }
  }
]


@jingjingxyk
Copy link
Contributor Author

额外工具: windows 下使用 awk sed md5sum xz wget zip

@crazywhalecc crazywhalecc added new feature New feature or request kind/dependency Issues related to dependencies os/windows Things only for Windows labels Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/dependency Issues related to dependencies new feature New feature or request os/windows Things only for Windows
Projects
None yet
Development

No branches or pull requests

2 participants