diff --git a/.config/configuration.vsEnterprise.winget b/.config/configuration.vsEnterprise.winget new file mode 100644 index 0000000000..800729d111 --- /dev/null +++ b/.config/configuration.vsEnterprise.winget @@ -0,0 +1,34 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/microsoft/winget-cli#building-the-client +properties: + resources: + - resource: Microsoft.Windows.Settings/WindowsSettings + directives: + description: Enable Developer Mode + # Requires elevation for the set operation + securityContext: elevated + allowPrerelease: true + settings: + DeveloperMode: true + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Enterprise + # Requires elevation for the set operation + 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 + # Requires elevation for the get and set operations + securityContext: elevated + allowPrerelease: true + 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..19475a618e --- /dev/null +++ b/.config/configuration.vsProfessional.winget @@ -0,0 +1,34 @@ +# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2 +# Reference: https://github.com/microsoft/winget-cli#building-the-client +properties: + resources: + - resource: Microsoft.Windows.Settings/WindowsSettings + directives: + description: Enable Developer Mode + # Requires elevation for the set operation + securityContext: elevated + allowPrerelease: true + settings: + DeveloperMode: true + - resource: Microsoft.WinGet.DSC/WinGetPackage + id: vsPackage + directives: + description: Install Visual Studio 2022 Professional + # Requires elevation for the set operation + 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 + # Requires elevation for the get and set operations + securityContext: elevated + allowPrerelease: true + 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 index 07195bd4da..01654421a7 100644 --- a/.config/configuration.winget +++ b/.config/configuration.winget @@ -13,7 +13,7 @@ properties: - resource: Microsoft.WinGet.DSC/WinGetPackage id: vsPackage directives: - description: Install Visual Studio 2022 (any edition is OK) + description: Install Visual Studio 2022 Community # Requires elevation for the set operation securityContext: elevated settings: diff --git a/doc/Developing.md b/doc/Developing.md index fcf0da2617..25be453796 100644 --- a/doc/Developing.md +++ b/doc/Developing.md @@ -24,7 +24,10 @@ ## Building the client 1. Clone the repository -2. Configure your system using the [configuration file](../.config/configuration.winget) in the repository. To run the configuration, use `winget configure .config/configuration.winget` from the project root so relative paths resolve correctly. +2. Configure your system using the [configuration file](../.config/configuration.winget) in the repository. Run one of the following configurations from the project root so relative paths resolve correctly: + - For VS Community: `winget configure .config/configuration.winget` + - For VS Professional: `winget configure .config/configuration.vsProfessional.winget` + - For VS Enterprise: `winget configure .config/configuration.vsEnterprise.winget` 3. Run `vcpkg integrate install` from the Developer Command Prompt / Developer PowerShell for VS 2022. This is a one-time setup step until the configuration file in step 2 is updated to work with vcpkg setup. Open `winget-cli\src\AppInstallerCLI.sln` in Visual Studio and build. We currently only build using the solution; command-line methods of building a VS solution should work as well.