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.
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.
Download MariaDB 10.7 installer (x64 MSI);
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.
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
Download the Visual Studio 2022 installer and open it.
Run the installer selecting the .Net Desktop development and Desktop development with C++ options.
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;
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;
Wait for the installation to complete. You will be prompted to restart your computer.
Build the Server project
Open Visual Studio 2022;
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.
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.
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 selectBuild
;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
Open the
Sapphire Launcher
source folder;Open the
SapphireBootWPF.sln
solution file;Right-click the Solution and select
Restore NuGet Packages
;Set your build target. The defaults are
Debug
andWin32
;Build the launcher;
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.
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:
Install development headers and tools:
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 -j
4
with your machine's thread count for faster compilation.
If you have successfully built all the projects required, you may proceed to configuring the server.
MacOS
Setup
You will need to install build and runtime dependencies before compiling.
Build
Locate and open the folder in which you cloned the Sapphire server through the terminal.
You can replace the command make -j
4
with your machine's thread count for faster compilation.
Starting the SQL server
It is recommended that you start up the MySQL server manually to configure the database.
If you have successfully built all the projects required, you may proceed to configuring the server.
Last updated