Sdk для windows 10 не устанавливается

После обновления VS 2022 RC до LTSC возникла проблема со сборкой консольных приложений С++ — исчезла папка C:\Program Files (x86)\Windows Kits\10 . Такая проблема была и раньше на VS 2019 и VS 2022 RC и я решал ее путем копирования папки Windows Kits с другой машины (виртуальной), а также создания ветки v10.0 в реестре.
В случае с VS 2022 LTSC этот метод не сработал и тогда я по совету MS попробовал установить SDK самостоятельно.
При установке Windows SDK 10.0.22000.0 получаю нулевой результат ( как при выборе рабочей нагрузки в VS Installer, так и при online/offline). При этом в случае offline установки видно, что процесс идет нормально, но на 60% начинается откат и удаление установленных перед этим файлов в C:\Program Files (x86)\Windows Kits\10.
Удаление Студии как средствами самой Студии (с помощью Installer, и InstallCleanup.exe) , так и чистка реестра и дисков вручную не дали положительного результата.
Как решить эту проблему?


  • Вопрос задан

  • 587 просмотров

If you’ve stumbled upon this post, it most likely means that you’re trying to install or update Visual Studio 2017 Community or Enterprise using the Visual Studio Installer tool. As you can easily notice, the installation phase is splitted into 2 steps: the download, which happen first, and the actual install.

The issue we’re talking about is related to the installation phase of the Win10SDK module, precisely Win10SDK_10.0.17763 at the time of writing — but we know that the issue also happened before and will most likely happen with future versions of the Win10SDK package as well.

The problem

The issue can be easily summarized with the following screenshot:

Visual Studio 2017 Installer Stuck at Win10SDK - How to fix

When this happens, the window GUI appear to be still responding and not locked up: however, pressing the Cancel button does nothing and basically hangs the tool undefinitely until its process is manually killed using Task Manager.

Such scenario can be troublesome, especially if you’re performing a «standard» VS2017 update, because you will be basically unable to launch Visual Studio until you fix that.

Visual Studio 2017 Installer Stuck at Win10SDK - How to fix

The setup for this installation of Visual Studio is not complete. Please run the Visual Studio Installer again to correct the issue.

needless to say, restarting and re-running the Visual Studio Installer will bring the same result: when it will try installing the Win10SDK, the tool will become stuck again.

The fix(es)

As this post from the VS developer community explains, the problem’s cause is related to a silent PowerShell script that gets executed during the Windows App Certification Kit installation phase that

Workaround #1

Luckily enough, the workaround for such issue is actually rather simple:

  • Navigate to the Microsoft Windows 10 SDK official web page.
  • Download the Win10SDK installer executable (or the ISO image if you prefer).
  • Run it manually using administrative priviledges (very important).
  • After the setup is done, launch the Visual Studio Installer and install (or update) Visual Studio 2017.

As you can see, installing the SDK with administrative priviledges is the key to work around the Windows App Certification permissions issue without having to mess with the existing Local Group Policies. If you don’t do that, you’ll most likely get the following:

Visual Studio 2017 Installer Stuck at Win10SDK - How to fix

Workaround #2

If running the Windows 10 SDK installer with administrative priviledges is not enough to fix your issue, you can try to temporarily enable the Local Group Policy using the Windows built-in Group Policy Editor in the following way:

  • Launch the Group Policy Editor: Start > Run > gpedit
  • Navigate through Computer Configuration > Administrative Templates > Windows Components > Windows Powershell (see screenshot below)
  • Set the Turn on Script Execution switch to Enabled, then sets its execution policy to Run all scripts.

Visual Studio 2017 Installer Stuck at Win10SDK - How to fix

Once done, try install or update Visual Studio again.

IMPORTANT: Remember to revert this change right after installing or updating Visual Studio, as leaving it like that will pose a non-trivial security issue on your machine.

Workaround #3

If none of the above workarounds worked, the last thing you can do is to uninstall and reinstall Visual Studio from scratch using the Visual Studio Installer tool: such procedure can be time-consuming, but is 100% guarranteed to work and will bring you back a clean installation of the latest version of VS2017.

Conclusion

That’s it, at least for now: we sincerely hope that this post will help other Visual Studio developers to work around this nasty issue, hoping that Microsoft and the VS team will fix it soon enough. If you have additional workarounds to suggest, feel free to leave a comment and we’ll be more than happy to add them to the list.

Solution 1:[1]

in my case the corrupted files caused that error. I manually deleted C:\ProgramData\Microsoft\VisualStudio\Packages\Win10SDK_10.0.19041,version=10.0.19041.1 (or your version of windowsSDK)
folder and then in Visual Studio 2022 installer picked up modify option and install after download (or so) from dropdown next to modify button .

It won’t work without delete.

Also For sure temporarily turn off Defender . Then if its all settled turn it on again.There are possible troubls with folder acceses. Seems.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1

So I’m having problems trying to get the windows 10 SDK to install… I originally tried to install the visual studio 2015 community edition with the SDK but it gave a generic error saying it failed to install the SDK but installed everything else — I could launch visual studio, create a universal app but got a message telling me I needed to install the emulator and SDK because neither were installed. Launched the setup again and went to modify, the SDK was selected (like it was installed) so I unticked it and removed it.

Downloaded the windows 10 emulator and SDK as external applications from the developer website — can’t install the emulator because I don’t have the hardware support for it, that’s OK, but I’m still unable to install the SDK. When I get the ‘failed to install’ with the standalone SDK I’m given a log file which shows the error:

MSI (s) (18:04) [21:02:57:565]: Created Custom Action Server with PID 3396 (0xD44).
MSI (s) (18:98) [21:02:57:594]: Running as a service.
MSI (s) (18:98) [21:02:57:596]: Hello, I’m your 32bit Elevated Non-remapped custom action server.
CAQuietExec:  Microsoft (R) Generate UnionWinMD Tool version 10.0.2
CAQuietExec:  Copyright (c) Microsoft Corporation
CAQuietExec:  All rights reserved.
CAQuietExec:  Error: You must run this script from an elevated command prompt.
CAQuietExec:  Error 0x80070002: Command line returned an error.
CAQuietExec:  Error 0x80070002: CAQuietExec Failed
CustomAction GenUnionWinMD returned actual error code 1603 (note this may not be 100% accurate if translation happened inside sandbox)

I’ve tried running the SDK as an admin and I still get the same error so it’s bogus saying it’s not an elevated command prompt. There are a few threads on the net with the same error as this for the old insider builds of windows 10 and the response from MS staff was to upgrade the installer because a newer version fixed it… Well this is the official release version of the SDK and I’m getting the error in this version. Has anyone else got this error or managed to find a workaround for it?

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Командная строка windows список папок
  • Какая комбинация клавиш вызывает диспетчер задач windows
  • Как правильно сделать восстановление системы windows 10
  • Как создать нового пользователя на windows без входа в систему windows
  • Lenovo ideapad 320 drivers windows 10