From dc0d9a30eefdc66a1e06089bbc510c5442c3e6e5 Mon Sep 17 00:00:00 2001 From: anon Date: Thu, 30 Dec 2021 13:59:58 +0900 Subject: [PATCH 1/3] #6 Directly launch the game MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ゲームの直接起動モードと設定の追加 --- KsGameLauncher/App.config | 15 ++++++ KsGameLauncher/Forms/OptionsForm.Designer.cs | 31 +++++++++--- KsGameLauncher/Forms/OptionsForm.cs | 3 ++ .../Properties/Settings.Designer.cs | 48 +++++++++++++++++++ KsGameLauncher/Properties/Settings.settings | 15 ++++++ KsGameLauncher/Resources.Designer.cs | 18 +++++++ KsGameLauncher/Resources.ja-JP.resx | 6 +++ KsGameLauncher/Resources.resx | 6 +++ 8 files changed, 135 insertions(+), 7 deletions(-) diff --git a/KsGameLauncher/App.config b/KsGameLauncher/App.config index 4aaebda..9ffb258 100644 --- a/KsGameLauncher/App.config +++ b/KsGameLauncher/App.config @@ -36,6 +36,18 @@ 16 + + launcher\modules\errorreporter.exe + + + launcher\modules\bm2dx_er.exe + + + launcher\modules\launcher.exe + + + launcher\modules\bm2dx_launcher.exe + @@ -123,6 +135,9 @@ 400, 300 + + False + diff --git a/KsGameLauncher/Forms/OptionsForm.Designer.cs b/KsGameLauncher/Forms/OptionsForm.Designer.cs index 0a23da6..b9d8073 100644 --- a/KsGameLauncher/Forms/OptionsForm.Designer.cs +++ b/KsGameLauncher/Forms/OptionsForm.Designer.cs @@ -37,6 +37,7 @@ private void InitializeComponent() this.label_ContextMenuSize = new System.Windows.Forms.Label(); this.button_SyncAppInfo = new System.Windows.Forms.Button(); this.checkBox_DisplayInstalledGamesOnly = new System.Windows.Forms.CheckBox(); + this.checkBox_RunDirect = new System.Windows.Forms.CheckBox(); this.SuspendLayout(); // // checkBox_UseProxy @@ -52,6 +53,7 @@ private void InitializeComponent() // // linkLabel_OpenProxySettings // + this.linkLabel_OpenProxySettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.linkLabel_OpenProxySettings.AutoSize = true; this.linkLabel_OpenProxySettings.Location = new System.Drawing.Point(112, 43); this.linkLabel_OpenProxySettings.Margin = new System.Windows.Forms.Padding(2, 0, 2, 0); @@ -66,7 +68,7 @@ private void InitializeComponent() // button_Save // this.button_Save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.button_Save.Location = new System.Drawing.Point(166, 224); + this.button_Save.Location = new System.Drawing.Point(171, 255); this.button_Save.Margin = new System.Windows.Forms.Padding(2); this.button_Save.Name = "button_Save"; this.button_Save.Size = new System.Drawing.Size(54, 25); @@ -101,17 +103,19 @@ private void InitializeComponent() // // comboBox_ContextMenuSize // + this.comboBox_ContextMenuSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.comboBox_ContextMenuSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox_ContextMenuSize.FormattingEnabled = true; - this.comboBox_ContextMenuSize.Location = new System.Drawing.Point(10, 159); + this.comboBox_ContextMenuSize.Location = new System.Drawing.Point(12, 184); this.comboBox_ContextMenuSize.Name = "comboBox_ContextMenuSize"; - this.comboBox_ContextMenuSize.Size = new System.Drawing.Size(121, 20); + this.comboBox_ContextMenuSize.Size = new System.Drawing.Size(125, 20); this.comboBox_ContextMenuSize.TabIndex = 5; // // label_ContextMenuSize // + this.label_ContextMenuSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label_ContextMenuSize.AutoSize = true; - this.label_ContextMenuSize.Location = new System.Drawing.Point(10, 144); + this.label_ContextMenuSize.Location = new System.Drawing.Point(12, 169); this.label_ContextMenuSize.Name = "label_ContextMenuSize"; this.label_ContextMenuSize.Size = new System.Drawing.Size(100, 12); this.label_ContextMenuSize.TabIndex = 6; @@ -119,9 +123,10 @@ private void InitializeComponent() // // button_SyncAppInfo // - this.button_SyncAppInfo.Location = new System.Drawing.Point(10, 196); + this.button_SyncAppInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + this.button_SyncAppInfo.Location = new System.Drawing.Point(12, 225); this.button_SyncAppInfo.Name = "button_SyncAppInfo"; - this.button_SyncAppInfo.Size = new System.Drawing.Size(100, 23); + this.button_SyncAppInfo.Size = new System.Drawing.Size(125, 23); this.button_SyncAppInfo.TabIndex = 7; this.button_SyncAppInfo.TabStop = false; this.button_SyncAppInfo.Text = "Sync with server"; @@ -140,12 +145,23 @@ private void InitializeComponent() this.checkBox_DisplayInstalledGamesOnly.Text = "Display installed games only"; this.checkBox_DisplayInstalledGamesOnly.UseVisualStyleBackColor = true; // + // checkBox_RunDirect + // + this.checkBox_RunDirect.AutoSize = true; + this.checkBox_RunDirect.Location = new System.Drawing.Point(12, 137); + this.checkBox_RunDirect.Name = "checkBox_RunDirect"; + this.checkBox_RunDirect.Size = new System.Drawing.Size(117, 16); + this.checkBox_RunDirect.TabIndex = 8; + this.checkBox_RunDirect.Text = "Run game directly"; + this.checkBox_RunDirect.UseVisualStyleBackColor = true; + // // OptionsForm // this.AcceptButton = this.button_Save; this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 12F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(227, 257); + this.ClientSize = new System.Drawing.Size(232, 288); + this.Controls.Add(this.checkBox_RunDirect); this.Controls.Add(this.button_SyncAppInfo); this.Controls.Add(this.label_ContextMenuSize); this.Controls.Add(this.comboBox_ContextMenuSize); @@ -180,5 +196,6 @@ private void InitializeComponent() private System.Windows.Forms.Label label_ContextMenuSize; private System.Windows.Forms.Button button_SyncAppInfo; private System.Windows.Forms.CheckBox checkBox_DisplayInstalledGamesOnly; + private System.Windows.Forms.CheckBox checkBox_RunDirect; } } \ No newline at end of file diff --git a/KsGameLauncher/Forms/OptionsForm.cs b/KsGameLauncher/Forms/OptionsForm.cs index 5866d97..358758c 100644 --- a/KsGameLauncher/Forms/OptionsForm.cs +++ b/KsGameLauncher/Forms/OptionsForm.cs @@ -36,6 +36,7 @@ private void OptionsForm_Load(object sender, EventArgs e) checkBox_Notification.Checked = Properties.Settings.Default.EnableNotification; checkBox_ConfirmExit.Checked = Properties.Settings.Default.ShowConfirmExit; checkBox_DisplayInstalledGamesOnly.Checked = Properties.Settings.Default.ShowOnlyInstalledGames; + checkBox_RunDirect.Checked = Properties.Settings.Default.RunGameDirect; comboBox_ContextMenuSize.SelectedIndex = Properties.Settings.Default.ContextMenuSize; // String @@ -45,6 +46,7 @@ private void OptionsForm_Load(object sender, EventArgs e) checkBox_Notification.Text = Resources.OptionsDisplayNotification; checkBox_ConfirmExit.Text = Resources.ShowConfirmExit; checkBox_DisplayInstalledGamesOnly.Text = Resources.ShowOnlyInstalledGames; + checkBox_RunDirect.Text = Resources.RunGameDirectly; linkLabel_OpenProxySettings.Text = Resources.OptionsProxySettingsLink; button_Save.Text = Resources.ButtonSave; button_SyncAppInfo.Text = Resources.SynchWithServerButton; @@ -66,6 +68,7 @@ private void Button_Save_Click(object sender, EventArgs e) Properties.Settings.Default.EnableNotification = checkBox_Notification.Checked; Properties.Settings.Default.ShowConfirmExit = checkBox_ConfirmExit.Checked; Properties.Settings.Default.ShowOnlyInstalledGames = checkBox_DisplayInstalledGamesOnly.Checked; + Properties.Settings.Default.RunGameDirect = checkBox_RunDirect.Checked; Properties.Settings.Default.ContextMenuSize = comboBox_ContextMenuSize.SelectedIndex; Properties.Settings.Default.Save(); diff --git a/KsGameLauncher/Properties/Settings.Designer.cs b/KsGameLauncher/Properties/Settings.Designer.cs index a529a6a..50c9204 100644 --- a/KsGameLauncher/Properties/Settings.Designer.cs +++ b/KsGameLauncher/Properties/Settings.Designer.cs @@ -255,5 +255,53 @@ public bool ShowOnlyInstalledGames { this["NewGameFormSize"] = value; } } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("launcher\\modules\\errorreporter.exe")] + public string ErrorReporterPath { + get { + return ((string)(this["ErrorReporterPath"])); + } + } + + [global::System.Configuration.UserScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("False")] + public bool RunGameDirect { + get { + return ((bool)(this["RunGameDirect"])); + } + set { + this["RunGameDirect"] = value; + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("launcher\\modules\\bm2dx_er.exe")] + public string ErrorReporterPath_2dx { + get { + return ((string)(this["ErrorReporterPath_2dx"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("launcher\\modules\\launcher.exe")] + public string LauncherPath { + get { + return ((string)(this["LauncherPath"])); + } + } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Configuration.DefaultSettingValueAttribute("launcher\\modules\\bm2dx_launcher.exe")] + public string LauncherPath_2dx { + get { + return ((string)(this["LauncherPath_2dx"])); + } + } } } diff --git a/KsGameLauncher/Properties/Settings.settings b/KsGameLauncher/Properties/Settings.settings index 5cf324f..81cd0a2 100644 --- a/KsGameLauncher/Properties/Settings.settings +++ b/KsGameLauncher/Properties/Settings.settings @@ -65,5 +65,20 @@ 400, 300 + + launcher\modules\errorreporter.exe + + + False + + + launcher\modules\bm2dx_er.exe + + + launcher\modules\launcher.exe + + + launcher\modules\bm2dx_launcher.exe + \ No newline at end of file diff --git a/KsGameLauncher/Resources.Designer.cs b/KsGameLauncher/Resources.Designer.cs index b637d0d..baa2c30 100644 --- a/KsGameLauncher/Resources.Designer.cs +++ b/KsGameLauncher/Resources.Designer.cs @@ -187,6 +187,15 @@ internal static string ButtonUpdate_Register { } } + /// + /// Launcher launches because the game execution file cannot be found. に類似しているローカライズされた文字列を検索します。 + /// + internal static string CannotFindErrorReporter { + get { + return ResourceManager.GetString("CannotFindErrorReporter", resourceCulture); + } + } + /// /// Could not be saved game list, because not allowed write files. に類似しているローカライズされた文字列を検索します。 /// @@ -521,6 +530,15 @@ internal static string OptionsWindowTitle { } } + /// + /// Run the game directly に類似しているローカライズされた文字列を検索します。 + /// + internal static string RunGameDirectly { + get { + return ResourceManager.GetString("RunGameDirectly", resourceCulture); + } + } + /// /// Service is temporarily down or unavailable. に類似しているローカライズされた文字列を検索します。 /// diff --git a/KsGameLauncher/Resources.ja-JP.resx b/KsGameLauncher/Resources.ja-JP.resx index e3dd506..a69affa 100644 --- a/KsGameLauncher/Resources.ja-JP.resx +++ b/KsGameLauncher/Resources.ja-JP.resx @@ -161,6 +161,9 @@ 登録 (&G) + + ゲーム実行ファイルが見つからないためランチャーを起動します。 + ファイルへの書き込みが許可されていないため ゲーム一覧を保存できませんでした。 @@ -279,6 +282,9 @@ オプション + + ランチャーをスキップ + サービスが一時的に停止しているか、利用できません。 diff --git a/KsGameLauncher/Resources.resx b/KsGameLauncher/Resources.resx index 4573fc2..c4d5fb3 100644 --- a/KsGameLauncher/Resources.resx +++ b/KsGameLauncher/Resources.resx @@ -162,6 +162,9 @@ You can try removing it from "Credential Manager" in Control Panel.\nIf you clic Re&gister + + Launcher launches because the game execution file cannot be found. + Could not be saved game list, because not allowed write files. @@ -283,6 +286,9 @@ This file may not exist or may be temporarily unavailable. Options + + Run the game directly + Service is temporarily down or unavailable. From 8b322f3657b7ca70ba611ee7669cc786078d8917 Mon Sep 17 00:00:00 2001 From: anon Date: Thu, 30 Dec 2021 14:09:03 +0900 Subject: [PATCH 2/3] #6 Directly launch the game --- KsGameLauncher/Launcher.cs | 99 +++++++++++++++++++++++++++++++++++--- 1 file changed, 92 insertions(+), 7 deletions(-) diff --git a/KsGameLauncher/Launcher.cs b/KsGameLauncher/Launcher.cs index ad54c36..a66763c 100644 --- a/KsGameLauncher/Launcher.cs +++ b/KsGameLauncher/Launcher.cs @@ -36,12 +36,18 @@ internal static Launcher Create() return instance; } + /// + /// Constructor + /// private Launcher() { } - + /// + /// Create HTTP client instance + /// + /// private HttpClient CreateHttp() { httpHandler = new HttpClientHandler() @@ -76,7 +82,10 @@ private HttpClient CreateHttp() - + /// + /// already logged in? + /// + /// internal bool IsLogin() { if (httpClient == null || httpHandler == null) @@ -100,7 +109,11 @@ internal bool IsLogin() } - + /// + /// Get login page URI + /// + /// + /// private async Task GetLoginUri() { Debug.WriteLine(String.Format("Get login page: {0}", Properties.Settings.Default.LoginURL)); @@ -118,6 +131,12 @@ private async Task GetLoginUri() } + /// + /// Login process + /// + /// + /// + /// public async Task Login(NetworkCredential credential, Uri loginURL) { if (Properties.Settings.Default.EnableNotification) @@ -167,6 +186,13 @@ public async Task Login(NetworkCredential credential, Uri loginURL) } } + /// + /// Send requqest to login + /// + /// + /// + /// + /// private async Task SendLoginRequest(Uri url, Dictionary requestParams) { @@ -201,6 +227,10 @@ private async Task SendLoginRequest(Uri url, Dictionary + /// Startup games + /// + /// async public void StartApp(AppInfo app) { NetworkCredential credential = GetCredential(); @@ -382,6 +412,12 @@ async public void StartApp(AppInfo app) } } + /// + /// Parse launcher launch page + /// + /// + /// + /// async void LauncherLoginPage(string content, string querySelector) { if (content == null || content.Length < 0) @@ -415,24 +451,73 @@ async void LauncherLoginPage(string content, string querySelector) Debug.WriteLine(String.Format("launcherUri: {0}", launcherCustomProtocol)); Debug.WriteLine(String.Format("custom scheme: {0}", customUri.Scheme)); #endif - string launcherPath = Utils.GameRegistry.GetLauncherPath(customUri.Scheme); + LaunchGame(customUri); + } + + } + + /// + /// Launch the launcher or game + /// + /// + private void LaunchGame(Uri launcherUri) + { + string execPath = Utils.GameRegistry.GetLauncherPath(launcherUri.Scheme); + string args = launcherUri.ToString(); #if DEBUG - Debug.WriteLine(String.Format("Launcher exec path: {0}", launcherPath)); + Debug.WriteLine(String.Format("Launcher exec path: {0}", execPath)); #endif + if (Properties.Settings.Default.RunGameDirect) + { + string launcherPath, errorReporterPath; + launcherPath = Properties.Settings.Default.LauncherPath; + errorReporterPath = Properties.Settings.Default.ErrorReporterPath; + if (launcherUri.Scheme.StartsWith("bm2dxinf")) + { + launcherPath = Properties.Settings.Default.LauncherPath_2dx; + errorReporterPath = Properties.Settings.Default.ErrorReporterPath_2dx; + } + + string testPath = execPath.Replace(launcherPath, errorReporterPath); + + if (File.Exists(testPath)) + { + execPath = testPath; + string param = "tk="; + if (launcherUri.Query.Contains("&")) + args = string.Format("-t {0}", launcherUri.Query.Substring(1).Substring(launcherUri.Query.IndexOf(param)+param.Length, launcherUri.Query.IndexOf("&"))); + else + args = string.Format("-t {0}", launcherUri.Query.Substring(1).Substring(launcherUri.Query.IndexOf(param) + param.Length)); + } + else + { + MessageBox.Show(Resources.CannotFindErrorReporter, Resources.AppName, + MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, + MessageBoxOptions.DefaultDesktopOnly); + } - Process.Start(launcherPath, launcherCustomProtocol); } + Process.Start(execPath, args); } + /// + /// Get credentials + /// + /// private NetworkCredential GetCredential() { return CredentialManager.GetCredentials(target: Properties.Resources.CredentialTarget); } + /// + /// Find game exe + /// + /// + /// private string GetGamePathFromLauncher(string launcherPath) { - string gamePath = launcherPath.Replace(@"\launcher\modules\launcher.exe", @"game\modules\"); + string gamePath = launcherPath.Replace(Properties.Settings.Default.LauncherPath, @"game\modules\"); string[] files = Directory.GetFiles(gamePath, "*.exe"); if (files.Length < 0) return null; From 1fdda0f8a4fbff698333b17dd46df835aa472fe1 Mon Sep 17 00:00:00 2001 From: anon Date: Sun, 27 Feb 2022 05:38:26 +0900 Subject: [PATCH 3/3] Fix for merging with v1.0.2 --- KsGameLauncher/Forms/OptionsForm.Designer.cs | 32 +++++++++---------- KsGameLauncher/Forms/OptionsForm.cs | 2 +- KsGameLauncher/Launcher.cs | 13 ++++---- .../Properties/Settings.Designer.cs | 3 ++ 4 files changed, 27 insertions(+), 23 deletions(-) diff --git a/KsGameLauncher/Forms/OptionsForm.Designer.cs b/KsGameLauncher/Forms/OptionsForm.Designer.cs index 9a92da6..707af89 100644 --- a/KsGameLauncher/Forms/OptionsForm.Designer.cs +++ b/KsGameLauncher/Forms/OptionsForm.Designer.cs @@ -60,7 +60,7 @@ private void InitializeComponent() // this.linkLabel_OpenProxySettings.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); this.linkLabel_OpenProxySettings.AutoSize = true; - this.linkLabel_OpenProxySettings.Location = new System.Drawing.Point(160, 122); + this.linkLabel_OpenProxySettings.Location = new System.Drawing.Point(185, 121); this.linkLabel_OpenProxySettings.Name = "linkLabel_OpenProxySettings"; this.linkLabel_OpenProxySettings.Size = new System.Drawing.Size(157, 18); this.linkLabel_OpenProxySettings.TabIndex = 1; @@ -72,8 +72,8 @@ private void InitializeComponent() // button_Save // this.button_Save.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.button_Save.Location = new System.Drawing.Point(261, 528); this.button_Save.Margin = new System.Windows.Forms.Padding(2); - this.button_Save.Location = new System.Drawing.Point(249, 511); this.button_Save.Name = "button_Save"; this.button_Save.Size = new System.Drawing.Size(81, 38); this.button_Save.TabIndex = 3; @@ -86,7 +86,7 @@ private void InitializeComponent() this.checkBox_Notification.AutoSize = true; this.checkBox_Notification.Checked = true; this.checkBox_Notification.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox_Notification.Location = new System.Drawing.Point(15, 148); + this.checkBox_Notification.Location = new System.Drawing.Point(13, 149); this.checkBox_Notification.Margin = new System.Windows.Forms.Padding(4); this.checkBox_Notification.Name = "checkBox_Notification"; this.checkBox_Notification.Size = new System.Drawing.Size(177, 22); @@ -99,7 +99,7 @@ private void InitializeComponent() this.checkBox_ConfirmExit.AutoSize = true; this.checkBox_ConfirmExit.Checked = true; this.checkBox_ConfirmExit.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox_ConfirmExit.Location = new System.Drawing.Point(15, 182); + this.checkBox_ConfirmExit.Location = new System.Drawing.Point(13, 179); this.checkBox_ConfirmExit.Margin = new System.Windows.Forms.Padding(4); this.checkBox_ConfirmExit.Name = "checkBox_ConfirmExit"; this.checkBox_ConfirmExit.Size = new System.Drawing.Size(167, 22); @@ -112,7 +112,7 @@ private void InitializeComponent() this.comboBox_ContextMenuSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.comboBox_ContextMenuSize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox_ContextMenuSize.FormattingEnabled = true; - this.comboBox_ContextMenuSize.Location = new System.Drawing.Point(12, 284); + this.comboBox_ContextMenuSize.Location = new System.Drawing.Point(12, 301); this.comboBox_ContextMenuSize.Margin = new System.Windows.Forms.Padding(4); this.comboBox_ContextMenuSize.Name = "comboBox_ContextMenuSize"; this.comboBox_ContextMenuSize.Size = new System.Drawing.Size(180, 26); @@ -122,7 +122,7 @@ private void InitializeComponent() // this.label_ContextMenuSize.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label_ContextMenuSize.AutoSize = true; - this.label_ContextMenuSize.Location = new System.Drawing.Point(12, 262); + this.label_ContextMenuSize.Location = new System.Drawing.Point(12, 279); this.label_ContextMenuSize.Margin = new System.Windows.Forms.Padding(4, 0, 4, 0); this.label_ContextMenuSize.Name = "label_ContextMenuSize"; this.label_ContextMenuSize.Size = new System.Drawing.Size(146, 18); @@ -132,7 +132,7 @@ private void InitializeComponent() // button_SyncAppInfo // this.button_SyncAppInfo.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.button_SyncAppInfo.Location = new System.Drawing.Point(12, 324); + this.button_SyncAppInfo.Location = new System.Drawing.Point(12, 341); this.button_SyncAppInfo.Margin = new System.Windows.Forms.Padding(4); this.button_SyncAppInfo.Name = "button_SyncAppInfo"; this.button_SyncAppInfo.Size = new System.Drawing.Size(150, 34); @@ -147,7 +147,7 @@ private void InitializeComponent() this.checkBox_DisplayInstalledGamesOnly.AutoSize = true; this.checkBox_DisplayInstalledGamesOnly.Checked = true; this.checkBox_DisplayInstalledGamesOnly.CheckState = System.Windows.Forms.CheckState.Checked; - this.checkBox_DisplayInstalledGamesOnly.Location = new System.Drawing.Point(15, 214); + this.checkBox_DisplayInstalledGamesOnly.Location = new System.Drawing.Point(13, 209); this.checkBox_DisplayInstalledGamesOnly.Margin = new System.Windows.Forms.Padding(4); this.checkBox_DisplayInstalledGamesOnly.Name = "checkBox_DisplayInstalledGamesOnly"; this.checkBox_DisplayInstalledGamesOnly.Size = new System.Drawing.Size(244, 22); @@ -158,20 +158,20 @@ private void InitializeComponent() // checkBox_RunDirect // this.checkBox_RunDirect.AutoSize = true; - this.checkBox_RunDirect.Location = new System.Drawing.Point(12, 137); + this.checkBox_RunDirect.Location = new System.Drawing.Point(13, 247); this.checkBox_RunDirect.Name = "checkBox_RunDirect"; - this.checkBox_RunDirect.Size = new System.Drawing.Size(117, 16); + this.checkBox_RunDirect.Size = new System.Drawing.Size(168, 22); this.checkBox_RunDirect.TabIndex = 8; this.checkBox_RunDirect.Text = "Run game directly"; this.checkBox_RunDirect.UseVisualStyleBackColor = true; - // + // // checkBox_RegisterCustomURI // this.checkBox_RegisterCustomURI.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.checkBox_RegisterCustomURI.Appearance = System.Windows.Forms.Appearance.Button; this.checkBox_RegisterCustomURI.AutoSize = true; this.checkBox_RegisterCustomURI.FlatStyle = System.Windows.Forms.FlatStyle.System; - this.checkBox_RegisterCustomURI.Location = new System.Drawing.Point(12, 372); + this.checkBox_RegisterCustomURI.Location = new System.Drawing.Point(12, 389); this.checkBox_RegisterCustomURI.Margin = new System.Windows.Forms.Padding(4); this.checkBox_RegisterCustomURI.Name = "checkBox_RegisterCustomURI"; this.checkBox_RegisterCustomURI.Size = new System.Drawing.Size(173, 28); @@ -204,7 +204,7 @@ private void InitializeComponent() // this.label_CheckAutoUpdateInterval.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); this.label_CheckAutoUpdateInterval.AutoSize = true; - this.label_CheckAutoUpdateInterval.Location = new System.Drawing.Point(12, 418); + this.label_CheckAutoUpdateInterval.Location = new System.Drawing.Point(12, 435); this.label_CheckAutoUpdateInterval.Name = "label_CheckAutoUpdateInterval"; this.label_CheckAutoUpdateInterval.Size = new System.Drawing.Size(149, 18); this.label_CheckAutoUpdateInterval.TabIndex = 11; @@ -216,7 +216,7 @@ private void InitializeComponent() this.comboBox_CheckInterval.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; this.comboBox_CheckInterval.FlatStyle = System.Windows.Forms.FlatStyle.System; this.comboBox_CheckInterval.FormattingEnabled = true; - this.comboBox_CheckInterval.Location = new System.Drawing.Point(12, 439); + this.comboBox_CheckInterval.Location = new System.Drawing.Point(12, 456); this.comboBox_CheckInterval.Name = "comboBox_CheckInterval"; this.comboBox_CheckInterval.Size = new System.Drawing.Size(219, 26); this.comboBox_CheckInterval.TabIndex = 12; @@ -224,7 +224,7 @@ private void InitializeComponent() // button_ManualCheck // this.button_ManualCheck.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - this.button_ManualCheck.Location = new System.Drawing.Point(12, 471); + this.button_ManualCheck.Location = new System.Drawing.Point(12, 488); this.button_ManualCheck.Name = "button_ManualCheck"; this.button_ManualCheck.Size = new System.Drawing.Size(146, 35); this.button_ManualCheck.TabIndex = 13; @@ -237,7 +237,7 @@ private void InitializeComponent() this.AcceptButton = this.button_Save; this.AutoScaleDimensions = new System.Drawing.SizeF(144F, 144F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi; - this.ClientSize = new System.Drawing.Size(340, 560); + this.ClientSize = new System.Drawing.Size(352, 577); this.Controls.Add(this.button_ManualCheck); this.Controls.Add(this.comboBox_CheckInterval); this.Controls.Add(this.label_CheckAutoUpdateInterval); diff --git a/KsGameLauncher/Forms/OptionsForm.cs b/KsGameLauncher/Forms/OptionsForm.cs index d0b2033..79e57bb 100644 --- a/KsGameLauncher/Forms/OptionsForm.cs +++ b/KsGameLauncher/Forms/OptionsForm.cs @@ -100,7 +100,7 @@ private void OptionsForm_Load(object sender, EventArgs e) checkBox_Notification.Text = Properties.Strings.OptionsDisplayNotification; checkBox_ConfirmExit.Text = Properties.Strings.ShowConfirmExit; checkBox_DisplayInstalledGamesOnly.Text = Properties.Strings.ShowOnlyInstalledGames; - checkBox_RunDirect.Text = Resources.RunGameDirectly; + checkBox_RunDirect.Text = Properties.Strings.RunGameDirectly; linkLabel_OpenProxySettings.Text = Properties.Strings.OptionsProxySettingsLink; button_Save.Text = Properties.Strings.ButtonSave; button_SyncAppInfo.Text = Properties.Strings.SynchWithServerButton; diff --git a/KsGameLauncher/Launcher.cs b/KsGameLauncher/Launcher.cs index c22365b..3edb49a 100644 --- a/KsGameLauncher/Launcher.cs +++ b/KsGameLauncher/Launcher.cs @@ -555,6 +555,7 @@ await Task.Factory.StartNew(() => /// Start game launcher /// /// + /// public async Task StartApp(AppInfo app) { NetworkCredential credential = GetCredential(); @@ -750,16 +751,16 @@ async Task LauncherLoginPage(string content, string querySelector) Debug.WriteLine(String.Format("launcherUri: {0}", launcherCustomProtocol)); Debug.WriteLine(String.Format("custom scheme: {0}", customUri.Scheme)); #endif - LaunchGame(customUri); + RunGame(customUri); } - + return true; } /// /// Launch the launcher or game /// /// - private void LaunchGame(Uri launcherUri) + private void RunGame(Uri launcherUri) { string execPath = Utils.GameRegistry.GetLauncherPath(launcherUri.Scheme); string args = launcherUri.ToString(); @@ -790,13 +791,13 @@ private void LaunchGame(Uri launcherUri) } else { - MessageBox.Show(Resources.CannotFindErrorReporter, Resources.AppName, + MessageBox.Show(Properties.Strings.CannotFindErrorReporter, Properties.Strings.AppName, MessageBoxButtons.OK, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1, MessageBoxOptions.DefaultDesktopOnly); } - } - return true; + + Process.Start(execPath, launcherUri.ToString()); } /// diff --git a/KsGameLauncher/Properties/Settings.Designer.cs b/KsGameLauncher/Properties/Settings.Designer.cs index bc7bf9c..0ec9a00 100644 --- a/KsGameLauncher/Properties/Settings.Designer.cs +++ b/KsGameLauncher/Properties/Settings.Designer.cs @@ -264,6 +264,9 @@ public string ErrorReporterPath { return ((string)(this["ErrorReporterPath"])); } } + + [global::System.Configuration.ApplicationScopedSettingAttribute()] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] [global::System.Configuration.DefaultSettingValueAttribute("ksgamelauncher")] public string AppUriScheme { get {