Installation

Building and installing Sapphire

We provide installation guides for multiple platforms.

Follow the guide to your platform as desired. Make sure you follow all the instructions as close as possible.

Windows

Windows Linux Subsystem (WSL)

If you are using WSL:

Sapphire will also operate correctly (save for unforeseen issues) within the WSL and is actively tested in this environment.

While setup will not be covered in this guide, please note that it does work and you may prefer to use this environment for development over the standard Windows development environment. You can refer to the Linux Installation Guide as the steps are the same regardless of where your Linux installation is hosted.

CLion may be used as a substitute over Visual Studio, as it has a very stable integration for WSL which may be preferable.

Prerequisites

  • Visual Studio 2022 (Older versions may not work);

  • MariaDB 10.3 to 10.7 (64-Bit) (Recommended);

    • Alternatively, Oracle MySQL 5.7 will also work, however MariaDB is hugely preferred over it.

  • Git or a graphical Git client like GitKraken;

  • Sapphire source code, as obtained via git clone (see Overview);

  • Sapphire Launcher source code (optional);

  • MySQL client (optional) ie. HeidiSQL (included with MariaDB);

Setup Development Environment

Install MySQL 5.7 or MariaDB

We really recommend to install MariaDB (64-Bit) and avoid the hassle that is Oracle MySQL's awful installer and hidden packages.

  1. Download MariaDB 10.7 installer (x64 MSI);

  2. Proceed through installation. Make sure you note down any settings you change;

    • If you only need development headers and libraries, you can deselect everything else;

      NOTE: The architecture matters! Please install 64-bit Database Server, and compile Sapphire for x64. 32-bit support has been dropped.

  3. Wait for the installation to complete.

    • If you installed a server, you will be guided through setup.

    • If you only installed development headers and libraries, you can cancel out of product configuration.

Installing Visual Studio 2022 with C++ and C# support

  1. Download the Visual Studio 2022 installer and open it.

  2. Run the installer selecting the .Net Desktop development and Desktop development with C++ options.

  3. Make sure you have the latest version of VS2022 and the MSVC v143 - VS 2022 C++ x64/x86 build tools package on the right. It should be selected by default;

  4. Switch to Individual components. You'll need to also select NuGet for installation. Select any additional features as needed. You can always add them later;

  5. Wait for the installation to complete. You will be prompted to restart your computer. ​

Build the Server project

  1. Open Visual Studio 2022;

  2. Using the "Open Folder" file option, browse to the Sapphire source code folder. The project should open and CMake will begin generating a cache automatically;

If you're using CMake externally, open the generated SLN file instead.

  1. If a CMake cache was not generated, select a Build Configuration.

    • Your MySQL installation will need to match your Build Configuruation. (Make sure you install 64 bit versions.)

You may change the desired build output folder by editing the CMakeSettings.json file in the project folder.

  1. Build the solution. Depending on how your Visual Studio is configured, you can build by: Build menu > Build All Right-click the CMakeLists.txt file and select Build;

  2. Files will be generated according to the buildRoot path specified in your CMakeSettings.json file. By default this is %userprofile%\CMakeBuild{hash}\build{build configuration}. The full path assuming a default installation of Windows 7 or later is C:\Users\[your username here]\CMakeBuild.

Build the Launcher project

  1. Open the Sapphire Launcher source folder;

  2. Open the SapphireBootWPF.sln solution file;

  3. Right-click the Solution and select Restore NuGet Packages;

  4. Set your build target. The defaults are Debug and Win32;

  5. Build the launcher;

  6. You can find the launcher executable files in Sapphire launcher\bin[x86/x64]\[Debug/Release] accordingly.

If you have successfully built all the projects required, you may proceed to configuring the server.

pageConfiguring

Linux

We currently do not provide a Linux version of our Sapphire launcher.

Setup

You will need to install build and runtime dependencies before compiling, please see below for your specific distribution.

Care must be taken when considering versioning for libraries, especially in rolling release distros such as Arch Linux.

Make sure you're targeting the correct version.

If you don't already have a development environment setup, run the following:

$ apt install -y build-essential

Install development headers and tools:

$ apt install cmake git libmariadb-dev zlib1g-dev

After installing all dependencies, you can proceed building.

Build

Locate and open the folder in which you cloned the Sapphire server through the terminal.

You can replace the command make -j4 with your machine's thread count for faster compilation.

$ mkdir build && cd build
$ cmake ..
$ make -j 4

If you have successfully built all the projects required, you may proceed to configuring the server.

pageConfiguring

MacOS

Setup

You will need to install build and runtime dependencies before compiling.

$ brew install cmake git mysql zlib

Build

Locate and open the folder in which you cloned the Sapphire server through the terminal.

You can replace the command make -j4 with your machine's thread count for faster compilation.

$ mkdir build && cd build
$ cmake .. -DCMAKE_CXX_COMPILER=/usr/bin/clang++
$ make -j 4

Starting the SQL server

It is recommended that you start up the MySQL server manually to configure the database.

$ mysql.server start
$ mysql_secure_installation
$ mysql.server stop

$ brew services start mysql

If you have successfully built all the projects required, you may proceed to configuring the server.

pageConfiguring

Last updated