From 26ca661a8771d333a8f5066412b05c401ffdeffa Mon Sep 17 00:00:00 2001 From: Tess Gauthier Date: Tue, 10 Oct 2023 13:53:11 -0400 Subject: [PATCH] update instructions for VS2022 Build Tools and new Win 10 SDK --- ...SSH-for-Windows-(using-LibreSSL-crypto).md | 37 ++++++++++++------- 1 file changed, 23 insertions(+), 14 deletions(-) diff --git a/Building-OpenSSH-for-Windows-(using-LibreSSL-crypto).md b/Building-OpenSSH-for-Windows-(using-LibreSSL-crypto).md index 820eb42..72548fa 100644 --- a/Building-OpenSSH-for-Windows-(using-LibreSSL-crypto).md +++ b/Building-OpenSSH-for-Windows-(using-LibreSSL-crypto).md @@ -2,18 +2,27 @@ - git clone https://github.com/PowerShell/openssh-portable - git checkout latestw_all -#### Building OpenSSH for Windows Using Visual Studio, 2015 or newer [*Recommended*] - - Download and Install VS 2015, or newer, with Desktop Development with C++ - [latest install here](https://visualstudio.microsoft.com/downloads/) - - Confirm the Desktop Development with C++ Kit was installed properly by checking `${env:ProgramFiles(x86)}\Microsoft Visual Studio\*\*\VC\Auxiliary\Build` for a `vcvarsall.bat` file, as shown in the image below: -![C++ Development Kit Folder Location](https://user-images.githubusercontent.com/14894321/155555676-53815d5e-5fb0-48ed-b71d-d0a679cb276b.png) -- Install Windows SDK 10.0.17763.0 during Visual Studio install, or download from [here](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/) - - Confirm the SDK was installed properly by checking `${env:ProgramFiles(x86)}\Windows Kits\10\Bin` for a `10.0.17763.0` folder, as shown in the image below: -![Windows 10 SDK Folder Location](https://user-images.githubusercontent.com/14894321/155553357-8961ac07-9671-4916-8ae2-8123ab2b892e.png) -- Install Microsoft Build Tools 2015 during Visual Studio install, or download from [here](https://www.microsoft.com/en-us/download/details.aspx?id=48159). Note, Build Tools 2015 are needed regardless of the Visual Studio version installed - - Confirm the Build Tools were installed properly by checking `${env:ProgramFiles(x86)}\MSBuild\Microsoft.Cpp\v4.0\140` for a `Microsoft.Cpp.Default.Props` file, as shown in the image below: -![Microsoft Build Tools 2015 Folder Location](https://user-images.githubusercontent.com/14894321/155554939-43ffc96f-185e-427c-82de-16a3a60ce32a.png) -- Open "contrib\win32\openssh\Win32-OpenSSH.sln" in Visual Studio, ensure platform toolset is set to "no upgrade" and Windows SDK is set to "10.0.17763.0" as shown in the image below: \ -![Visual Studio Initial Solution Settings](https://user-images.githubusercontent.com/14894321/155555889-9a2e617c-5f64-4178-b40d-e5231f42f302.png) +#### Building OpenSSH for Windows Using Visual Studio [*Recommended*] + - Download and Install Visual Studio - [latest install here](https://visualstudio.microsoft.com/downloads/). + - If using the Visual Studio installer, select the following: + - Desktop Development with C++ Workload + - Windows 11 SDK 10.0.22621.0 Individual Component + - MSVC 143 Build Tool(s) Individual Component(s) - up to 3 depending on which architecture(s) will be built: x86/x64, ARM, ARM64 + - MSVC 143 Spectre-Mitigated Lib(s) Individual Component(s) - up to 3 depending on which architecture(s) will be built: x86/x64, ARM, ARM64 + + - Confirm the selections look something like this: +![Visual Studio Installer GUI](https://github.com/PowerShell/Win32-OpenSSH/assets/14894321/1966b3df-2c42-4eb6-a8b1-dad3bc84d095) + + - Confirm the Desktop Development with C++ Kit was installed properly by checking `${env:ProgramFiles}\Microsoft Visual Studio\*\*\VC\Auxiliary\Build` for a `vcvarsall.bat` file, as shown in the image below: +![C++ Development Kit Folder Location](https://github.com/PowerShell/Win32-OpenSSH/assets/14894321/f27bf4cd-70fd-4c48-847c-41cf5cf4b0aa) + +- Install Windows SDK 10.0.22621.0 during Visual Studio install, or download from [here](https://developer.microsoft.com/en-us/windows/downloads/sdk-archive/) + - Confirm the SDK was installed properly by checking `${env:ProgramFiles(x86)}\Windows Kits\10\Bin` for a `10.0.22621.0` folder, as shown in the image below: +![Windows 10 SDK Folder Location](https://github.com/PowerShell/Win32-OpenSSH/assets/14894321/fbde27f5-3f2e-4ded-9733-61b1279f06ac) + +- Confirm the Build Tools were installed properly by checking `${env:ProgramFiles}\Microsoft Visual Studio\2022\*\MSBuild\Microsoft\VC\v170` for a `Microsoft.Cpp.Default.Props` file, as shown in the image below: +![Microsoft Build Tools 2022 Folder Location](https://github.com/PowerShell/Win32-OpenSSH/assets/14894321/4e8b0f24-2ef1-4d4a-8c60-b580d425fe89) +- Open `contrib\win32\openssh\Win32-OpenSSH.sln` in Visual Studio, if prompted ensure platform toolset is set to "no upgrade" and Windows SDK is set to "10.0.22621.0" - If necessary, change the configuration and architecture from the middle toolbar - Build the Win32-OpenSSH binaries - Binaries will be in a `.\bin\{Architecture}\{Configuration}` folder, as shown in the image below for an x64, Debug build: @@ -23,10 +32,10 @@ In Powershell: - cd repository-root - ipmo .\contrib\win32\openssh\OpenSSHBuildHelper.psm1 -Force - - Start-OpenSSHBuild -Configuration -NativeHostArch + - Start-OpenSSHBuild -Configuration -NativeHostArch #### Deploying OpenSSH for Windows - - Start-OpenSSHPackage -Configuration -NativeHostArch + - Start-OpenSSHPackage -Configuration -NativeHostArch - Above generates Zipped binary and symbols payload. Follow further installation instructions [here](https://github.com/PowerShell/Win32-OpenSSH/wiki/Install-Win32-OpenSSH).