Skip to content

[PoC] Rework WinGet guide to make use of configurations #701

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions _data/install/visualstudio.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
- id: Community
name: Community
- id: BuildTools
name: Build Tools
- id: Enterprise
name: Enterprise
- id: Professional
name: Professional
5 changes: 5 additions & 0 deletions _data/install/windows_sdk.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- 10.0.19041
- 10.0.20348
- 10.0.22000
- 10.0.22621
- 10.0.26100
19 changes: 19 additions & 0 deletions _includes/install/_visual_studio_tabs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[Windows Package Manager](https://docs.microsoft.com/windows/package-manager/) (aka WinGet) comes pre-installed with Windows 11 (21H2 and later). It can also be found in the [Microsoft Store](https://www.microsoft.com/p/app-installer/9nblggh4nns1) or be [installed directly](ms-appinstaller:?source=https://aka.ms/getwinget).

---

<p id="platforms">Select Visual Studio 2022 edition:</p>

<div class="interactive-tabs os">
<div class="tabs">
{% for edition in site.data.install.visualstudio %}
{% if include.pressed == edition.id %}
<a href="/install/windows/winget/vs17_{{ edition.id | downcase }}" aria-pressed="true">{{ edition.name }}</a>
{% else %}
<a href="/install/windows/winget/vs17_{{ edition.id | downcase }}" aria-pressed="">{{ edition.name }}</a>
{% endif %}
{% endfor %}
</div>
</div>

<hr>
15 changes: 15 additions & 0 deletions _includes/install/_windows_sdk_tabs.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<p id="platforms">Select Windows SDK version:</p>

<div class="interactive-tabs os">
<div class="tabs">
{% for sdk_version in site.data.install.windows_sdk %}
{% if include.pressed == sdk_version %}
<a href="/install/windows/winget/{{ include.visualstudio }}/{{ sdk_version }}" aria-pressed="true">{{ sdk_version }}</a>
{% else %}
<a href="/install/windows/winget/{{ include.visualstudio }}/{{ sdk_version }}" aria-pressed="">{{ sdk_version }}</a>
{% endif %}
{% endfor %}
</div>
</div>

<hr>
52 changes: 52 additions & 0 deletions _includes/install/_winget_configuration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
configurationVersion: 0.2.0
assertions:
- resource: Microsoft.Windows.Developer/OsVersion
directives:
description: Verify minimum OS version requirement
allowPrerelease: true
settings:
MinVersion: '10.0.19041'
resources:
- resource: Microsoft.Windows.Developer/DeveloperMode
directives:
description: Enable Developer Mode
allowPrerelease: true
securityContext: elevated
settings:
Ensure: Present
- resource: Microsoft.WinGet.DSC/WinGetPackage
id: vsPackage
directives:
description: Install Visual Studio {{ include.vs_version }} {{ include.vs_edition }}
allowPrerelease: true
settings:
id: Microsoft.VisualStudio.{{ include.vs_version }}.{{ include.vs_edition }}
source: winget
- resource: Microsoft.VisualStudio.DSC/VSComponents
dependsOn:
- vsPackage
directives:
description: Install required VS workloads
allowPrerelease: true
securityContext: elevated
settings:
productId: Microsoft.VisualStudio.Product.{{ include.vs_edition }}
channelId: VisualStudio.{{ include.vs_release }}.Release
Components:
- Microsoft.VisualStudio.Component.VC.Tools.x86.x64
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Windows SDK {{ include.windows_sdk_version }}
allowPrerelease: true
settings:
id: Microsoft.WindowsSDK.{{ include.windows_sdk_version }}
source: winget
- resource: Microsoft.WinGet.DSC/WinGetPackage
directives:
description: Install Swift
allowPrerelease: true
settings:
id: Swift.Toolchain
source: winget
6 changes: 6 additions & 0 deletions _includes/install/_winget_installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Install from the following WinGet configurations:

```powershell
$ winget configure -f {{ site.url }}/install/windows/winget/enable-configure-elevation.dsc.yaml
$ winget configure -f {{ site.url }}{{ page.dir }}configuration.dsc.yaml
```
2 changes: 1 addition & 1 deletion install/windows/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ title: Install Swift
<p class="description">
Install Swift via Windows Package Manager (aka WinGet).
</p>
<a href="/install/windows/winget" class="cta-secondary">Instructions</a>
<a href="/install/windows/winget/vs17_community/10.0.22621" class="cta-secondary">Instructions</a>
</li>
<li class="resource">
<h3>Package Installer</h3>
Expand Down
13 changes: 13 additions & 0 deletions install/windows/winget/enable-configure-elevation.dsc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# yaml-language-server: $schema=https://aka.ms/configuration-dsc-schema/0.2
properties:
configurationVersion: 0.2.0
resources:
- resource: Microsoft.WinGet.DSC/WinGetUserSettings
directives:
description: Enable self-elevation in WinGet Configuration
allowPrerelease: true
settings:
Settings:
experimentalFeatures:
configureSelfElevate: true
Action: Partial
22 changes: 1 addition & 21 deletions install/windows/winget/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,4 @@ layout: page
title: Installation via Windows Package Manager
---

[Windows Package Manager](https://docs.microsoft.com/windows/package-manager/) (aka WinGet) comes pre-installed with Windows 11 (21H2 and later). It can also be found in the [Microsoft Store](https://www.microsoft.com/p/app-installer/9nblggh4nns1) or be [installed directly](ms-appinstaller:?source=https://aka.ms/getwinget).

0. Enable Developer Mode:

In order to develop applications, particularly with the Swift Package Manager, you will need to enable developer mode. Please see Microsoft’s [documentation](https://docs.microsoft.com/windows/apps/get-started/enable-your-device-for-development) for instructions about how to enable developer mode.

0. Install required Visual Studio components:

Install the latest MSVC toolset and Windows 11 SDK (10.0.22000) through Visual Studio 2022 Community installer. You may change the Visual Studio edition depending on your usage and team size.

~~~ batch
winget install --id Microsoft.VisualStudio.2022.Community --exact --force --custom "--add Microsoft.VisualStudio.Component.Windows11SDK.22000 --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
~~~

0. Install Swift and other dependencies:

Install the latest Swift developer package, as well as compatible Git and Python tools if they don't exist.

~~~ batch
winget install --id Swift.Toolchain -e
~~~
{% include install/_visual_studio_tabs.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="BuildTools" vs_release="17"
windows_sdk_version="10.0.19041"
%}
10 changes: 10 additions & 0 deletions install/windows/winget/vs17_buildtools/10.0.19041/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="BuildTools" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_buildtools" pressed="10.0.19041" %}

{% include install/_winget_installation.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="BuildTools" vs_release="17"
windows_sdk_version="10.0.20348"
%}
10 changes: 10 additions & 0 deletions install/windows/winget/vs17_buildtools/10.0.20348/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="BuildTools" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_buildtools" pressed="10.0.20348" %}

{% include install/_winget_installation.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="BuildTools" vs_release="17"
windows_sdk_version="10.0.22000"
%}
10 changes: 10 additions & 0 deletions install/windows/winget/vs17_buildtools/10.0.22000/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="BuildTools" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_buildtools" pressed="10.0.22000" %}

{% include install/_winget_installation.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="BuildTools" vs_release="17"
windows_sdk_version="10.0.22621"
%}
10 changes: 10 additions & 0 deletions install/windows/winget/vs17_buildtools/10.0.22621/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="BuildTools" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_buildtools" pressed="10.0.22621" %}

{% include install/_winget_installation.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="BuildTools" vs_release="17"
windows_sdk_version="10.0.26100"
%}
10 changes: 10 additions & 0 deletions install/windows/winget/vs17_buildtools/10.0.26100/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="BuildTools" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_buildtools" pressed="10.0.26100" %}

{% include install/_winget_installation.md %}
8 changes: 8 additions & 0 deletions install/windows/winget/vs17_buildtools/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="BuildTools" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_buildtools" %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="Community" vs_release="17"
windows_sdk_version="10.0.19041"
%}
10 changes: 10 additions & 0 deletions install/windows/winget/vs17_community/10.0.19041/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="Community" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_community" pressed="10.0.19041" %}

{% include install/_winget_installation.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="Community" vs_release="17"
windows_sdk_version="10.0.20348"
%}
10 changes: 10 additions & 0 deletions install/windows/winget/vs17_community/10.0.20348/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="Community" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_community" pressed="10.0.20348" %}

{% include install/_winget_installation.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="Community" vs_release="17"
windows_sdk_version="10.0.22000"
%}
10 changes: 10 additions & 0 deletions install/windows/winget/vs17_community/10.0.22000/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="Community" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_community" pressed="10.0.22000" %}

{% include install/_winget_installation.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="Community" vs_release="17"
windows_sdk_version="10.0.22621"
%}
10 changes: 10 additions & 0 deletions install/windows/winget/vs17_community/10.0.22621/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="Community" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_community" pressed="10.0.22621" %}

{% include install/_winget_installation.md %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="Community" vs_release="17"
windows_sdk_version="10.0.26100"
%}
10 changes: 10 additions & 0 deletions install/windows/winget/vs17_community/10.0.26100/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="Community" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_community" pressed="10.0.26100" %}

{% include install/_winget_installation.md %}
8 changes: 8 additions & 0 deletions install/windows/winget/vs17_community/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
---
layout: page
title: Installation via Windows Package Manager
---

{% include install/_visual_studio_tabs.md pressed="Community" %}

{% include install/_windows_sdk_tabs.md visualstudio="vs17_community" %}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
layout: null
---
{% include install/_winget_configuration.yml
vs_version="2022" vs_edition="Enterprise" vs_release="17"
windows_sdk_version="10.0.19041"
%}
Loading