Primary Purpose:
msvcup is a standalone tool designed to install the MSVC (Microsoft Visual C++) toolchain and Windows SDK without the need for Visual Studio. It manages these components as versioned assets, ensuring installations are isolated and reproducible, thus avoiding system-wide changes.
Key Features:
Fast Installation: Runs in milliseconds when already installed, making it ideal to integrate at the start of build scripts.
Reproducibility: Utilizes a lock file to ensure consistent toolchain installations across different environments.
Isolated Installations: Packages are installed into versioned directories, preventing registry modifications and conflicts.
Cross-compilation Support: Targets x64, arm64, and x86 architectures seamlessly out of the box.
Minimal Downloads: Installs only necessary components for a functional toolchain and SDK.
Winget Installation: Easily install msvcup via winget for convenience and integration with existing workflows.
Audience & Benefit:
Ideal for developers and build engineers seeking reliable, consistent setup of MSVC and Windows SDK environments. By eliminating the need for Visual Studio, msvcup provides a lightweight solution that enhances productivity and ensures predictable builds across teams. Its isolated and reproducible installations reduce friction in collaborative development, offering a robust toolchain management experience.
README
msvcup
A standalone tool for installing the MSVC toolchain and Windows SDK without Visual Studio.
Why?
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.
These examples contain batch scripts that download msvcup, install an MSVC/SDK, and then compile "hello.c". The cmake build.bat is also project agnostic, meaning it can be used to build most CMAKE projects with no changes.
After downloading msvcup, the example will install the toolchain and an SDK with a command like this:
That command would install the 3 packages "autoenv", "msvc-14.44.17.14" and "sdk-10.0.22621.7" to the "msvc" directory. It also creates a lock file named "msvc.lock" alongside that msvc directory. This lock file contains all the packages and payloads along with URL's and hashes for everything msvcup installs. This lock file is meant to be commited to source control and its content is a hashable representation of all the content msvcup installs along with the entirety of all info msvcup requires to download everything.
Use the msvcup list command to query the available packages/versions. Also note that msvcup caches everything it downloads into a global directory. Deleting the install directory and re-installing should require no network access.
Visual Studio Command Prompts
The install directory will include the following 4 vcvars files:
These scripts update the INCLUDE, PATH and LIB environment variables which is what transforms your shell into a "Visual Studio Command Prompt".
Note that if you include the "autoenv" package, your install directory will include autoenv/$ARCH subdirectories which enables using the toolchain/sdk outside a special command prompt. It works by installing wrapper executables (cl.exe, link.exe, etc) that will initialize the environment variables before forwarding to the underlying executables, and also includes toolchain files for CMake/Zig.
Additional Features
Install metadata: Every installed file is tracked in /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 %localappdata%\msvcup\cache. Failed installs can be retried without network access.
Acknowledgements
Special thanks to Mārtiņš Možeiko (@mmozeiko) for his original Python MSVC installer, which served as a vital reference for this project.