Skip to content

Installation

Installation

  1. Import Cobra Logging into your Unity project -> Link
  2. Import Cobra Updater into your Unity project.

Server Installation

This sections explains how to setup the server.

Prerequisites

Before starting, ensure you have Docker installed on your server. If Docker is not installed on your server, please follow the Docker Installation Guide. You can also opt out of using docker by simply building the solution and running the ByteCobra.Updater.Server.exe file to start the server, but it is not recommended.

Docker

  • Unzip the zip file Byte Cobra/Updater/Server.zip that came with the Unity package.
  • In the unzipped folder there should be a file called Admins.json, open it, set your admin credentials and save it. You can add more than one admin.
  • Open a CMD window or terminal in the unzipped folder, where the docker-compose.yml file is located.
  • Make sure that Docker is running, and run the following command to start the server in a container: docker-compose -p bytecobra up -d --build.
  • This will build the server project and start it in a docker container. It should create a new folder ./Uploads, this is where all the uploaded game files will be stored.
  • You should be able to see the running container in the Docker Desktop containers tab, or with the docker ps command.

Non-Docker

  • Unzip the zip file Byte Cobra/Updater/Server.zip that came with the Unity package.
  • In the unzipped folder there should be a file called Admins.json, open it and set your admin credentials and save it. You can add more than one admin.
  • Open the ByteCobra.Updater.sln file in your IDE (e.g. Visual Studio) and rebuild the solution in Debug mode.
  • Now you should have an exectuable file in ByteCobra.Updater\ByteCobra.Updater.Server\bin\Debug\net8.0\ called ByteCobra.Updater.Server.exe.
  • Run the executable ByteCobra.Updater.Server.exe to start the server.
  • All the uploaded game files will be stored in the ./Uploads directory.

Verify

You can verify that the server is running by going to http://localhost:21302/. It should show you the Swagger documentation.

Editor Setup

Once your server is ready, configure Cobra Updater within your editor.

  1. Open Cobra Updater: Go to Tools -> Byte Cobra -> Cobra Updater.
  2. Access Settings: Select 'Settings' from the top dropdown menu.
  3. Server URL: Input your server's URL, e.g. http://localhost:21302/ or your domain if you use one.
  4. Credentials: Enter your login credentials.
  5. Application Name: Specify the name of your game or application.

Uploading Versions

Prepare and upload new versions of your game or application.

  1. Open Build Settings: Choose File -> Build Settings from the top menu.
  2. Scene and Platform: Add at least one scene and select the Windows platform.
  3. Configure Settings: Tailor the Build Settings for your project, then close the window.
  4. Build & Publish: Open the Cobra Updater menu in Tools > Byte Cobra > Cobra Updater and go to the 'Build & Publish' section via the dropdown menu.
  5. Version Input: Specify the version for your game.
  6. Build & Upload: Click 'Build & Upload' to process and upload to your server.
  7. Wait: Please wait a couple of minutes (don't close the Unity editor) until it completely finishes uploading. This might take some time depending on your games size.
  8. Confirmation: Check the console to ensure successful upload.

Publishing Versions

Decide which version your players will access through the launcher.

  1. Choose Version: Input the version number to be published, like 1.0.
  2. Publish: Click the 'Publish' button.
  3. Verify: Confirm successful publication in the console window.

Launcher Setup

Developing a launcher is an essential step in providing a seamless start to your game or application. You have the flexibility to build this launcher either in Unity or using any C# project compatible with .NET Standard 2.1 or higher. This opens up possibilities to use frameworks like WPF, Xamarin, or .NET MAUI for a customized experience. Follow these guidelines for an effective and streamlined launcher setup:

Unity Launcher

  1. Create a New Launcher Scene: Start by creating a new scene in Unity (File -> New Scene) and name it, e.g. 'Launcher'.
  2. Add the Updater Prefab: Locate the 'Updater' prefab in Assets/Byte Cobra/Updater/Prefabs folder and add it to the Launcher scene. This prefab manages the update process.
  3. Configure the Updater: In the scene, select the Updater object and customize its components in the Inspector window. Swap components with custom ones as needed, referring to the class description or tutorial sections for guidance.
  4. Test the Setup: Test the scene in Unity to ensure the Updater initializes and connects to the server correctly. Address any errors or issues.
  5. Build the Launcher Scene: Add the Launcher scene to your game's build settings (File -> Build Settings) after setup completion.
  6. Upload & Publish: Distribute your launcher on your preferred platform, such as Steam or Itch.io. When players download it, they will automatically get the latest version of your game, without you having to re-publish the game on the platform.

Custom Launcher

For a custom launcher (C# non-Unity), extract the Server.zip file and utilize its source code. Check the ByteCobra.Updater.Console example for a C# console application launcher. You can develop custom launchers using any .NET Standard 2.1 compatible framework, including WPF and .NET MAUI.

Remember, the Launcher is your users' first interaction point. It should be user-friendly and clearly communicate the update process and necessary user actions.