# **How To Install CS50 VSCode IDE Offline?** :::warning ## **Tools You'll Need** ### 1. Docker Desktop > you can download it from this link [click here](https://desktop.docker.com/win/main/amd64/Docker%20Desktop%20Installer.exe) ### 2. VS Code desktop > you can download it from this link [click here](https://www.python.org/ftp/python/3.10.6/python-3.10.6-amd64.exe) ### 3. wsl installation > you can download it from this link [click here](https://www.microsoft.com/store/apps/9n6svws3rx71) ### 4. download devcontainer.json > you can download it from this link [click here](https://drive.google.com/drive/folders/13h4KtZD81gwyMjPl8yneMElGJcHjCLaA?usp=sharing) ::: <!-- https://docs.microsoft.com/windows/wsl/wsl2-kernel --> :::info # **Let's Start Installing** ## **First:** * Install docker * Install vs code * download .devcontainer.json file ## **Second:** ### To install wsl follow these steps: #### Open command prompt as adminstrator and copy & paste these commands: **2. ```wsl --install```** <br> **3. ```dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart```** <br> **4. ```dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart```** ## **Third** ### wsl update kernel > download this file and install it [click here](https://wslstorestorage.blob.core.windows.net/wslblob/wsl_update_x64.msi) ::: :::success ## **Finally** * put the .devcontainer.json file in a folder on desktop called cs50ide (make sure the file name starts with dot ```.```) * open the folder in vscode ![](https://i.imgur.com/1oiOlhK.png) * go to extentsions and type ```remote container``` in the search feild then install it (reload the window if required by exiting from the vs code then re-open it) ![](https://i.imgur.com/sVy5nbk.png) * press ```ctrl shift p``` in vscode window * write ```Remote-Containers: Install devcontainer CLI``` in the feild that will show after pressing ```ctrl shift p``` ![](https://i.imgur.com/VyiuyBs.png) * click add then ok * re-press ```ctrl shift p``` and type ```Remote-Containers: open folder in container``` then choose the folder that has the .devcontainer file which we called it ```cs50ide``` * it will start downloading and this download will take a long time because it's downloading the structure of the container. * after the download complete, congarts you finally have the vscode for cs50 offline. ### ::: :::danger # **NOTE: IF YOUR COMPUTER IS WEAK AND DOES NOT HAS A GOOD HARDWARE DO NOT EVER NEVER TRY TO DOWNLOAD THE CONTAINER BECAUSE YOUR COMPUTER WILL BLOW UP!!** ::: :::info ::: ## Another way to download cs50 ide library locally (offline) without container: :::warning ## Steps: * install codeblocks from here: >> if you have 64-bit system [click here](https://www.fosshub.com/Code-Blocks.html?dwl=codeblocks-20.03-setup.exe) >> if you have 32 bit system [click here](https://www.fosshub.com/Code-Blocks.html?dwl=codeblocks-20.03-32bit-mingw-32bit-setup.exe) * after you install it go to the folder where you download it... you can find it in: for 64 bit```C:\Program Files\codeblocks``` for 32 bit ```C:\Program Files (x86)\codeblocks``` * enter to the folder you will find many files and two folders(maybe..). enter to the ```MinGW``` then enter to bin. * press here and copy the path like the photo below: ![](https://i.imgur.com/t9LBgUe.png) * from the taskbar click on the search button and type ```envirmonment variables``` then click on the shown in the image below: ![](https://i.imgur.com/Hsvl3qY.png) * double click on path and press on add button then paste the path that you had copied it. then press ok (don't forget to press ok it's important to save the path). * open codeblocks and create a new project with c language, after click on create new project button selesct console application and press ok. * install cs50 library from [here](https://github.com/cs50/libcs50/archive/refs/tags/v11.0.1.zip) * you should have a github account to download it. * un compress the file and go to the ```src``` folder * copy the files inside this folder then paste it inside the folder of the project that you have created. * type ```#include "cs50.c"``` use "" not <> becaues it's different from the onw in the vs code codespace. and don't forget to type ```cs50.c``` not ```cs50 .h``` * congarts you have finished type a c code as you like :::