Installation Windows10 - SkycoinWikis/CX GitHub Wiki

CX HOME » CX » GETTING STARTED » INSTALLATION WINDOWS10

Windows 10 Installation

You have got two options to install CX on Windows.

  1. Binary Releases - Fast and safe Installation
  2. Compiling from Source - better to customize your cx-options, also necessary for CX-Chains

Binary Releases

  1. Download the latest version of cx.exe from https://github.com/SkycoinProject/cx/releases

  2. Unzip into the destination folder you want to have your CX-files. For example: D:\Programs\CX

  3. Setup Environment Variables to get access to your cx.exe through the terminal:

    Press WIN + R, type in C:\Windows\System32\systempropertiesadvanced.exe and hit ENTER
    Search for Path in 'User variables for User', select it and press Edit.
    Make a new environment variable with the path, depending on your destination folder. Here D:\Programs\CX

  4. Check your installation like described here

  5. To update your CX-Installation just get the latest cx.exe and replace the old one.

Compiling from Source

  1. First make sure you have got GO installed and set up your Environment Variables. If not follow this instruction.

  2. We also need git to copy github repos. You can download it from https://git-scm.com/downloads.

  3. After the installation make a new Environment Variable like described in the next steps:

    3.1 Press WIN + R and type in C:\Windows\System32\systempropertiesadvanced.exe

    3.2 Make a new variable called CXPATH with the value:

    %USERPROFILE%\go\src\github.com\SkycoinProject\cx
    

    3.3 Make sure the Environment Variables from 1. are also set:

    GOPATH = %USERPROFILE%\go
    GOBIN  = %USERPROFILE%\go\bin
    
  4. Get the latest version of the github cx-repository

    4.1 Press WIN + R, type in cmd.exe and hit ENTER

    4.2 get github repo by typing in:

    mkdir -p %GOPATH%\src\github.com\SkycoinProject\
    cd %GOPATH%\src\github.com\SkycoinProject\
    git clone https://github.com/SkycoinProject/cx.git

    4.2 To install cx type in:

    cd %CXPATH%
    cx-setup.bat
  5. Check your installation by typing in:

    cd %CXPATH%
    cx tests\main.cx ++wdir=tests ++disable-tests=issue
  6. To update your CX-Installation just run cx-setup.bat again

Check Installation

  1. Open Terminal with WIN + R and type in cmd.exe

  2. Type in cx -v

  3. The output should look like this: CX version X.X.X (the X depends on the version you installed)

Hello, World!

To check our Installation with something more than a version output we will now make a cx-file to print out 'Hello World!'

  1. Make a new text-file in the location where your cx.exe is and rename it to hello-world.cx

  2. Open the file with Editor and type in the following:

    package main
    
    func main () {
         str.print("Hello, World!")
    }

    Ctrl + S and close

  3. Open Terminal with WIN + R and type in cmd.exe

  4. Move to the direction where your hello-world.cx is and type in cx hello-world.cx or just drag and drop your file into the terminal after typing in cx followed by a Space

Next Step

The next step should be to search for a tool / development environment that fits you to code as easy as possible. Have a look into Programming Tools to find your favorite Code Editor.

⚠️ **GitHub.com Fallback** ⚠️