@@ -55,14 +55,32 @@ Expand-Archive -Path "$env:TEMP\vulkan-runtime-components.zip" -DestinationPath
5555Copy-Item - Path " *\x64\vulkan-1.dll" - Destination C:\Windows\System32\
5656
5757$visual_studio_build = $args [0 ]
58+ $unreal_engine_version = $args [1 ]
59+
60+ Write-Host " Unreal Engine version: $unreal_engine_version "
5861
5962if ($visual_studio_build -eq " 15" )
6063{
6164 $windows_sdk_version = 18362
65+ $windows_os_version = " Windows10SDK"
6266}
6367else
6468{
6569 $windows_sdk_version = 20348
70+ $windows_os_version = " Windows10SDK"
71+
72+ # NOTE: See suggested components https://github.com/EpicGames/UnrealEngine/blob/release/Engine/Config/Windows/Windows_SDK.json
73+ if ($unreal_engine_version.StartsWith (" 5.4" ))
74+ {
75+ $windows_sdk_version = 22621
76+ $vs_tools_version = " 14.38.17.8"
77+ }
78+ elseif ($unreal_engine_version.StartsWith (" 5.5" ))
79+ {
80+ $windows_sdk_version = 22621
81+ $windows_os_version = " Windows11SDK"
82+ $vs_tools_version = " 14.38.17.8"
83+ }
6684}
6785
6886# NOTE: We use the Visual Studio 2022 installer even for Visual Studio 2019 and 2017 here because the old (2017) installer now breaks
@@ -85,15 +103,26 @@ $vs_args = @(
85103 " --add" , " Microsoft.VisualStudio.Workload.VCTools" ,
86104 " --add" , " Microsoft.VisualStudio.Workload.MSBuildTools" ,
87105 " --add" , " Microsoft.VisualStudio.Component.NuGet" ,
88- " --add" , " Microsoft.VisualStudio.Component.VC.Tools.x86.x64" ,
89- " --add" , " Microsoft.VisualStudio.Component.Windows10SDK.$windows_sdk_version " ,
106+ " --add" , " Microsoft.VisualStudio.Component.$windows_os_version .$windows_sdk_version " ,
90107 " --add" , " Microsoft.Net.Component.4.5.TargetingPack" ,
91108 " --add" , " Microsoft.Net.Component.4.6.2.TargetingPack" ,
92109 " --add" , " Microsoft.Net.ComponentGroup.DevelopmentPrerequisites" ,
93110 " --add" , " Microsoft.NetCore.Component.SDK" ,
94111 " --add" , " Microsoft.NetCore.Component.Runtime.3.1"
95112)
96113
114+ if (-not ([string ]::IsNullOrEmpty($vs_tools_version ))) {
115+ $vs_args = $vs_args ,
116+ " --add" , " Microsoft.VisualStudio.Component.VC.$vs_tools_version .x86.x64" ,
117+ " --remove" , " Microsoft.VisualStudio.Component.VC.Tools.x86.x64" ,
118+ " --remove" , " Microsoft.VisualStudio.Component.Windows10SDK.20348"
119+ }
120+ else
121+ {
122+ $vs_args = $vs_args ,
123+ " --add" , " Microsoft.VisualStudio.Component.VC.Tools.x86.x64"
124+ }
125+
97126# Install the Visual Studio Build Tools workloads and components we need
98127RunProcessChecked " $env: TEMP \vs_buildtools.exe" $vs_args
99128
0 commit comments