# \[Windows]\[VC2022]\[Solution] Compiling Canary Launcher Sources

## **1 - Requirement:**

* Create a github repository with your launcher files.

## **2 - Downloads Required:**

* **Visual Studio 2022 Community:** <https://visualstudio.microsoft.com/pt-br/thank-you-downloading-visual-studio/?sku=Community&rel=17>
* **.NET 6.0:** <https://dotnet.microsoft.com/en-us/download/dotnet/6.0>
* **Git:** <https://git-scm.com/download/win>

## 3 - Visual Studio 2022:

* On the Visual Studio home screen, in the Visual Studio Community 2022 product click the Install button.
* On the next screen under Workloads select Desktop Development with .NET.
* Then in Language Packs, select English.[ ](https://forums.otserv.com.br/index.php?/forums/topic/170157-windowsvc2022-compilando-sources-otservbr-global/)

## 4 - **Install the necessary software:**

* Install .NET 6.0.
* Install Git.

## 5 - Canary Launcher Sources:

* Download **Canary** **Launcher** sources with the command below in **Powershell:**

{% hint style="info" %}
cd C:\\

git clone --recursive <https://github.com/opentibiabr/canary-launcher.git>
{% endhint %}

## 6 - Editing Canary Launcher:

* Open **src/MainWindow\.xaml.cs** and find for:

<pre><code><strong>"https://raw.githubusercontent.com/opentibiabr/canary-launcher/main/launcher_config.json"
</strong></code></pre>

* Then Change for your **launcher\_config.json** github repository link.
* Open **src/SplashScreen.xaml.cs** and find for:

```
"https://raw.githubusercontent.com/opentibiabr/canary-launcher/main/launcher_config.json"
```

* Then Change for your **launcher\_config.json** github repository link.

## 7 - Compiling Canary Launcher:

* Open CanaryLauncherUpdate.csproj on Visual Studio 2022, select Release in the drop down menu then go to the menu Build > Build Solution.

## 8 - Configuring Canary Launcher:

* Go to the Releases category of your launcher github repository.
* Create a release for your launcher and upload the client zip in the attachments.
* Check if your client files is a zip like the example below:
* ![](https://1381914140-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzV9t92sKcMkphxwdvwZs%2Fuploads%2FQVQp80wHcHBmuFRtojz1%2Fcanary_launcher.png?alt=media\&token=671f7801-bc28-461a-a422-1be2d123e7e4)&#x20;
* Open **launcher\_config.json** and configure the options like the example below:

```
/**
• JSON configuration file for the Client Updater
• version The version of the client, represented as "major.minor.patch".
• replaceFolders Whether the updater should replace the client's current folders
• folders An array of objects representing the client's folders, each object has the key "name"
• clientFolder The name of the main client folder, represented as "Tibia"
NOTE: Set it to "false" or only "" to not use the client folder, so everything will be added to the main folder
• newClientUrl The URL where the new client version can be downloaded from
• executable The path to the client's executable file, represented as "bin/client.exe"
*/
{
	"clientVersion": "13.20.13560",
	"launcherVersion": "1.0",
	"replaceFolders": true,
	"replaceFolderName": [
		{
			"name": "assets"
		},
		{
			"name": "storeimages"
		},
		{
			"name": "bin"
		}
	],
	"clientFolder": "Tibia",
	"newClientUrl" : "https://github.com/opentibiabr/canary-launcher/releases/download/1.0.0/client-to-update.zip",
	"clientExecutable": "client.exe"
}
```

* Then your launcher is ready and you can use to download the client.

## 9 - How to Update:

* Update the launcher\_config.json in your repository with your new client version, example:
* ```
  "clientVersion": "13.21.13831",
  ```
* Commit the change in your repository.
* Upload the changes to a new release (if it is a new release, you need to update the link in the json. Or use the existing zip.
* Your Canary Launcher will automatically download the new release on the next run.

## 10 - Credits:

* **Majesty**
