A Minimal Windows SDK.
MIT License
Installs only the necessary Windows 10 .lib
files to save you having to download the full Visual Studio package. You can either download the zip file or the installer.
First Visual Studio needs to be installed, but not as much as usual. Using powershell:
> Invoke-WebRequest https://aka.ms/vs/16/release/vs_buildtools.exe -OutFile vs_buildtools.exe
> .\vs_buildtools --add Microsoft.VisualStudio.Component.VC.Tools.x86.x64 --add Microsoft.Component.VC.Runtime.UCRTSDK
This will install the Visual Studio package manager then open up the GUI installer. You can click straight on install. All the necessary components are already selected.
Wait for that to finish then run this installer. Alternatively, see Manually Install Only the Libs.
> Invoke-WebRequest https://github.com/ChrisDenton/minwinsdk/releases/download/0.0.1/minwinsdk.exe -OutFile minwinsdk.exe
> .\minwinsdk
If all goes well you should finally be able to install rustup
> Invoke-WebRequest https://static.rust-lang.org/rustup/dist/x86_64-pc-windows-msvc/rustup-init.exe -OutFile rustup-init.exe
> .\rustup-init -y --default-host x86_64-pc-windows-msvc
Download Minimal.Windows.SDK.zip and unzip it somewhere nice. You may want to set the LIB
environment variable for your default target.
If you used the installer or manually set the LIB
environment variable then it should "just work" for the default target. If using another target you may need to set the library search path appropriately. You can do this globally in your cargo configuration file
. By default it's located at %USERPROFILE%\.cargo\config.toml
but you might need to create it.
Add this to the config (replacing path\to\libs
with the folder the libs are in):
[target.x86_64-pc-windows-msvc]
rustflags = [ "-L", "path\to\libs\x64"]
[target.i686-pc-windows-msvc]
rustflags = [ "-L", "path\to\libs\x86"]
[target.aarch64-pc-windows-msvc]
rustflags = [ "-L", "path\to\libs\arm64"]
[target.thumbv7a-pc-windows-msvc]
rustflags = [ "-L", "path\to\libs\arm"]
ucrt.lib
.x86_64
installer. There's no inherent reason for this, it's just that I'm being lazy.This should become obsolete once Rust has raw-dylibs.