Skip to content

Commit 6eb6512

Browse files
mdanish-khdenelon
andauthored
Add WinGet configuration files for building terminal (#18645)
PR adds a WinGet configuration file to install the necessary dependencies in order to build terminal locally. The configuration file enables developer mode, installs PowerShell 7, Visual Studio 2022 & all the required workloads from the .vsconfig file (in accordance with the dependencies listed in the README). ## Validation Steps Performed Tested the configuration file by spinning up a clean Win11 Pro VM in azure and then doing the following: 1. Install latest WinGet on the VM using WinGet sandbox script. Install git and clone the repo 2. Run `winget configure .config/configuration.winget` (this should work by just double-clicking the file in explorer too) 3. After the configuration is completed, open the solution in the now installed Visual Studio and build. The build is successful and I could start terminal with F5 Co-authored-by: Demitrius Nelon <[email protected]>
1 parent 75d8fc2 commit 6eb6512

File tree

5 files changed

+143
-0
lines changed

5 files changed

+143
-0
lines changed
+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
# Reference: https://github.com/microsoft/terminal/blob/main/README.md#developer-guidance
3+
properties:
4+
resources:
5+
- resource: Microsoft.Windows.Developer/DeveloperMode
6+
directives:
7+
description: Enable Developer Mode
8+
allowPrerelease: true
9+
# Requires elevation for the set operation
10+
securityContext: elevated
11+
settings:
12+
Ensure: Present
13+
- resource: Microsoft.WinGet.DSC/WinGetPackage
14+
id: powershell
15+
directives:
16+
description: Install PowerShell 7
17+
# Requires elevation for the set operation (i.e., installation)
18+
securityContext: elevated
19+
settings:
20+
id: Microsoft.PowerShell
21+
source: winget
22+
- resource: Microsoft.WinGet.DSC/WinGetPackage
23+
id: vsPackage
24+
directives:
25+
description: Install Visual Studio 2022 Enterprise (any edition is OK)
26+
# Requires elevation for the set operation (i.e., installation)
27+
securityContext: elevated
28+
settings:
29+
id: Microsoft.VisualStudio.2022.Enterprise
30+
source: winget
31+
- resource: Microsoft.VisualStudio.DSC/VSComponents
32+
dependsOn:
33+
- vsPackage
34+
directives:
35+
description: Install required VS workloads from project .vsconfig file
36+
allowPrerelease: true
37+
# Requires elevation for the get and set operations
38+
securityContext: elevated
39+
settings:
40+
productId: Microsoft.VisualStudio.Product.Enterprise
41+
channelId: VisualStudio.17.Release
42+
vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig'
43+
configurationVersion: 0.2.0
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
# Reference: https://github.com/microsoft/terminal/blob/main/README.md#developer-guidance
3+
properties:
4+
resources:
5+
- resource: Microsoft.Windows.Developer/DeveloperMode
6+
directives:
7+
description: Enable Developer Mode
8+
allowPrerelease: true
9+
# Requires elevation for the set operation
10+
securityContext: elevated
11+
settings:
12+
Ensure: Present
13+
- resource: Microsoft.WinGet.DSC/WinGetPackage
14+
id: powershell
15+
directives:
16+
description: Install PowerShell 7
17+
# Requires elevation for the set operation (i.e., installation)
18+
securityContext: elevated
19+
settings:
20+
id: Microsoft.PowerShell
21+
source: winget
22+
- resource: Microsoft.WinGet.DSC/WinGetPackage
23+
id: vsPackage
24+
directives:
25+
description: Install Visual Studio 2022 Professional (any edition is OK)
26+
# Requires elevation for the set operation (i.e., installation)
27+
securityContext: elevated
28+
settings:
29+
id: Microsoft.VisualStudio.2022.Professional
30+
source: winget
31+
- resource: Microsoft.VisualStudio.DSC/VSComponents
32+
dependsOn:
33+
- vsPackage
34+
directives:
35+
description: Install required VS workloads from project .vsconfig file
36+
allowPrerelease: true
37+
# Requires elevation for the get and set operations
38+
securityContext: elevated
39+
settings:
40+
productId: Microsoft.VisualStudio.Product.Professional
41+
channelId: VisualStudio.17.Release
42+
vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig'
43+
configurationVersion: 0.2.0

.config/configuration.winget

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
2+
# Reference: https://github.com/microsoft/terminal/blob/main/README.md#developer-guidance
3+
properties:
4+
resources:
5+
- resource: Microsoft.Windows.Developer/DeveloperMode
6+
directives:
7+
description: Enable Developer Mode
8+
allowPrerelease: true
9+
# Requires elevation for the set operation
10+
securityContext: elevated
11+
settings:
12+
Ensure: Present
13+
- resource: Microsoft.WinGet.DSC/WinGetPackage
14+
id: powershell
15+
directives:
16+
description: Install PowerShell 7
17+
# Requires elevation for the set operation (i.e., installation)
18+
securityContext: elevated
19+
settings:
20+
id: Microsoft.PowerShell
21+
source: winget
22+
- resource: Microsoft.WinGet.DSC/WinGetPackage
23+
id: vsPackage
24+
directives:
25+
description: Install Visual Studio 2022 Community (any edition is OK)
26+
# Requires elevation for the set operation (i.e., installation)
27+
securityContext: elevated
28+
settings:
29+
id: Microsoft.VisualStudio.2022.Community
30+
source: winget
31+
- resource: Microsoft.VisualStudio.DSC/VSComponents
32+
dependsOn:
33+
- vsPackage
34+
directives:
35+
description: Install required VS workloads from project .vsconfig file
36+
allowPrerelease: true
37+
# Requires elevation for the get and set operations
38+
securityContext: elevated
39+
settings:
40+
productId: Microsoft.VisualStudio.Product.Community
41+
channelId: VisualStudio.17.Release
42+
vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig'
43+
configurationVersion: 0.2.0

.github/actions/spelling/expect/expect.txt

+1
Original file line numberDiff line numberDiff line change
@@ -1945,6 +1945,7 @@ VPACKMANIFESTDIRECTORY
19451945
VPR
19461946
VREDRAW
19471947
vsc
1948+
vsconfig
19481949
vscprintf
19491950
VSCROLL
19501951
vsdevshell

README.md

+13
Original file line numberDiff line numberDiff line change
@@ -340,6 +340,19 @@ If you would like to ask a question that you feel doesn't warrant an issue
340340

341341
## Prerequisites
342342

343+
You can configure your environment to build Terminal in one of two ways:
344+
345+
### Using WinGet configuration file
346+
347+
After cloning the repository, you can use a [WinGet configuration file](https://learn.microsoft.com/en-us/windows/package-manager/configuration/#use-a-winget-configuration-file-to-configure-your-machine)
348+
to set up your environment. The [default configuration file](.config/configuration.winget) installs Visual Studio 2022 Community & rest of the required tools. There are two other variants of the configuration file available in the [.config](.config) directory for Enterprise & Professional editions of Visual Studio 2022. To run the default configuration file, you can either double-click the file from explorer or run the following command:
349+
350+
```powershell
351+
winget configure .config\configuration.winget
352+
```
353+
354+
### Manual configuration
355+
343356
* You must be running Windows 10 2004 (build >= 10.0.19041.0) or later to run
344357
Windows Terminal
345358
* You must [enable Developer Mode in the Windows Settings

0 commit comments

Comments
 (0)