A standalone tool for installing the MSVC toolchain and Windows SDK without Visual Studio.
The Visual Studio Installer manages thousands of components, modifies the registry, and can take hours to configure. msvcup treats the toolchain as a versioned asset rather than global system state. The build environment is defined by code, not a GUI.
- Fast: Runs in milliseconds when already installed. Put it at the start of every build script.
- Reproducible: Lock file ensures everyone gets the same toolchain.
- Isolated: Every package is installed to its own versioned directory. No registry modifications. No conflicts.
- Cross-compilation: Target x64, arm64, or x86 out of the box.
- Minimal: Download only what's needed to get a working native toolchain/SDK.
- for CMake projects, see examples/cmake/build.bat
- for "handmade" style projects, see examples/handmade/build.bat
These examples contain batch scripts that download msvcup, install an MSVC/SDK, and then compile "hello.c".
After downloading msvcup, the example will install the toolchain and an SDK with a command like this:
> msvcup install --lock-file msvcup.lock msvc-14.44.17.14 sdk-10.0.22621.7All packages are installed to C:\msvcup so this would create the following directories:
C:\msvcup\msvc-14.44.17.14andC:\msvcup\sdk-10.0.22621.7
You can query the latest packages/versions using msvcup list.
Each package includes a vcvars script for each target architecture:
vcvars-x64.batvcvars-arm64.batvcvars-x86.batvcvars-arm.bat
These scripts add extra environment variables like a "Visual Studio Command Prompt" would.
msvcup can also create an "automatic environment" directory which enables using the toolchain/sdk outside a special command prompt, e.g.
> msvcup autoenv --target-cpu x64 --out-dir autoenv-x64 msvc-14.44.17.14 sdk-10.0.22621.7This generates a directory with wrapper executables (cl.exe, link.exe, etc) that can be invoked in a normal command prompt along with toolchain files for CMake/Zig.
- Lock file: All components and URLs are saved before install, enabling reproducible builds via source control.
- Install metadata: Every installed file is tracked in
<package>/install. This allows msvcup to detect file conflicts and allows the user to query which component(s) installed which files. - Download cache: Packages are cached in
C:\msvcup\cache. Failed installs can be retried without network access.
Special thanks to Mārtiņš Možeiko (@mmozeiko) for his original Python MSVC installer, which served as a vital reference for this project.