Factsheet
vs code - How to Install VSCode on Windows as Administrator for data science projects without painful debugging and re-installations later? - Stack Overflow
Windows 11 - Install VSCode to Program Files or AppData?
Install Visual Studio Code for all users - Stack Overflow
Difference between User and System Installer of Visual Studio Code - Stack Overflow
Hi Guys,
By default it seems to install VSCode to AppData, however as the only user on my PC I was wondering if there were any issues with installing to Program Files? I generally prefer software to go there as it makes it more mangible and easy to find, but i'm not sure if there is a strict reason why it wants to put everything in AppData?
Look for the system installer instead of the user setup installer. The system installer will give you the option to: 1. Install for all users 2. Choose a directory.
Download here (oficial page): https://code.visualstudio.com/download
Can't find it? The system installer is below the big blue button to download. You'll see 3 options. The middle option will say system installer.
The current download page has a Windows icon that downloads the AMD64 user installer. You don't get an option to select the user or system installer. Interestingly, below the Windows icon there are links to multiple ARM64 installers, including the ARM64 system installer, but you don't want that one.
The link to download the AMD64 system installer file is here. This link is on the Visual Studio Code installation and setup page in the 'User setup versus system setup' section: Visual Studio Code on Windows
User setup for Windows
Announced last release, the user setup package for Windows is now available on stable. Installing the user setup does not require Administrator privileges as the location will be under your user Local AppData (LOCALAPPDATA) folder. User setup also provides a smoother background update experience.
Download User Setup
If you are a current user of the system-wide Windows setup, you will be prompted to install user setup, which we recommend using from now on. Don't worry, all your settings and extensions will be kept during the transition. During installation, you will also be prompted to uninstall the system-wide setup.
Reference: https://code.visualstudio.com/updates/v1_26#_user-setup-for-windows
I installed the user version side-by-side with the system version with no problems. The basic differences between the two is that the system version installs on the file system like every other app. The user install is basically a click-once (or web installer) version that installs in the User folder of the machine.
The settings made to VS Code in the system version save for Everybody on the computer and the user version the settings are only for the user. I find that the behavior of the user version is a bit annoying for me because I have reasons to want to open multiple copies of VS Code at the same time and the user version only allows one instance. Otherwise, there's not really anything different between the two as far as I can tell.
Last update: 18.05.2025
Preface
-
This is a simple guide for complete beginners to set up VSCode from ground up. That means you barely installed the OS and that's it
-
There are 2 tutorials. One for Windows and one for Debian. I'm not saying this is the best setup for either OS, but it's an easy one and gets you going. Once you know C++ a bit better you can look further into how everything works
-
For Windows I created and tested this guide with a fresh installation of Windows 11 (more specifically Win11_24H2_EnglishInternational_x64.iso) in VirtualBox
-
For Debian I used Debian 12 (more specifically debian-12.10.0-amd64-netinst.iso) in VirtualBox
-
-
The first part of this guide is only for Debian. If you're on Windows you can just skip the parts not marked for your system
-
If you are on Windows, please just use Visual Studio Community Edition which is an actual IDE compared to VSCode
-
It's way easier to set up
-
You're not doing yourself a favor, if you insist in using VSCode
-
-
Regardless of Windows or Linux I also highly recommend to have a look at CLion, which has a free hobby license. In my opinion it's the best IDE out there
But since VSCode is so prevalent in guides and tutorials, here is the definitive beginner guide to set up VSCode:
Tutorial
Software setup (Debian)
-
Start Terminal
-
Type
sudo testand press ENTER -
If you get an error message we need to set up
sudofor you in the next block. If there is no error message you can skip it
Adding your user to sudo (Debian)
-
Type
su rootand press ENTER -
Enter your root password. If you didn't specify one its probably the same as your normal user
-
Type
/usr/sbin/usermod -aG sudo vboxuser-
Replace vboxuser with your user name and press ENTER
-
-
Restart your system once and open Terminal again
Install required software (Debian)
-
Open https://code.visualstudio.com/docs/?dv=linux64 in your browser. It will download the current VSCode in a compressed folder.
-
Go back to your Terminal and type these commands and press ENTER afterwards:
-
sudo apt update -y -
sudo apt upgrade -y -
sudo apt install build-essential cmake gdb -y -
cd ~ -
tar -xvzf ~/Downloads/code-stable-x64-1746623059.tar.gz-
The specific name for the file may change with time. Its enough to type
tar -xvzf ~/Downloads/code-stableand press TAB, it should auto-complete the whole name
-
-
Open your file explorer. There should now be a directory called VSCode-linux-x64 in your home directory. Open it and double-click code to open VSCode
-
Software setup (Windows)
-
Download and install CMake using the .msi installer https://cmake.org/download
-
Accept all defaults during installation
-
-
Download and install MSYS2 using the .exe installer https://www.msys2.org
-
Accept all defaults during installation
-
After installation you will be asked to run MSYS2 now. Accept that.
-
Enter
pacman -S --needed base-devel mingw-w64-ucrt-x86_64-toolchaininto the command prompt and press ENTER-
If you want to copy the command use your mouse. Don't use keyboard shortcuts to paste!
-
-
MSYS2 will show you a list of packages to install. Accept them all by just pressing ENTER
-
You're now shown a list of software packages that will be installed and you're asked if you want to proceed with the installation. Type "Y" and press ENTER
-
After installation close the MSYS2 window
-
-
Download and install VSCode https://code.visualstudio.com/docs/?dv=win64user
-
Accept all defaults during installation
-
After installation you're asked to run VSCode now. Accept that
-
Setup VSCode (Debian and Windows)
-
In your top bar go to File -> Add Folder To Workspace
-
Create a new folder, name it what ever you want. Then open this folder to set it as your workspace
-
Switch to your EXPLORER tab in your left bar
-
Create a file CMakeLists.txt in your workspace
-
VSCode will ask you if you want to install the extension CMake Tools. Install it
-
-
Add the following content to your CMakeLists.txt:
cmake_minimum_required(VERSION 4.0) set(CMAKE_CXX_STANDARD 20) # Set higher if you can project(LearnProject) # Add your source files here add_executable(LearnProject src/main.cpp ) # Add compiler warnings add_compile_options(LearnProject -Wall -Wextra )
-
You don't need to know how CMake works and what it does. For now it's okay to just know: it will create the executable from your source code
-
As you go further in your journey with C++ you have to add more source files. Simply add them in the next line after src/main.cpp
-
Create a new folder inside your workspace called src
-
Add a new file inside this src folder called main.cpp
-
VSCode will ask you if you want to install the extension C/C++ Extension Pack. Install it
-
-
Add the following content to your main.cpp file and save:
#include <iostream>
int main() {
std::cout << "Hello World";
} -
Your workspace should now have the following structure:
Workspace:
- src
- main.cpp
- CMakeLists.txt-
In your bottom left there should be a button called Build followed by a button that looks like a bug and a triangle pointing to the right
-
The Build button will build your application
-
You need to do this after every change if you want to run your code
-
(Actually, most times CMake will detect changes and compile again if needed. But sometimes it doesn't and then you're wondering why your changes don't work. It's also just a good habit to compile your stuff)
-
-
The bug button starts your code in a debugger
-
I recommend you to always start with the debugger. It adds additional checks to your code to find errors, which is very useful for beginners
-
-
The triangle button starts your code without debugger
-
-
Press Build and VSCode will ask you for a Kit at the top of your window
-
If you can already choose GCC, select it
-
Otherwise, run [Scan for kits] and accept to search in the suggested paths
-
Press Build again and chose GCC now
-
-
Your compiler is now set up
-
-
On Windows your
#include <iostream>may have a red line underneath it. In that case you need to setup IntelliSense-
Press the yellow alert symbol in the bottom part of your window
-
Select Use g++.exe in the top part of your window
-
-
Click on the bug button and let it run your code. VSCode will open the DEBUG CONSOLE and print a lot of stuff you don't need to know yet
-
Switch to TERMINAL
-
If you're on Debian it will show the output of your program followed by something like
[1] + Done "/usr/bin/gdb" ...Just ignore that -
If you're on Windows the output will be some garbage before your output
-
-
-
Go to File -> Preferences -> Settings and type
Cpp Standardinto the search bar-
Set Cpp Standard to
c++20or higher -
Set C Standard to
c17or higher
-
Congratulations. Your VSCode is now up and running. Good luck with your journey.
If you're following this guide and you're having trouble with something, please me know in the comments. I will expand this guide to cover your case.