From 6eb6512d12cf3c38d69dba6e6d6b01617e13cda0 Mon Sep 17 00:00:00 2001 From: Muhammad Danish Date: Fri, 21 Mar 2025 21:57:04 +0500 Subject: [PATCH] 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 --- .config/configuration.vsEnterprise.winget | 43 +++++++++++++++++++++ .config/configuration.vsProfessional.winget | 43 +++++++++++++++++++++ .config/configuration.winget | 43 +++++++++++++++++++++ .github/actions/spelling/expect/expect.txt | 1 + README.md | 13 +++++++ 5 files changed, 143 insertions(+) create mode 100644 .config/configuration.vsEnterprise.winget create mode 100644 .config/configuration.vsProfessional.winget create mode 100644 .config/configuration.winget diff --git a/.config/configuration.vsEnterprise.winget b/.config/configuration.vsEnterprise.winget new file mode 100644 index 0000000000..cf7f657d11 --- /dev/null +++ b/.config/configuration.vsEnterprise.winget @@ -0,0 +1,43 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/microsoft/terminal/blob/main/README.md#developer-guidance +properties: + resources: + - resource: Microsoft.Windows.Developer/DeveloperMode + directives: + description: Enable Developer Mode + allowPrerelease: true + # Requires elevation for the set operation + securityContext: elevated + settings: + Ensure: Present + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: powershell + directives: + description: Install PowerShell 7 + # Requires elevation for the set operation (i.e., installation) + securityContext: elevated + settings: + id: Microsoft.PowerShell + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Enterprise (any edition is OK) + # Requires elevation for the set operation (i.e., installation) + securityContext: elevated + settings: + id: Microsoft.VisualStudio.2022.Enterprise + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + dependsOn: + - vsPackage + directives: + description: Install required VS workloads from project .vsconfig file + allowPrerelease: true + # Requires elevation for the get and set operations + securityContext: elevated + settings: + productId: Microsoft.VisualStudio.Product.Enterprise + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig' + configurationVersion: 0.2.0 diff --git a/.config/configuration.vsProfessional.winget b/.config/configuration.vsProfessional.winget new file mode 100644 index 0000000000..d0b7508f36 --- /dev/null +++ b/.config/configuration.vsProfessional.winget @@ -0,0 +1,43 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/microsoft/terminal/blob/main/README.md#developer-guidance +properties: + resources: + - resource: Microsoft.Windows.Developer/DeveloperMode + directives: + description: Enable Developer Mode + allowPrerelease: true + # Requires elevation for the set operation + securityContext: elevated + settings: + Ensure: Present + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: powershell + directives: + description: Install PowerShell 7 + # Requires elevation for the set operation (i.e., installation) + securityContext: elevated + settings: + id: Microsoft.PowerShell + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Professional (any edition is OK) + # Requires elevation for the set operation (i.e., installation) + securityContext: elevated + settings: + id: Microsoft.VisualStudio.2022.Professional + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + dependsOn: + - vsPackage + directives: + description: Install required VS workloads from project .vsconfig file + allowPrerelease: true + # Requires elevation for the get and set operations + securityContext: elevated + settings: + productId: Microsoft.VisualStudio.Product.Professional + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig' + configurationVersion: 0.2.0 diff --git a/.config/configuration.winget b/.config/configuration.winget new file mode 100644 index 0000000000..1dcd7cf829 --- /dev/null +++ b/.config/configuration.winget @@ -0,0 +1,43 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/microsoft/terminal/blob/main/README.md#developer-guidance +properties: + resources: + - resource: Microsoft.Windows.Developer/DeveloperMode + directives: + description: Enable Developer Mode + allowPrerelease: true + # Requires elevation for the set operation + securityContext: elevated + settings: + Ensure: Present + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: powershell + directives: + description: Install PowerShell 7 + # Requires elevation for the set operation (i.e., installation) + securityContext: elevated + settings: + id: Microsoft.PowerShell + source: winget + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Community (any edition is OK) + # Requires elevation for the set operation (i.e., installation) + securityContext: elevated + settings: + id: Microsoft.VisualStudio.2022.Community + source: winget + - resource: Microsoft.VisualStudio.DSC/VSComponents + dependsOn: + - vsPackage + directives: + description: Install required VS workloads from project .vsconfig file + allowPrerelease: true + # Requires elevation for the get and set operations + securityContext: elevated + settings: + productId: Microsoft.VisualStudio.Product.Community + channelId: VisualStudio.17.Release + vsConfigFile: '${WinGetConfigRoot}\..\.vsconfig' + configurationVersion: 0.2.0 diff --git a/.github/actions/spelling/expect/expect.txt b/.github/actions/spelling/expect/expect.txt index e78cb97139..f8468d1fca 100644 --- a/.github/actions/spelling/expect/expect.txt +++ b/.github/actions/spelling/expect/expect.txt @@ -1945,6 +1945,7 @@ VPACKMANIFESTDIRECTORY VPR VREDRAW vsc +vsconfig vscprintf VSCROLL vsdevshell diff --git a/README.md b/README.md index 71b0daad26..e178ad2eb3 100644 --- a/README.md +++ b/README.md @@ -340,6 +340,19 @@ If you would like to ask a question that you feel doesn't warrant an issue ## Prerequisites +You can configure your environment to build Terminal in one of two ways: + +### Using WinGet configuration file + +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) +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: + +```powershell +winget configure .config\configuration.winget +``` + +### Manual configuration + * You must be running Windows 10 2004 (build >= 10.0.19041.0) or later to run Windows Terminal * You must [enable Developer Mode in the Windows Settings