Skip to content

Conversation

@joshspicer
Copy link
Member

No description provided.

@joshspicer joshspicer changed the title first pass at winget HowToContribute configuration file Convert HowToContribute to a winget configuration file Sep 17, 2025
Copy link
Member

@benvillalobos benvillalobos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On a fresh dev box I was able to run this (with my edits), npm install and run the vs code launch config and it worked.

The only funky thing is getting that last SetScript to work without error. python -m pip install setuptools writes some output like [config]: Something something pip can be updated one minor version. I tried passing --quiet in the command but that didn't prevent the line from showing up.

So the config thinks it failed but it actually successfully installed.

Comment on lines +92 to +93
npm config set msvs_version 2022
npm config set python python
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
npm config set msvs_version 2022
npm config set python python
$npmrc = "$env:USERPROFILE\.npmrc"
if (Test-Path $npmrc) {
(Get-Content $npmrc) -replace '^msvs_version=.*$', 'msvs_version=2022' | Set-Content $npmrc
if (-not (Select-String -Path $npmrc -Pattern '^msvs_version=')) {
Add-Content $npmrc "`nmsvs_version=2022"
}
} else {
Set-Content $npmrc "msvs_version=2022"
}

npm config set msvs_version throws an error every time (I saw this while coming up with the AI script as well). I suggested the solution I came up with. Also I noticed you don't need to set python to get the build & run to work. Is that needed for something else?

Comment on lines +141 to +146
try {
$result = python -m pip show setuptools
return $true
} catch {
return $false
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
try {
$result = python -m pip show setuptools
return $true
} catch {
return $false
}
$result = python -m pip show setuptools 2>&1
if ($result -notmatch "not found") {
return $true
} else {
return $false
}

The try catch solution was throwing errors when installing

"Microsoft.Component.MSBuild",
"Microsoft.VisualStudio.Component.CoreBuildTools",
"Microsoft.VisualStudio.Workload.MSBuildTools",
"Microsoft.VisualStudio.Component.Windows10SDK",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think Windows10SDK and Windows10SDK.20348 can be removed. Other scan definitely be removed as well, but I"m not sure that we need 3 windows SDK's installed.

For the record this is the winget command I used to install only the essentials: winget install --id Microsoft.VisualStudio.2022.BuildTools -e --source winget --override "--add Microsoft.VisualStudio.Component.Windows11SDK.22621 --add Microsoft.VisualStudio.Workload.VCTools --add Microsoft.VisualStudio.Component.VC.Runtimes.x86.x64.Spectre --add Microsoft.VisualStudio.Component.VC.ATL.Spectre --add Microsoft.VisualStudio.Component.VC.ATLMFC.Spectre"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@TylerLeonhardt found that we needed Windows10 SDK for arm machines, i'm not sure if anyone knows why.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I got the idea from @amunger , not sure if he knows why

Copy link
Contributor

@amunger amunger Sep 29, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

During the node-gyp run, there was a log saying I didn't have the win SDK, despite win11 SDK being installed, so I tried win10 and that worked. That's the best explanation I have.
but yes, seems to be particular to win on ARM

@benvillalobos
Copy link
Member

On installing on a second dev box: All installations pass except for the final python setuptools install. It errors with Python was not found;. Turns out I had to restart my entire vscode instance for any shell to pick it up on the PATH. Since this is unavoidable, maybe this should be part of the output when testing to see if python is installed.

On second run of winget configure .config/configuration.winget, everything works though it does think it failed with:

  The configuration unit failed while attempting to apply the desired state.
System.Management.Automation.RemoteException
[notice] A new release of pip is available: 25.0.1 -> 25.2
[notice] To update, run: python.exe -m pip install --upgrade pip
<See the log file for additional details>
Some of the configuration was not applied successfully.

When in fact, it does work. Not sure what to do about that.

Copy link
Member

@Tyriar Tyriar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did we need these files to live in the wiki? Seems more appropriate to live in the main repo

@benvillalobos
Copy link
Member

+1 to "this should live in the main repo". In fact, there's already a configuration.winget file there that should just be updated.

Also, we should update https://github.com/microsoft/vscode/wiki/How-to-Contribute with a line about "If on a fresh windows setup, try winget configure --enable and winget configure ./config/configFile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants