2020-08-10 06:58:51 +02:00
|
|
|
|
using System;
|
2020-08-11 20:24:04 +02:00
|
|
|
|
using System.Collections.Generic;
|
2020-08-10 06:58:51 +02:00
|
|
|
|
using System.ComponentModel;
|
|
|
|
|
using System.Diagnostics;
|
|
|
|
|
using System.IO;
|
|
|
|
|
using System.Media;
|
|
|
|
|
using System.Net;
|
2020-08-11 10:29:45 +02:00
|
|
|
|
using System.Net.Http;
|
|
|
|
|
using System.Threading.Tasks;
|
2020-08-10 06:58:51 +02:00
|
|
|
|
using System.Windows.Forms;
|
2020-08-11 10:29:45 +02:00
|
|
|
|
using Giants.WebApi.Clients;
|
2020-08-10 06:58:51 +02:00
|
|
|
|
using Microsoft.Win32;
|
|
|
|
|
|
|
|
|
|
namespace Giants.Launcher
|
|
|
|
|
{
|
|
|
|
|
public partial class LauncherForm : Form
|
|
|
|
|
{
|
|
|
|
|
// Constant settings
|
2020-08-16 11:52:58 +02:00
|
|
|
|
private const string GamePath = "GiantsMain.exe";
|
|
|
|
|
private const string RegistryKey = @"HKEY_CURRENT_USER\Software\PlanetMoon\Giants";
|
|
|
|
|
private const string RegistryValue = "DestDir";
|
|
|
|
|
|
|
|
|
|
private readonly HttpClient httpClient;
|
2022-09-09 07:31:24 +02:00
|
|
|
|
private readonly BranchesClient branchHttpClient;
|
|
|
|
|
private readonly VersionClient versionHttpClient;
|
2020-08-16 12:08:49 +02:00
|
|
|
|
private readonly CommunityClient communityHttpClient;
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
2020-09-14 09:11:32 +02:00
|
|
|
|
private string commandLine;
|
2020-08-11 10:29:45 +02:00
|
|
|
|
private string gamePath = null;
|
|
|
|
|
private Updater updater;
|
2022-09-09 07:31:24 +02:00
|
|
|
|
private readonly Config config;
|
|
|
|
|
private string branchName;
|
2020-08-16 12:08:49 +02:00
|
|
|
|
private string communityAppUri;
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
|
|
|
|
public LauncherForm()
|
|
|
|
|
{
|
2020-08-11 10:55:57 +02:00
|
|
|
|
this.InitializeComponent();
|
2020-08-16 12:08:49 +02:00
|
|
|
|
this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
|
|
|
|
|
this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
2020-08-11 10:29:45 +02:00
|
|
|
|
// Set window title
|
2022-09-05 05:29:59 +02:00
|
|
|
|
this.SetTitle();
|
2020-08-16 11:52:58 +02:00
|
|
|
|
|
2022-09-10 04:07:40 +02:00
|
|
|
|
this.updater = new Updater(
|
|
|
|
|
updateCompletedCallback: this.LauncherForm_DownloadCompletedCallback,
|
|
|
|
|
updateProgressCallback: this.LauncherForm_DownloadProgressCallback);
|
|
|
|
|
|
|
|
|
|
// Read newer file-based game settings
|
|
|
|
|
this.config = new Config();
|
2020-09-14 09:11:32 +02:00
|
|
|
|
this.config.Read();
|
|
|
|
|
|
2022-09-09 07:31:24 +02:00
|
|
|
|
this.config.TryGetString(ConfigSections.Network, ConfigKeys.MasterServerHostName, ConfigDefaults.MasterServerHostNameDefault, out string baseUrl);
|
|
|
|
|
this.config.TryGetString(ConfigSections.Update, ConfigKeys.BranchName, defaultValue: ConfigDefaults.BranchNameDefault, out string branchName);
|
2020-09-14 09:11:32 +02:00
|
|
|
|
|
2022-09-09 07:31:24 +02:00
|
|
|
|
this.branchName = branchName;
|
|
|
|
|
|
|
|
|
|
this.httpClient = new HttpClient(
|
2020-09-11 07:50:39 +02:00
|
|
|
|
new HttpClientHandler()
|
|
|
|
|
{
|
|
|
|
|
UseProxy = false
|
|
|
|
|
});
|
2022-09-09 07:31:24 +02:00
|
|
|
|
this.branchHttpClient = new BranchesClient(this.httpClient)
|
|
|
|
|
{
|
|
|
|
|
BaseUrl = baseUrl,
|
|
|
|
|
|
|
|
|
|
};
|
2020-09-11 07:50:39 +02:00
|
|
|
|
this.versionHttpClient = new VersionClient(this.httpClient)
|
|
|
|
|
{
|
2020-09-14 09:11:32 +02:00
|
|
|
|
BaseUrl = baseUrl
|
|
|
|
|
};
|
2020-09-11 07:50:39 +02:00
|
|
|
|
this.communityHttpClient = new CommunityClient(this.httpClient)
|
|
|
|
|
{
|
2020-09-14 09:11:32 +02:00
|
|
|
|
BaseUrl = baseUrl
|
|
|
|
|
};
|
2020-09-11 07:50:39 +02:00
|
|
|
|
}
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
|
|
|
|
private void btnExit_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
2022-09-10 04:07:40 +02:00
|
|
|
|
this.config.Write();
|
2020-08-10 06:58:51 +02:00
|
|
|
|
Application.Exit();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void btnPlay_Click(object sender, EventArgs e)
|
|
|
|
|
{
|
|
|
|
|
GameSettings.Save();
|
2022-09-10 04:07:40 +02:00
|
|
|
|
this.config.Write();
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
|
|
|
|
foreach (string c in Environment.GetCommandLineArgs())
|
2020-08-11 10:29:45 +02:00
|
|
|
|
{
|
|
|
|
|
this.commandLine = this.commandLine + c + " ";
|
|
|
|
|
}
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
2020-08-11 10:29:45 +02:00
|
|
|
|
string commandLine = string.Format("{0} -launcher", this.commandLine.Trim());
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
Process gameProcess = new Process();
|
|
|
|
|
|
|
|
|
|
gameProcess.StartInfo.Arguments = commandLine;
|
2020-08-11 10:29:45 +02:00
|
|
|
|
gameProcess.StartInfo.FileName = this.gamePath;
|
|
|
|
|
gameProcess.StartInfo.WorkingDirectory = Path.GetDirectoryName(this.gamePath);
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
|
|
|
|
gameProcess.Start();
|
|
|
|
|
Application.Exit();
|
|
|
|
|
}
|
2022-09-10 04:07:40 +02:00
|
|
|
|
catch (Exception ex)
|
2020-08-10 06:58:51 +02:00
|
|
|
|
{
|
2020-08-11 10:29:45 +02:00
|
|
|
|
MessageBox.Show(string.Format("Failed to launch game process at: {0}. {1}", this.gamePath, ex.Message),
|
2020-08-10 06:58:51 +02:00
|
|
|
|
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-10 04:07:40 +02:00
|
|
|
|
private async void btnOptions_Click(object sender, EventArgs e)
|
2020-08-10 06:58:51 +02:00
|
|
|
|
{
|
2022-09-10 04:07:40 +02:00
|
|
|
|
OptionsForm form = new OptionsForm(
|
2022-09-09 07:31:24 +02:00
|
|
|
|
title: Resources.AppName + " Options",
|
|
|
|
|
gamePath: this.gamePath,
|
|
|
|
|
appName: ApplicationNames.Giants,
|
2022-09-10 04:07:40 +02:00
|
|
|
|
currentBranchName: this.branchName,
|
2022-09-09 07:31:24 +02:00
|
|
|
|
config: this.config,
|
2022-09-10 04:07:40 +02:00
|
|
|
|
branchesClient: this.branchHttpClient)
|
|
|
|
|
{
|
|
|
|
|
StartPosition = FormStartPosition.CenterParent
|
|
|
|
|
};
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
|
|
|
|
form.ShowDialog();
|
2022-09-10 04:07:40 +02:00
|
|
|
|
|
|
|
|
|
this.config.TryGetBool(ConfigSections.Update, ConfigKeys.EnableBranchSelection, defaultValue: false, out bool enableBranchSelection);
|
|
|
|
|
if (enableBranchSelection)
|
|
|
|
|
{
|
|
|
|
|
this.config.TryGetString(ConfigSections.Update, ConfigKeys.BranchName, defaultValue: ConfigDefaults.BranchNameDefault, out string branchName);
|
|
|
|
|
|
|
|
|
|
if (!this.branchName.Equals(branchName))
|
|
|
|
|
{
|
|
|
|
|
this.branchName = branchName;
|
|
|
|
|
|
|
|
|
|
VersionInfo gameVersionInfo = await this.GetVersionInfo(
|
|
|
|
|
GetApplicationName(ApplicationType.Game), this.branchName);
|
|
|
|
|
|
|
|
|
|
this.btnPlay.Enabled = false;
|
|
|
|
|
await this.updater.UpdateApplication(ApplicationType.Game, gameVersionInfo);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-08-10 06:58:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
2020-08-11 10:29:45 +02:00
|
|
|
|
private async void LauncherForm_Load(object sender, EventArgs e)
|
2020-08-10 06:58:51 +02:00
|
|
|
|
{
|
|
|
|
|
// Find the game executable, first looking for it relative to our current directory and then
|
|
|
|
|
// using the registry path if that fails.
|
2020-08-16 11:52:58 +02:00
|
|
|
|
this.gamePath = Path.GetDirectoryName(Application.ExecutablePath) + "\\" + GamePath;
|
2020-08-11 10:29:45 +02:00
|
|
|
|
if (!File.Exists(this.gamePath))
|
2020-08-10 06:58:51 +02:00
|
|
|
|
{
|
2020-08-16 11:52:58 +02:00
|
|
|
|
this.gamePath = (string)Registry.GetValue(RegistryKey, RegistryValue, null);
|
2020-08-11 10:29:45 +02:00
|
|
|
|
if (this.gamePath != null)
|
2020-08-16 11:52:58 +02:00
|
|
|
|
this.gamePath = Path.Combine(this.gamePath, GamePath);
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
2020-08-11 10:29:45 +02:00
|
|
|
|
if (this.gamePath == null || !File.Exists(this.gamePath))
|
2020-08-10 06:58:51 +02:00
|
|
|
|
{
|
2022-09-05 05:29:59 +02:00
|
|
|
|
string message = string.Format(Resources.AppNotFound, Resources.AppName);
|
2020-08-10 06:58:51 +02:00
|
|
|
|
MessageBox.Show(message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
Application.Exit();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// Read game settings from registry
|
2020-08-11 10:29:45 +02:00
|
|
|
|
GameSettings.Load(this.gamePath);
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
2020-08-13 08:02:36 +02:00
|
|
|
|
if (GameSettings.Get<int>("NoAutoUpdate") == 0)
|
2022-09-10 04:07:40 +02:00
|
|
|
|
{
|
|
|
|
|
Task updateTask = this.CheckForUpdates();
|
|
|
|
|
Task discordTask = this.UpdateDiscordStatus();
|
2020-08-16 11:52:58 +02:00
|
|
|
|
|
2022-09-10 04:07:40 +02:00
|
|
|
|
await Task.WhenAll(updateTask, discordTask);
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-08-16 11:52:58 +02:00
|
|
|
|
|
2022-09-10 04:07:40 +02:00
|
|
|
|
private async Task UpdateDiscordStatus()
|
2020-08-16 11:52:58 +02:00
|
|
|
|
{
|
|
|
|
|
try
|
2020-08-10 06:58:51 +02:00
|
|
|
|
{
|
2020-08-16 12:08:49 +02:00
|
|
|
|
var status = await this.communityHttpClient.GetDiscordStatusAsync();
|
2020-08-16 11:52:58 +02:00
|
|
|
|
|
2020-08-16 12:08:49 +02:00
|
|
|
|
this.communityAppUri = status.CommunityAppUri;
|
|
|
|
|
this.CommunityLabel.Text = string.Format(Resources.CommunityLabel, status.CommunityAppName);
|
|
|
|
|
this.CommunityLabel.Visible = true;
|
2020-08-16 11:52:58 +02:00
|
|
|
|
}
|
|
|
|
|
catch (Exception)
|
|
|
|
|
{
|
|
|
|
|
// Ignore
|
|
|
|
|
}
|
|
|
|
|
}
|
2020-08-11 20:24:04 +02:00
|
|
|
|
|
2022-09-10 04:07:40 +02:00
|
|
|
|
private async Task CheckForUpdates()
|
2020-08-16 11:52:58 +02:00
|
|
|
|
{
|
2022-09-10 04:07:40 +02:00
|
|
|
|
Task<VersionInfo> gameVersionInfo = this.GetVersionInfo(
|
|
|
|
|
GetApplicationName(ApplicationType.Game), this.branchName);
|
|
|
|
|
|
|
|
|
|
Task<VersionInfo> launcherVersionInfo = this.GetVersionInfo(
|
|
|
|
|
GetApplicationName(ApplicationType.Launcher), this.branchName);
|
|
|
|
|
|
|
|
|
|
Version localGameVersion = VersionHelper.GetGameVersion(this.gamePath);
|
|
|
|
|
Version localLauncherVersion = VersionHelper.GetLauncherVersion();
|
2020-08-11 10:29:45 +02:00
|
|
|
|
|
2022-09-10 04:07:40 +02:00
|
|
|
|
await Task.WhenAll(gameVersionInfo, launcherVersionInfo);
|
2020-10-18 08:44:41 +02:00
|
|
|
|
|
2022-09-10 04:07:40 +02:00
|
|
|
|
if (this.updater.IsUpdateRequired(ApplicationType.Game, gameVersionInfo.Result, localGameVersion))
|
2020-10-18 08:44:41 +02:00
|
|
|
|
{
|
|
|
|
|
this.btnPlay.Enabled = false;
|
2022-09-10 04:07:40 +02:00
|
|
|
|
await this.updater.UpdateApplication(ApplicationType.Game, gameVersionInfo.Result);
|
2020-10-18 08:44:41 +02:00
|
|
|
|
}
|
2022-09-10 04:07:40 +02:00
|
|
|
|
|
|
|
|
|
if (this.updater.IsUpdateRequired(ApplicationType.Launcher, launcherVersionInfo.Result, localLauncherVersion))
|
|
|
|
|
{
|
|
|
|
|
this.btnPlay.Enabled = false;
|
|
|
|
|
await this.updater.UpdateApplication(ApplicationType.Launcher, launcherVersionInfo.Result);
|
|
|
|
|
}
|
2020-08-10 06:58:51 +02:00
|
|
|
|
}
|
|
|
|
|
|
2020-11-04 04:49:04 +01:00
|
|
|
|
private static string GetApplicationName(ApplicationType applicationType)
|
|
|
|
|
{
|
|
|
|
|
switch (applicationType)
|
|
|
|
|
{
|
|
|
|
|
case ApplicationType.Game:
|
|
|
|
|
return ApplicationNames.Giants;
|
2022-09-10 04:07:40 +02:00
|
|
|
|
case ApplicationType.Launcher:
|
|
|
|
|
return ApplicationNames.GiantsLauncher;
|
2020-11-04 04:49:04 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-10 04:07:40 +02:00
|
|
|
|
throw new ArgumentOutOfRangeException();
|
2020-11-04 04:49:04 +01:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-10 04:07:40 +02:00
|
|
|
|
private async Task<VersionInfo> GetVersionInfo(string appName, string branchName)
|
2020-08-11 10:29:45 +02:00
|
|
|
|
{
|
|
|
|
|
VersionInfo versionInfo;
|
|
|
|
|
try
|
|
|
|
|
{
|
2022-09-10 04:07:40 +02:00
|
|
|
|
versionInfo = await this.versionHttpClient.GetVersionInfoAsync(appName, branchName);
|
2020-08-11 10:29:45 +02:00
|
|
|
|
return versionInfo;
|
|
|
|
|
}
|
|
|
|
|
catch (ApiException ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show($"Exception retrieving version information: {ex.StatusCode}");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
catch (Exception ex)
|
|
|
|
|
{
|
|
|
|
|
MessageBox.Show($"Exception retrieving version information: {ex.Message}");
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-09 07:31:24 +02:00
|
|
|
|
private void LauncherForm_MouseDown(object sender, MouseEventArgs e)
|
2020-08-10 06:58:51 +02:00
|
|
|
|
{
|
|
|
|
|
// Force window to be draggable even though we have no menu bar
|
|
|
|
|
if (e.Button == MouseButtons.Left)
|
|
|
|
|
{
|
|
|
|
|
NativeMethods.ReleaseCapture();
|
2020-08-10 09:22:33 +02:00
|
|
|
|
NativeMethods.SendMessage(this.Handle, NativeMethods.WM_NCLBUTTONDOWN, NativeMethods.HT_CAPTION, 0);
|
2020-08-10 06:58:51 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LauncherForm_Shown(object sender, EventArgs e)
|
|
|
|
|
{
|
2020-08-10 09:22:33 +02:00
|
|
|
|
this.btnOptions.Visible = true;
|
|
|
|
|
this.btnPlay.Visible = true;
|
|
|
|
|
this.btnExit.Visible = true;
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
|
|
|
|
// Play intro sound
|
|
|
|
|
SoundPlayer player = new SoundPlayer(Resources.LauncherStart);
|
|
|
|
|
player.Play();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LauncherForm_DownloadCompletedCallback(object sender, AsyncCompletedEventArgs e)
|
|
|
|
|
{
|
2020-10-18 08:44:41 +02:00
|
|
|
|
this.btnPlay.Enabled = true;
|
|
|
|
|
|
2020-08-10 06:58:51 +02:00
|
|
|
|
if (e.Cancelled)
|
2020-08-11 10:29:45 +02:00
|
|
|
|
{
|
2020-08-10 06:58:51 +02:00
|
|
|
|
return;
|
2020-08-11 10:29:45 +02:00
|
|
|
|
}
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
2020-08-10 09:22:33 +02:00
|
|
|
|
this.updateProgressBar.Value = 0;
|
|
|
|
|
this.updateProgressBar.Visible = false;
|
|
|
|
|
this.txtProgress.Visible = false;
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
|
|
|
|
if (e.Error != null)
|
|
|
|
|
{
|
|
|
|
|
string errorMsg = string.Format(Resources.UpdateDownloadFailedText, e.Error.Message);
|
|
|
|
|
MessageBox.Show(errorMsg, Resources.UpdateDownloadFailedTitle, MessageBoxButtons.OK, MessageBoxIcon.Error);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
// Show "Download Complete" message, warn that we're closing
|
|
|
|
|
MessageBox.Show(Resources.LauncherClosingText, Resources.LauncherClosingTitle);
|
|
|
|
|
|
|
|
|
|
UpdateInfo updateInfo = (UpdateInfo)e.UserState;
|
|
|
|
|
|
|
|
|
|
// Start the installer process
|
|
|
|
|
Process updaterProcess = new Process();
|
2020-08-11 10:29:45 +02:00
|
|
|
|
updaterProcess.StartInfo.FileName = updateInfo.FilePath;
|
2020-08-10 06:58:51 +02:00
|
|
|
|
updaterProcess.StartInfo.WorkingDirectory = Directory.GetCurrentDirectory();
|
|
|
|
|
|
2020-08-11 10:29:45 +02:00
|
|
|
|
if (updateInfo.ApplicationType == ApplicationType.Game)
|
2020-08-10 06:58:51 +02:00
|
|
|
|
{
|
|
|
|
|
// Default installation directory to current directory
|
|
|
|
|
updaterProcess.StartInfo.Arguments = string.Format("/D {0}", Path.GetDirectoryName(Application.ExecutablePath));
|
|
|
|
|
}
|
2020-08-11 10:29:45 +02:00
|
|
|
|
else if (updateInfo.ApplicationType == ApplicationType.Launcher)
|
2020-08-10 06:58:51 +02:00
|
|
|
|
{
|
|
|
|
|
// Default installation directory to current directory and launch a silent install
|
|
|
|
|
updaterProcess.StartInfo.Arguments = string.Format("/S /D {0}", Path.GetDirectoryName(Application.ExecutablePath));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
updaterProcess.Start();
|
|
|
|
|
|
2022-09-10 04:07:40 +02:00
|
|
|
|
this.config.TryGetBool(ConfigSections.Update, ConfigKeys.EnableBranchSelection, defaultValue: false, out bool enableBranchSelection);
|
|
|
|
|
if (enableBranchSelection)
|
|
|
|
|
{
|
|
|
|
|
this.config.SetValue(ConfigSections.Update, ConfigKeys.BranchName, this.branchName);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
this.config.Write();
|
|
|
|
|
|
2020-08-10 06:58:51 +02:00
|
|
|
|
Application.Exit();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void LauncherForm_DownloadProgressCallback(object sender, DownloadProgressChangedEventArgs e)
|
|
|
|
|
{
|
2020-08-10 09:22:33 +02:00
|
|
|
|
this.updateProgressBar.Visible = true;
|
|
|
|
|
this.updateProgressBar.Value = e.ProgressPercentage;
|
2020-08-10 06:58:51 +02:00
|
|
|
|
|
|
|
|
|
UpdateInfo info = (UpdateInfo)e.UserState;
|
|
|
|
|
|
2020-08-10 09:22:33 +02:00
|
|
|
|
this.txtProgress.Visible = true;
|
2020-08-13 08:37:45 +02:00
|
|
|
|
this.txtProgress.Text = string.Format(Resources.DownloadProgress, e.ProgressPercentage, info.FileSize / 1024 / 1024);
|
2020-08-10 06:58:51 +02:00
|
|
|
|
}
|
2020-08-16 11:52:58 +02:00
|
|
|
|
|
|
|
|
|
private void DiscordLabel_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
|
|
|
|
|
{
|
2020-08-16 12:08:49 +02:00
|
|
|
|
if (string.IsNullOrEmpty(this.communityAppUri))
|
2020-08-16 11:52:58 +02:00
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-16 12:08:49 +02:00
|
|
|
|
var uri = new Uri(this.communityAppUri);
|
2020-08-16 11:52:58 +02:00
|
|
|
|
if (uri.Scheme != "https")
|
|
|
|
|
{
|
|
|
|
|
// For security, reject any non-HTTPS or local file system URIs
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
2020-08-16 12:08:49 +02:00
|
|
|
|
Process.Start(this.communityAppUri);
|
2022-09-05 05:29:59 +02:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void SetTitle()
|
|
|
|
|
{
|
|
|
|
|
string title = Resources.AppName;
|
|
|
|
|
this.Text = title;
|
2020-08-16 11:52:58 +02:00
|
|
|
|
}
|
|
|
|
|
}
|
2020-08-10 06:58:51 +02:00
|
|
|
|
}
|