Skip to content
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

Add Windows SDK 8.1 #842

Closed
1 of 5 tasks
jamesmcguirepro opened this issue May 6, 2020 · 11 comments
Closed
1 of 5 tasks

Add Windows SDK 8.1 #842

jamesmcguirepro opened this issue May 6, 2020 · 11 comments

Comments

@jamesmcguirepro
Copy link

jamesmcguirepro commented May 6, 2020

Tool information

Area for Triage:

Question, Bug, or Feature?:

Virtual environments affected

  • macOS 10.15
  • Ubuntu 16.04 LTS
  • Ubuntu 18.04 LTS
  • Windows Server 2016 R2
  • Windows Server 2019

Can this tool be installed during the build?
Possibly, with admin rights and a restart.

Tool installation time in runtime

Are you willing to submit a PR?
Yes. It existed before: https://github.com/actions/virtual-environments/blob/master/images/win/scripts/Installers/Windows2016/Install-VS2017.ps1#L61

@ghost ghost mentioned this issue May 7, 2020
4 tasks
@maxim-lobanov
Copy link
Contributor

@jamesmcguirepro , Could you please share the approximate size of this SDK?

Also I see that Windows 8.1 SDK is officially deprecated in VS 2019.

The Windows 8.1 SDK is no longer available in the Visual Studio installer. Please upgrade your C++ projects to the latest Windows 10 SDK. If you have a hard dependency on 8.1, you can download it from the Windows SDK archive.

@jamesmcguirepro
Copy link
Author

@maxim-lobanov
It's listed as 0.98 GB on my local machine's Uninstall Programs list

@riverar
Copy link

riverar commented May 11, 2020

All SKUs of Windows 8.1 have left mainstream support. Only extended support is available for this version of Windows.

You can install just the desktop/.NET SDK features (no tooling) via:

sdksetup.exe /features OptionId.WindowsDesktopSoftwareDevelopmentKit OptionId.NetFxSoftwareDevelopmentKit /quiet

The SDK footprint is about 505MB, calculated from a clean machine install via:

  • C:\Program Files (x86)\Windows Kits\8.1 @ 490MB
  • C:\Program Files (x86)\Microsoft SDKs\Windows\v8.1A @ 15MB

@alepauly
Copy link
Contributor

Hi @jamesmcguirepro, considering that it can be installed on runtime and it's a pretty old version, we won't install it by default in the images. Thanks for the suggestion though.

@abergmeier
Copy link

abergmeier commented Jun 12, 2020

So IIUC the steps for getting Windows SDK 8.1 on windows-latest would be to:

  1. Download https://go.microsoft.com/fwlink/p/?LinkId=323507
  2. Run C:\temp\sdksetup.exe /features OptionId.WindowsDesktopSoftwareDevelopmentKit OptionId.NetFxSoftwareDevelopmentKit /quiet

@riverar
Copy link

riverar commented Jun 12, 2020

@abergmeier Yep, specifically this should do:

- name: Install Windows 8.1 SDK
  shell: powershell
  run: |
    Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?LinkId=323507 -OutFile sdksetup.exe -UseBasicParsing
    Start-Process -Wait sdksetup.exe -ArgumentList "/q", "/norestart", "/features", "OptionId.WindowsDesktopSoftwareDevelopmentKit", "OptionId.NetFxSoftwareDevelopmentKit"

@abergmeier
Copy link

abergmeier commented Jun 12, 2020

That is what I tried I tried something similar and Invoke-WebRequest fails with:

Response status code does not indicate success: 301 (Moved Permanently).

because I did not bother to copy shell: powershell

@abergmeier
Copy link

abergmeier commented Jun 12, 2020

The following also works for me:

    - name: Download and install Windows SDK
      run: |
        import subprocess
        import urllib.request
        urllib.request.urlretrieve("https://go.microsoft.com/fwlink/p/?LinkId=323507", "sdksetup.exe")
        subprocess.run(["sdksetup.exe", "/q", "/norestart", "/features", "OptionId.WindowsDesktopSoftwareDevelopmentKit", "OptionId.NetFxSoftwareDevelopmentKit"], check=True, capture_output=True)
      shell: python

@riverar
Copy link

riverar commented Jun 12, 2020

If you use PowerShell Core, you'll run into questionable semantics around HTTP 3xx status codes (see PowerShell/PowerShell#4534), hence the shell: powershell instead 😉

@ben-spiller
Copy link

NB: MS SDK 8.1 is the default SDK you get when you install Visual Studio 2015 SP3 (even on a Windows 10 machine), and VS2015 itself is supported until 2025. So maybe there is an argument for providing it until VS2015 goes out of support?

Or at least providing an action to install it when needed.

The powershell example above works, but after a quick download it takes several minutes to install. Does anyone have an action or workflow recipe for caching the actual installation (or even know if that's possible - not sure if there are registry aspects needed in addition to the files themselves)?

@laurence-myers
Copy link

You can also install the SDK using an older version of vs_buildtools.exe. This is handy if you also need to install an older version of MSVC.

In this example, I use v15 of vs_buildtools.exe to install platform tools v140 (VS 2015) and the windows 8.1 SDK.

    - name: Install MSVC 2015 (v140) and Windows 8.1 SDK
      shell: powershell
      run: |
        $VS_BTOOLS_EXE="vs_buildtools.exe"
        $VS_BTOOLS_URI="https://aka.ms/vs/15/release/vs_buildtools.exe"
        Invoke-WebRequest -Uri $VS_BTOOLS_URI -OutFile $VS_BTOOLS_EXE
        Start-Process -FilePath ./vs_BuildTools.exe -ArgumentList `
        "--add", "Microsoft.VisualStudio.Component.VC.140", `
        "--add", "Microsoft.VisualStudio.Component.Windows81SDK", `
        "--quiet", "--norestart", "--force", "--wait" -Wait -PassThru

(I based the example on this StackOverflow answer)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants