c-env-bootstrap — A streamlined, one-click automation tool for deploying C/C++ environments on Windows.
[English | 繁體中文]
This script eliminates manual configuration by orchestrating the installation of the compiler, IDE, extensions, and system pathing in one execution.
Setting up a C++ environment on Windows often involves fragmented steps (installing MSYS2, configuring MinGW, manually editing Environment Variables, and setting up VSCode JSON files). This script automates the entire pipeline to ensure a consistent environment for students and developers.
-
Automatically Set Up: Silent installation of Visual Studio Code and MSYS2.
-
Toolchain Provisioning: Automated MSYS2 environment initialization and
mingw-w64-x86_64-gccsynchronization. -
Extension Management: Auto-installs Essential C++ Tools and Code Runner.
-
Intelligent Pathing: Dynamically updates the User
PATHwithout requiring a system reboot. -
Best-Practice Configuration: Injects optimized
settings.json(Integrated Terminal, Auto-save, Output clearing). -
Sanity Test: Automatically generates a "Hello World" project to verify toolchain integrity.
| Component | Version / Source | Purpose |
|---|---|---|
| VSCode | Latest Stable (x64) | IDE |
| MSYS2 | Latest Rolling | Software Distribution & Package Management |
| MinGW-w64 | GCC Toolchain | Compiler, Linker, and Debugger |
| Extensions | C/C++ Tools, Code Runner | IntelliSense & One-click Execution |
-
OS: Windows 10 or 11 (64-bit).
-
Permissions: You must run the scripts as Administrator.
-
Network: Active internet connection for downloading components (~300MB+).
-
Go to the repository Releases section.
-
Download the latest release ZIP file (
c-env-bootstrap.zip).
Important
Instead:
-
Right-click the downloaded ZIP file.
-
Select "Extract All..."
-
Choose a destination folder.
-
Click Extract.
After extraction, open the extracted folder.
If you see an execution policy error, do:
-
Right-click the Start button.
-
Select Terminal (Admin) or Windows PowerShell (Admin).
-
Click Yes if prompted by UAC.
Then run:
Set-ExecutionPolicy RemoteSigned -Scope Process-
Inside the extracted folder, locate:
run_setup.bat -
Right-click it and select "Run as administrator"
-
Click Yes if prompted by UAC
The setup process will then start automatically.
The installer will automatically:
- Install Visual Studio Code (if not installed)
- Install required extensions
- Install MSYS2
- Install GCC toolchain
- Configure environment variables
- Create a
Hello Worldproject on the Desktop
-
Administrator privileges are required.
-
Do not run the script directly from inside the ZIP file.
-
On some systems, PowerShell execution policy restrictions may apply.
This project is licensed under MIT license, so feel free to use it for educational or professional purposes.