Skip to content

Commit 2156d16

Browse files
committed
build,win: add WinGet Visual Studio 2022 Build Tools Edition config
1 parent 1818bb7 commit 2156d16

File tree

2 files changed

+72
-4
lines changed

2 files changed

+72
-4
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
# Reference: https://github.com/nodejs/node/blob/main/BUILDING.md#windows
3+
properties:
4+
resources:
5+
- resource: Microsoft.WinGet.DSC/WinGetPackage
6+
id: pythonPackage
7+
directives:
8+
description: Install Python 3.14
9+
module: Microsoft.WinGet.DSC
10+
allowPrerelease: true
11+
settings:
12+
id: Python.Python.3.14
13+
source: winget
14+
- resource: Microsoft.WinGet.DSC/WinGetPackage
15+
id: vsPackage
16+
directives:
17+
description: Install Visual Studio 2022 Build Tools
18+
allowPrerelease: true
19+
settings:
20+
id: Microsoft.VisualStudio.2022.BuildTools
21+
source: winget
22+
useLatest: true
23+
- resource: Microsoft.VisualStudio.DSC/VSComponents
24+
id: vsComponents
25+
dependsOn:
26+
- vsPackage
27+
directives:
28+
description: Install required VS workloads and components
29+
allowPrerelease: true
30+
settings:
31+
productId: Microsoft.VisualStudio.Product.BuildTools
32+
channelId: VisualStudio.17.Release
33+
includeRecommended: true
34+
components:
35+
- Microsoft.VisualStudio.Workload.VCTools
36+
- Microsoft.VisualStudio.Component.VC.Llvm.Clang
37+
- Microsoft.VisualStudio.Component.VC.Llvm.ClangToolset
38+
- resource: Microsoft.WinGet.DSC/WinGetPackage
39+
id: gitPackage
40+
directives:
41+
description: Install Git
42+
allowPrerelease: true
43+
settings:
44+
id: Git.Git
45+
source: winget
46+
- resource: Microsoft.WinGet.DSC/WinGetPackage
47+
id: nasmPackage
48+
directives:
49+
description: Install NetWide Assembler (NASM)
50+
allowPrerelease: true
51+
settings:
52+
id: Nasm.Nasm
53+
source: winget
54+
configurationVersion: 0.1.1

BUILDING.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -774,23 +774,37 @@ first and then reinstalling them again.
774774

775775
##### Option 2: Automated install with WinGet
776776

777-
[WinGet configuration files](https://github.com/nodejs/node/tree/main/.configurations)
777+
[WinGet configuration files](./.configurations)
778778
can be used to install all the required prerequisites for Node.js development
779779
easily. These files will install the following
780780
[WinGet](https://learn.microsoft.com/en-us/windows/package-manager/winget/) packages:
781781

782782
* Git for Windows with the `git` and Unix tools added to the `PATH`
783783
* `Python 3.14`
784-
* `Visual Studio 2022` (Community, Enterprise or Professional)
785-
* `Visual Studio 2022 Build Tools` with Visual C++ workload, Clang and ClangToolset
784+
* `Visual Studio 2022` (Build Tools, Community, Professional or Enterprise Edition) and
785+
"Desktop development with C++" workload, Clang and ClangToolset optional components
786786
* `NetWide Assembler`
787787

788-
To install Node.js prerequisites from PowerShell Terminal:
788+
The following Desired State Configuration (DSC) files are available:
789+
790+
| Edition | DSC Configuration |
791+
| ------------ | ------------------------------------------------------------------------------------------------ |
792+
| Build Tools | [configuration.vsBuildTools.dsc.yaml](./.configurations/configuration.vsBuildTools.dsc.yaml) |
793+
| Community | [configuration.dsc.yaml](./.configurations/configuration.dsc.yaml) |
794+
| Professional | [configuration.vsProfessional.dsc.yaml](./.configurations/configuration.vsProfessional.dsc.yaml) |
795+
| Enterprise | [configuration.vsEnterprise.dsc.yaml](./.configurations/configuration.vsEnterprise.dsc.yaml) |
796+
797+
Use one of the above DSC files with
798+
[winget configure](https://learn.microsoft.com/en-us/windows/package-manager/winget/configure#configure-subcommands)
799+
in a PowerShell Terminal to install Node.js prerequisites.
800+
For example, using the DSC file for Visual Studio Community Edition, execute the following command line:
789801

790802
```powershell
791803
winget configure .\.configurations\configuration.dsc.yaml
792804
```
793805

806+
To add optional components for MSI or ARM64 builds, refer to [Option 1: Manual install](#option-1-manual-install).
807+
794808
##### Option 3: Automated install with Boxstarter
795809

796810
A [Boxstarter](https://boxstarter.org/) script can be used for easy setup of

0 commit comments

Comments
 (0)