From 2af010113a2e2a4be7dba5eb041e730451b4b290 Mon Sep 17 00:00:00 2001 From: Jizheng Date: Tue, 3 Nov 2020 02:52:50 +0000 Subject: [PATCH 01/23] update --- App.config | 10 +- App.xaml.cs | 3 + Enums/WebRequestType.cs | 15 ++ Extensions/ControlExtensions.cs | 34 +++ Games/EVE/EVEAccount.cs | 314 +++++++++++++++++++-------- Games/EVE/EVECharacter.cs | 2 +- ISBoxerEVELauncher.csproj | 144 +++++++++--- ISBoxerEVELauncher.sln | 16 +- Settings.cs | 1 + Web/RequestResponse.cs | 34 ++- Web/Response.cs | 39 ++++ Windows/LaunchProgressWindow.xaml.cs | 67 +++--- Windows/LoginBrowser.Designer.cs | 61 ++++++ Windows/LoginBrowser.cs | 76 +++++++ Windows/LoginBrowser.resx | 120 ++++++++++ packages.config | 44 ++-- 16 files changed, 809 insertions(+), 171 deletions(-) create mode 100644 Enums/WebRequestType.cs create mode 100644 Extensions/ControlExtensions.cs create mode 100644 Windows/LoginBrowser.Designer.cs create mode 100644 Windows/LoginBrowser.cs create mode 100644 Windows/LoginBrowser.resx diff --git a/App.config b/App.config index 4e52de0..4c6ae16 100644 --- a/App.config +++ b/App.config @@ -11,7 +11,15 @@ - + + + + + + + + + diff --git a/App.xaml.cs b/App.xaml.cs index 522df15..c2b77f2 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -17,6 +17,7 @@ using ISBoxerEVELauncher.Games.EVE; using ISBoxerEVELauncher.Interface; using System.Net; +using ISBoxerEVELauncher.Windows; namespace ISBoxerEVELauncher { @@ -26,6 +27,8 @@ namespace ISBoxerEVELauncher public partial class App : Application { public static bool HasInnerSpace { get; set; } + public static LoginBrowser myLB =new LoginBrowser(); + public static string strUserName {get; set; } public static string AppVersion { diff --git a/Enums/WebRequestType.cs b/Enums/WebRequestType.cs new file mode 100644 index 0000000..4820de4 --- /dev/null +++ b/Enums/WebRequestType.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ISBoxerEVELauncher.Enums +{ + public enum WebRequestType + { + RequestVerificationToken, + VerficationCode, + Result + } +} diff --git a/Extensions/ControlExtensions.cs b/Extensions/ControlExtensions.cs new file mode 100644 index 0000000..80412f3 --- /dev/null +++ b/Extensions/ControlExtensions.cs @@ -0,0 +1,34 @@ +using System; +using System.Windows.Forms; + + +namespace ISBoxerEVELauncher.Extensions +{ + public static class ControlExtensions + { + /// + /// Executes the Action asynchronously on the UI thread, does not block execution on the calling thread. + /// + /// the control for which the update is required + /// action to be performed on the control + public static void InvokeOnUiThreadIfRequired(this Control control, Action action) + { + //If you are planning on using a similar function in your own code then please be sure to + //have a quick read over https://stackoverflow.com/questions/1874728/avoid-calling-invoke-when-the-control-is-disposed + //No action + if (control.Disposing || control.IsDisposed || !control.IsHandleCreated) + { + return; + } + + if (control.InvokeRequired) + { + control.BeginInvoke(action); + } + else + { + action.Invoke(); + } + } + } +} diff --git a/Games/EVE/EVEAccount.cs b/Games/EVE/EVEAccount.cs index 0caa114..14cc3be 100644 --- a/Games/EVE/EVEAccount.cs +++ b/Games/EVE/EVEAccount.cs @@ -39,7 +39,10 @@ public class EVEAccount : INotifyPropertyChanged, IDisposable, ILaunchTarget [XmlIgnore] private string code; - public string Profile { get; set; } + public string Profile + { + get; set; + } public EVEAccount() @@ -94,11 +97,17 @@ public bool IsExpired /// /// The actual token data /// - public string TokenString { get; set; } + public string TokenString + { + get; set; + } /// /// When the token is good until... /// - public DateTime Expiration { get; set; } + public DateTime Expiration + { + get; set; + } } CookieContainer _Cookies; @@ -158,7 +167,18 @@ public void UpdateCookieStorage() /// /// EVE Account username /// - public string Username { get { return _Username; } set { _Username = value; OnPropertyChanged("Username"); } } + public string Username + { + get + { + return _Username; + } + set + { + _Username = value; + OnPropertyChanged("Username"); + } + } /// /// Old cookie storage. If found in the XML, it will automatically be split into separate storage @@ -179,7 +199,10 @@ public string CookieStorage } } - public static bool ShouldUgradeCookieStorage { get; private set; } + public static bool ShouldUgradeCookieStorage + { + get; private set; + } /// /// New method of storing cookies /// @@ -203,7 +226,20 @@ public string NewCookieStorage /// A Secure (and non-plaintext) representation of the password. This will NOT be stored in XML. /// [XmlIgnore] - public System.Security.SecureString SecurePassword { get { return _SecurePassword; } set { _SecurePassword = value; OnPropertyChanged("SecurePassword"); EncryptedPassword = null; EncryptedPasswordIV = null; } } + public System.Security.SecureString SecurePassword + { + get + { + return _SecurePassword; + } + set + { + _SecurePassword = value; + OnPropertyChanged("SecurePassword"); + EncryptedPassword = null; + EncryptedPasswordIV = null; + } + } string _EncryptedPassword; /// @@ -215,14 +251,29 @@ public string EncryptedPassword { return _EncryptedPassword; } - set { _EncryptedPassword = value; OnPropertyChanged("EncryptedPassword"); } + set + { + _EncryptedPassword = value; + OnPropertyChanged("EncryptedPassword"); + } } string _EncryptedPasswordIV; /// /// The Initialization Vector used to encrypt the password /// - public string EncryptedPasswordIV { get { return _EncryptedPasswordIV; } set { _EncryptedPasswordIV = value; OnPropertyChanged("EncryptedPasswordIV"); } } + public string EncryptedPasswordIV + { + get + { + return _EncryptedPasswordIV; + } + set + { + _EncryptedPasswordIV = value; + OnPropertyChanged("EncryptedPasswordIV"); + } + } /// /// Sets the encrypted password to the given SecureString, if possible @@ -364,7 +415,20 @@ public void DecryptPassword(bool allowPopup) /// A Secure (and non-plaintext) representation of the CharacterName. This will NOT be stored in XML. /// [XmlIgnore] - public System.Security.SecureString SecureCharacterName { get { return _SecureCharacterName; } set { _SecureCharacterName = value; OnPropertyChanged("SecureCharacterName"); EncryptedCharacterName = null; EncryptedCharacterNameIV = null; } } + public System.Security.SecureString SecureCharacterName + { + get + { + return _SecureCharacterName; + } + set + { + _SecureCharacterName = value; + OnPropertyChanged("SecureCharacterName"); + EncryptedCharacterName = null; + EncryptedCharacterNameIV = null; + } + } string _EncryptedCharacterName; /// @@ -376,14 +440,29 @@ public string EncryptedCharacterName { return _EncryptedCharacterName; } - set { _EncryptedCharacterName = value; OnPropertyChanged("EncryptedCharacterName"); } + set + { + _EncryptedCharacterName = value; + OnPropertyChanged("EncryptedCharacterName"); + } } string _EncryptedCharacterNameIV; /// /// The Initialization Vector used to encrypt the CharacterName /// - public string EncryptedCharacterNameIV { get { return _EncryptedCharacterNameIV; } set { _EncryptedCharacterNameIV = value; OnPropertyChanged("EncryptedCharacterNameIV"); } } + public string EncryptedCharacterNameIV + { + get + { + return _EncryptedCharacterNameIV; + } + set + { + _EncryptedCharacterNameIV = value; + OnPropertyChanged("EncryptedCharacterNameIV"); + } + } /// /// Attempts to prepare the encrypted verison of the currently active SecureCharacterName @@ -509,14 +588,36 @@ public void DecryptCharacterName(bool allowPopup) /// AccessToken for Tranquility. Lasts up to 11 hours? /// [XmlIgnore] - public Token TranquilityToken { get { return _TranquilityToken; } set { _TranquilityToken = value; OnPropertyChanged("TranquilityToken"); } } + public Token TranquilityToken + { + get + { + return _TranquilityToken; + } + set + { + _TranquilityToken = value; + OnPropertyChanged("TranquilityToken"); + } + } Token _SisiToken; /// /// AccessToken for Singularity. Lasts up to 11 hours? /// [XmlIgnore] - public Token SisiToken { get { return _SisiToken; } set { _SisiToken = value; OnPropertyChanged("SisiToken"); } } + public Token SisiToken + { + get + { + return _SisiToken; + } + set + { + _SisiToken = value; + OnPropertyChanged("SisiToken"); + } + } #region Refresh Tokens /* This section is for experimental implemtnation using Refresh Tokens, which are used by the official EVE Launcher and described as insecure. @@ -989,88 +1090,99 @@ public LoginResult GetAccessToken(bool sisi, HttpWebRequest req, out Token acces try { - response = new Response(req); - - string responseBody = response.Body; - UpdateCookieStorage(); + if (App.myLB.strHTML_RequestVerificationToken == "") + { + response = new Response(req); + } + else + { + response = new Response(req, WebRequestType.Result); + } - if (responseBody.Contains("Incorrect character name entered")) - { - accessToken = null; - SecurePassword = null; - SecureCharacterName = null; - return LoginResult.InvalidCharacterChallenge; - } - if (responseBody.Contains("Invalid username / password")) - { - accessToken = null; - SecurePassword = null; - return LoginResult.InvalidUsernameOrPassword; - } + string responseBody = response.Body; + UpdateCookieStorage(); - // I'm just guessing on this one at the moment. - if (responseBody.Contains("Invalid authenticat") - || (responseBody.Contains("Verification code mismatch") && responseBody.Contains("/account/authenticator")) - ) - { - accessToken = null; - SecurePassword = null; - return LoginResult.InvalidAuthenticatorChallenge; - } - //The 2FA page now has "Character challenge" in the text but it is hidden. This should fix it from - //Coming up during 2FA challenge - if (responseBody.Contains("Character challenge") && !responseBody.Contains("visuallyhidden")) - { - return GetCharacterChallenge(sisi, out accessToken); - } + if (responseBody.Contains("Incorrect character name entered")) + { + accessToken = null; + SecurePassword = null; + SecureCharacterName = null; + return LoginResult.InvalidCharacterChallenge; + } - if (responseBody.Contains("Email verification required")) - { - return GetEmailChallenge(sisi, responseBody, out accessToken); - } + if (responseBody.Contains("Invalid username / password")) + { + accessToken = null; + SecurePassword = null; + return LoginResult.InvalidUsernameOrPassword; + } - if (responseBody.Contains("Authenticator is enabled")) - { - return GetAuthenticatorChallenge(sisi, out accessToken); - } + // I'm just guessing on this one at the moment. + if (responseBody.Contains("Invalid authenticat") + || (responseBody.Contains("Verification code mismatch") && responseBody.Contains("/account/authenticator")) + ) + { + accessToken = null; + SecurePassword = null; + return LoginResult.InvalidAuthenticatorChallenge; + } + //The 2FA page now has "Character challenge" in the text but it is hidden. This should fix it from + //Coming up during 2FA challenge + if (responseBody.Contains("Character challenge") && !responseBody.Contains("visuallyhidden")) + { + return GetCharacterChallenge(sisi, out accessToken); + } - if (responseBody.Contains("Please enter the verification code ")) - { - return GetEmailCodeChallenge(sisi, responseBody, out accessToken); - } + if (responseBody.Contains("Email verification required")) + { + return GetEmailChallenge(sisi, responseBody, out accessToken); + } - if (responseBody.Contains("Security Warning")) - { - return GetSecurityWarningChallenge(sisi, responseBody, response.ResponseUri, out accessToken); - } + if (responseBody.Contains("Authenticator is enabled")) + { + return GetAuthenticatorChallenge(sisi, out accessToken); + } - if (responseBody.ToLower().Contains("form action=\"/oauth/eula\"")) - { - return GetEULAChallenge(sisi, responseBody, response.ResponseUri, out accessToken); - } + if (responseBody.Contains("Please enter the verification code ")) + { + return GetEmailCodeChallenge(sisi, responseBody, out accessToken); + } - try - { - code = HttpUtility.ParseQueryString(response.ResponseUri.ToString()).Get("code"); - if (code == null) - { - - return LoginResult.Error; - } - GetAccessToken(sisi, code, out response); - accessToken = new Token(JsonConvert.DeserializeObject(response.Body)); - } - catch (Exception) + if (responseBody.Contains("Security Warning")) + { + return GetSecurityWarningChallenge(sisi, responseBody, response.ResponseUri, out accessToken); + } + + if (responseBody.ToLower().Contains("form action=\"/oauth/eula\"")) + { + return GetEULAChallenge(sisi, responseBody, response.ResponseUri, out accessToken); + } + + try + { + + code = HttpUtility.ParseQueryString(response.ResponseUri.OriginalString).Get("code"); + + + if (code == null) { - Windows.UnhandledResponseWindow urw = new Windows.UnhandledResponseWindow(responseBody); - urw.ShowDialog(); - // can't get the token - accessToken = null; - SecurePassword = null; - return LoginResult.TokenFailure; + return LoginResult.Error; } + GetAccessToken(sisi, code, out response); + accessToken = new Token(JsonConvert.DeserializeObject(response.Body)); + } + catch (Exception) + { + Windows.UnhandledResponseWindow urw = new Windows.UnhandledResponseWindow(responseBody); + urw.ShowDialog(); + + // can't get the token + accessToken = null; + SecurePassword = null; + return LoginResult.TokenFailure; + } if (!sisi) { @@ -1102,7 +1214,10 @@ public LoginResult GetAccessToken(bool sisi, HttpWebRequest req, out Token acces public class authObj { private int _expiresIn; - public string access_token { get; set; } + public string access_token + { + get; set; + } public int expires_in { get @@ -1115,10 +1230,19 @@ public int expires_in Expiration = DateTime.Now.AddMinutes(_expiresIn); } } - public string token_type { get; set; } - public string refresh_token { get; set; } + public string token_type + { + get; set; + } + public string refresh_token + { + get; set; + } - public DateTime Expiration { get; private set; } + public DateTime Expiration + { + get; private set; + } } @@ -1140,7 +1264,8 @@ public LoginResult GetRequestVerificationToken(Uri uri, bool sisi, out string ve var req = RequestResponse.CreateGetRequest(uri, sisi, true, "URL", Cookies); req.ContentLength = 0; - + //App.strUserName = Username; + var result = RequestResponse.GetHttpWebResponse(req, UpdateCookieStorage, out response); if (result == LoginResult.Success) @@ -1182,6 +1307,7 @@ public LoginResult GetAccessToken(bool sisi, out Token accessToken) } } + App.strUserName = Username; var uri = RequestResponse.GetLoginUri(sisi, state.ToString(), challengeHash); @@ -1214,7 +1340,7 @@ public LoginResult GetAccessToken(bool sisi, out Token accessToken) public LoginResult GetSSOToken(bool sisi, out Token ssoToken) { LoginResult lr = this.GetAccessToken(sisi, out ssoToken); - + return lr; } @@ -1291,12 +1417,18 @@ public override string ToString() EVEAccount ILaunchTarget.EVEAccount { - get { return this; } + get + { + return this; + } } public long CharacterID { - get { return 0; } + get + { + return 0; + } } } } diff --git a/Games/EVE/EVECharacter.cs b/Games/EVE/EVECharacter.cs index a89c77f..6a992bc 100644 --- a/Games/EVE/EVECharacter.cs +++ b/Games/EVE/EVECharacter.cs @@ -63,7 +63,7 @@ public long GetCharacterID() public static long GetCharacterID(bool sisi, string characterName) { - string uri = string.Format("https://esi.evetech.net/v1/search/?categories=character&datasource={0}&language=en-us&search={1}&strict=true", (sisi?"singularity":"tranquility"), WebUtility.UrlEncode(characterName)); + string uri = string.Format("https://esi.evetech.net/latest/search/?categories=character&datasource={0}&language=en-us&search={1}&strict=true", (sisi?"singularity":"tranquility"), WebUtility.UrlEncode(characterName)); using (WebClient wc = new WebClient()) { diff --git a/ISBoxerEVELauncher.csproj b/ISBoxerEVELauncher.csproj index 8a70e3c..f9acc29 100644 --- a/ISBoxerEVELauncher.csproj +++ b/ISBoxerEVELauncher.csproj @@ -1,5 +1,9 @@  + + + + @@ -34,7 +38,7 @@ true - AnyCPU + x86 true full false @@ -43,7 +47,7 @@ prompt 4 true - true + false AnyCPU @@ -62,18 +66,64 @@ app.manifest + + true + bin\x64\Debug\ + DEBUG;TRACE + true + full + x64 + 7.3 + prompt + MinimumRecommendedRules.ruleset + + + bin\x64\Release\ + TRACE + true + true + pdbonly + x64 + 7.3 + prompt + MinimumRecommendedRules.ruleset + true + + + true + bin\x86\Debug\ + DEBUG;TRACE + true + full + x86 + 7.3 + prompt + MinimumRecommendedRules.ruleset + + + bin\x86\Release\ + TRACE + true + true + pdbonly + x86 + 7.3 + prompt + MinimumRecommendedRules.ruleset + true + packages\Costura.Fody.5.0.0-alpha0281\lib\netstandard1.0\Costura.dll - - packages\HtmlAgilityPack.1.11.24\lib\Net45\HtmlAgilityPack.dll + + packages\HtmlAgilityPack.1.11.26\lib\Net45\HtmlAgilityPack.dll - - packages\Microsoft.IdentityModel.Logging.6.7.2-preview-10803222715\lib\netstandard2.0\Microsoft.IdentityModel.Logging.dll + + packages\Microsoft.IdentityModel.Logging.6.8.0\lib\net461\Microsoft.IdentityModel.Logging.dll - - packages\Microsoft.IdentityModel.Tokens.6.7.2-preview-10803222715\lib\netstandard2.0\Microsoft.IdentityModel.Tokens.dll + + packages\Microsoft.IdentityModel.Tokens.6.8.0\lib\net461\Microsoft.IdentityModel.Tokens.dll packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll @@ -83,21 +133,26 @@ packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll - + + C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll + packages\System.AppContext.4.3.0\lib\net463\System.AppContext.dll True True + + packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + - - packages\System.Console.4.3.0\lib\net46\System.Console.dll + + packages\System.Console.4.3.1\lib\net46\System.Console.dll True True - - packages\System.Diagnostics.DiagnosticSource.4.3.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + packages\System.Diagnostics.DiagnosticSource.4.7.1\lib\net46\System.Diagnostics.DiagnosticSource.dll packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll @@ -146,8 +201,11 @@ True True - - packages\System.Net.Http.4.3.0\lib\net46\System.Net.Http.dll + + packages\System.Memory.4.5.4\lib\net461\System.Memory.dll + + + packages\System.Net.Http.4.3.4\lib\net46\System.Net.Http.dll True True @@ -157,18 +215,24 @@ True + + packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll + packages\System.Reflection.4.3.0\lib\net462\System.Reflection.dll True True - - packages\System.Runtime.4.3.0\lib\net462\System.Runtime.dll + + packages\System.Runtime.4.3.1\lib\net462\System.Runtime.dll True True - - packages\System.Runtime.Extensions.4.3.0\lib\net462\System.Runtime.Extensions.dll + + packages\System.Runtime.CompilerServices.Unsafe.4.7.1\lib\net461\System.Runtime.CompilerServices.Unsafe.dll + + + packages\System.Runtime.Extensions.4.3.1\lib\net462\System.Runtime.Extensions.dll True True @@ -184,12 +248,12 @@ - packages\System.Security.Cryptography.Algorithms.4.3.0\lib\net463\System.Security.Cryptography.Algorithms.dll + packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\System.Security.Cryptography.Algorithms.dll True True - - packages\System.Security.Cryptography.Cng.4.5.0\lib\net47\System.Security.Cryptography.Cng.dll + + packages\System.Security.Cryptography.Cng.4.7.0\lib\net47\System.Security.Cryptography.Cng.dll packages\System.Security.Cryptography.Encoding.4.3.0\lib\net46\System.Security.Cryptography.Encoding.dll @@ -201,13 +265,13 @@ True True - - packages\System.Security.Cryptography.X509Certificates.4.3.0\lib\net461\System.Security.Cryptography.X509Certificates.dll + + packages\System.Security.Cryptography.X509Certificates.4.3.2\lib\net461\System.Security.Cryptography.X509Certificates.dll True True - packages\System.Text.RegularExpressions.4.3.0\lib\net463\System.Text.RegularExpressions.dll + packages\System.Text.RegularExpressions.4.3.1\lib\net463\System.Text.RegularExpressions.dll True True @@ -222,7 +286,7 @@ 4.0 - packages\System.Xml.ReaderWriter.4.3.0\lib\net46\System.Xml.ReaderWriter.dll + packages\System.Xml.ReaderWriter.4.3.1\lib\net46\System.Xml.ReaderWriter.dll True True @@ -237,6 +301,8 @@ + + @@ -283,6 +349,12 @@ LaunchProgressWindow.xaml + + Form + + + LoginBrowser.cs + MasterKeyEntryWindow.xaml @@ -392,6 +464,9 @@ ResXFileCodeGenerator Resources.Designer.cs + + LoginBrowser.cs + @@ -437,16 +512,27 @@ if "$(ConfigurationName)"=="Debug" ( ) - copy /Y "$(TargetDir)$(TargetFileName)" "N:\Dropbox\InnerSpace\$(TargetFileName)" + + - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/packages.config b/packages.config index 442c28b..760b5f0 100644 --- a/packages.config +++ b/packages.config @@ -1,21 +1,26 @@  + + + + - - - - - - + + + + + + - + + - + - + @@ -27,31 +32,34 @@ - - + + + + - - + + + - - + + - + - + - + \ No newline at end of file From aebb6cc7c9abef16b4b94eb6adf8800106017edb Mon Sep 17 00:00:00 2001 From: Jizheng Date: Tue, 3 Nov 2020 14:09:48 +0000 Subject: [PATCH 02/23] v1.0.0.37 --- App.xaml.cs | 4 ++- Games/EVE/EVEAccount.cs | 6 ++++ Properties/AssemblyInfo.cs | 4 +-- Web/RequestResponse.cs | 46 ++++++++++++++++------------ Windows/LaunchProgressWindow.xaml.cs | 5 +++ Windows/LoginBrowser.cs | 26 +++++++++++----- Windows/MainWindow.xaml.cs | 2 +- 7 files changed, 62 insertions(+), 31 deletions(-) diff --git a/App.xaml.cs b/App.xaml.cs index c2b77f2..95ac0f1 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -19,6 +19,7 @@ using System.Net; using ISBoxerEVELauncher.Windows; + namespace ISBoxerEVELauncher { /// @@ -27,9 +28,10 @@ namespace ISBoxerEVELauncher public partial class App : Application { public static bool HasInnerSpace { get; set; } - public static LoginBrowser myLB =new LoginBrowser(); + public static LoginBrowser myLB = new LoginBrowser(); public static string strUserName {get; set; } + public static string AppVersion { get diff --git a/Games/EVE/EVEAccount.cs b/Games/EVE/EVEAccount.cs index 14cc3be..e4aa77f 100644 --- a/Games/EVE/EVEAccount.cs +++ b/Games/EVE/EVEAccount.cs @@ -1314,6 +1314,12 @@ public LoginResult GetAccessToken(bool sisi, out Token accessToken) string RequestVerificationToken = string.Empty; var result = GetRequestVerificationToken(uri, sisi, out RequestVerificationToken); + if (result == LoginResult.Error) + { + accessToken = null; + return result; + } + var req = RequestResponse.CreatePostRequest(uri, sisi, true, "URL", Cookies); using (SecureBytesWrapper body = new SecureBytesWrapper()) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index dd41830..2790b1d 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -51,5 +51,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.36")] -[assembly: AssemblyFileVersion("1.0.0.36")] +[assembly: AssemblyVersion("1.0.0.37")] +[assembly: AssemblyFileVersion("1.0.0.37")] diff --git a/Web/RequestResponse.cs b/Web/RequestResponse.cs index d374638..115e4cd 100644 --- a/Web/RequestResponse.cs +++ b/Web/RequestResponse.cs @@ -10,6 +10,7 @@ using ISBoxerEVELauncher.Extensions; using ISBoxerEVELauncher.Enums; using ISBoxerEVELauncher.Windows; +using ISBoxerEVELauncher; using Microsoft.IdentityModel.Tokens; namespace ISBoxerEVELauncher.Web @@ -34,7 +35,7 @@ public static class RequestResponse public const string refererUri = "https://launcher.eveonline.com/6-0-x/6.4.15/"; - + public static Uri GetLoginUri(bool sisi, string state, string challengeHash) { @@ -95,9 +96,9 @@ public static HttpWebRequest CreatePostRequest(Uri uri, bool sisi, bool origin, public static byte[] GetSsoTokenRequestBody(bool sisi, string authCode, byte[] challengeCode) { - return + return Encoding.UTF8.GetBytes(new Uri("/", UriKind.Relative) - .AddQuery("grant_type","authorization_code") + .AddQuery("grant_type", "authorization_code") .AddQuery("client_id", "eveLauncherTQ") .AddQuery("redirect_uri", new Uri(new Uri(sisi ? RequestResponse.sisiBaseUri : RequestResponse.tqBaseUri), launcher) .AddQuery("client_id", "eveLauncherTQ").ToString()) @@ -231,33 +232,41 @@ private static HttpWebRequest CreateHttpWebRequest(Uri uri, string methodType, b return req; } - public static LoginResult GetHttpWebResponse(HttpWebRequest webRequest, Action updateCookies, out Response response, bool tofModified = false) + public static LoginResult GetHttpWebResponse(HttpWebRequest webRequest, Action updateCookies, out Response response) { response = null; + bool tofModified = false; + + try + { + response = new Response(webRequest); + } + catch (Exception e) + { + tofModified = true; + } try { if (tofModified) { App.myLB = new LoginBrowser(); - App.myLB.chromiumWebBrowser.Text = App.strUserName; + App.myLB.Clearup(); + App.myLB.Text = "EVE - " + App.strUserName; + App.myLB.chromiumWebBrowser.Load(webRequest.Address.ToString()); - + App.myLB.ShowDialog(); } - if (!tofModified) - { - response = new Response(webRequest); - } - else + if (tofModified) { //response.Body = strHTML; - if (App.myLB.strHTML_RequestVerificationToken == "") + if (App.myLB.strHTML_Result == "") return LoginResult.Error; response = new Response(webRequest, WebRequestType.RequestVerificationToken); } - + if (updateCookies != null) { updateCookies(); @@ -277,14 +286,11 @@ public static LoginResult GetHttpWebResponse(HttpWebRequest webRequest, Action u return LoginResult.Error; } default: - if (tofModified) - throw; + throw; break; } - - GetHttpWebResponse(webRequest, updateCookies, out response, true); } - + return LoginResult.Success; } @@ -329,8 +335,8 @@ public static string GetEulaReturnUrlFromBody(string body) return body.Substring(fieldStart, fieldEnd - fieldStart); } - - + + } } diff --git a/Windows/LaunchProgressWindow.xaml.cs b/Windows/LaunchProgressWindow.xaml.cs index e7534c0..a4fa94c 100644 --- a/Windows/LaunchProgressWindow.xaml.cs +++ b/Windows/LaunchProgressWindow.xaml.cs @@ -174,6 +174,11 @@ void Timer_Tick(object sender, EventArgs e) LastLaunch = DateTime.Now; AddDetailsLine("Account '" + a.EVEAccount.Username + "' launched"); break; + case LoginResult.Error: + Accounts.Remove(a); + LastLaunch = DateTime.Now; + AddDetailsLine("Account '" + a.EVEAccount.Username + "' cannot be launched, skip to the next one if there is any."); + break; default: AddDetailsLine("Account '" + a.EVEAccount.Username + "' failed to launch: " + lr.ToString() + ". Aborting!"); NumErrors++; diff --git a/Windows/LoginBrowser.cs b/Windows/LoginBrowser.cs index e9713eb..bb81cfb 100644 --- a/Windows/LoginBrowser.cs +++ b/Windows/LoginBrowser.cs @@ -14,17 +14,29 @@ namespace ISBoxerEVELauncher.Windows { public partial class LoginBrowser : Form { - public string strCurrentAddress = ""; - public string strHTML_RequestVerificationToken = ""; - public string strURL_RequestVerificationToken = ""; - public string strHTML_VerficationCode = ""; - public string strURL_VerficationCode = ""; - public string strHTML_Result = ""; - public string strURL_Result = ""; + public string strCurrentAddress { get; set; } + public string strHTML_RequestVerificationToken { get; set; } + public string strURL_RequestVerificationToken { get; set; } + public string strHTML_VerficationCode { get; set; } + public string strURL_VerficationCode { get; set; } + public string strHTML_Result { get; set; } + public string strURL_Result { get; set; } public LoginBrowser() { InitializeComponent(); + Clearup(); + } + + public void Clearup() + { + strCurrentAddress = ""; + strHTML_RequestVerificationToken = ""; + strURL_RequestVerificationToken = ""; + strHTML_VerficationCode = ""; + strURL_VerficationCode = ""; + strHTML_Result = ""; + strURL_Result = ""; } private void chromiumWebBrowser_AddressChanged(object sender, CefSharp.AddressChangedEventArgs e) diff --git a/Windows/MainWindow.xaml.cs b/Windows/MainWindow.xaml.cs index cc98fe3..d7ae1fd 100644 --- a/Windows/MainWindow.xaml.cs +++ b/Windows/MainWindow.xaml.cs @@ -823,7 +823,7 @@ private void buttonLaunchCharacterIS_Click(object sender, RoutedEventArgs e) List launchCharacters = new List(); foreach (EVECharacter a in listCharacters.SelectedItems) { - launchCharacters.Add(a); + launchCharacters.Add(a); } if (launchCharacters.Count == 0) From 3bf6e419a97c798b765a999724d35441b59e3df5 Mon Sep 17 00:00:00 2001 From: Jizheng Date: Tue, 3 Nov 2020 14:35:59 +0000 Subject: [PATCH 03/23] update --- app.manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.manifest b/app.manifest index 90915b2..074a6c5 100644 --- a/app.manifest +++ b/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + From 186be56bb347f4524d086cdb46d75b1be8412588 Mon Sep 17 00:00:00 2001 From: Jizheng Date: Tue, 3 Nov 2020 14:50:57 +0000 Subject: [PATCH 04/23] update --- Games/EVE/EVEAccount.cs | 1 + app.manifest | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/Games/EVE/EVEAccount.cs b/Games/EVE/EVEAccount.cs index e4aa77f..17040ec 100644 --- a/Games/EVE/EVEAccount.cs +++ b/Games/EVE/EVEAccount.cs @@ -16,6 +16,7 @@ using ISBoxerEVELauncher.Web; using System.Security.Cryptography; using ISBoxerEVELauncher.Interface; +using ISBoxerEVELauncher; namespace ISBoxerEVELauncher.Games.EVE diff --git a/app.manifest b/app.manifest index 074a6c5..90915b2 100644 --- a/app.manifest +++ b/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + From 56779f0cc0820bed53e41a7f31197fa82ee2e81f Mon Sep 17 00:00:00 2001 From: Jizheng Date: Tue, 3 Nov 2020 18:27:32 +0000 Subject: [PATCH 05/23] beta2 --- App.xaml.cs | 14 ++++---- Windows/LoginBrowser.Designer.cs | 47 ++++++++++++++++++++++++-- Windows/LoginBrowser.cs | 58 +++++++++++++++++++++++--------- Windows/LoginBrowser.resx | 41 ++++++++++++++++++++++ app.manifest | 2 +- 5 files changed, 136 insertions(+), 26 deletions(-) diff --git a/App.xaml.cs b/App.xaml.cs index 95ac0f1..55457ea 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -734,15 +734,13 @@ private void ApplicationStart(object sender, StartupEventArgs e) HasInnerSpace = true; } - var mainWindow = new Windows.MainWindow(); - //Re-enable normal shutdown mode. - Current.ShutdownMode = ShutdownMode.OnMainWindowClose; - Current.MainWindow = mainWindow; - mainWindow.Show(); + var mainWindow = new Windows.MainWindow(); + //Re-enable normal shutdown mode. + Current.ShutdownMode = ShutdownMode.OnMainWindowClose; + Current.MainWindow = mainWindow; + mainWindow.Show(); - - - ProcessCommandLine(CommandLine); + ProcessCommandLine(CommandLine); } } diff --git a/Windows/LoginBrowser.Designer.cs b/Windows/LoginBrowser.Designer.cs index a541bdd..6402c2f 100644 --- a/Windows/LoginBrowser.Designer.cs +++ b/Windows/LoginBrowser.Designer.cs @@ -28,34 +28,77 @@ protected override void Dispose(bool disposing) /// private void InitializeComponent() { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginBrowser)); this.chromiumWebBrowser = new CefSharp.WinForms.ChromiumWebBrowser(); + this.toolStrip_Main = new System.Windows.Forms.ToolStrip(); + this.toolStripTextBox_Addressbar = new System.Windows.Forms.ToolStripTextBox(); + this.toolStripButton_Refresh = new System.Windows.Forms.ToolStripButton(); + this.toolStrip_Main.SuspendLayout(); this.SuspendLayout(); // // chromiumWebBrowser // this.chromiumWebBrowser.ActivateBrowserOnCreation = false; this.chromiumWebBrowser.Dock = System.Windows.Forms.DockStyle.Fill; - this.chromiumWebBrowser.Location = new System.Drawing.Point(0, 0); + this.chromiumWebBrowser.Location = new System.Drawing.Point(0, 39); this.chromiumWebBrowser.Name = "chromiumWebBrowser"; - this.chromiumWebBrowser.Size = new System.Drawing.Size(804, 631); + this.chromiumWebBrowser.Size = new System.Drawing.Size(804, 592); this.chromiumWebBrowser.TabIndex = 0; this.chromiumWebBrowser.FrameLoadEnd += new System.EventHandler(this.chromiumWebBrowser_FrameLoadEnd); this.chromiumWebBrowser.AddressChanged += new System.EventHandler(this.chromiumWebBrowser_AddressChanged); // + // toolStrip_Main + // + this.toolStrip_Main.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.toolStripTextBox_Addressbar, + this.toolStripButton_Refresh}); + this.toolStrip_Main.Location = new System.Drawing.Point(0, 0); + this.toolStrip_Main.Name = "toolStrip_Main"; + this.toolStrip_Main.Size = new System.Drawing.Size(804, 39); + this.toolStrip_Main.TabIndex = 1; + this.toolStrip_Main.Text = "toolStrip1"; + // + // toolStripTextBox_Addressbar + // + this.toolStripTextBox_Addressbar.Enabled = false; + this.toolStripTextBox_Addressbar.Font = new System.Drawing.Font("Segoe UI", 9F); + this.toolStripTextBox_Addressbar.Name = "toolStripTextBox_Addressbar"; + this.toolStripTextBox_Addressbar.Size = new System.Drawing.Size(700, 39); + // + // toolStripButton_Refresh + // + this.toolStripButton_Refresh.Alignment = System.Windows.Forms.ToolStripItemAlignment.Right; + this.toolStripButton_Refresh.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image; + this.toolStripButton_Refresh.Image = ((System.Drawing.Image)(resources.GetObject("toolStripButton_Refresh.Image"))); + this.toolStripButton_Refresh.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; + this.toolStripButton_Refresh.ImageTransparentColor = System.Drawing.Color.Magenta; + this.toolStripButton_Refresh.Name = "toolStripButton_Refresh"; + this.toolStripButton_Refresh.Size = new System.Drawing.Size(36, 36); + this.toolStripButton_Refresh.Text = "toolStripButton1"; + this.toolStripButton_Refresh.Click += new System.EventHandler(this.toolStripButton_Refresh_Click); + // // LoginBrowser // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; this.ClientSize = new System.Drawing.Size(804, 631); this.Controls.Add(this.chromiumWebBrowser); + this.Controls.Add(this.toolStrip_Main); this.Name = "LoginBrowser"; this.Text = "EVE Online Login"; + this.Resize += new System.EventHandler(this.LoginBrowser_Resize); + this.toolStrip_Main.ResumeLayout(false); + this.toolStrip_Main.PerformLayout(); this.ResumeLayout(false); + this.PerformLayout(); } #endregion public CefSharp.WinForms.ChromiumWebBrowser chromiumWebBrowser; + private System.Windows.Forms.ToolStrip toolStrip_Main; + public System.Windows.Forms.ToolStripTextBox toolStripTextBox_Addressbar; + private System.Windows.Forms.ToolStripButton toolStripButton_Refresh; } } \ No newline at end of file diff --git a/Windows/LoginBrowser.cs b/Windows/LoginBrowser.cs index bb81cfb..99873d9 100644 --- a/Windows/LoginBrowser.cs +++ b/Windows/LoginBrowser.cs @@ -14,18 +14,40 @@ namespace ISBoxerEVELauncher.Windows { public partial class LoginBrowser : Form { - public string strCurrentAddress { get; set; } - public string strHTML_RequestVerificationToken { get; set; } - public string strURL_RequestVerificationToken { get; set; } - public string strHTML_VerficationCode { get; set; } - public string strURL_VerficationCode { get; set; } - public string strHTML_Result { get; set; } - public string strURL_Result { get; set; } + public string strCurrentAddress + { + get; set; + } + public string strHTML_RequestVerificationToken + { + get; set; + } + public string strURL_RequestVerificationToken + { + get; set; + } + public string strHTML_VerficationCode + { + get; set; + } + public string strURL_VerficationCode + { + get; set; + } + public string strHTML_Result + { + get; set; + } + public string strURL_Result + { + get; set; + } public LoginBrowser() { InitializeComponent(); Clearup(); + toolStripTextBox_Addressbar.Size = new Size(toolStrip_Main.Size.Width - toolStripButton_Refresh.Size.Width - 20, toolStripTextBox_Addressbar.Size.Height); } public void Clearup() @@ -42,6 +64,7 @@ public void Clearup() private void chromiumWebBrowser_AddressChanged(object sender, CefSharp.AddressChangedEventArgs e) { strCurrentAddress = e.Address; + this.InvokeOnUiThreadIfRequired(() => toolStripTextBox_Addressbar.Text = e.Address); } private void chromiumWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEndEventArgs e) @@ -53,16 +76,12 @@ private void chromiumWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEn const string needle = "name=\"__RequestVerificationToken\" type=\"hidden\" value=\""; int hashStart = taskHtml.Result.IndexOf(needle, StringComparison.Ordinal); - if (hashStart == -1) - { - - } - else + if (hashStart != -1) { strHTML_RequestVerificationToken = taskHtml.Result; strURL_RequestVerificationToken = strCurrentAddress; } - + if (taskHtml.Result.Contains("Be sure to click the prompt above to login to the EVE Online launcher")) { strHTML_Result = taskHtml.Result; @@ -81,8 +100,17 @@ private void chromiumWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEn }); } + private void LoginBrowser_Resize(object sender, EventArgs e) + { + toolStripTextBox_Addressbar.Size = new Size(toolStrip_Main.Size.Width - toolStripButton_Refresh.Size.Width - 20, toolStripTextBox_Addressbar.Size.Height); + } + private void toolStripButton_Refresh_Click(object sender, EventArgs e) + { + if (toolStripTextBox_Addressbar.Text != "") + { + this.InvokeOnUiThreadIfRequired(() => chromiumWebBrowser.Load(toolStripTextBox_Addressbar.Text)); + } + } } - - } diff --git a/Windows/LoginBrowser.resx b/Windows/LoginBrowser.resx index 1af7de1..cc81fe5 100644 --- a/Windows/LoginBrowser.resx +++ b/Windows/LoginBrowser.resx @@ -117,4 +117,45 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + 17, 17 + + + + + iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 + YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAdPSURBVFhH7ZZrTJvXGcezrWulbdq0mzSt26R+6Ye1LOkg + abKEptqlTddU4hYgkDXNoiLUQBhKwiUiJWlDsm5T2qYdIUsaLiZAuLngGxeDwdx8e218v2Ab2/gG2BjY + 0qTSpP/OefOaIUwjou1j/9Jfr8/r5zy/5zznHMO2L/WlHkW7z+qeTD3HFKVWqSWpZxnNnirm39T0M/uO + fEdjuPD/n/adY5L3ndXcfPWyHuWdHtQzUbQaIhgOrEA+/xk6LCto0C6x39EYGkvncNP/N+2tUP/lwEUG + 70lcEDgXIPYuQ0AsdARhC0XQ7ZhHh3sJAk8Mff5VSOfv4f2RMF65NA06l0vz6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R03Gj8dNxyTmMRqzfk48D02YqG3b/gMGsC7Q3A4uSAAAAABJRU5ErkJggg== + + \ No newline at end of file diff --git a/app.manifest b/app.manifest index 90915b2..074a6c5 100644 --- a/app.manifest +++ b/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + From 1cc1a39634135201bf4b64d0edd8fb805f9c1cc5 Mon Sep 17 00:00:00 2001 From: Jizheng Date: Sat, 7 Nov 2020 22:52:24 +0000 Subject: [PATCH 06/23] Beta3 --- App.xaml.cs | 1390 +++++++++++++++--------------- Games/EVE/EVEAccount.cs | 1 + Windows/LoginBrowser.Designer.cs | 2 +- Windows/LoginBrowser.cs | 10 +- Windows/LoginBrowser.resx | 64 +- 5 files changed, 751 insertions(+), 716 deletions(-) diff --git a/App.xaml.cs b/App.xaml.cs index 55457ea..4588b3b 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -1,14 +1,11 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Configuration; -using System.Data; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Text; -using System.Threading.Tasks; using System.Windows; using Microsoft.Win32; using ISBoxerEVELauncher.Extensions; @@ -17,722 +14,751 @@ using ISBoxerEVELauncher.Games.EVE; using ISBoxerEVELauncher.Interface; using System.Net; +using CefSharp.WinForms; using ISBoxerEVELauncher.Windows; namespace ISBoxerEVELauncher { - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - public static bool HasInnerSpace { get; set; } - public static LoginBrowser myLB = new LoginBrowser(); - public static string strUserName {get; set; } - - - public static string AppVersion - { - get - { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); - } - } - - - public static void ReloadGameConfiguration() - { - try - { - GameConfiguration = InnerSpaceSettings.Load(ISPath + @"\GameConfiguration.XML"); - } - catch - { - GameConfiguration = null; - } - } - - public static string DetectedEVESharedCachePath - { - get - { - RegistryKey hkcu = Registry.CurrentUser; - RegistryKey PathKey = hkcu.OpenSubKey(@"SOFTWARE\CCP\EVEONLINE"); - if (PathKey != null) - { - string value = PathKey.GetValue("CACHEFOLDER", Environment.SpecialFolder.CommonApplicationData + @"\CCP\EVE\SharedCache\") as string; - return value; + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + public static bool HasInnerSpace + { + get; set; + } + public static LoginBrowser myLB = new LoginBrowser(); + public static string strUserName + { + get; set; + } + public static string strPassword + { + get; set; + } + + + public static string AppVersion + { + get + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); } - return null; - } - - } - - public static string[] CommandLine; - public static bool ExitAfterLaunch; - public static bool searchCharactersOnly; - - static Settings _Settings; - public static Settings Settings - { - get - { - if (_Settings == null) - { - try - { - _Settings = Settings.Load(); - if (EVEAccount.ShouldUgradeCookieStorage) - { - _Settings.Store(); - } - } - catch (System.IO.FileNotFoundException) - { - _Settings = new Settings(); - _Settings.Store(); - } - } - return _Settings; - } - } - - public static string ISBoxerEVELauncherPath - { - get - { - return System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - } - } - - public static string ISExecutable - { - get - { - return ISPath + "\\InnerSpace.exe"; - } - } - - public static string BaseDirectory - { - get - { - return System.AppDomain.CurrentDomain.BaseDirectory; - } - } - - static string _ISPath = string.Empty; - /// - /// Path to Inner Space, which should either be in the registry, or the current folder. Otherwise, the user likely doesn't care about Inner Space integration. - /// - public static string ISPath - { - get - { - // already detected? - if (!string.IsNullOrEmpty(_ISPath)) - return _ISPath; - - // nope. - - // we're expected to be installed into the IS/ISBoxer folder.... - if (System.IO.File.Exists(BaseDirectory + @"\InnerSpace.exe")) - { - _ISPath = BaseDirectory; - return _ISPath; - } - - // oh well... the path SHOULD be in the registry... - { - RegistryKey hklm = Registry.LocalMachine; - RegistryKey ISPathKey = hklm.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\App Paths\InnerSpace.exe"); - if (ISPathKey != null) - { - string reg_path = ISPathKey.GetValue("Path", Environment.SpecialFolder.ProgramFiles + @"\InnerSpace") as string; - if (System.IO.File.Exists(reg_path + "\\InnerSpace.exe")) - { - _ISPath = reg_path; - return _ISPath; - } - } - } - - // didn't find it. maybe not even installed. - return BaseDirectory; - } - set - { - _ISPath = value; - } - } - - static void ReloadGameProfiles() - { - InnerSpaceGameProfile gpSingularity = Settings.SingularityGameProfile; - InnerSpaceGameProfile gpTranquility = Settings.TranquilityGameProfile; - - if (_GameProfiles == null) - { - _GameProfiles = new ObservableCollection(); - } - else - _GameProfiles.Clear(); - - if (GameConfiguration != null) - { - if (GameConfiguration.Sets != null) - { - foreach (Set gameSet in GameConfiguration.Sets) - { - Set profilesSet = gameSet.FindSet("Profiles"); - if (profilesSet == null || profilesSet.Sets == null) - continue; - - foreach (Set gameProfileSet in profilesSet.Sets) - { - InnerSpaceGameProfile gp = new InnerSpaceGameProfile() { Game = gameSet.Name, GameProfile = gameProfileSet.Name }; - _GameProfiles.Add(gp); - } - } - } - } - - Settings.SingularityGameProfile = App.FindGlobalGameProfile(gpSingularity); - Settings.TranquilityGameProfile = App.FindGlobalGameProfile(gpTranquility); - } - - public static Set FindGameProfileSet(string gameName, string gameProfileName) - { - if (string.IsNullOrWhiteSpace(gameName) || string.IsNullOrWhiteSpace(gameProfileName)) - return null; + } - if (GameConfiguration == null || GameConfiguration.Sets == null) - return null; - Set gameSet = GameConfiguration.FindSet(gameName); - if (gameSet == null) - return null; + public static void ReloadGameConfiguration() + { + try + { + GameConfiguration = InnerSpaceSettings.Load(ISPath + @"\GameConfiguration.XML"); + } + catch + { + GameConfiguration = null; + } + } - Set profilesSet = gameSet.FindSet("Profiles"); - if (profilesSet == null || profilesSet.Sets == null) - return null; + public static string DetectedEVESharedCachePath + { + get + { + RegistryKey hkcu = Registry.CurrentUser; + RegistryKey PathKey = hkcu.OpenSubKey(@"SOFTWARE\CCP\EVEONLINE"); + if (PathKey != null) + { + string value = PathKey.GetValue("CACHEFOLDER", Environment.SpecialFolder.CommonApplicationData + @"\CCP\EVE\SharedCache\") as string; + return value; + } + return null; + } + + } + + public static string[] CommandLine; + public static bool ExitAfterLaunch; + public static bool searchCharactersOnly; + + static Settings _Settings; + public static Settings Settings + { + get + { + if (_Settings == null) + { + try + { + _Settings = Settings.Load(); + if (EVEAccount.ShouldUgradeCookieStorage) + { + _Settings.Store(); + } + } + catch (System.IO.FileNotFoundException) + { + _Settings = new Settings(); + _Settings.Store(); + } + } + return _Settings; + } + } - return profilesSet.FindSet(gameProfileName); - } + public static string ISBoxerEVELauncherPath + { + get + { + return System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + } + } + + public static string ISExecutable + { + get + { + return ISPath + "\\InnerSpace.exe"; + } + } + + public static string BaseDirectory + { + get + { + return System.AppDomain.CurrentDomain.BaseDirectory; + } + } + + static string _ISPath = string.Empty; + /// + /// Path to Inner Space, which should either be in the registry, or the current folder. Otherwise, the user likely doesn't care about Inner Space integration. + /// + public static string ISPath + { + get + { + // already detected? + if (!string.IsNullOrEmpty(_ISPath)) + return _ISPath; + + // nope. + + // we're expected to be installed into the IS/ISBoxer folder.... + if (System.IO.File.Exists(BaseDirectory + @"\InnerSpace.exe")) + { + _ISPath = BaseDirectory; + return _ISPath; + } + + // oh well... the path SHOULD be in the registry... + { + RegistryKey hklm = Registry.LocalMachine; + RegistryKey ISPathKey = hklm.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\App Paths\InnerSpace.exe"); + if (ISPathKey != null) + { + string reg_path = ISPathKey.GetValue("Path", Environment.SpecialFolder.ProgramFiles + @"\InnerSpace") as string; + if (System.IO.File.Exists(reg_path + "\\InnerSpace.exe")) + { + _ISPath = reg_path; + return _ISPath; + } + } + } + + // didn't find it. maybe not even installed. + return BaseDirectory; + } + set + { + _ISPath = value; + } + } + + static void ReloadGameProfiles() + { + InnerSpaceGameProfile gpSingularity = Settings.SingularityGameProfile; + InnerSpaceGameProfile gpTranquility = Settings.TranquilityGameProfile; - static Set _GameConfiguration; - public static Set GameConfiguration { get { return _GameConfiguration; } private set { _GameConfiguration = value; ReloadGameProfiles(); } } - static ObservableCollection _GameProfiles; - public static ObservableCollection GameProfiles - { - get - { if (_GameProfiles == null) { - _GameProfiles = new ObservableCollection(); - ReloadGameProfiles(); - } - return _GameProfiles; - } - private set - { - _GameProfiles = value; - } - } - - public static InnerSpaceGameProfile FindGlobalGameProfile(InnerSpaceGameProfile likeThis) - { - if (GameProfiles == null || likeThis == null) - return likeThis; - - InnerSpaceGameProfile found = GameProfiles.FirstOrDefault(q => q.Game.Equals(likeThis.Game, StringComparison.InvariantCultureIgnoreCase) && q.GameProfile.Equals(likeThis.GameProfile, StringComparison.InvariantCultureIgnoreCase)); - if (found == null) - return likeThis; - - return found; - } - - static bool AddGameToXML(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) - { - // not running, just edit the XML - if (GameConfiguration == null) - { - // no existing XML. - return false; - } - - Set gameSet = GameConfiguration.FindSet(gameName); - if (gameSet == null) - { - gameSet = new Set(gameName); - GameConfiguration.Add(gameSet); - gameSet.Add(new Setting("OpenGL", "1")); - gameSet.Add(new Setting("Direct3D8", "1")); - gameSet.Add(new Setting("Direct3D9", "1")); - gameSet.Add(new Setting("Win32I Keyboard", "1")); - gameSet.Add(new Setting("Win32I Mouse", "1")); - gameSet.Add(new Setting("DirectInput8 Keyboard", "1")); - gameSet.Add(new Setting("DirectInput8 Mouse", "1")); - gameSet.Add(new Setting("modules", "auto")); - gameSet.Add(new Setting("Background Mouse", "1")); - gameSet.Add(new Setting("Keystroke Delay", "1")); - } - - Set gameProfilesSet = gameSet.FindSet("Profiles"); - if (gameProfilesSet == null) - { - gameProfilesSet = new Set("Profiles"); - gameSet.Add(gameProfilesSet); - } - - Set gameProfileSet = gameSet.FindSet(gameProfileName); - if (gameProfileSet == null) - { - gameProfileSet = new Set(gameProfileName); - gameProfilesSet.Add(gameProfileSet); - } - - Setting setting = gameProfileSet.FindSetting("Executable"); - if (setting == null) - gameProfileSet.Add(new Setting("Executable", executableName)); - else - setting.Value = executableName; - - setting = gameProfileSet.FindSetting("Path"); - if (setting == null) - gameProfileSet.Add(new Setting("Path", executablePath)); - else - setting.Value = executablePath; - - setting = gameProfileSet.FindSetting("Parameters"); - if (setting == null) - { - if (!string.IsNullOrEmpty(parameters)) - gameProfileSet.Add(new Setting("Parameters", parameters)); - } - else - { - if (string.IsNullOrEmpty(parameters)) - gameProfileSet.Settings.Remove(setting); + _GameProfiles = new ObservableCollection(); + } else - setting.Value = parameters; - } - - if (GameProfiles.FirstOrDefault(q => q.GameProfile.Equals(gameProfileName)) == null) - { - GameProfiles.Add(new InnerSpaceGameProfile() { Game = gameName, GameProfile = gameProfileName }); - } - - GameConfiguration.Store(ISPath + @"\GameConfiguration.XML"); - return true; - } - /// - /// Add a Game/Game Profile to Inner Space - /// - /// - /// - /// - /// - /// - /// - public static bool AddGame(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) - { - string isboxerFilename = System.IO.Path.Combine(ISPath, "ISBoxer Toolkit.exe"); - while (true) - { - System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("InnerSpace"); - if (processes.Length == 0) - { - if (!AddGameToXML(gameName, gameProfileName, executablePath, executableName, parameters)) - { - MessageBox.Show("In order to Add Game for you, ISBoxer EVE Launcher requires that GameConfiguration.XML exist in the Inner Space folder -- looking for: " + isboxerFilename); - return false; - } - return true; - } - - if (!System.IO.File.Exists(isboxerFilename)) - { - switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) - { - case MessageBoxResult.OK: - continue; - case MessageBoxResult.Cancel: - return false; - } + _GameProfiles.Clear(); + + if (GameConfiguration != null) + { + if (GameConfiguration.Sets != null) + { + foreach (Set gameSet in GameConfiguration.Sets) + { + Set profilesSet = gameSet.FindSet("Profiles"); + if (profilesSet == null || profilesSet.Sets == null) + continue; + + foreach (Set gameProfileSet in profilesSet.Sets) + { + InnerSpaceGameProfile gp = new InnerSpaceGameProfile() { Game = gameSet.Name, GameProfile = gameProfileSet.Name }; + _GameProfiles.Add(gp); + } + } + } } + + Settings.SingularityGameProfile = App.FindGlobalGameProfile(gpSingularity); + Settings.TranquilityGameProfile = App.FindGlobalGameProfile(gpTranquility); + } + + public static Set FindGameProfileSet(string gameName, string gameProfileName) + { + if (string.IsNullOrWhiteSpace(gameName) || string.IsNullOrWhiteSpace(gameProfileName)) + return null; + + if (GameConfiguration == null || GameConfiguration.Sets == null) + return null; + + Set gameSet = GameConfiguration.FindSet(gameName); + if (gameSet == null) + return null; + + Set profilesSet = gameSet.FindSet("Profiles"); + if (profilesSet == null || profilesSet.Sets == null) + return null; + + return profilesSet.FindSet(gameProfileName); + } + + static Set _GameConfiguration; + public static Set GameConfiguration + { + get + { + return _GameConfiguration; + } + private set + { + _GameConfiguration = value; + ReloadGameProfiles(); + } + } + static ObservableCollection _GameProfiles; + public static ObservableCollection GameProfiles + { + get + { + if (_GameProfiles == null) + { + _GameProfiles = new ObservableCollection(); + ReloadGameProfiles(); + } + return _GameProfiles; + } + private set + { + _GameProfiles = value; + } + } + + public static InnerSpaceGameProfile FindGlobalGameProfile(InnerSpaceGameProfile likeThis) + { + if (GameProfiles == null || likeThis == null) + return likeThis; + + InnerSpaceGameProfile found = GameProfiles.FirstOrDefault(q => q.Game.Equals(likeThis.Game, StringComparison.InvariantCultureIgnoreCase) && q.GameProfile.Equals(likeThis.GameProfile, StringComparison.InvariantCultureIgnoreCase)); + if (found == null) + return likeThis; + + return found; + } + + static bool AddGameToXML(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) + { + // not running, just edit the XML + if (GameConfiguration == null) + { + // no existing XML. + return false; + } + + Set gameSet = GameConfiguration.FindSet(gameName); + if (gameSet == null) + { + gameSet = new Set(gameName); + GameConfiguration.Add(gameSet); + gameSet.Add(new Setting("OpenGL", "1")); + gameSet.Add(new Setting("Direct3D8", "1")); + gameSet.Add(new Setting("Direct3D9", "1")); + gameSet.Add(new Setting("Win32I Keyboard", "1")); + gameSet.Add(new Setting("Win32I Mouse", "1")); + gameSet.Add(new Setting("DirectInput8 Keyboard", "1")); + gameSet.Add(new Setting("DirectInput8 Mouse", "1")); + gameSet.Add(new Setting("modules", "auto")); + gameSet.Add(new Setting("Background Mouse", "1")); + gameSet.Add(new Setting("Keystroke Delay", "1")); + } + + Set gameProfilesSet = gameSet.FindSet("Profiles"); + if (gameProfilesSet == null) + { + gameProfilesSet = new Set("Profiles"); + gameSet.Add(gameProfilesSet); + } + + Set gameProfileSet = gameSet.FindSet(gameProfileName); + if (gameProfileSet == null) + { + gameProfileSet = new Set(gameProfileName); + gameProfilesSet.Add(gameProfileSet); + } + + Setting setting = gameProfileSet.FindSetting("Executable"); + if (setting == null) + gameProfileSet.Add(new Setting("Executable", executableName)); else + setting.Value = executableName; + + setting = gameProfileSet.FindSetting("Path"); + if (setting == null) + gameProfileSet.Add(new Setting("Path", executablePath)); + else + setting.Value = executablePath; + + setting = gameProfileSet.FindSetting("Parameters"); + if (setting == null) { - FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(isboxerFilename); - if (fvi.ProductMajorPart < 42) - { - switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) - { - case MessageBoxResult.OK: - continue; - case MessageBoxResult.Cancel: + if (!string.IsNullOrEmpty(parameters)) + gameProfileSet.Add(new Setting("Parameters", parameters)); + } + else + { + if (string.IsNullOrEmpty(parameters)) + gameProfileSet.Settings.Remove(setting); + else + setting.Value = parameters; + } + + if (GameProfiles.FirstOrDefault(q => q.GameProfile.Equals(gameProfileName)) == null) + { + GameProfiles.Add(new InnerSpaceGameProfile() { Game = gameName, GameProfile = gameProfileName }); + } + + GameConfiguration.Store(ISPath + @"\GameConfiguration.XML"); + return true; + } + /// + /// Add a Game/Game Profile to Inner Space + /// + /// + /// + /// + /// + /// + /// + public static bool AddGame(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) + { + string isboxerFilename = System.IO.Path.Combine(ISPath, "ISBoxer Toolkit.exe"); + while (true) + { + System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("InnerSpace"); + if (processes.Length == 0) + { + if (!AddGameToXML(gameName, gameProfileName, executablePath, executableName, parameters)) + { + MessageBox.Show("In order to Add Game for you, ISBoxer EVE Launcher requires that GameConfiguration.XML exist in the Inner Space folder -- looking for: " + isboxerFilename); return false; - } - } + } + return true; + } + + if (!System.IO.File.Exists(isboxerFilename)) + { + switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) + { + case MessageBoxResult.OK: + continue; + case MessageBoxResult.Cancel: + return false; + } + } + else + { + FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(isboxerFilename); + if (fvi.ProductMajorPart < 42) + { + switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) + { + case MessageBoxResult.OK: + continue; + case MessageBoxResult.Cancel: + return false; + } + } + } + + + string cmdLine = "run isboxer -inituplink;isboxeraddgame \"" + gameName.Replace("\"", "\\\"") + "\" \"" + gameProfileName.Replace("\"", "\\\"") + "\" \"" + executablePath.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\" \"" + executableName.Replace("\"", "\\\"") + "\" \"" + parameters.Replace("\"", "\\\"") + "\""; + System.Diagnostics.Process.Start(ISExecutable, cmdLine); + return true; + } + } + + /// + /// Have Inner Space launch EVE via a specified Game and Game Profile + /// + /// + /// + /// + /// + /// + /// + static public bool Launch(string gameName, string gameProfileName, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) + { + //if (ssoToken == null) + // throw new ArgumentNullException("ssoToken"); + if (gameName == null) + throw new ArgumentNullException("gameName"); + if (gameProfileName == null) + throw new ArgumentNullException("gameProfileName"); + + string cmdLine = "open \"" + gameName + "\" \"" + gameProfileName + "\" -addparam \"/noconsole\" -addparam \"/ssoToken=" + token.TokenString + "\""; + if (dxVersion != DirectXVersion.Default) + { + cmdLine += " -addparam \"/triPlatform=" + dxVersion.ToString() + "\""; } + if (characterID != 0) + { + cmdLine += " -addparam \"/character=" + characterID + "\""; + } - string cmdLine = "run isboxer -inituplink;isboxeraddgame \"" + gameName.Replace("\"", "\\\"") + "\" \"" + gameProfileName.Replace("\"", "\\\"") + "\" \"" + executablePath.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\" \"" + executableName.Replace("\"", "\\\"") + "\" \"" + parameters.Replace("\"", "\\\"") + "\""; - System.Diagnostics.Process.Start(ISExecutable, cmdLine); + if (sisi) + { + cmdLine += " -addparam \"/server:Singularity\""; + } + else + { + cmdLine += " -addparam \"/server:tranquility\""; + } + + cmdLine += " -addparam \"settingsprofile=ISBEL\" -addparam \"/machineHash=" + App.Settings.MachineHash + "\" \"\""; + + try + { + System.Diagnostics.Process.Start(App.ISExecutable, cmdLine); + } + catch (Exception e) + { + MessageBox.Show("Launch failed. executable=" + App.ISExecutable + "; args=" + cmdLine + System.Environment.NewLine + e.ToString()); + return false; + } return true; - } - } - - /// - /// Have Inner Space launch EVE via a specified Game and Game Profile - /// - /// - /// - /// - /// - /// - /// - static public bool Launch(string gameName, string gameProfileName, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) - { - //if (ssoToken == null) - // throw new ArgumentNullException("ssoToken"); - if (gameName == null) - throw new ArgumentNullException("gameName"); - if (gameProfileName == null) - throw new ArgumentNullException("gameProfileName"); - - string cmdLine = "open \"" + gameName + "\" \"" + gameProfileName + "\" -addparam \"/noconsole\" -addparam \"/ssoToken=" + token.TokenString + "\""; - if (dxVersion != DirectXVersion.Default) - { - cmdLine += " -addparam \"/triPlatform=" + dxVersion.ToString() + "\""; - } - - if (characterID != 0) - { - cmdLine += " -addparam \"/character=" + characterID + "\""; - } - - if (sisi) - { - cmdLine += " -addparam \"/server:Singularity\""; - } - else - { - cmdLine += " -addparam \"/server:tranquility\""; - } - - cmdLine += " -addparam \"settingsprofile=ISBEL\" -addparam \"/machineHash=" + App.Settings.MachineHash + "\" \"\""; - - try - { - System.Diagnostics.Process.Start(App.ISExecutable, cmdLine); - } - catch (Exception e) - { - MessageBox.Show("Launch failed. executable=" + App.ISExecutable + "; args=" + cmdLine + System.Environment.NewLine + e.ToString()); - return false; - } - return true; - } - - /// - /// Launch EVE directly - /// - /// - /// - /// - /// - /// - static public bool Launch(string sharedCachePath, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) - { - //if (ssoToken == null) - // throw new ArgumentNullException("ssoToken"); - if (sharedCachePath == null) - throw new ArgumentNullException("sharedCachePath"); - - string args = "/noconsole /ssoToken=" + token.TokenString; - if (dxVersion != DirectXVersion.Default) - { - args += " /triPlatform=" + dxVersion.ToString(); - } - - if (sisi) - { - args += " /server:Singularity"; - } - else - { - args += " /server:tranquility"; - } - - if (characterID != 0) - { - args += " /character=" + characterID; - } - - args += " /settingsprofile=ISBEL /machineHash=" + App.Settings.MachineHash + " \"\""; - - string executable; - if (sisi) - executable = App.Settings.GetSingularityEXE(); - else - executable = App.Settings.GetTranquilityEXE(); - - if (!System.IO.File.Exists(executable)) - { - MessageBox.Show("Cannot find exefile.exe for launch -- looking at: " + executable); - return false; - } - - try - { - System.Diagnostics.Process.Start(executable, args); - } - catch (Exception e) - { - MessageBox.Show("Launch failed. executable=" + executable + "; args=" + args + System.Environment.NewLine + e.ToString()); - return false; - } - return true; - } - - public static void ProcessCommandLine(string Args) - { - ProcessCommandLine(Args.SplitCommandLine()); - } - - public static void ProcessCommandLine(IEnumerable Args) - { - - if (Args == null || Args.Count() == 0) - { - ProfileManager.MigrateSettingsToISBEL(); - return; - } - - List LaunchAccountNames = new List(); - - bool useInnerSpace = false; - foreach (string s in Args) - { - switch (s.ToLowerInvariant()) - { - case "-dx9": - Settings.UseDirectXVersion = DirectXVersion.dx9; - break; - case "-dx11": - Settings.UseDirectXVersion = DirectXVersion.dx11; - break; - case "-singularity": - Settings.UseSingularity = true; - break; - case "-tranquility": - Settings.UseSingularity = false; - break; - case "-innerspace": - useInnerSpace = true; - break; - case "-eve": - useInnerSpace = false; - break; - case "-multiinstance": - break; - case "-exit": - ExitAfterLaunch = true; - break; - case "-c": - searchCharactersOnly = true; - break; - case "null": - // ignore - break; - default: - LaunchAccountNames.Add(s); - break; - } - } - - if (LaunchAccountNames.Count == 0) - { - - return; - } - - List LaunchAccounts = new List(); - - foreach (string name in LaunchAccountNames) - { - - if (!searchCharactersOnly) - { - EVEAccount acct = Settings.Accounts.FirstOrDefault(q => q.Username.Equals(name, StringComparison.InvariantCultureIgnoreCase)); - if (acct != null) - { - LaunchAccounts.Add(acct); - continue; - } - } - EVECharacter ec = Settings.Characters.FirstOrDefault(q => q.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); - if (ec != null) - { - LaunchAccounts.Add(ec); - continue; - } - - MessageBox.Show("Unrecognized EVE Account or Character name '" + name + "' -- if this is correct, please use Add Account/Character to enable it before launching."); - return; - } - - ILauncher launcher; - if (useInnerSpace) - { - InnerSpaceGameProfile gp; - if (Settings.UseSingularity) - { - gp = Settings.SingularityGameProfile; + } + + /// + /// Launch EVE directly + /// + /// + /// + /// + /// + /// + static public bool Launch(string sharedCachePath, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) + { + //if (ssoToken == null) + // throw new ArgumentNullException("ssoToken"); + if (sharedCachePath == null) + throw new ArgumentNullException("sharedCachePath"); + + string args = "/noconsole /ssoToken=" + token.TokenString; + if (dxVersion != DirectXVersion.Default) + { + args += " /triPlatform=" + dxVersion.ToString(); + } + + if (sisi) + { + args += " /server:Singularity"; } else { - gp = Settings.TranquilityGameProfile; + args += " /server:tranquility"; } - if (gp == null || string.IsNullOrEmpty(gp.Game) || string.IsNullOrEmpty(gp.GameProfile)) + if (characterID != 0) { - MessageBox.Show("Please select a Game Profile first!"); - return; + args += " /character=" + characterID; } - launcher = new Launchers.InnerSpace(gp, Settings.UseDirectXVersion, Settings.UseSingularity); - } - else - { - launcher = new Launchers.Direct(Settings.EVESharedCachePath, Settings.UseDirectXVersion, Settings.UseSingularity); - } - Windows.LaunchProgressWindow lpw = new Windows.LaunchProgressWindow(LaunchAccounts, launcher); - lpw.ShowDialog(); + args += " /settingsprofile=ISBEL /machineHash=" + App.Settings.MachineHash + " \"\""; - if (ExitAfterLaunch) - { - App.Current.Shutdown(); - } - } + string executable; + if (sisi) + executable = App.Settings.GetSingularityEXE(); + else + executable = App.Settings.GetTranquilityEXE(); - /// - /// Gets what we think is the "master" ISBoxer EVE Launcher instance - /// - /// true if we should be more secure about it (e.g. Master Key transfer), false if we're just passing command-line around - /// - static public Process GetMasterInstance(bool ensureMainModule) - { - Process currentProcess = Process.GetCurrentProcess(); + if (!System.IO.File.Exists(executable)) + { + MessageBox.Show("Cannot find exefile.exe for launch -- looking at: " + executable); + return false; + } - //Note: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.mainwindowhandle?view=netframework-4.7 - //When the Main window is hidden, it will return a MainWindowHandle of 0. This makes the following code fail when trying to find the master window that is minimized to the system tray: - IEnumerable processList = Process.GetProcesses().Where(q => q.NameMatches(currentProcess) && (q.MainWindowHandle != IntPtr.Zero || q.Id == currentProcess.Id)); + try + { + System.Diagnostics.Process.Start(executable, args); + } + catch (Exception e) + { + MessageBox.Show("Launch failed. executable=" + executable + "; args=" + args + System.Environment.NewLine + e.ToString()); + return false; + } + return true; + } - if (processList == null) - return null; + public static void ProcessCommandLine(string Args) + { + ProcessCommandLine(Args.SplitCommandLine()); + } - Process[] processes = processList.ToArray(); - Array.Sort(processes, (a, b) => a.StartTime > b.StartTime ? 1 : -1); - if (processes.Length > 1) - { - for (int i = 0; i < processes.Length; i++) - { - if (processes[i].Id == currentProcess.Id) - continue; - - // ensure that the Master Instance is indeed this app by checking the module list? (note: if the other process is Administrator, this one also needs to be Administrator) - if (!ensureMainModule) - return processes[i]; - - try - { - - if (processes[i].MainModuleNameMatches(currentProcess)) - return processes[i]; - } - catch (System.ComponentModel.Win32Exception we) - { - if (we.NativeErrorCode == 5) - { - // this might be the right instance, but since it's Administrator and we're not, we can't use it. - continue; - } - throw; - } - } - } - return null; - } - - /// - /// Transmit the command-line to an already-running Master instance, if one is available - /// - /// - public bool TransmitCommandLine() - { - // check if it's already running. - - System.Diagnostics.Process masterInstance = GetMasterInstance(false); - - if (masterInstance != null) - { - string joinedCommandLine = string.Empty; - foreach (string s in CommandLine) - { - // if it's another process, don't exit - switch (s.ToLowerInvariant()) - { - case "null": - // ignore... - break; - case "-exit": - // the -exit is intended for THIS process, not the other one. - break; - case "-multiinstance": - return false; - } - - if (!s.Equals("-exit", StringComparison.InvariantCultureIgnoreCase)) - joinedCommandLine += "\"" + s.Replace("\"", "\\\"") + "\" "; - } - joinedCommandLine.TrimEnd(); + public static void ProcessCommandLine(IEnumerable Args) + { - byte[] buff = Encoding.Unicode.GetBytes(joinedCommandLine); + if (Args == null || Args.Count() == 0) + { + ProfileManager.MigrateSettingsToISBEL(); + return; + } - Windows.COPYDATASTRUCT cds = new Windows.COPYDATASTRUCT(); - cds.cbData = buff.Length; - cds.lpData = Marshal.AllocHGlobal(buff.Length); - Marshal.Copy(buff, 0, cds.lpData, buff.Length); - cds.dwData = IntPtr.Zero; - cds.cbData = buff.Length; - var ret = ISBoxerEVELauncher.Windows.MainWindow.SendMessage(masterInstance.MainWindowHandle, ISBoxerEVELauncher.Windows.MainWindow.WM_COPYDATA, IntPtr.Zero, ref cds); - Marshal.FreeHGlobal(cds.lpData); + List LaunchAccountNames = new List(); - Shutdown(); - return true; - } - return false; - } + bool useInnerSpace = false; + foreach (string s in Args) + { + switch (s.ToLowerInvariant()) + { + case "-dx9": + Settings.UseDirectXVersion = DirectXVersion.dx9; + break; + case "-dx11": + Settings.UseDirectXVersion = DirectXVersion.dx11; + break; + case "-singularity": + Settings.UseSingularity = true; + break; + case "-tranquility": + Settings.UseSingularity = false; + break; + case "-innerspace": + useInnerSpace = true; + break; + case "-eve": + useInnerSpace = false; + break; + case "-multiinstance": + break; + case "-exit": + ExitAfterLaunch = true; + break; + case "-c": + searchCharactersOnly = true; + break; + case "null": + // ignore + break; + default: + LaunchAccountNames.Add(s); + break; + } + } + + if (LaunchAccountNames.Count == 0) + { + + return; + } + + List LaunchAccounts = new List(); + + foreach (string name in LaunchAccountNames) + { + + if (!searchCharactersOnly) + { + EVEAccount acct = Settings.Accounts.FirstOrDefault(q => q.Username.Equals(name, StringComparison.InvariantCultureIgnoreCase)); + if (acct != null) + { + LaunchAccounts.Add(acct); + continue; + } + } + EVECharacter ec = Settings.Characters.FirstOrDefault(q => q.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); + if (ec != null) + { + LaunchAccounts.Add(ec); + continue; + } + + MessageBox.Show("Unrecognized EVE Account or Character name '" + name + "' -- if this is correct, please use Add Account/Character to enable it before launching."); + return; + } + + ILauncher launcher; + if (useInnerSpace) + { + InnerSpaceGameProfile gp; + if (Settings.UseSingularity) + { + gp = Settings.SingularityGameProfile; + } + else + { + gp = Settings.TranquilityGameProfile; + } + + if (gp == null || string.IsNullOrEmpty(gp.Game) || string.IsNullOrEmpty(gp.GameProfile)) + { + MessageBox.Show("Please select a Game Profile first!"); + return; + } + + launcher = new Launchers.InnerSpace(gp, Settings.UseDirectXVersion, Settings.UseSingularity); + } + else + { + launcher = new Launchers.Direct(Settings.EVESharedCachePath, Settings.UseDirectXVersion, Settings.UseSingularity); + } + Windows.LaunchProgressWindow lpw = new Windows.LaunchProgressWindow(LaunchAccounts, launcher); + lpw.ShowDialog(); + + if (ExitAfterLaunch) + { + App.Current.Shutdown(); + } + } + + /// + /// Gets what we think is the "master" ISBoxer EVE Launcher instance + /// + /// true if we should be more secure about it (e.g. Master Key transfer), false if we're just passing command-line around + /// + static public Process GetMasterInstance(bool ensureMainModule) + { + Process currentProcess = Process.GetCurrentProcess(); + + //Note: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.mainwindowhandle?view=netframework-4.7 + //When the Main window is hidden, it will return a MainWindowHandle of 0. This makes the following code fail when trying to find the master window that is minimized to the system tray: + IEnumerable processList = Process.GetProcesses().Where(q => q.NameMatches(currentProcess) && (q.MainWindowHandle != IntPtr.Zero || q.Id == currentProcess.Id)); + + if (processList == null) + return null; + + Process[] processes = processList.ToArray(); + Array.Sort(processes, (a, b) => a.StartTime > b.StartTime ? 1 : -1); + if (processes.Length > 1) + { + for (int i = 0; i < processes.Length; i++) + { + if (processes[i].Id == currentProcess.Id) + continue; - private void ApplicationStart(object sender, StartupEventArgs e) - { - AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; - // Allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this value. - ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault; + // ensure that the Master Instance is indeed this app by checking the module list? (note: if the other process is Administrator, this one also needs to be Administrator) + if (!ensureMainModule) + return processes[i]; + + try + { + + if (processes[i].MainModuleNameMatches(currentProcess)) + return processes[i]; + } + catch (System.ComponentModel.Win32Exception we) + { + if (we.NativeErrorCode == 5) + { + // this might be the right instance, but since it's Administrator and we're not, we can't use it. + continue; + } + throw; + } + } + } + return null; + } - CommandLine = e.Args; + /// + /// Transmit the command-line to an already-running Master instance, if one is available + /// + /// + public bool TransmitCommandLine() + { + // check if it's already running. - if (!TransmitCommandLine()) - { - ReloadGameConfiguration(); + System.Diagnostics.Process masterInstance = GetMasterInstance(false); - if (GameConfiguration != null || System.IO.File.Exists(ISExecutable)) + if (masterInstance != null) { - HasInnerSpace = true; + string joinedCommandLine = string.Empty; + foreach (string s in CommandLine) + { + // if it's another process, don't exit + switch (s.ToLowerInvariant()) + { + case "null": + // ignore... + break; + case "-exit": + // the -exit is intended for THIS process, not the other one. + break; + case "-multiinstance": + return false; + } + + if (!s.Equals("-exit", StringComparison.InvariantCultureIgnoreCase)) + joinedCommandLine += "\"" + s.Replace("\"", "\\\"") + "\" "; + } + joinedCommandLine.TrimEnd(); + + byte[] buff = Encoding.Unicode.GetBytes(joinedCommandLine); + + Windows.COPYDATASTRUCT cds = new Windows.COPYDATASTRUCT(); + cds.cbData = buff.Length; + cds.lpData = Marshal.AllocHGlobal(buff.Length); + Marshal.Copy(buff, 0, cds.lpData, buff.Length); + cds.dwData = IntPtr.Zero; + cds.cbData = buff.Length; + var ret = ISBoxerEVELauncher.Windows.MainWindow.SendMessage(masterInstance.MainWindowHandle, ISBoxerEVELauncher.Windows.MainWindow.WM_COPYDATA, IntPtr.Zero, ref cds); + Marshal.FreeHGlobal(cds.lpData); + + Shutdown(); + return true; } + return false; + } + + private void ApplicationStart(object sender, StartupEventArgs e) + { + AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; + // Allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this value. + ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault; + + CommandLine = e.Args; + + if (!TransmitCommandLine()) + { + ReloadGameConfiguration(); + + if (GameConfiguration != null || System.IO.File.Exists(ISExecutable)) + { + HasInnerSpace = true; + } + + CefSettings settings = new CefSettings(); + settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\CEF"; + + CefSharp.Cef.Initialize(settings); + + var mainWindow = new Windows.MainWindow(); //Re-enable normal shutdown mode. @@ -741,13 +767,13 @@ private void ApplicationStart(object sender, StartupEventArgs e) mainWindow.Show(); ProcessCommandLine(CommandLine); - } - } + } + } - void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) - { - MessageBox.Show("Exception unhandled by ISBoxer EVE Launcher: " + e.ExceptionObject.ToString()); - } + void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + { + MessageBox.Show("Exception unhandled by ISBoxer EVE Launcher: " + e.ExceptionObject.ToString()); + } - } + } } diff --git a/Games/EVE/EVEAccount.cs b/Games/EVE/EVEAccount.cs index 17040ec..7ccbdbf 100644 --- a/Games/EVE/EVEAccount.cs +++ b/Games/EVE/EVEAccount.cs @@ -1309,6 +1309,7 @@ public LoginResult GetAccessToken(bool sisi, out Token accessToken) } App.strUserName = Username; + App.strPassword = new System.Net.NetworkCredential(string.Empty, SecurePassword).Password; var uri = RequestResponse.GetLoginUri(sisi, state.ToString(), challengeHash); diff --git a/Windows/LoginBrowser.Designer.cs b/Windows/LoginBrowser.Designer.cs index 6402c2f..7f350bd 100644 --- a/Windows/LoginBrowser.Designer.cs +++ b/Windows/LoginBrowser.Designer.cs @@ -74,7 +74,7 @@ private void InitializeComponent() this.toolStripButton_Refresh.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton_Refresh.Name = "toolStripButton_Refresh"; this.toolStripButton_Refresh.Size = new System.Drawing.Size(36, 36); - this.toolStripButton_Refresh.Text = "toolStripButton1"; + this.toolStripButton_Refresh.Text = "Refresh"; this.toolStripButton_Refresh.Click += new System.EventHandler(this.toolStripButton_Refresh_Click); // // LoginBrowser diff --git a/Windows/LoginBrowser.cs b/Windows/LoginBrowser.cs index 99873d9..01fcfe9 100644 --- a/Windows/LoginBrowser.cs +++ b/Windows/LoginBrowser.cs @@ -82,7 +82,14 @@ private void chromiumWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEn strURL_RequestVerificationToken = strCurrentAddress; } - if (taskHtml.Result.Contains("Be sure to click the prompt above to login to the EVE Online launcher")) + if (taskHtml.Result.Contains("Log in to your account") && !taskHtml.Result.Contains("Invalid username / password")) + { + this.chromiumWebBrowser.EvaluateScriptAsync("document.getElementById('UserName').value = '" + App.strUserName + "';"); + this.chromiumWebBrowser.EvaluateScriptAsync("document.getElementById('Password').value = '" + App.strPassword + "';"); + this.chromiumWebBrowser.EvaluateScriptAsync("document.getElementById('RememberMe').click();"); + this.chromiumWebBrowser.EvaluateScriptAsync("document.forms['loginForm'].submit();"); + } + else if (taskHtml.Result.Contains("Be sure to click the prompt above to login to the EVE Online launcher")) { strHTML_Result = taskHtml.Result; strURL_Result = strCurrentAddress; @@ -98,6 +105,7 @@ private void chromiumWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEn } }); + } private void LoginBrowser_Resize(object sender, EventArgs e) diff --git a/Windows/LoginBrowser.resx b/Windows/LoginBrowser.resx index cc81fe5..527e628 100644 --- a/Windows/LoginBrowser.resx +++ b/Windows/LoginBrowser.resx @@ -124,38 +124,38 @@ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAdPSURBVFhH7ZZrTJvXGcezrWulbdq0mzSt26R+6Ye1LOkg - abKEptqlTddU4hYgkDXNoiLUQBhKwiUiJWlDsm5T2qYdIUsaLiZAuLngGxeDwdx8e218v2Ab2/gG2BjY - 0qTSpP/OefOaIUwjou1j/9Jfr8/r5zy/5zznHMO2L/WlHkW7z+qeTD3HFKVWqSWpZxnNnirm39T0M/uO - fEdjuPD/n/adY5L3ndXcfPWyHuWdHtQzUbQaIhgOrEA+/xk6LCto0C6x39EYGkvncNP/N+2tUP/lwEUG - 70lcEDgXIPYuQ0AsdARhC0XQ7ZhHh3sJAk8Mff5VSOfv4f2RMF65NA06l0vz6Pp5tenxvWVT116v1aNF - 74XSOYf5aAxqTwidBg8Wl2JYXV2FM7iAKVcA9uAi5O4wPnXFIA7eg9B/D8du2EgRqlqai0u7dVF44S0j - uvVu+BciWFlZWfN8JIrl5eU1r/9O6Q6hnRTRH7oPQfA+iltc2HtGUcul3Zp+dWryr9lXNODrnIhEo4jF - Ypt6aWkpYbxIims1h9HpuQtx4D66vPeQ93cL9pye2tp27Dslf/7Fs+O4MWZBhCSLJ46SQtY7EolgYWEB - 4XAYwWAQgUAAIfKkY4HZjzbnKto9n0FEtqLOsorfV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XxpUrB7JKMggwhcTv + zs3NTXzoDhCtnYEDBw58Jy8v7/sk0Q9pQSTpT2iytLS0J2mHyOefx0zHZMWPk7ifpqam/pjOIe9/QPy9 + hzoD60SD2WJipknoKmhx1GT8aMx0TGIeoTHr58Ty0ITx2rbtP+rnLs63FIfEAAAAAElFTkSuQmCC \ No newline at end of file From 110c6fc4a4ac8b29799dd0bb189c58db5e513cbb Mon Sep 17 00:00:00 2001 From: Jizheng Date: Mon, 9 Nov 2020 19:10:22 +0000 Subject: [PATCH 07/23] Update app.manifest --- app.manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.manifest b/app.manifest index 074a6c5..90915b2 100644 --- a/app.manifest +++ b/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + From fa2fc4d1c4d5d23248c98dd89034b32f60f77726 Mon Sep 17 00:00:00 2001 From: Jizheng Date: Mon, 9 Nov 2020 19:10:35 +0000 Subject: [PATCH 08/23] Revert "Update app.manifest" This reverts commit 110c6fc4a4ac8b29799dd0bb189c58db5e513cbb. --- app.manifest | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app.manifest b/app.manifest index 90915b2..074a6c5 100644 --- a/app.manifest +++ b/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + From 3d663828e9a34f03cbe140bf88930523493660fc Mon Sep 17 00:00:00 2001 From: Jizheng Date: Mon, 9 Nov 2020 19:10:59 +0000 Subject: [PATCH 09/23] Revert "Beta3" This reverts commit 1cc1a39634135201bf4b64d0edd8fb805f9c1cc5. --- App.xaml.cs | 1390 +++++++++++++++--------------- Games/EVE/EVEAccount.cs | 1 - Windows/LoginBrowser.Designer.cs | 2 +- Windows/LoginBrowser.cs | 10 +- Windows/LoginBrowser.resx | 64 +- 5 files changed, 716 insertions(+), 751 deletions(-) diff --git a/App.xaml.cs b/App.xaml.cs index 4588b3b..55457ea 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -1,11 +1,14 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Configuration; +using System.Data; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Text; +using System.Threading.Tasks; using System.Windows; using Microsoft.Win32; using ISBoxerEVELauncher.Extensions; @@ -14,751 +17,722 @@ using ISBoxerEVELauncher.Games.EVE; using ISBoxerEVELauncher.Interface; using System.Net; -using CefSharp.WinForms; using ISBoxerEVELauncher.Windows; namespace ISBoxerEVELauncher { - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - public static bool HasInnerSpace - { - get; set; - } - public static LoginBrowser myLB = new LoginBrowser(); - public static string strUserName - { - get; set; - } - public static string strPassword - { - get; set; - } - - - public static string AppVersion - { - get - { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); - } - } - - - public static void ReloadGameConfiguration() - { - try - { - GameConfiguration = InnerSpaceSettings.Load(ISPath + @"\GameConfiguration.XML"); - } - catch - { - GameConfiguration = null; - } - } - - public static string DetectedEVESharedCachePath - { - get - { - RegistryKey hkcu = Registry.CurrentUser; - RegistryKey PathKey = hkcu.OpenSubKey(@"SOFTWARE\CCP\EVEONLINE"); - if (PathKey != null) - { - string value = PathKey.GetValue("CACHEFOLDER", Environment.SpecialFolder.CommonApplicationData + @"\CCP\EVE\SharedCache\") as string; - return value; - } - return null; + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + public static bool HasInnerSpace { get; set; } + public static LoginBrowser myLB = new LoginBrowser(); + public static string strUserName {get; set; } + + + public static string AppVersion + { + get + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); + } + } + + + public static void ReloadGameConfiguration() + { + try + { + GameConfiguration = InnerSpaceSettings.Load(ISPath + @"\GameConfiguration.XML"); + } + catch + { + GameConfiguration = null; + } + } + + public static string DetectedEVESharedCachePath + { + get + { + RegistryKey hkcu = Registry.CurrentUser; + RegistryKey PathKey = hkcu.OpenSubKey(@"SOFTWARE\CCP\EVEONLINE"); + if (PathKey != null) + { + string value = PathKey.GetValue("CACHEFOLDER", Environment.SpecialFolder.CommonApplicationData + @"\CCP\EVE\SharedCache\") as string; + return value; } + return null; + } + + } + + public static string[] CommandLine; + public static bool ExitAfterLaunch; + public static bool searchCharactersOnly; + + static Settings _Settings; + public static Settings Settings + { + get + { + if (_Settings == null) + { + try + { + _Settings = Settings.Load(); + if (EVEAccount.ShouldUgradeCookieStorage) + { + _Settings.Store(); + } + } + catch (System.IO.FileNotFoundException) + { + _Settings = new Settings(); + _Settings.Store(); + } + } + return _Settings; + } + } + + public static string ISBoxerEVELauncherPath + { + get + { + return System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + } + } + + public static string ISExecutable + { + get + { + return ISPath + "\\InnerSpace.exe"; + } + } + + public static string BaseDirectory + { + get + { + return System.AppDomain.CurrentDomain.BaseDirectory; + } + } + + static string _ISPath = string.Empty; + /// + /// Path to Inner Space, which should either be in the registry, or the current folder. Otherwise, the user likely doesn't care about Inner Space integration. + /// + public static string ISPath + { + get + { + // already detected? + if (!string.IsNullOrEmpty(_ISPath)) + return _ISPath; + + // nope. + + // we're expected to be installed into the IS/ISBoxer folder.... + if (System.IO.File.Exists(BaseDirectory + @"\InnerSpace.exe")) + { + _ISPath = BaseDirectory; + return _ISPath; + } + + // oh well... the path SHOULD be in the registry... + { + RegistryKey hklm = Registry.LocalMachine; + RegistryKey ISPathKey = hklm.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\App Paths\InnerSpace.exe"); + if (ISPathKey != null) + { + string reg_path = ISPathKey.GetValue("Path", Environment.SpecialFolder.ProgramFiles + @"\InnerSpace") as string; + if (System.IO.File.Exists(reg_path + "\\InnerSpace.exe")) + { + _ISPath = reg_path; + return _ISPath; + } + } + } + + // didn't find it. maybe not even installed. + return BaseDirectory; + } + set + { + _ISPath = value; + } + } + + static void ReloadGameProfiles() + { + InnerSpaceGameProfile gpSingularity = Settings.SingularityGameProfile; + InnerSpaceGameProfile gpTranquility = Settings.TranquilityGameProfile; + + if (_GameProfiles == null) + { + _GameProfiles = new ObservableCollection(); + } + else + _GameProfiles.Clear(); + + if (GameConfiguration != null) + { + if (GameConfiguration.Sets != null) + { + foreach (Set gameSet in GameConfiguration.Sets) + { + Set profilesSet = gameSet.FindSet("Profiles"); + if (profilesSet == null || profilesSet.Sets == null) + continue; + + foreach (Set gameProfileSet in profilesSet.Sets) + { + InnerSpaceGameProfile gp = new InnerSpaceGameProfile() { Game = gameSet.Name, GameProfile = gameProfileSet.Name }; + _GameProfiles.Add(gp); + } + } + } + } + + Settings.SingularityGameProfile = App.FindGlobalGameProfile(gpSingularity); + Settings.TranquilityGameProfile = App.FindGlobalGameProfile(gpTranquility); + } + + public static Set FindGameProfileSet(string gameName, string gameProfileName) + { + if (string.IsNullOrWhiteSpace(gameName) || string.IsNullOrWhiteSpace(gameProfileName)) + return null; - } - - public static string[] CommandLine; - public static bool ExitAfterLaunch; - public static bool searchCharactersOnly; - - static Settings _Settings; - public static Settings Settings - { - get - { - if (_Settings == null) - { - try - { - _Settings = Settings.Load(); - if (EVEAccount.ShouldUgradeCookieStorage) - { - _Settings.Store(); - } - } - catch (System.IO.FileNotFoundException) - { - _Settings = new Settings(); - _Settings.Store(); - } - } - return _Settings; - } - } - - public static string ISBoxerEVELauncherPath - { - get - { - return System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - } - } + if (GameConfiguration == null || GameConfiguration.Sets == null) + return null; - public static string ISExecutable - { - get - { - return ISPath + "\\InnerSpace.exe"; - } - } + Set gameSet = GameConfiguration.FindSet(gameName); + if (gameSet == null) + return null; - public static string BaseDirectory - { - get - { - return System.AppDomain.CurrentDomain.BaseDirectory; - } - } - - static string _ISPath = string.Empty; - /// - /// Path to Inner Space, which should either be in the registry, or the current folder. Otherwise, the user likely doesn't care about Inner Space integration. - /// - public static string ISPath - { - get - { - // already detected? - if (!string.IsNullOrEmpty(_ISPath)) - return _ISPath; - - // nope. - - // we're expected to be installed into the IS/ISBoxer folder.... - if (System.IO.File.Exists(BaseDirectory + @"\InnerSpace.exe")) - { - _ISPath = BaseDirectory; - return _ISPath; - } - - // oh well... the path SHOULD be in the registry... - { - RegistryKey hklm = Registry.LocalMachine; - RegistryKey ISPathKey = hklm.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\App Paths\InnerSpace.exe"); - if (ISPathKey != null) - { - string reg_path = ISPathKey.GetValue("Path", Environment.SpecialFolder.ProgramFiles + @"\InnerSpace") as string; - if (System.IO.File.Exists(reg_path + "\\InnerSpace.exe")) - { - _ISPath = reg_path; - return _ISPath; - } - } - } - - // didn't find it. maybe not even installed. - return BaseDirectory; - } - set - { - _ISPath = value; - } - } + Set profilesSet = gameSet.FindSet("Profiles"); + if (profilesSet == null || profilesSet.Sets == null) + return null; - static void ReloadGameProfiles() - { - InnerSpaceGameProfile gpSingularity = Settings.SingularityGameProfile; - InnerSpaceGameProfile gpTranquility = Settings.TranquilityGameProfile; + return profilesSet.FindSet(gameProfileName); + } + static Set _GameConfiguration; + public static Set GameConfiguration { get { return _GameConfiguration; } private set { _GameConfiguration = value; ReloadGameProfiles(); } } + static ObservableCollection _GameProfiles; + public static ObservableCollection GameProfiles + { + get + { if (_GameProfiles == null) { - _GameProfiles = new ObservableCollection(); - } - else - _GameProfiles.Clear(); - - if (GameConfiguration != null) - { - if (GameConfiguration.Sets != null) - { - foreach (Set gameSet in GameConfiguration.Sets) - { - Set profilesSet = gameSet.FindSet("Profiles"); - if (profilesSet == null || profilesSet.Sets == null) - continue; - - foreach (Set gameProfileSet in profilesSet.Sets) - { - InnerSpaceGameProfile gp = new InnerSpaceGameProfile() { Game = gameSet.Name, GameProfile = gameProfileSet.Name }; - _GameProfiles.Add(gp); - } - } - } - } - - Settings.SingularityGameProfile = App.FindGlobalGameProfile(gpSingularity); - Settings.TranquilityGameProfile = App.FindGlobalGameProfile(gpTranquility); - } - - public static Set FindGameProfileSet(string gameName, string gameProfileName) - { - if (string.IsNullOrWhiteSpace(gameName) || string.IsNullOrWhiteSpace(gameProfileName)) - return null; - - if (GameConfiguration == null || GameConfiguration.Sets == null) - return null; - - Set gameSet = GameConfiguration.FindSet(gameName); - if (gameSet == null) - return null; - - Set profilesSet = gameSet.FindSet("Profiles"); - if (profilesSet == null || profilesSet.Sets == null) - return null; - - return profilesSet.FindSet(gameProfileName); - } - - static Set _GameConfiguration; - public static Set GameConfiguration - { - get - { - return _GameConfiguration; - } - private set - { - _GameConfiguration = value; - ReloadGameProfiles(); - } - } - static ObservableCollection _GameProfiles; - public static ObservableCollection GameProfiles - { - get - { - if (_GameProfiles == null) - { - _GameProfiles = new ObservableCollection(); - ReloadGameProfiles(); - } - return _GameProfiles; - } - private set - { - _GameProfiles = value; - } - } - - public static InnerSpaceGameProfile FindGlobalGameProfile(InnerSpaceGameProfile likeThis) - { - if (GameProfiles == null || likeThis == null) - return likeThis; - - InnerSpaceGameProfile found = GameProfiles.FirstOrDefault(q => q.Game.Equals(likeThis.Game, StringComparison.InvariantCultureIgnoreCase) && q.GameProfile.Equals(likeThis.GameProfile, StringComparison.InvariantCultureIgnoreCase)); - if (found == null) - return likeThis; - - return found; - } - - static bool AddGameToXML(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) - { - // not running, just edit the XML - if (GameConfiguration == null) - { - // no existing XML. - return false; - } - - Set gameSet = GameConfiguration.FindSet(gameName); - if (gameSet == null) - { - gameSet = new Set(gameName); - GameConfiguration.Add(gameSet); - gameSet.Add(new Setting("OpenGL", "1")); - gameSet.Add(new Setting("Direct3D8", "1")); - gameSet.Add(new Setting("Direct3D9", "1")); - gameSet.Add(new Setting("Win32I Keyboard", "1")); - gameSet.Add(new Setting("Win32I Mouse", "1")); - gameSet.Add(new Setting("DirectInput8 Keyboard", "1")); - gameSet.Add(new Setting("DirectInput8 Mouse", "1")); - gameSet.Add(new Setting("modules", "auto")); - gameSet.Add(new Setting("Background Mouse", "1")); - gameSet.Add(new Setting("Keystroke Delay", "1")); - } - - Set gameProfilesSet = gameSet.FindSet("Profiles"); - if (gameProfilesSet == null) - { - gameProfilesSet = new Set("Profiles"); - gameSet.Add(gameProfilesSet); - } - - Set gameProfileSet = gameSet.FindSet(gameProfileName); - if (gameProfileSet == null) - { - gameProfileSet = new Set(gameProfileName); - gameProfilesSet.Add(gameProfileSet); - } - - Setting setting = gameProfileSet.FindSetting("Executable"); - if (setting == null) - gameProfileSet.Add(new Setting("Executable", executableName)); - else - setting.Value = executableName; - - setting = gameProfileSet.FindSetting("Path"); - if (setting == null) - gameProfileSet.Add(new Setting("Path", executablePath)); + _GameProfiles = new ObservableCollection(); + ReloadGameProfiles(); + } + return _GameProfiles; + } + private set + { + _GameProfiles = value; + } + } + + public static InnerSpaceGameProfile FindGlobalGameProfile(InnerSpaceGameProfile likeThis) + { + if (GameProfiles == null || likeThis == null) + return likeThis; + + InnerSpaceGameProfile found = GameProfiles.FirstOrDefault(q => q.Game.Equals(likeThis.Game, StringComparison.InvariantCultureIgnoreCase) && q.GameProfile.Equals(likeThis.GameProfile, StringComparison.InvariantCultureIgnoreCase)); + if (found == null) + return likeThis; + + return found; + } + + static bool AddGameToXML(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) + { + // not running, just edit the XML + if (GameConfiguration == null) + { + // no existing XML. + return false; + } + + Set gameSet = GameConfiguration.FindSet(gameName); + if (gameSet == null) + { + gameSet = new Set(gameName); + GameConfiguration.Add(gameSet); + gameSet.Add(new Setting("OpenGL", "1")); + gameSet.Add(new Setting("Direct3D8", "1")); + gameSet.Add(new Setting("Direct3D9", "1")); + gameSet.Add(new Setting("Win32I Keyboard", "1")); + gameSet.Add(new Setting("Win32I Mouse", "1")); + gameSet.Add(new Setting("DirectInput8 Keyboard", "1")); + gameSet.Add(new Setting("DirectInput8 Mouse", "1")); + gameSet.Add(new Setting("modules", "auto")); + gameSet.Add(new Setting("Background Mouse", "1")); + gameSet.Add(new Setting("Keystroke Delay", "1")); + } + + Set gameProfilesSet = gameSet.FindSet("Profiles"); + if (gameProfilesSet == null) + { + gameProfilesSet = new Set("Profiles"); + gameSet.Add(gameProfilesSet); + } + + Set gameProfileSet = gameSet.FindSet(gameProfileName); + if (gameProfileSet == null) + { + gameProfileSet = new Set(gameProfileName); + gameProfilesSet.Add(gameProfileSet); + } + + Setting setting = gameProfileSet.FindSetting("Executable"); + if (setting == null) + gameProfileSet.Add(new Setting("Executable", executableName)); + else + setting.Value = executableName; + + setting = gameProfileSet.FindSetting("Path"); + if (setting == null) + gameProfileSet.Add(new Setting("Path", executablePath)); + else + setting.Value = executablePath; + + setting = gameProfileSet.FindSetting("Parameters"); + if (setting == null) + { + if (!string.IsNullOrEmpty(parameters)) + gameProfileSet.Add(new Setting("Parameters", parameters)); + } + else + { + if (string.IsNullOrEmpty(parameters)) + gameProfileSet.Settings.Remove(setting); else - setting.Value = executablePath; - - setting = gameProfileSet.FindSetting("Parameters"); - if (setting == null) - { - if (!string.IsNullOrEmpty(parameters)) - gameProfileSet.Add(new Setting("Parameters", parameters)); + setting.Value = parameters; + } + + if (GameProfiles.FirstOrDefault(q => q.GameProfile.Equals(gameProfileName)) == null) + { + GameProfiles.Add(new InnerSpaceGameProfile() { Game = gameName, GameProfile = gameProfileName }); + } + + GameConfiguration.Store(ISPath + @"\GameConfiguration.XML"); + return true; + } + /// + /// Add a Game/Game Profile to Inner Space + /// + /// + /// + /// + /// + /// + /// + public static bool AddGame(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) + { + string isboxerFilename = System.IO.Path.Combine(ISPath, "ISBoxer Toolkit.exe"); + while (true) + { + System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("InnerSpace"); + if (processes.Length == 0) + { + if (!AddGameToXML(gameName, gameProfileName, executablePath, executableName, parameters)) + { + MessageBox.Show("In order to Add Game for you, ISBoxer EVE Launcher requires that GameConfiguration.XML exist in the Inner Space folder -- looking for: " + isboxerFilename); + return false; + } + return true; + } + + if (!System.IO.File.Exists(isboxerFilename)) + { + switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) + { + case MessageBoxResult.OK: + continue; + case MessageBoxResult.Cancel: + return false; + } } else { - if (string.IsNullOrEmpty(parameters)) - gameProfileSet.Settings.Remove(setting); - else - setting.Value = parameters; - } - - if (GameProfiles.FirstOrDefault(q => q.GameProfile.Equals(gameProfileName)) == null) - { - GameProfiles.Add(new InnerSpaceGameProfile() { Game = gameName, GameProfile = gameProfileName }); - } - - GameConfiguration.Store(ISPath + @"\GameConfiguration.XML"); - return true; - } - /// - /// Add a Game/Game Profile to Inner Space - /// - /// - /// - /// - /// - /// - /// - public static bool AddGame(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) - { - string isboxerFilename = System.IO.Path.Combine(ISPath, "ISBoxer Toolkit.exe"); - while (true) - { - System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("InnerSpace"); - if (processes.Length == 0) - { - if (!AddGameToXML(gameName, gameProfileName, executablePath, executableName, parameters)) - { - MessageBox.Show("In order to Add Game for you, ISBoxer EVE Launcher requires that GameConfiguration.XML exist in the Inner Space folder -- looking for: " + isboxerFilename); + FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(isboxerFilename); + if (fvi.ProductMajorPart < 42) + { + switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) + { + case MessageBoxResult.OK: + continue; + case MessageBoxResult.Cancel: return false; - } - return true; - } - - if (!System.IO.File.Exists(isboxerFilename)) - { - switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) - { - case MessageBoxResult.OK: - continue; - case MessageBoxResult.Cancel: - return false; - } - } - else - { - FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(isboxerFilename); - if (fvi.ProductMajorPart < 42) - { - switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) - { - case MessageBoxResult.OK: - continue; - case MessageBoxResult.Cancel: - return false; - } - } - } - - - string cmdLine = "run isboxer -inituplink;isboxeraddgame \"" + gameName.Replace("\"", "\\\"") + "\" \"" + gameProfileName.Replace("\"", "\\\"") + "\" \"" + executablePath.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\" \"" + executableName.Replace("\"", "\\\"") + "\" \"" + parameters.Replace("\"", "\\\"") + "\""; - System.Diagnostics.Process.Start(ISExecutable, cmdLine); - return true; - } - } - - /// - /// Have Inner Space launch EVE via a specified Game and Game Profile - /// - /// - /// - /// - /// - /// - /// - static public bool Launch(string gameName, string gameProfileName, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) - { - //if (ssoToken == null) - // throw new ArgumentNullException("ssoToken"); - if (gameName == null) - throw new ArgumentNullException("gameName"); - if (gameProfileName == null) - throw new ArgumentNullException("gameProfileName"); - - string cmdLine = "open \"" + gameName + "\" \"" + gameProfileName + "\" -addparam \"/noconsole\" -addparam \"/ssoToken=" + token.TokenString + "\""; - if (dxVersion != DirectXVersion.Default) - { - cmdLine += " -addparam \"/triPlatform=" + dxVersion.ToString() + "\""; + } + } } - if (characterID != 0) - { - cmdLine += " -addparam \"/character=" + characterID + "\""; - } - if (sisi) - { - cmdLine += " -addparam \"/server:Singularity\""; - } - else - { - cmdLine += " -addparam \"/server:tranquility\""; - } - - cmdLine += " -addparam \"settingsprofile=ISBEL\" -addparam \"/machineHash=" + App.Settings.MachineHash + "\" \"\""; - - try - { - System.Diagnostics.Process.Start(App.ISExecutable, cmdLine); - } - catch (Exception e) - { - MessageBox.Show("Launch failed. executable=" + App.ISExecutable + "; args=" + cmdLine + System.Environment.NewLine + e.ToString()); - return false; - } + string cmdLine = "run isboxer -inituplink;isboxeraddgame \"" + gameName.Replace("\"", "\\\"") + "\" \"" + gameProfileName.Replace("\"", "\\\"") + "\" \"" + executablePath.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\" \"" + executableName.Replace("\"", "\\\"") + "\" \"" + parameters.Replace("\"", "\\\"") + "\""; + System.Diagnostics.Process.Start(ISExecutable, cmdLine); return true; - } - - /// - /// Launch EVE directly - /// - /// - /// - /// - /// - /// - static public bool Launch(string sharedCachePath, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) - { - //if (ssoToken == null) - // throw new ArgumentNullException("ssoToken"); - if (sharedCachePath == null) - throw new ArgumentNullException("sharedCachePath"); - - string args = "/noconsole /ssoToken=" + token.TokenString; - if (dxVersion != DirectXVersion.Default) - { - args += " /triPlatform=" + dxVersion.ToString(); - } - - if (sisi) - { - args += " /server:Singularity"; - } - else - { - args += " /server:tranquility"; - } - - if (characterID != 0) - { - args += " /character=" + characterID; + } + } + + /// + /// Have Inner Space launch EVE via a specified Game and Game Profile + /// + /// + /// + /// + /// + /// + /// + static public bool Launch(string gameName, string gameProfileName, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) + { + //if (ssoToken == null) + // throw new ArgumentNullException("ssoToken"); + if (gameName == null) + throw new ArgumentNullException("gameName"); + if (gameProfileName == null) + throw new ArgumentNullException("gameProfileName"); + + string cmdLine = "open \"" + gameName + "\" \"" + gameProfileName + "\" -addparam \"/noconsole\" -addparam \"/ssoToken=" + token.TokenString + "\""; + if (dxVersion != DirectXVersion.Default) + { + cmdLine += " -addparam \"/triPlatform=" + dxVersion.ToString() + "\""; + } + + if (characterID != 0) + { + cmdLine += " -addparam \"/character=" + characterID + "\""; + } + + if (sisi) + { + cmdLine += " -addparam \"/server:Singularity\""; + } + else + { + cmdLine += " -addparam \"/server:tranquility\""; + } + + cmdLine += " -addparam \"settingsprofile=ISBEL\" -addparam \"/machineHash=" + App.Settings.MachineHash + "\" \"\""; + + try + { + System.Diagnostics.Process.Start(App.ISExecutable, cmdLine); + } + catch (Exception e) + { + MessageBox.Show("Launch failed. executable=" + App.ISExecutable + "; args=" + cmdLine + System.Environment.NewLine + e.ToString()); + return false; + } + return true; + } + + /// + /// Launch EVE directly + /// + /// + /// + /// + /// + /// + static public bool Launch(string sharedCachePath, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) + { + //if (ssoToken == null) + // throw new ArgumentNullException("ssoToken"); + if (sharedCachePath == null) + throw new ArgumentNullException("sharedCachePath"); + + string args = "/noconsole /ssoToken=" + token.TokenString; + if (dxVersion != DirectXVersion.Default) + { + args += " /triPlatform=" + dxVersion.ToString(); + } + + if (sisi) + { + args += " /server:Singularity"; + } + else + { + args += " /server:tranquility"; + } + + if (characterID != 0) + { + args += " /character=" + characterID; + } + + args += " /settingsprofile=ISBEL /machineHash=" + App.Settings.MachineHash + " \"\""; + + string executable; + if (sisi) + executable = App.Settings.GetSingularityEXE(); + else + executable = App.Settings.GetTranquilityEXE(); + + if (!System.IO.File.Exists(executable)) + { + MessageBox.Show("Cannot find exefile.exe for launch -- looking at: " + executable); + return false; + } + + try + { + System.Diagnostics.Process.Start(executable, args); + } + catch (Exception e) + { + MessageBox.Show("Launch failed. executable=" + executable + "; args=" + args + System.Environment.NewLine + e.ToString()); + return false; + } + return true; + } + + public static void ProcessCommandLine(string Args) + { + ProcessCommandLine(Args.SplitCommandLine()); + } + + public static void ProcessCommandLine(IEnumerable Args) + { + + if (Args == null || Args.Count() == 0) + { + ProfileManager.MigrateSettingsToISBEL(); + return; + } + + List LaunchAccountNames = new List(); + + bool useInnerSpace = false; + foreach (string s in Args) + { + switch (s.ToLowerInvariant()) + { + case "-dx9": + Settings.UseDirectXVersion = DirectXVersion.dx9; + break; + case "-dx11": + Settings.UseDirectXVersion = DirectXVersion.dx11; + break; + case "-singularity": + Settings.UseSingularity = true; + break; + case "-tranquility": + Settings.UseSingularity = false; + break; + case "-innerspace": + useInnerSpace = true; + break; + case "-eve": + useInnerSpace = false; + break; + case "-multiinstance": + break; + case "-exit": + ExitAfterLaunch = true; + break; + case "-c": + searchCharactersOnly = true; + break; + case "null": + // ignore + break; + default: + LaunchAccountNames.Add(s); + break; + } + } + + if (LaunchAccountNames.Count == 0) + { + + return; + } + + List LaunchAccounts = new List(); + + foreach (string name in LaunchAccountNames) + { + + if (!searchCharactersOnly) + { + EVEAccount acct = Settings.Accounts.FirstOrDefault(q => q.Username.Equals(name, StringComparison.InvariantCultureIgnoreCase)); + if (acct != null) + { + LaunchAccounts.Add(acct); + continue; + } + } + EVECharacter ec = Settings.Characters.FirstOrDefault(q => q.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); + if (ec != null) + { + LaunchAccounts.Add(ec); + continue; + } + + MessageBox.Show("Unrecognized EVE Account or Character name '" + name + "' -- if this is correct, please use Add Account/Character to enable it before launching."); + return; + } + + ILauncher launcher; + if (useInnerSpace) + { + InnerSpaceGameProfile gp; + if (Settings.UseSingularity) + { + gp = Settings.SingularityGameProfile; } - - args += " /settingsprofile=ISBEL /machineHash=" + App.Settings.MachineHash + " \"\""; - - string executable; - if (sisi) - executable = App.Settings.GetSingularityEXE(); else - executable = App.Settings.GetTranquilityEXE(); - - if (!System.IO.File.Exists(executable)) - { - MessageBox.Show("Cannot find exefile.exe for launch -- looking at: " + executable); - return false; - } - - try - { - System.Diagnostics.Process.Start(executable, args); - } - catch (Exception e) { - MessageBox.Show("Launch failed. executable=" + executable + "; args=" + args + System.Environment.NewLine + e.ToString()); - return false; + gp = Settings.TranquilityGameProfile; } - return true; - } - - public static void ProcessCommandLine(string Args) - { - ProcessCommandLine(Args.SplitCommandLine()); - } - - public static void ProcessCommandLine(IEnumerable Args) - { - - if (Args == null || Args.Count() == 0) - { - ProfileManager.MigrateSettingsToISBEL(); - return; - } - - List LaunchAccountNames = new List(); - bool useInnerSpace = false; - foreach (string s in Args) + if (gp == null || string.IsNullOrEmpty(gp.Game) || string.IsNullOrEmpty(gp.GameProfile)) { - switch (s.ToLowerInvariant()) - { - case "-dx9": - Settings.UseDirectXVersion = DirectXVersion.dx9; - break; - case "-dx11": - Settings.UseDirectXVersion = DirectXVersion.dx11; - break; - case "-singularity": - Settings.UseSingularity = true; - break; - case "-tranquility": - Settings.UseSingularity = false; - break; - case "-innerspace": - useInnerSpace = true; - break; - case "-eve": - useInnerSpace = false; - break; - case "-multiinstance": - break; - case "-exit": - ExitAfterLaunch = true; - break; - case "-c": - searchCharactersOnly = true; - break; - case "null": - // ignore - break; - default: - LaunchAccountNames.Add(s); - break; - } + MessageBox.Show("Please select a Game Profile first!"); + return; } - if (LaunchAccountNames.Count == 0) - { - - return; - } + launcher = new Launchers.InnerSpace(gp, Settings.UseDirectXVersion, Settings.UseSingularity); + } + else + { + launcher = new Launchers.Direct(Settings.EVESharedCachePath, Settings.UseDirectXVersion, Settings.UseSingularity); + } + Windows.LaunchProgressWindow lpw = new Windows.LaunchProgressWindow(LaunchAccounts, launcher); + lpw.ShowDialog(); - List LaunchAccounts = new List(); + if (ExitAfterLaunch) + { + App.Current.Shutdown(); + } + } - foreach (string name in LaunchAccountNames) - { - - if (!searchCharactersOnly) - { - EVEAccount acct = Settings.Accounts.FirstOrDefault(q => q.Username.Equals(name, StringComparison.InvariantCultureIgnoreCase)); - if (acct != null) - { - LaunchAccounts.Add(acct); - continue; - } - } - EVECharacter ec = Settings.Characters.FirstOrDefault(q => q.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); - if (ec != null) - { - LaunchAccounts.Add(ec); - continue; - } - - MessageBox.Show("Unrecognized EVE Account or Character name '" + name + "' -- if this is correct, please use Add Account/Character to enable it before launching."); - return; - } - - ILauncher launcher; - if (useInnerSpace) - { - InnerSpaceGameProfile gp; - if (Settings.UseSingularity) - { - gp = Settings.SingularityGameProfile; - } - else - { - gp = Settings.TranquilityGameProfile; - } - - if (gp == null || string.IsNullOrEmpty(gp.Game) || string.IsNullOrEmpty(gp.GameProfile)) - { - MessageBox.Show("Please select a Game Profile first!"); - return; - } - - launcher = new Launchers.InnerSpace(gp, Settings.UseDirectXVersion, Settings.UseSingularity); - } - else - { - launcher = new Launchers.Direct(Settings.EVESharedCachePath, Settings.UseDirectXVersion, Settings.UseSingularity); - } - Windows.LaunchProgressWindow lpw = new Windows.LaunchProgressWindow(LaunchAccounts, launcher); - lpw.ShowDialog(); + /// + /// Gets what we think is the "master" ISBoxer EVE Launcher instance + /// + /// true if we should be more secure about it (e.g. Master Key transfer), false if we're just passing command-line around + /// + static public Process GetMasterInstance(bool ensureMainModule) + { + Process currentProcess = Process.GetCurrentProcess(); - if (ExitAfterLaunch) - { - App.Current.Shutdown(); - } - } - - /// - /// Gets what we think is the "master" ISBoxer EVE Launcher instance - /// - /// true if we should be more secure about it (e.g. Master Key transfer), false if we're just passing command-line around - /// - static public Process GetMasterInstance(bool ensureMainModule) - { - Process currentProcess = Process.GetCurrentProcess(); - - //Note: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.mainwindowhandle?view=netframework-4.7 - //When the Main window is hidden, it will return a MainWindowHandle of 0. This makes the following code fail when trying to find the master window that is minimized to the system tray: - IEnumerable processList = Process.GetProcesses().Where(q => q.NameMatches(currentProcess) && (q.MainWindowHandle != IntPtr.Zero || q.Id == currentProcess.Id)); - - if (processList == null) - return null; - - Process[] processes = processList.ToArray(); - Array.Sort(processes, (a, b) => a.StartTime > b.StartTime ? 1 : -1); - if (processes.Length > 1) - { - for (int i = 0; i < processes.Length; i++) - { - if (processes[i].Id == currentProcess.Id) - continue; + //Note: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.mainwindowhandle?view=netframework-4.7 + //When the Main window is hidden, it will return a MainWindowHandle of 0. This makes the following code fail when trying to find the master window that is minimized to the system tray: + IEnumerable processList = Process.GetProcesses().Where(q => q.NameMatches(currentProcess) && (q.MainWindowHandle != IntPtr.Zero || q.Id == currentProcess.Id)); - // ensure that the Master Instance is indeed this app by checking the module list? (note: if the other process is Administrator, this one also needs to be Administrator) - if (!ensureMainModule) - return processes[i]; - - try - { - - if (processes[i].MainModuleNameMatches(currentProcess)) - return processes[i]; - } - catch (System.ComponentModel.Win32Exception we) - { - if (we.NativeErrorCode == 5) - { - // this might be the right instance, but since it's Administrator and we're not, we can't use it. - continue; - } - throw; - } - } - } + if (processList == null) return null; - } - - /// - /// Transmit the command-line to an already-running Master instance, if one is available - /// - /// - public bool TransmitCommandLine() - { - // check if it's already running. - System.Diagnostics.Process masterInstance = GetMasterInstance(false); - - if (masterInstance != null) - { - string joinedCommandLine = string.Empty; - foreach (string s in CommandLine) - { - // if it's another process, don't exit - switch (s.ToLowerInvariant()) - { - case "null": - // ignore... - break; - case "-exit": - // the -exit is intended for THIS process, not the other one. - break; - case "-multiinstance": - return false; - } - - if (!s.Equals("-exit", StringComparison.InvariantCultureIgnoreCase)) - joinedCommandLine += "\"" + s.Replace("\"", "\\\"") + "\" "; - } - joinedCommandLine.TrimEnd(); + Process[] processes = processList.ToArray(); + Array.Sort(processes, (a, b) => a.StartTime > b.StartTime ? 1 : -1); + if (processes.Length > 1) + { + for (int i = 0; i < processes.Length; i++) + { + if (processes[i].Id == currentProcess.Id) + continue; + + // ensure that the Master Instance is indeed this app by checking the module list? (note: if the other process is Administrator, this one also needs to be Administrator) + if (!ensureMainModule) + return processes[i]; + + try + { + + if (processes[i].MainModuleNameMatches(currentProcess)) + return processes[i]; + } + catch (System.ComponentModel.Win32Exception we) + { + if (we.NativeErrorCode == 5) + { + // this might be the right instance, but since it's Administrator and we're not, we can't use it. + continue; + } + throw; + } + } + } + return null; + } + + /// + /// Transmit the command-line to an already-running Master instance, if one is available + /// + /// + public bool TransmitCommandLine() + { + // check if it's already running. + + System.Diagnostics.Process masterInstance = GetMasterInstance(false); + + if (masterInstance != null) + { + string joinedCommandLine = string.Empty; + foreach (string s in CommandLine) + { + // if it's another process, don't exit + switch (s.ToLowerInvariant()) + { + case "null": + // ignore... + break; + case "-exit": + // the -exit is intended for THIS process, not the other one. + break; + case "-multiinstance": + return false; + } + + if (!s.Equals("-exit", StringComparison.InvariantCultureIgnoreCase)) + joinedCommandLine += "\"" + s.Replace("\"", "\\\"") + "\" "; + } + joinedCommandLine.TrimEnd(); byte[] buff = Encoding.Unicode.GetBytes(joinedCommandLine); - Windows.COPYDATASTRUCT cds = new Windows.COPYDATASTRUCT(); - cds.cbData = buff.Length; - cds.lpData = Marshal.AllocHGlobal(buff.Length); - Marshal.Copy(buff, 0, cds.lpData, buff.Length); - cds.dwData = IntPtr.Zero; - cds.cbData = buff.Length; - var ret = ISBoxerEVELauncher.Windows.MainWindow.SendMessage(masterInstance.MainWindowHandle, ISBoxerEVELauncher.Windows.MainWindow.WM_COPYDATA, IntPtr.Zero, ref cds); - Marshal.FreeHGlobal(cds.lpData); - - Shutdown(); - return true; - } - return false; - } - - private void ApplicationStart(object sender, StartupEventArgs e) - { - AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; - // Allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this value. - ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault; - - CommandLine = e.Args; - - if (!TransmitCommandLine()) - { - ReloadGameConfiguration(); + Windows.COPYDATASTRUCT cds = new Windows.COPYDATASTRUCT(); + cds.cbData = buff.Length; + cds.lpData = Marshal.AllocHGlobal(buff.Length); + Marshal.Copy(buff, 0, cds.lpData, buff.Length); + cds.dwData = IntPtr.Zero; + cds.cbData = buff.Length; + var ret = ISBoxerEVELauncher.Windows.MainWindow.SendMessage(masterInstance.MainWindowHandle, ISBoxerEVELauncher.Windows.MainWindow.WM_COPYDATA, IntPtr.Zero, ref cds); + Marshal.FreeHGlobal(cds.lpData); - if (GameConfiguration != null || System.IO.File.Exists(ISExecutable)) - { - HasInnerSpace = true; - } + Shutdown(); + return true; + } + return false; + } - CefSettings settings = new CefSettings(); - settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\CEF"; + private void ApplicationStart(object sender, StartupEventArgs e) + { + AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; + // Allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this value. + ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault; - CefSharp.Cef.Initialize(settings); + CommandLine = e.Args; + if (!TransmitCommandLine()) + { + ReloadGameConfiguration(); + if (GameConfiguration != null || System.IO.File.Exists(ISExecutable)) + { + HasInnerSpace = true; + } var mainWindow = new Windows.MainWindow(); //Re-enable normal shutdown mode. @@ -767,13 +741,13 @@ private void ApplicationStart(object sender, StartupEventArgs e) mainWindow.Show(); ProcessCommandLine(CommandLine); - } - } + } + } - void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) - { - MessageBox.Show("Exception unhandled by ISBoxer EVE Launcher: " + e.ExceptionObject.ToString()); - } + void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + { + MessageBox.Show("Exception unhandled by ISBoxer EVE Launcher: " + e.ExceptionObject.ToString()); + } - } + } } diff --git a/Games/EVE/EVEAccount.cs b/Games/EVE/EVEAccount.cs index 7ccbdbf..17040ec 100644 --- a/Games/EVE/EVEAccount.cs +++ b/Games/EVE/EVEAccount.cs @@ -1309,7 +1309,6 @@ public LoginResult GetAccessToken(bool sisi, out Token accessToken) } App.strUserName = Username; - App.strPassword = new System.Net.NetworkCredential(string.Empty, SecurePassword).Password; var uri = RequestResponse.GetLoginUri(sisi, state.ToString(), challengeHash); diff --git a/Windows/LoginBrowser.Designer.cs b/Windows/LoginBrowser.Designer.cs index 7f350bd..6402c2f 100644 --- a/Windows/LoginBrowser.Designer.cs +++ b/Windows/LoginBrowser.Designer.cs @@ -74,7 +74,7 @@ private void InitializeComponent() this.toolStripButton_Refresh.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton_Refresh.Name = "toolStripButton_Refresh"; this.toolStripButton_Refresh.Size = new System.Drawing.Size(36, 36); - this.toolStripButton_Refresh.Text = "Refresh"; + this.toolStripButton_Refresh.Text = "toolStripButton1"; this.toolStripButton_Refresh.Click += new System.EventHandler(this.toolStripButton_Refresh_Click); // // LoginBrowser diff --git a/Windows/LoginBrowser.cs b/Windows/LoginBrowser.cs index 01fcfe9..99873d9 100644 --- a/Windows/LoginBrowser.cs +++ b/Windows/LoginBrowser.cs @@ -82,14 +82,7 @@ private void chromiumWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEn strURL_RequestVerificationToken = strCurrentAddress; } - if (taskHtml.Result.Contains("Log in to your account") && !taskHtml.Result.Contains("Invalid username / password")) - { - this.chromiumWebBrowser.EvaluateScriptAsync("document.getElementById('UserName').value = '" + App.strUserName + "';"); - this.chromiumWebBrowser.EvaluateScriptAsync("document.getElementById('Password').value = '" + App.strPassword + "';"); - this.chromiumWebBrowser.EvaluateScriptAsync("document.getElementById('RememberMe').click();"); - this.chromiumWebBrowser.EvaluateScriptAsync("document.forms['loginForm'].submit();"); - } - else if (taskHtml.Result.Contains("Be sure to click the prompt above to login to the EVE Online launcher")) + if (taskHtml.Result.Contains("Be sure to click the prompt above to login to the EVE Online launcher")) { strHTML_Result = taskHtml.Result; strURL_Result = strCurrentAddress; @@ -105,7 +98,6 @@ private void chromiumWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEn } }); - } private void LoginBrowser_Resize(object sender, EventArgs e) diff --git a/Windows/LoginBrowser.resx b/Windows/LoginBrowser.resx index 527e628..cc81fe5 100644 --- a/Windows/LoginBrowser.resx +++ b/Windows/LoginBrowser.resx @@ -124,38 +124,38 @@ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAdOSURBVFhH7ZZrTJvXGcezrWulbdq0mzT1Mqlf+mEtSzpI - SprQVLu06ZpK3AIEsqZZVIQaCENJuESkJG1I1m1K27QjZEnDxQQIN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F8jK + 9Xo9ptRanGzWIOUNIWhuDvNwJeX2XN5fOoyidiu6ZAxuSKZxscfGuk6kYwEbgXFbLBaYSMspXMNocb5d + hdST/aA5ufRb0zPZ/I9eqpSjuFWP3hEGJosd41orGsRqKLUGtr0bTfeaXlWtVguFUoULrXL89owUz2Z3 + f8yl3ZK+Ul1d/dWCgoKvJ2V1XnuhqB+neAp098mgI4npnqqZaRYUt06nY6EajQYKBYkVS1FyS47UE2I8 + k9l2/cCBA08cOnToazT3A8RDROHFxcVPZGVlfY/4qR0Zjbe253Yho2YUpY1jqKkXorlbgqHhEYyMjGCU + mD75okFc4QlQ3igjsSOgc57Lqm/Iycl5msB/dOTIkW/u37//MYJ4eBG0UhpMJv40Ozt7Z25u7qsvZ1eW + pWT+Y3hHHh8vlUmRf1WBo3UKlDZP4XTzON64Nom8D6fwu7JB7MjrQkr6ddnL2RWVZG46yfECLYIuiOSm + /5w+vICNHSAJthPvPnz48L7f55Rk7Mz88IOkjEZVUgbP+XTa7bvUSek85y/SeOpdmVevHswuzSTAVBK/ + Jy8vL/mRO0C0dgYOHjz4jfz8/G+TRN+lBZGkP6DJ0tPTf0I7RD7/LG46Jiv+MYn7YVpa2vfpHPL+O8Tf + eqQzsE40mC0mbpqEroIWR03Gj8dNxyTmMRqzfk48D02YqG3b/gMGsC7Q3A4uSAAAAABJRU5ErkJggg== \ No newline at end of file From 7fb17dc3d918e182f637714bcf1d63bdd966b1e2 Mon Sep 17 00:00:00 2001 From: Jizheng Date: Mon, 9 Nov 2020 19:12:08 +0000 Subject: [PATCH 10/23] Revert "Revert "Beta3"" This reverts commit 3d663828e9a34f03cbe140bf88930523493660fc. --- App.xaml.cs | 1390 +++++++++++++++--------------- Games/EVE/EVEAccount.cs | 1 + Windows/LoginBrowser.Designer.cs | 2 +- Windows/LoginBrowser.cs | 10 +- Windows/LoginBrowser.resx | 64 +- 5 files changed, 751 insertions(+), 716 deletions(-) diff --git a/App.xaml.cs b/App.xaml.cs index 55457ea..4588b3b 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -1,14 +1,11 @@ using System; using System.Collections.Generic; using System.Collections.ObjectModel; -using System.Configuration; -using System.Data; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Text; -using System.Threading.Tasks; using System.Windows; using Microsoft.Win32; using ISBoxerEVELauncher.Extensions; @@ -17,722 +14,751 @@ using ISBoxerEVELauncher.Games.EVE; using ISBoxerEVELauncher.Interface; using System.Net; +using CefSharp.WinForms; using ISBoxerEVELauncher.Windows; namespace ISBoxerEVELauncher { - /// - /// Interaction logic for App.xaml - /// - public partial class App : Application - { - public static bool HasInnerSpace { get; set; } - public static LoginBrowser myLB = new LoginBrowser(); - public static string strUserName {get; set; } - - - public static string AppVersion - { - get - { - return Assembly.GetExecutingAssembly().GetName().Version.ToString(); - } - } - - - public static void ReloadGameConfiguration() - { - try - { - GameConfiguration = InnerSpaceSettings.Load(ISPath + @"\GameConfiguration.XML"); - } - catch - { - GameConfiguration = null; - } - } - - public static string DetectedEVESharedCachePath - { - get - { - RegistryKey hkcu = Registry.CurrentUser; - RegistryKey PathKey = hkcu.OpenSubKey(@"SOFTWARE\CCP\EVEONLINE"); - if (PathKey != null) - { - string value = PathKey.GetValue("CACHEFOLDER", Environment.SpecialFolder.CommonApplicationData + @"\CCP\EVE\SharedCache\") as string; - return value; + /// + /// Interaction logic for App.xaml + /// + public partial class App : Application + { + public static bool HasInnerSpace + { + get; set; + } + public static LoginBrowser myLB = new LoginBrowser(); + public static string strUserName + { + get; set; + } + public static string strPassword + { + get; set; + } + + + public static string AppVersion + { + get + { + return Assembly.GetExecutingAssembly().GetName().Version.ToString(); } - return null; - } - - } - - public static string[] CommandLine; - public static bool ExitAfterLaunch; - public static bool searchCharactersOnly; - - static Settings _Settings; - public static Settings Settings - { - get - { - if (_Settings == null) - { - try - { - _Settings = Settings.Load(); - if (EVEAccount.ShouldUgradeCookieStorage) - { - _Settings.Store(); - } - } - catch (System.IO.FileNotFoundException) - { - _Settings = new Settings(); - _Settings.Store(); - } - } - return _Settings; - } - } - - public static string ISBoxerEVELauncherPath - { - get - { - return System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); - } - } - - public static string ISExecutable - { - get - { - return ISPath + "\\InnerSpace.exe"; - } - } - - public static string BaseDirectory - { - get - { - return System.AppDomain.CurrentDomain.BaseDirectory; - } - } - - static string _ISPath = string.Empty; - /// - /// Path to Inner Space, which should either be in the registry, or the current folder. Otherwise, the user likely doesn't care about Inner Space integration. - /// - public static string ISPath - { - get - { - // already detected? - if (!string.IsNullOrEmpty(_ISPath)) - return _ISPath; - - // nope. - - // we're expected to be installed into the IS/ISBoxer folder.... - if (System.IO.File.Exists(BaseDirectory + @"\InnerSpace.exe")) - { - _ISPath = BaseDirectory; - return _ISPath; - } - - // oh well... the path SHOULD be in the registry... - { - RegistryKey hklm = Registry.LocalMachine; - RegistryKey ISPathKey = hklm.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\App Paths\InnerSpace.exe"); - if (ISPathKey != null) - { - string reg_path = ISPathKey.GetValue("Path", Environment.SpecialFolder.ProgramFiles + @"\InnerSpace") as string; - if (System.IO.File.Exists(reg_path + "\\InnerSpace.exe")) - { - _ISPath = reg_path; - return _ISPath; - } - } - } - - // didn't find it. maybe not even installed. - return BaseDirectory; - } - set - { - _ISPath = value; - } - } - - static void ReloadGameProfiles() - { - InnerSpaceGameProfile gpSingularity = Settings.SingularityGameProfile; - InnerSpaceGameProfile gpTranquility = Settings.TranquilityGameProfile; - - if (_GameProfiles == null) - { - _GameProfiles = new ObservableCollection(); - } - else - _GameProfiles.Clear(); - - if (GameConfiguration != null) - { - if (GameConfiguration.Sets != null) - { - foreach (Set gameSet in GameConfiguration.Sets) - { - Set profilesSet = gameSet.FindSet("Profiles"); - if (profilesSet == null || profilesSet.Sets == null) - continue; - - foreach (Set gameProfileSet in profilesSet.Sets) - { - InnerSpaceGameProfile gp = new InnerSpaceGameProfile() { Game = gameSet.Name, GameProfile = gameProfileSet.Name }; - _GameProfiles.Add(gp); - } - } - } - } - - Settings.SingularityGameProfile = App.FindGlobalGameProfile(gpSingularity); - Settings.TranquilityGameProfile = App.FindGlobalGameProfile(gpTranquility); - } - - public static Set FindGameProfileSet(string gameName, string gameProfileName) - { - if (string.IsNullOrWhiteSpace(gameName) || string.IsNullOrWhiteSpace(gameProfileName)) - return null; + } - if (GameConfiguration == null || GameConfiguration.Sets == null) - return null; - Set gameSet = GameConfiguration.FindSet(gameName); - if (gameSet == null) - return null; + public static void ReloadGameConfiguration() + { + try + { + GameConfiguration = InnerSpaceSettings.Load(ISPath + @"\GameConfiguration.XML"); + } + catch + { + GameConfiguration = null; + } + } - Set profilesSet = gameSet.FindSet("Profiles"); - if (profilesSet == null || profilesSet.Sets == null) - return null; + public static string DetectedEVESharedCachePath + { + get + { + RegistryKey hkcu = Registry.CurrentUser; + RegistryKey PathKey = hkcu.OpenSubKey(@"SOFTWARE\CCP\EVEONLINE"); + if (PathKey != null) + { + string value = PathKey.GetValue("CACHEFOLDER", Environment.SpecialFolder.CommonApplicationData + @"\CCP\EVE\SharedCache\") as string; + return value; + } + return null; + } + + } + + public static string[] CommandLine; + public static bool ExitAfterLaunch; + public static bool searchCharactersOnly; + + static Settings _Settings; + public static Settings Settings + { + get + { + if (_Settings == null) + { + try + { + _Settings = Settings.Load(); + if (EVEAccount.ShouldUgradeCookieStorage) + { + _Settings.Store(); + } + } + catch (System.IO.FileNotFoundException) + { + _Settings = new Settings(); + _Settings.Store(); + } + } + return _Settings; + } + } - return profilesSet.FindSet(gameProfileName); - } + public static string ISBoxerEVELauncherPath + { + get + { + return System.IO.Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); + } + } + + public static string ISExecutable + { + get + { + return ISPath + "\\InnerSpace.exe"; + } + } + + public static string BaseDirectory + { + get + { + return System.AppDomain.CurrentDomain.BaseDirectory; + } + } + + static string _ISPath = string.Empty; + /// + /// Path to Inner Space, which should either be in the registry, or the current folder. Otherwise, the user likely doesn't care about Inner Space integration. + /// + public static string ISPath + { + get + { + // already detected? + if (!string.IsNullOrEmpty(_ISPath)) + return _ISPath; + + // nope. + + // we're expected to be installed into the IS/ISBoxer folder.... + if (System.IO.File.Exists(BaseDirectory + @"\InnerSpace.exe")) + { + _ISPath = BaseDirectory; + return _ISPath; + } + + // oh well... the path SHOULD be in the registry... + { + RegistryKey hklm = Registry.LocalMachine; + RegistryKey ISPathKey = hklm.OpenSubKey(@"Software\Microsoft\Windows\CurrentVersion\App Paths\InnerSpace.exe"); + if (ISPathKey != null) + { + string reg_path = ISPathKey.GetValue("Path", Environment.SpecialFolder.ProgramFiles + @"\InnerSpace") as string; + if (System.IO.File.Exists(reg_path + "\\InnerSpace.exe")) + { + _ISPath = reg_path; + return _ISPath; + } + } + } + + // didn't find it. maybe not even installed. + return BaseDirectory; + } + set + { + _ISPath = value; + } + } + + static void ReloadGameProfiles() + { + InnerSpaceGameProfile gpSingularity = Settings.SingularityGameProfile; + InnerSpaceGameProfile gpTranquility = Settings.TranquilityGameProfile; - static Set _GameConfiguration; - public static Set GameConfiguration { get { return _GameConfiguration; } private set { _GameConfiguration = value; ReloadGameProfiles(); } } - static ObservableCollection _GameProfiles; - public static ObservableCollection GameProfiles - { - get - { if (_GameProfiles == null) { - _GameProfiles = new ObservableCollection(); - ReloadGameProfiles(); - } - return _GameProfiles; - } - private set - { - _GameProfiles = value; - } - } - - public static InnerSpaceGameProfile FindGlobalGameProfile(InnerSpaceGameProfile likeThis) - { - if (GameProfiles == null || likeThis == null) - return likeThis; - - InnerSpaceGameProfile found = GameProfiles.FirstOrDefault(q => q.Game.Equals(likeThis.Game, StringComparison.InvariantCultureIgnoreCase) && q.GameProfile.Equals(likeThis.GameProfile, StringComparison.InvariantCultureIgnoreCase)); - if (found == null) - return likeThis; - - return found; - } - - static bool AddGameToXML(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) - { - // not running, just edit the XML - if (GameConfiguration == null) - { - // no existing XML. - return false; - } - - Set gameSet = GameConfiguration.FindSet(gameName); - if (gameSet == null) - { - gameSet = new Set(gameName); - GameConfiguration.Add(gameSet); - gameSet.Add(new Setting("OpenGL", "1")); - gameSet.Add(new Setting("Direct3D8", "1")); - gameSet.Add(new Setting("Direct3D9", "1")); - gameSet.Add(new Setting("Win32I Keyboard", "1")); - gameSet.Add(new Setting("Win32I Mouse", "1")); - gameSet.Add(new Setting("DirectInput8 Keyboard", "1")); - gameSet.Add(new Setting("DirectInput8 Mouse", "1")); - gameSet.Add(new Setting("modules", "auto")); - gameSet.Add(new Setting("Background Mouse", "1")); - gameSet.Add(new Setting("Keystroke Delay", "1")); - } - - Set gameProfilesSet = gameSet.FindSet("Profiles"); - if (gameProfilesSet == null) - { - gameProfilesSet = new Set("Profiles"); - gameSet.Add(gameProfilesSet); - } - - Set gameProfileSet = gameSet.FindSet(gameProfileName); - if (gameProfileSet == null) - { - gameProfileSet = new Set(gameProfileName); - gameProfilesSet.Add(gameProfileSet); - } - - Setting setting = gameProfileSet.FindSetting("Executable"); - if (setting == null) - gameProfileSet.Add(new Setting("Executable", executableName)); - else - setting.Value = executableName; - - setting = gameProfileSet.FindSetting("Path"); - if (setting == null) - gameProfileSet.Add(new Setting("Path", executablePath)); - else - setting.Value = executablePath; - - setting = gameProfileSet.FindSetting("Parameters"); - if (setting == null) - { - if (!string.IsNullOrEmpty(parameters)) - gameProfileSet.Add(new Setting("Parameters", parameters)); - } - else - { - if (string.IsNullOrEmpty(parameters)) - gameProfileSet.Settings.Remove(setting); + _GameProfiles = new ObservableCollection(); + } else - setting.Value = parameters; - } - - if (GameProfiles.FirstOrDefault(q => q.GameProfile.Equals(gameProfileName)) == null) - { - GameProfiles.Add(new InnerSpaceGameProfile() { Game = gameName, GameProfile = gameProfileName }); - } - - GameConfiguration.Store(ISPath + @"\GameConfiguration.XML"); - return true; - } - /// - /// Add a Game/Game Profile to Inner Space - /// - /// - /// - /// - /// - /// - /// - public static bool AddGame(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) - { - string isboxerFilename = System.IO.Path.Combine(ISPath, "ISBoxer Toolkit.exe"); - while (true) - { - System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("InnerSpace"); - if (processes.Length == 0) - { - if (!AddGameToXML(gameName, gameProfileName, executablePath, executableName, parameters)) - { - MessageBox.Show("In order to Add Game for you, ISBoxer EVE Launcher requires that GameConfiguration.XML exist in the Inner Space folder -- looking for: " + isboxerFilename); - return false; - } - return true; - } - - if (!System.IO.File.Exists(isboxerFilename)) - { - switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) - { - case MessageBoxResult.OK: - continue; - case MessageBoxResult.Cancel: - return false; - } + _GameProfiles.Clear(); + + if (GameConfiguration != null) + { + if (GameConfiguration.Sets != null) + { + foreach (Set gameSet in GameConfiguration.Sets) + { + Set profilesSet = gameSet.FindSet("Profiles"); + if (profilesSet == null || profilesSet.Sets == null) + continue; + + foreach (Set gameProfileSet in profilesSet.Sets) + { + InnerSpaceGameProfile gp = new InnerSpaceGameProfile() { Game = gameSet.Name, GameProfile = gameProfileSet.Name }; + _GameProfiles.Add(gp); + } + } + } } + + Settings.SingularityGameProfile = App.FindGlobalGameProfile(gpSingularity); + Settings.TranquilityGameProfile = App.FindGlobalGameProfile(gpTranquility); + } + + public static Set FindGameProfileSet(string gameName, string gameProfileName) + { + if (string.IsNullOrWhiteSpace(gameName) || string.IsNullOrWhiteSpace(gameProfileName)) + return null; + + if (GameConfiguration == null || GameConfiguration.Sets == null) + return null; + + Set gameSet = GameConfiguration.FindSet(gameName); + if (gameSet == null) + return null; + + Set profilesSet = gameSet.FindSet("Profiles"); + if (profilesSet == null || profilesSet.Sets == null) + return null; + + return profilesSet.FindSet(gameProfileName); + } + + static Set _GameConfiguration; + public static Set GameConfiguration + { + get + { + return _GameConfiguration; + } + private set + { + _GameConfiguration = value; + ReloadGameProfiles(); + } + } + static ObservableCollection _GameProfiles; + public static ObservableCollection GameProfiles + { + get + { + if (_GameProfiles == null) + { + _GameProfiles = new ObservableCollection(); + ReloadGameProfiles(); + } + return _GameProfiles; + } + private set + { + _GameProfiles = value; + } + } + + public static InnerSpaceGameProfile FindGlobalGameProfile(InnerSpaceGameProfile likeThis) + { + if (GameProfiles == null || likeThis == null) + return likeThis; + + InnerSpaceGameProfile found = GameProfiles.FirstOrDefault(q => q.Game.Equals(likeThis.Game, StringComparison.InvariantCultureIgnoreCase) && q.GameProfile.Equals(likeThis.GameProfile, StringComparison.InvariantCultureIgnoreCase)); + if (found == null) + return likeThis; + + return found; + } + + static bool AddGameToXML(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) + { + // not running, just edit the XML + if (GameConfiguration == null) + { + // no existing XML. + return false; + } + + Set gameSet = GameConfiguration.FindSet(gameName); + if (gameSet == null) + { + gameSet = new Set(gameName); + GameConfiguration.Add(gameSet); + gameSet.Add(new Setting("OpenGL", "1")); + gameSet.Add(new Setting("Direct3D8", "1")); + gameSet.Add(new Setting("Direct3D9", "1")); + gameSet.Add(new Setting("Win32I Keyboard", "1")); + gameSet.Add(new Setting("Win32I Mouse", "1")); + gameSet.Add(new Setting("DirectInput8 Keyboard", "1")); + gameSet.Add(new Setting("DirectInput8 Mouse", "1")); + gameSet.Add(new Setting("modules", "auto")); + gameSet.Add(new Setting("Background Mouse", "1")); + gameSet.Add(new Setting("Keystroke Delay", "1")); + } + + Set gameProfilesSet = gameSet.FindSet("Profiles"); + if (gameProfilesSet == null) + { + gameProfilesSet = new Set("Profiles"); + gameSet.Add(gameProfilesSet); + } + + Set gameProfileSet = gameSet.FindSet(gameProfileName); + if (gameProfileSet == null) + { + gameProfileSet = new Set(gameProfileName); + gameProfilesSet.Add(gameProfileSet); + } + + Setting setting = gameProfileSet.FindSetting("Executable"); + if (setting == null) + gameProfileSet.Add(new Setting("Executable", executableName)); else + setting.Value = executableName; + + setting = gameProfileSet.FindSetting("Path"); + if (setting == null) + gameProfileSet.Add(new Setting("Path", executablePath)); + else + setting.Value = executablePath; + + setting = gameProfileSet.FindSetting("Parameters"); + if (setting == null) { - FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(isboxerFilename); - if (fvi.ProductMajorPart < 42) - { - switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) - { - case MessageBoxResult.OK: - continue; - case MessageBoxResult.Cancel: + if (!string.IsNullOrEmpty(parameters)) + gameProfileSet.Add(new Setting("Parameters", parameters)); + } + else + { + if (string.IsNullOrEmpty(parameters)) + gameProfileSet.Settings.Remove(setting); + else + setting.Value = parameters; + } + + if (GameProfiles.FirstOrDefault(q => q.GameProfile.Equals(gameProfileName)) == null) + { + GameProfiles.Add(new InnerSpaceGameProfile() { Game = gameName, GameProfile = gameProfileName }); + } + + GameConfiguration.Store(ISPath + @"\GameConfiguration.XML"); + return true; + } + /// + /// Add a Game/Game Profile to Inner Space + /// + /// + /// + /// + /// + /// + /// + public static bool AddGame(string gameName, string gameProfileName, string executablePath, string executableName, string parameters) + { + string isboxerFilename = System.IO.Path.Combine(ISPath, "ISBoxer Toolkit.exe"); + while (true) + { + System.Diagnostics.Process[] processes = System.Diagnostics.Process.GetProcessesByName("InnerSpace"); + if (processes.Length == 0) + { + if (!AddGameToXML(gameName, gameProfileName, executablePath, executableName, parameters)) + { + MessageBox.Show("In order to Add Game for you, ISBoxer EVE Launcher requires that GameConfiguration.XML exist in the Inner Space folder -- looking for: " + isboxerFilename); return false; - } - } + } + return true; + } + + if (!System.IO.File.Exists(isboxerFilename)) + { + switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) + { + case MessageBoxResult.OK: + continue; + case MessageBoxResult.Cancel: + return false; + } + } + else + { + FileVersionInfo fvi = FileVersionInfo.GetVersionInfo(isboxerFilename); + if (fvi.ProductMajorPart < 42) + { + switch (MessageBox.Show("ISBoxer EVE Launcher has determined that Inner Space is running. Please Exit Inner Space and click OK to try again, otherwise click Cancel.", "Adding a Game this way requires Inner Space to be closed", MessageBoxButton.OKCancel)) + { + case MessageBoxResult.OK: + continue; + case MessageBoxResult.Cancel: + return false; + } + } + } + + + string cmdLine = "run isboxer -inituplink;isboxeraddgame \"" + gameName.Replace("\"", "\\\"") + "\" \"" + gameProfileName.Replace("\"", "\\\"") + "\" \"" + executablePath.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\" \"" + executableName.Replace("\"", "\\\"") + "\" \"" + parameters.Replace("\"", "\\\"") + "\""; + System.Diagnostics.Process.Start(ISExecutable, cmdLine); + return true; + } + } + + /// + /// Have Inner Space launch EVE via a specified Game and Game Profile + /// + /// + /// + /// + /// + /// + /// + static public bool Launch(string gameName, string gameProfileName, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) + { + //if (ssoToken == null) + // throw new ArgumentNullException("ssoToken"); + if (gameName == null) + throw new ArgumentNullException("gameName"); + if (gameProfileName == null) + throw new ArgumentNullException("gameProfileName"); + + string cmdLine = "open \"" + gameName + "\" \"" + gameProfileName + "\" -addparam \"/noconsole\" -addparam \"/ssoToken=" + token.TokenString + "\""; + if (dxVersion != DirectXVersion.Default) + { + cmdLine += " -addparam \"/triPlatform=" + dxVersion.ToString() + "\""; } + if (characterID != 0) + { + cmdLine += " -addparam \"/character=" + characterID + "\""; + } - string cmdLine = "run isboxer -inituplink;isboxeraddgame \"" + gameName.Replace("\"", "\\\"") + "\" \"" + gameProfileName.Replace("\"", "\\\"") + "\" \"" + executablePath.Replace("\\", "\\\\").Replace("\"", "\\\"") + "\" \"" + executableName.Replace("\"", "\\\"") + "\" \"" + parameters.Replace("\"", "\\\"") + "\""; - System.Diagnostics.Process.Start(ISExecutable, cmdLine); + if (sisi) + { + cmdLine += " -addparam \"/server:Singularity\""; + } + else + { + cmdLine += " -addparam \"/server:tranquility\""; + } + + cmdLine += " -addparam \"settingsprofile=ISBEL\" -addparam \"/machineHash=" + App.Settings.MachineHash + "\" \"\""; + + try + { + System.Diagnostics.Process.Start(App.ISExecutable, cmdLine); + } + catch (Exception e) + { + MessageBox.Show("Launch failed. executable=" + App.ISExecutable + "; args=" + cmdLine + System.Environment.NewLine + e.ToString()); + return false; + } return true; - } - } - - /// - /// Have Inner Space launch EVE via a specified Game and Game Profile - /// - /// - /// - /// - /// - /// - /// - static public bool Launch(string gameName, string gameProfileName, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) - { - //if (ssoToken == null) - // throw new ArgumentNullException("ssoToken"); - if (gameName == null) - throw new ArgumentNullException("gameName"); - if (gameProfileName == null) - throw new ArgumentNullException("gameProfileName"); - - string cmdLine = "open \"" + gameName + "\" \"" + gameProfileName + "\" -addparam \"/noconsole\" -addparam \"/ssoToken=" + token.TokenString + "\""; - if (dxVersion != DirectXVersion.Default) - { - cmdLine += " -addparam \"/triPlatform=" + dxVersion.ToString() + "\""; - } - - if (characterID != 0) - { - cmdLine += " -addparam \"/character=" + characterID + "\""; - } - - if (sisi) - { - cmdLine += " -addparam \"/server:Singularity\""; - } - else - { - cmdLine += " -addparam \"/server:tranquility\""; - } - - cmdLine += " -addparam \"settingsprofile=ISBEL\" -addparam \"/machineHash=" + App.Settings.MachineHash + "\" \"\""; - - try - { - System.Diagnostics.Process.Start(App.ISExecutable, cmdLine); - } - catch (Exception e) - { - MessageBox.Show("Launch failed. executable=" + App.ISExecutable + "; args=" + cmdLine + System.Environment.NewLine + e.ToString()); - return false; - } - return true; - } - - /// - /// Launch EVE directly - /// - /// - /// - /// - /// - /// - static public bool Launch(string sharedCachePath, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) - { - //if (ssoToken == null) - // throw new ArgumentNullException("ssoToken"); - if (sharedCachePath == null) - throw new ArgumentNullException("sharedCachePath"); - - string args = "/noconsole /ssoToken=" + token.TokenString; - if (dxVersion != DirectXVersion.Default) - { - args += " /triPlatform=" + dxVersion.ToString(); - } - - if (sisi) - { - args += " /server:Singularity"; - } - else - { - args += " /server:tranquility"; - } - - if (characterID != 0) - { - args += " /character=" + characterID; - } - - args += " /settingsprofile=ISBEL /machineHash=" + App.Settings.MachineHash + " \"\""; - - string executable; - if (sisi) - executable = App.Settings.GetSingularityEXE(); - else - executable = App.Settings.GetTranquilityEXE(); - - if (!System.IO.File.Exists(executable)) - { - MessageBox.Show("Cannot find exefile.exe for launch -- looking at: " + executable); - return false; - } - - try - { - System.Diagnostics.Process.Start(executable, args); - } - catch (Exception e) - { - MessageBox.Show("Launch failed. executable=" + executable + "; args=" + args + System.Environment.NewLine + e.ToString()); - return false; - } - return true; - } - - public static void ProcessCommandLine(string Args) - { - ProcessCommandLine(Args.SplitCommandLine()); - } - - public static void ProcessCommandLine(IEnumerable Args) - { - - if (Args == null || Args.Count() == 0) - { - ProfileManager.MigrateSettingsToISBEL(); - return; - } - - List LaunchAccountNames = new List(); - - bool useInnerSpace = false; - foreach (string s in Args) - { - switch (s.ToLowerInvariant()) - { - case "-dx9": - Settings.UseDirectXVersion = DirectXVersion.dx9; - break; - case "-dx11": - Settings.UseDirectXVersion = DirectXVersion.dx11; - break; - case "-singularity": - Settings.UseSingularity = true; - break; - case "-tranquility": - Settings.UseSingularity = false; - break; - case "-innerspace": - useInnerSpace = true; - break; - case "-eve": - useInnerSpace = false; - break; - case "-multiinstance": - break; - case "-exit": - ExitAfterLaunch = true; - break; - case "-c": - searchCharactersOnly = true; - break; - case "null": - // ignore - break; - default: - LaunchAccountNames.Add(s); - break; - } - } - - if (LaunchAccountNames.Count == 0) - { - - return; - } - - List LaunchAccounts = new List(); - - foreach (string name in LaunchAccountNames) - { - - if (!searchCharactersOnly) - { - EVEAccount acct = Settings.Accounts.FirstOrDefault(q => q.Username.Equals(name, StringComparison.InvariantCultureIgnoreCase)); - if (acct != null) - { - LaunchAccounts.Add(acct); - continue; - } - } - EVECharacter ec = Settings.Characters.FirstOrDefault(q => q.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); - if (ec != null) - { - LaunchAccounts.Add(ec); - continue; - } - - MessageBox.Show("Unrecognized EVE Account or Character name '" + name + "' -- if this is correct, please use Add Account/Character to enable it before launching."); - return; - } - - ILauncher launcher; - if (useInnerSpace) - { - InnerSpaceGameProfile gp; - if (Settings.UseSingularity) - { - gp = Settings.SingularityGameProfile; + } + + /// + /// Launch EVE directly + /// + /// + /// + /// + /// + /// + static public bool Launch(string sharedCachePath, bool sisi, DirectXVersion dxVersion, long characterID, EVEAccount.Token token) + { + //if (ssoToken == null) + // throw new ArgumentNullException("ssoToken"); + if (sharedCachePath == null) + throw new ArgumentNullException("sharedCachePath"); + + string args = "/noconsole /ssoToken=" + token.TokenString; + if (dxVersion != DirectXVersion.Default) + { + args += " /triPlatform=" + dxVersion.ToString(); + } + + if (sisi) + { + args += " /server:Singularity"; } else { - gp = Settings.TranquilityGameProfile; + args += " /server:tranquility"; } - if (gp == null || string.IsNullOrEmpty(gp.Game) || string.IsNullOrEmpty(gp.GameProfile)) + if (characterID != 0) { - MessageBox.Show("Please select a Game Profile first!"); - return; + args += " /character=" + characterID; } - launcher = new Launchers.InnerSpace(gp, Settings.UseDirectXVersion, Settings.UseSingularity); - } - else - { - launcher = new Launchers.Direct(Settings.EVESharedCachePath, Settings.UseDirectXVersion, Settings.UseSingularity); - } - Windows.LaunchProgressWindow lpw = new Windows.LaunchProgressWindow(LaunchAccounts, launcher); - lpw.ShowDialog(); + args += " /settingsprofile=ISBEL /machineHash=" + App.Settings.MachineHash + " \"\""; - if (ExitAfterLaunch) - { - App.Current.Shutdown(); - } - } + string executable; + if (sisi) + executable = App.Settings.GetSingularityEXE(); + else + executable = App.Settings.GetTranquilityEXE(); - /// - /// Gets what we think is the "master" ISBoxer EVE Launcher instance - /// - /// true if we should be more secure about it (e.g. Master Key transfer), false if we're just passing command-line around - /// - static public Process GetMasterInstance(bool ensureMainModule) - { - Process currentProcess = Process.GetCurrentProcess(); + if (!System.IO.File.Exists(executable)) + { + MessageBox.Show("Cannot find exefile.exe for launch -- looking at: " + executable); + return false; + } - //Note: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.mainwindowhandle?view=netframework-4.7 - //When the Main window is hidden, it will return a MainWindowHandle of 0. This makes the following code fail when trying to find the master window that is minimized to the system tray: - IEnumerable processList = Process.GetProcesses().Where(q => q.NameMatches(currentProcess) && (q.MainWindowHandle != IntPtr.Zero || q.Id == currentProcess.Id)); + try + { + System.Diagnostics.Process.Start(executable, args); + } + catch (Exception e) + { + MessageBox.Show("Launch failed. executable=" + executable + "; args=" + args + System.Environment.NewLine + e.ToString()); + return false; + } + return true; + } - if (processList == null) - return null; + public static void ProcessCommandLine(string Args) + { + ProcessCommandLine(Args.SplitCommandLine()); + } - Process[] processes = processList.ToArray(); - Array.Sort(processes, (a, b) => a.StartTime > b.StartTime ? 1 : -1); - if (processes.Length > 1) - { - for (int i = 0; i < processes.Length; i++) - { - if (processes[i].Id == currentProcess.Id) - continue; - - // ensure that the Master Instance is indeed this app by checking the module list? (note: if the other process is Administrator, this one also needs to be Administrator) - if (!ensureMainModule) - return processes[i]; - - try - { - - if (processes[i].MainModuleNameMatches(currentProcess)) - return processes[i]; - } - catch (System.ComponentModel.Win32Exception we) - { - if (we.NativeErrorCode == 5) - { - // this might be the right instance, but since it's Administrator and we're not, we can't use it. - continue; - } - throw; - } - } - } - return null; - } - - /// - /// Transmit the command-line to an already-running Master instance, if one is available - /// - /// - public bool TransmitCommandLine() - { - // check if it's already running. - - System.Diagnostics.Process masterInstance = GetMasterInstance(false); - - if (masterInstance != null) - { - string joinedCommandLine = string.Empty; - foreach (string s in CommandLine) - { - // if it's another process, don't exit - switch (s.ToLowerInvariant()) - { - case "null": - // ignore... - break; - case "-exit": - // the -exit is intended for THIS process, not the other one. - break; - case "-multiinstance": - return false; - } - - if (!s.Equals("-exit", StringComparison.InvariantCultureIgnoreCase)) - joinedCommandLine += "\"" + s.Replace("\"", "\\\"") + "\" "; - } - joinedCommandLine.TrimEnd(); + public static void ProcessCommandLine(IEnumerable Args) + { - byte[] buff = Encoding.Unicode.GetBytes(joinedCommandLine); + if (Args == null || Args.Count() == 0) + { + ProfileManager.MigrateSettingsToISBEL(); + return; + } - Windows.COPYDATASTRUCT cds = new Windows.COPYDATASTRUCT(); - cds.cbData = buff.Length; - cds.lpData = Marshal.AllocHGlobal(buff.Length); - Marshal.Copy(buff, 0, cds.lpData, buff.Length); - cds.dwData = IntPtr.Zero; - cds.cbData = buff.Length; - var ret = ISBoxerEVELauncher.Windows.MainWindow.SendMessage(masterInstance.MainWindowHandle, ISBoxerEVELauncher.Windows.MainWindow.WM_COPYDATA, IntPtr.Zero, ref cds); - Marshal.FreeHGlobal(cds.lpData); + List LaunchAccountNames = new List(); - Shutdown(); - return true; - } - return false; - } + bool useInnerSpace = false; + foreach (string s in Args) + { + switch (s.ToLowerInvariant()) + { + case "-dx9": + Settings.UseDirectXVersion = DirectXVersion.dx9; + break; + case "-dx11": + Settings.UseDirectXVersion = DirectXVersion.dx11; + break; + case "-singularity": + Settings.UseSingularity = true; + break; + case "-tranquility": + Settings.UseSingularity = false; + break; + case "-innerspace": + useInnerSpace = true; + break; + case "-eve": + useInnerSpace = false; + break; + case "-multiinstance": + break; + case "-exit": + ExitAfterLaunch = true; + break; + case "-c": + searchCharactersOnly = true; + break; + case "null": + // ignore + break; + default: + LaunchAccountNames.Add(s); + break; + } + } + + if (LaunchAccountNames.Count == 0) + { + + return; + } + + List LaunchAccounts = new List(); + + foreach (string name in LaunchAccountNames) + { + + if (!searchCharactersOnly) + { + EVEAccount acct = Settings.Accounts.FirstOrDefault(q => q.Username.Equals(name, StringComparison.InvariantCultureIgnoreCase)); + if (acct != null) + { + LaunchAccounts.Add(acct); + continue; + } + } + EVECharacter ec = Settings.Characters.FirstOrDefault(q => q.Name.Equals(name, StringComparison.InvariantCultureIgnoreCase)); + if (ec != null) + { + LaunchAccounts.Add(ec); + continue; + } + + MessageBox.Show("Unrecognized EVE Account or Character name '" + name + "' -- if this is correct, please use Add Account/Character to enable it before launching."); + return; + } + + ILauncher launcher; + if (useInnerSpace) + { + InnerSpaceGameProfile gp; + if (Settings.UseSingularity) + { + gp = Settings.SingularityGameProfile; + } + else + { + gp = Settings.TranquilityGameProfile; + } + + if (gp == null || string.IsNullOrEmpty(gp.Game) || string.IsNullOrEmpty(gp.GameProfile)) + { + MessageBox.Show("Please select a Game Profile first!"); + return; + } + + launcher = new Launchers.InnerSpace(gp, Settings.UseDirectXVersion, Settings.UseSingularity); + } + else + { + launcher = new Launchers.Direct(Settings.EVESharedCachePath, Settings.UseDirectXVersion, Settings.UseSingularity); + } + Windows.LaunchProgressWindow lpw = new Windows.LaunchProgressWindow(LaunchAccounts, launcher); + lpw.ShowDialog(); + + if (ExitAfterLaunch) + { + App.Current.Shutdown(); + } + } + + /// + /// Gets what we think is the "master" ISBoxer EVE Launcher instance + /// + /// true if we should be more secure about it (e.g. Master Key transfer), false if we're just passing command-line around + /// + static public Process GetMasterInstance(bool ensureMainModule) + { + Process currentProcess = Process.GetCurrentProcess(); + + //Note: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process.mainwindowhandle?view=netframework-4.7 + //When the Main window is hidden, it will return a MainWindowHandle of 0. This makes the following code fail when trying to find the master window that is minimized to the system tray: + IEnumerable processList = Process.GetProcesses().Where(q => q.NameMatches(currentProcess) && (q.MainWindowHandle != IntPtr.Zero || q.Id == currentProcess.Id)); + + if (processList == null) + return null; + + Process[] processes = processList.ToArray(); + Array.Sort(processes, (a, b) => a.StartTime > b.StartTime ? 1 : -1); + if (processes.Length > 1) + { + for (int i = 0; i < processes.Length; i++) + { + if (processes[i].Id == currentProcess.Id) + continue; - private void ApplicationStart(object sender, StartupEventArgs e) - { - AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; - // Allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this value. - ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault; + // ensure that the Master Instance is indeed this app by checking the module list? (note: if the other process is Administrator, this one also needs to be Administrator) + if (!ensureMainModule) + return processes[i]; + + try + { + + if (processes[i].MainModuleNameMatches(currentProcess)) + return processes[i]; + } + catch (System.ComponentModel.Win32Exception we) + { + if (we.NativeErrorCode == 5) + { + // this might be the right instance, but since it's Administrator and we're not, we can't use it. + continue; + } + throw; + } + } + } + return null; + } - CommandLine = e.Args; + /// + /// Transmit the command-line to an already-running Master instance, if one is available + /// + /// + public bool TransmitCommandLine() + { + // check if it's already running. - if (!TransmitCommandLine()) - { - ReloadGameConfiguration(); + System.Diagnostics.Process masterInstance = GetMasterInstance(false); - if (GameConfiguration != null || System.IO.File.Exists(ISExecutable)) + if (masterInstance != null) { - HasInnerSpace = true; + string joinedCommandLine = string.Empty; + foreach (string s in CommandLine) + { + // if it's another process, don't exit + switch (s.ToLowerInvariant()) + { + case "null": + // ignore... + break; + case "-exit": + // the -exit is intended for THIS process, not the other one. + break; + case "-multiinstance": + return false; + } + + if (!s.Equals("-exit", StringComparison.InvariantCultureIgnoreCase)) + joinedCommandLine += "\"" + s.Replace("\"", "\\\"") + "\" "; + } + joinedCommandLine.TrimEnd(); + + byte[] buff = Encoding.Unicode.GetBytes(joinedCommandLine); + + Windows.COPYDATASTRUCT cds = new Windows.COPYDATASTRUCT(); + cds.cbData = buff.Length; + cds.lpData = Marshal.AllocHGlobal(buff.Length); + Marshal.Copy(buff, 0, cds.lpData, buff.Length); + cds.dwData = IntPtr.Zero; + cds.cbData = buff.Length; + var ret = ISBoxerEVELauncher.Windows.MainWindow.SendMessage(masterInstance.MainWindowHandle, ISBoxerEVELauncher.Windows.MainWindow.WM_COPYDATA, IntPtr.Zero, ref cds); + Marshal.FreeHGlobal(cds.lpData); + + Shutdown(); + return true; } + return false; + } + + private void ApplicationStart(object sender, StartupEventArgs e) + { + AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; + // Allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this value. + ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault; + + CommandLine = e.Args; + + if (!TransmitCommandLine()) + { + ReloadGameConfiguration(); + + if (GameConfiguration != null || System.IO.File.Exists(ISExecutable)) + { + HasInnerSpace = true; + } + + CefSettings settings = new CefSettings(); + settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\CEF"; + + CefSharp.Cef.Initialize(settings); + + var mainWindow = new Windows.MainWindow(); //Re-enable normal shutdown mode. @@ -741,13 +767,13 @@ private void ApplicationStart(object sender, StartupEventArgs e) mainWindow.Show(); ProcessCommandLine(CommandLine); - } - } + } + } - void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) - { - MessageBox.Show("Exception unhandled by ISBoxer EVE Launcher: " + e.ExceptionObject.ToString()); - } + void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e) + { + MessageBox.Show("Exception unhandled by ISBoxer EVE Launcher: " + e.ExceptionObject.ToString()); + } - } + } } diff --git a/Games/EVE/EVEAccount.cs b/Games/EVE/EVEAccount.cs index 17040ec..7ccbdbf 100644 --- a/Games/EVE/EVEAccount.cs +++ b/Games/EVE/EVEAccount.cs @@ -1309,6 +1309,7 @@ public LoginResult GetAccessToken(bool sisi, out Token accessToken) } App.strUserName = Username; + App.strPassword = new System.Net.NetworkCredential(string.Empty, SecurePassword).Password; var uri = RequestResponse.GetLoginUri(sisi, state.ToString(), challengeHash); diff --git a/Windows/LoginBrowser.Designer.cs b/Windows/LoginBrowser.Designer.cs index 6402c2f..7f350bd 100644 --- a/Windows/LoginBrowser.Designer.cs +++ b/Windows/LoginBrowser.Designer.cs @@ -74,7 +74,7 @@ private void InitializeComponent() this.toolStripButton_Refresh.ImageTransparentColor = System.Drawing.Color.Magenta; this.toolStripButton_Refresh.Name = "toolStripButton_Refresh"; this.toolStripButton_Refresh.Size = new System.Drawing.Size(36, 36); - this.toolStripButton_Refresh.Text = "toolStripButton1"; + this.toolStripButton_Refresh.Text = "Refresh"; this.toolStripButton_Refresh.Click += new System.EventHandler(this.toolStripButton_Refresh_Click); // // LoginBrowser diff --git a/Windows/LoginBrowser.cs b/Windows/LoginBrowser.cs index 99873d9..01fcfe9 100644 --- a/Windows/LoginBrowser.cs +++ b/Windows/LoginBrowser.cs @@ -82,7 +82,14 @@ private void chromiumWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEn strURL_RequestVerificationToken = strCurrentAddress; } - if (taskHtml.Result.Contains("Be sure to click the prompt above to login to the EVE Online launcher")) + if (taskHtml.Result.Contains("Log in to your account") && !taskHtml.Result.Contains("Invalid username / password")) + { + this.chromiumWebBrowser.EvaluateScriptAsync("document.getElementById('UserName').value = '" + App.strUserName + "';"); + this.chromiumWebBrowser.EvaluateScriptAsync("document.getElementById('Password').value = '" + App.strPassword + "';"); + this.chromiumWebBrowser.EvaluateScriptAsync("document.getElementById('RememberMe').click();"); + this.chromiumWebBrowser.EvaluateScriptAsync("document.forms['loginForm'].submit();"); + } + else if (taskHtml.Result.Contains("Be sure to click the prompt above to login to the EVE Online launcher")) { strHTML_Result = taskHtml.Result; strURL_Result = strCurrentAddress; @@ -98,6 +105,7 @@ private void chromiumWebBrowser_FrameLoadEnd(object sender, CefSharp.FrameLoadEn } }); + } private void LoginBrowser_Resize(object sender, EventArgs e) diff --git a/Windows/LoginBrowser.resx b/Windows/LoginBrowser.resx index cc81fe5..527e628 100644 --- a/Windows/LoginBrowser.resx +++ b/Windows/LoginBrowser.resx @@ -124,38 +124,38 @@ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAdPSURBVFhH7ZZrTJvXGcezrWulbdq0mzSt26R+6Ye1LO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BlR441qORLyuq9ymK9WQi4/IemoBPmt0/hIZIBeb8DfhBZ8QFp+UexGn+L+1sROO/1MV74ebKV/F8jK + 9Xo9JtVanGjSIOktIWhuDvNgJeR0X9pXMoTCNis6ZQyuS6ZwodvGulakYwEbgTFbLBaYSMspXMNoca5N + hZQTfaA5ufRb07NZ/E9eqZCjqEWPnmEGJosdY1or6sVqKLUGtr0bTfeaXlWtVguFUoXzLXL89rQUz2V1 + fcql3ZK+UVVV9c38/PxvJ2R2XH2psA8neQp09cqgI4npnqqZKRYUs06nY6EajQYKBYkVS1F8U46U42I8 + m9F6bf/+/Y8dPHjwWzT3fcQDROFFRUWPZWZm/oj46R3pDTe353QivXoEJQ2jqK4ToqlLgsGhYQwPD2OE + mD75ogFc5glQ1iAjscOgc57PrKvPzs5+hsB/dvjw4e/u27fvEYJ4cBG0UhpMJj6VlZW1Mycn5/VXsypK + kzL+MbQjl49XSqXIu6LAkVoFSpomcappDG9dnUDux5P4XekAduR2IintmuzVrPIKMjeN5HiJFkEXRHLT + f04fXMDGDpAE24mTDx06tPf32cXpOzM+/ighvUGVkM5zPpN66w51QhrP+ctUnnpXxpUrB7JKMggwhcTv + zs3NTXzoDhCtnYEDBw58Jy8v7/sk0Q9pQSTpT2iytLS0J2mHyOefx0zHZMWPk7ifpqam/pjOIe9/QPy9 + hzoD60SD2WJipknoKmhx1GT8aMx0TGIeoTHr58Ty0ITx2rbtP+rnLs63FIfEAAAAAElFTkSuQmCC \ No newline at end of file From 5713214f012a82129f3a741f0b42775d5b0e73c2 Mon Sep 17 00:00:00 2001 From: Jizheng Date: Sat, 14 Nov 2020 20:46:43 +0000 Subject: [PATCH 11/23] update --- App.xaml.cs | 10 +- ISBoxerEVELauncher.csproj | 30 ++-- Web/RequestResponse.cs | 5 +- ...esigner.cs => EVELoginBrowser.Designer.cs} | 43 +++--- Windows/EVELoginBrowser.cs | 144 ++++++++++++++++++ ...LoginBrowser.resx => EVELoginBrowser.resx} | 64 ++++---- Windows/LoginBrowser.cs | 124 --------------- packages.config | 4 - 8 files changed, 211 insertions(+), 213 deletions(-) rename Windows/{LoginBrowser.Designer.cs => EVELoginBrowser.Designer.cs} (71%) create mode 100644 Windows/EVELoginBrowser.cs rename Windows/{LoginBrowser.resx => EVELoginBrowser.resx} (68%) delete mode 100644 Windows/LoginBrowser.cs diff --git a/App.xaml.cs b/App.xaml.cs index 4588b3b..6afdaa3 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -14,7 +14,6 @@ using ISBoxerEVELauncher.Games.EVE; using ISBoxerEVELauncher.Interface; using System.Net; -using CefSharp.WinForms; using ISBoxerEVELauncher.Windows; @@ -29,7 +28,7 @@ public static bool HasInnerSpace { get; set; } - public static LoginBrowser myLB = new LoginBrowser(); + public static EVELoginBrowser myLB = new EVELoginBrowser(); public static string strUserName { get; set; @@ -753,13 +752,6 @@ private void ApplicationStart(object sender, StartupEventArgs e) HasInnerSpace = true; } - CefSettings settings = new CefSettings(); - settings.CachePath = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\CEF"; - - CefSharp.Cef.Initialize(settings); - - - var mainWindow = new Windows.MainWindow(); //Re-enable normal shutdown mode. Current.ShutdownMode = ShutdownMode.OnMainWindowClose; diff --git a/ISBoxerEVELauncher.csproj b/ISBoxerEVELauncher.csproj index f9acc29..80a223e 100644 --- a/ISBoxerEVELauncher.csproj +++ b/ISBoxerEVELauncher.csproj @@ -1,9 +1,5 @@  - - - - @@ -125,6 +121,7 @@ packages\Microsoft.IdentityModel.Tokens.6.8.0\lib\net461\Microsoft.IdentityModel.Tokens.dll + packages\Microsoft.Win32.Primitives.4.3.0\lib\net46\Microsoft.Win32.Primitives.dll True @@ -151,6 +148,7 @@ True + packages\System.Diagnostics.DiagnosticSource.4.7.1\lib\net46\System.Diagnostics.DiagnosticSource.dll @@ -346,14 +344,14 @@ EVEEULAWindow.xaml - - LaunchProgressWindow.xaml - - + Form - - LoginBrowser.cs + + EVELoginBrowser.cs + + + LaunchProgressWindow.xaml MasterKeyEntryWindow.xaml @@ -464,8 +462,8 @@ ResXFileCodeGenerator Resources.Designer.cs - - LoginBrowser.cs + + EVELoginBrowser.cs @@ -522,17 +520,9 @@ if "$(ConfigurationName)"=="Debug" ( - - - - - - - - - + From 935ba2302b4aef7e9b175bb42e6b77736c0e4b2e Mon Sep 17 00:00:00 2001 From: Jizheng Date: Sun, 22 Nov 2020 03:56:07 +0000 Subject: [PATCH 17/23] update --- App.xaml.cs | 1 + Games/EVE/EVEAccount.cs | 1 - ISBoxerEVELauncher.csproj | 1 + Web/BrowserCookie.cs | 112 ++++++++++++++++++++++++++++ Web/RequestResponse.cs | 3 + Windows/EVELoginBrowser.Designer.cs | 1 - Windows/EVELoginBrowser.cs | 7 ++ Windows/EVELoginBrowser.resx | 64 ++++++++-------- 8 files changed, 156 insertions(+), 34 deletions(-) create mode 100644 Web/BrowserCookie.cs diff --git a/App.xaml.cs b/App.xaml.cs index 19b3676..28ead94 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -742,6 +742,7 @@ private void ApplicationStart(object sender, StartupEventArgs e) // Allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this value. ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault; + CommandLine = e.Args; if (!TransmitCommandLine()) diff --git a/Games/EVE/EVEAccount.cs b/Games/EVE/EVEAccount.cs index 27fa7d6..3be2ff2 100644 --- a/Games/EVE/EVEAccount.cs +++ b/Games/EVE/EVEAccount.cs @@ -1264,7 +1264,6 @@ public LoginResult GetRequestVerificationToken(Uri uri, bool sisi, out string ve var req = RequestResponse.CreateGetRequest(uri, sisi, true, "URL", Cookies); req.ContentLength = 0; - //App.strUserName = Username; var result = RequestResponse.GetHttpWebResponse(req, UpdateCookieStorage, out response); diff --git a/ISBoxerEVELauncher.csproj b/ISBoxerEVELauncher.csproj index b90bf76..940fd21 100644 --- a/ISBoxerEVELauncher.csproj +++ b/ISBoxerEVELauncher.csproj @@ -306,6 +306,7 @@ + diff --git a/Web/BrowserCookie.cs b/Web/BrowserCookie.cs new file mode 100644 index 0000000..a412b6e --- /dev/null +++ b/Web/BrowserCookie.cs @@ -0,0 +1,112 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ISBoxerEVELauncher.Web +{ + using System; + using System.ComponentModel; + using System.Net; + using System.Runtime.InteropServices; + using System.Security; + using System.Security.Permissions; + using System.Text; + using System.Windows.Forms; + + + internal sealed class NativeMethods + { + #region enums + + public enum ErrorFlags + { + ERROR_INSUFFICIENT_BUFFER = 122, + ERROR_INVALID_PARAMETER = 87, + ERROR_NO_MORE_ITEMS = 259 + } + + public enum InternetFlags + { + INTERNET_COOKIE_HTTPONLY = 8192, //Requires IE 8 or higher + INTERNET_COOKIE_THIRD_PARTY = 131072, + INTERNET_FLAG_RESTRICTED_ZONE = 16 + } + + #endregion + + #region DLL Imports + + [SuppressUnmanagedCodeSecurity, SecurityCritical, DllImport("wininet.dll", EntryPoint = "InternetGetCookieExW", CharSet = CharSet.Unicode, SetLastError = true, ExactSpelling = true)] + internal static extern bool InternetGetCookieEx([In] string Url, [In] string cookieName, [Out] StringBuilder cookieData, [In, Out] ref uint pchCookieData, uint flags, IntPtr reserved); + + #endregion + } + + + /// + /// WebBrowserCookie? + /// webBrowser1.Document.CookieHttpOnlyCookie + /// + public class BrowserCookie : WebBrowser + { + + [SecurityCritical] + public static string GetCookieInternal(Uri uri, bool throwIfNoCookie) + { + uint pchCookieData = 0; + string url = UriToString(uri); + uint flag = (uint)NativeMethods.InternetFlags.INTERNET_COOKIE_HTTPONLY; + + //Gets the size of the string builder + if (NativeMethods.InternetGetCookieEx(url, null, null, ref pchCookieData, flag, IntPtr.Zero)) + { + pchCookieData++; + StringBuilder cookieData = new StringBuilder((int)pchCookieData); + + //Read the cookie + if (NativeMethods.InternetGetCookieEx(url, null, cookieData, ref pchCookieData, flag, IntPtr.Zero)) + { + DemandWebPermission(uri); + return cookieData.ToString(); + } + } + + int lastErrorCode = Marshal.GetLastWin32Error(); + + if (throwIfNoCookie || (lastErrorCode != (int)NativeMethods.ErrorFlags.ERROR_NO_MORE_ITEMS)) + { + throw new Win32Exception(lastErrorCode); + } + + return null; + } + + private static void DemandWebPermission(Uri uri) + { + string uriString = UriToString(uri); + + if (uri.IsFile) + { + string localPath = uri.LocalPath; + new FileIOPermission(FileIOPermissionAccess.Read, localPath).Demand(); + } + else + { + new WebPermission(NetworkAccess.Connect, uriString).Demand(); + } + } + + private static string UriToString(Uri uri) + { + if (uri == null) + { + throw new ArgumentNullException("uri"); + } + + UriComponents components = (uri.IsAbsoluteUri ? UriComponents.AbsoluteUri : UriComponents.SerializationInfoString); + return new StringBuilder(uri.GetComponents(components, UriFormat.SafeUnescaped), 2083).ToString(); + } + } +} diff --git a/Web/RequestResponse.cs b/Web/RequestResponse.cs index ef93e3b..f5d7669 100644 --- a/Web/RequestResponse.cs +++ b/Web/RequestResponse.cs @@ -34,6 +34,7 @@ public static class RequestResponse public static Uri GetLoginUri(bool sisi, string state, string challengeHash) { + return new Uri(logon, UriKind.Relative) .AddQuery("ReturnUrl", new Uri(auth, UriKind.Relative) @@ -76,6 +77,7 @@ public static Uri GetSecurityWarningChallenge(bool sisi, string state, string ch public static HttpWebRequest CreateGetRequest(Uri uri, bool sisi, bool origin, string referer, CookieContainer cookies) { + //.Replace("https:", "http:") if (!uri.IsAbsoluteUri) uri = new Uri(string.Concat(sisi ? sisiBaseUri : tqBaseUri, uri.ToString())); return CreateHttpWebRequest(uri, "GET", sisi, origin, referer, cookies); @@ -251,6 +253,7 @@ public static LoginResult GetHttpWebResponse(HttpWebRequest webRequest, Action u if (webRequest.Method == "GET") { + //.ToString().Replace("https:", "http:") App.myLB.webBrowser_EVE.Navigate(webRequest.Address.ToString().Replace("https:", "http:")); } else diff --git a/Windows/EVELoginBrowser.Designer.cs b/Windows/EVELoginBrowser.Designer.cs index edabbbc..97c481a 100644 --- a/Windows/EVELoginBrowser.Designer.cs +++ b/Windows/EVELoginBrowser.Designer.cs @@ -61,7 +61,6 @@ private void InitializeComponent() // // toolStripTextBox_Addressbar // - this.toolStripTextBox_Addressbar.Enabled = false; this.toolStripTextBox_Addressbar.Font = new System.Drawing.Font("Segoe UI", 9F); this.toolStripTextBox_Addressbar.Name = "toolStripTextBox_Addressbar"; this.toolStripTextBox_Addressbar.Size = new System.Drawing.Size(700, 39); diff --git a/Windows/EVELoginBrowser.cs b/Windows/EVELoginBrowser.cs index deb2678..8ed2578 100644 --- a/Windows/EVELoginBrowser.cs +++ b/Windows/EVELoginBrowser.cs @@ -2,7 +2,9 @@ using Microsoft.Win32; using System; using System.Drawing; +using System.Web; using System.Windows.Forms; +using ISBoxerEVELauncher.Web; namespace ISBoxerEVELauncher.Windows { @@ -110,6 +112,11 @@ private void ContentAnalyse() webBrowser_EVE.Document.GetElementById("UserName").SetAttribute("value", App.strUserName); webBrowser_EVE.Document.GetElementById("Password").SetAttribute("value", App.strPassword); webBrowser_EVE.Document.GetElementById("RememberMe").InvokeMember("click"); + + var cookies = BrowserCookie.GetCookieInternal(webBrowser_EVE.Url, false); + + string[] strCookies = HttpContext.Current.Response.Cookies.AllKeys; + webBrowser_EVE.Document.Forms["loginForm"].InvokeMember("submit"); } else if (webBrowser_EVE.DocumentText.Contains("Be sure to click the prompt above to login to the EVE Online launcher") || webBrowser_EVE.DocumentText.Contains("{\"access_token\":\"")) diff --git a/Windows/EVELoginBrowser.resx b/Windows/EVELoginBrowser.resx index 409151a..4ec20c7 100644 --- a/Windows/EVELoginBrowser.resx +++ b/Windows/EVELoginBrowser.resx @@ -124,38 +124,38 @@ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAdPSURBVFhH7ZZrTJvXGcezrWulbdq0mzSt26R+6Ye1LOkg - abKEptqlTddU4hYgkDXNoiLUQBhKw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NSsjhJyQdkSCvZQofiwzQ6w34u9CCD0nLL4jd6FXc25rYaaef6crXgq307wJZ + uV6vx4Rai+ONGiS9LQTNzWHur4Tsrot7iwdR0GpFh4zBNckkznfZWNeIdCxgPTBmi8UCE2k5hWsYLc62 + qpB8vBc0J5d+c3o2k//pq+VyFDbr0T3EwGSxY1RrRZ1YDaXWwLZ3vele06uq1WqhUKpwrlmO352S4rnM + zs+4tJvSdyorK7+bl5f3/YSM9isvF/TiBE+Bzh4ZdCQx3VM1M8mCYtbpdCxUo9FAoSCxYimKbsiRfEyM + Z9Nbru7bt++RAwcOfI/mvoe4jyi8sLDwkYyMjJ8SP70trf7G1uwOpFUNo7h+BFW1QjR2SjAwOIShoSEM + E9MnX9SPSzwBSutlJHYIdM7zGbV1WVlZzxD4Y4cOHfrB3r17HyKI+xdBK6XBZOJTmZmZ27Ozs994LbO8 + JCn988FtOXy8WiJF7mUFDtcoUNw4gZONo3j7yjhyPpnA70v6sS2nA0mpV2WvZZaVk7mpJMfLtAi6IJKb + /nN6/wLWd4Ak2Eq88+DBg3v+kFWUtj39k48T0upVCWk85zMpN29TJ6TynL9O4al3pF++vD+zOJ0Ak0n8 + rpycnMQH7gDR6hnYv3//o7m5uT8iiX5CCyJJf06TpaamPkk7RD7/MmY6Jit+nMT9IiUl5Wd0Dnn/Y+If + PtAZWCMazBYTM01CV0GLoybjh2OmYxLzEI1ZOyeWhyaM15Yt/wFEiy7CBwPe3wAAAABJRU5ErkJggg== \ No newline at end of file From d952fcdbe7af281c75542fd538c8bd28ab2d06ce Mon Sep 17 00:00:00 2001 From: Jizheng Date: Mon, 23 Nov 2020 02:58:11 +0000 Subject: [PATCH 18/23] v1.0.0.37-Beta7 --- App.config | 4 ++++ ISBoxerEVELauncher.csproj | 6 +----- Web/BrowserCookie.cs | 7 +++++++ Web/RequestResponse.cs | 8 +++++--- Windows/EVELoginBrowser.cs | 24 ++++++++++++++++++++---- app.manifest | 2 +- packages.config | 3 --- 7 files changed, 38 insertions(+), 16 deletions(-) diff --git a/App.config b/App.config index 213a009..b17bfae 100644 --- a/App.config +++ b/App.config @@ -25,6 +25,10 @@ + + + + diff --git a/ISBoxerEVELauncher.csproj b/ISBoxerEVELauncher.csproj index 940fd21..5b9fdf0 100644 --- a/ISBoxerEVELauncher.csproj +++ b/ISBoxerEVELauncher.csproj @@ -141,9 +141,6 @@ True True - - packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll - packages\System.Console.4.3.1\lib\net46\System.Console.dll @@ -245,6 +242,7 @@ True + packages\System.Security.Cryptography.Algorithms.4.3.1\lib\net463\System.Security.Cryptography.Algorithms.dll True @@ -519,10 +517,8 @@ if "$(ConfigurationName)"=="Debug" ( This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - + diff --git a/packages.config b/packages.config index 5f0b175..52b93f8 100644 --- a/packages.config +++ b/packages.config @@ -6,12 +6,9 @@ - - - From 5629c30c88c9402abb7c8908c775faa29fe19b6c Mon Sep 17 00:00:00 2001 From: Jizheng Date: Sun, 21 Feb 2021 17:09:32 +0000 Subject: [PATCH 19/23] v1.0.0.37 1. Remove the auto-fresh function since the browser can now handle this itself. 2. Fix a few bugs. --- App.xaml.cs | 3 ++ Extensions/HttpWebRequestExtension.cs | 8 ++-- Web/RequestResponse.cs | 19 ++++---- Windows/EVELoginBrowser.cs | 6 ++- Windows/EVELoginBrowser.resx | 64 +++++++++++++-------------- 5 files changed, 54 insertions(+), 46 deletions(-) diff --git a/App.xaml.cs b/App.xaml.cs index 28ead94..c6caa3d 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -30,6 +30,7 @@ public static bool HasInnerSpace } public static EVELoginBrowser myLB = new EVELoginBrowser(); public static byte[] requestBody; + public static bool tofCaptcha; public static string strUserName { get; set; @@ -754,6 +755,8 @@ private void ApplicationStart(object sender, StartupEventArgs e) HasInnerSpace = true; } + tofCaptcha = false; + var mainWindow = new Windows.MainWindow(); //Re-enable normal shutdown mode. Current.ShutdownMode = ShutdownMode.OnMainWindowClose; diff --git a/Extensions/HttpWebRequestExtension.cs b/Extensions/HttpWebRequestExtension.cs index 7bb2e49..2c9a603 100644 --- a/Extensions/HttpWebRequestExtension.cs +++ b/Extensions/HttpWebRequestExtension.cs @@ -22,11 +22,13 @@ public static void SetBody(this HttpWebRequest webRequest, byte[] body) App.requestBody = body; try { - using (Stream reqStream = webRequest.GetRequestStream()) + if (!App.tofCaptcha) { - reqStream.Write(body, 0, body.Length); + using (Stream reqStream = webRequest.GetRequestStream()) + { + reqStream.Write(body, 0, body.Length); + } } - } catch (Exception) { diff --git a/Web/RequestResponse.cs b/Web/RequestResponse.cs index c2f39e7..174b6f2 100644 --- a/Web/RequestResponse.cs +++ b/Web/RequestResponse.cs @@ -92,7 +92,6 @@ public static HttpWebRequest CreatePostRequest(Uri uri, bool sisi, bool origin, public static byte[] GetSsoTokenRequestBody(bool sisi, string authCode, byte[] challengeCode) { - return Encoding.UTF8.GetBytes(new Uri("/", UriKind.Relative) .AddQuery("grant_type", "authorization_code") @@ -101,7 +100,6 @@ public static byte[] GetSsoTokenRequestBody(bool sisi, string authCode, byte[] c .AddQuery("client_id", "eveLauncherTQ").ToString()) .AddQuery("code", authCode) .AddQuery("code_verifier", Base64UrlEncoder.Encode(challengeCode)).SafeQuery()); - } public static Uri GetVerifyTwoFactorUri(bool sisi, string state, string challengeHash) @@ -232,24 +230,26 @@ private static HttpWebRequest CreateHttpWebRequest(Uri uri, string methodType, b public static LoginResult GetHttpWebResponse(HttpWebRequest webRequest, Action updateCookies, out Response response) { response = null; - bool tofModified = false; try { - response = new Response(webRequest); + if (!App.tofCaptcha) + { + response = new Response(webRequest); + } } catch (Exception e) { - tofModified = true; + App.tofCaptcha = true; } try { - if (tofModified) + if (App.tofCaptcha) { App.myLB = new EVELoginBrowser(); App.myLB.Clearup(); - + App.myLB.Text = "EVE - " + App.strUserName; if (webRequest.Method == "GET") @@ -262,12 +262,13 @@ public static LoginResult GetHttpWebResponse(HttpWebRequest webRequest, Action u { SetRegistery(); App.myLB.webBrowser_EVE.Navigate(webRequest.Address, string.Empty, App.requestBody, webRequest.Headers.ToString()); + } App.myLB.ShowDialog(); } - if (tofModified) + if (App.tofCaptcha) { if (App.myLB.strHTML_Result == "") return LoginResult.Error; @@ -376,7 +377,7 @@ public static string GetEulaReturnUrlFromBody(string body) return body.Substring(fieldStart, fieldEnd - fieldStart); } - + } diff --git a/Windows/EVELoginBrowser.cs b/Windows/EVELoginBrowser.cs index 9f8fa77..7c39e1c 100644 --- a/Windows/EVELoginBrowser.cs +++ b/Windows/EVELoginBrowser.cs @@ -7,7 +7,6 @@ using System.Windows.Forms; using ISBoxerEVELauncher.Web; - namespace ISBoxerEVELauncher.Windows { public partial class EVELoginBrowser : Form @@ -150,10 +149,13 @@ private void ContentAnalyse() { this.InvokeOnUiThreadIfRequired(() => this.Close()); } + //Remove this part as now the browser will handle the refresh itself. + /* else if (webBrowser_EVE.DocumentText.Contains("Please stand by, while we are checking your browser...")) { - webBrowser_EVE.Navigate(toolStripTextBox_Addressbar.Text); + //webBrowser_EVE.Navigate(toolStripTextBox_Addressbar.Text); } + */ } } diff --git a/Windows/EVELoginBrowser.resx b/Windows/EVELoginBrowser.resx index 4ec20c7..68f3489 100644 --- a/Windows/EVELoginBrowser.resx +++ b/Windows/EVELoginBrowser.resx @@ -124,38 +124,38 @@ iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8 - YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAdPSURBVFhH7ZZrTJvXGcezrWulbtq0m1T1Mqlf+mEtS1pI - mjShqXZp0zWVuAUIZE2zqAg1EIaScIlISdqQrNuUtmlHSJOGiwkQbi74xsVgMDffXhvfL9jGNr4BBgNb - mlSa9N85b14zhGlEtH3sX/rr9Xn9nOf3nOecY9jyrb7Vg2jnad0TyWeYguQKtST5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XjXWNSMcC1gNjtlgsMJGWU7iG0eJc + qwrJJ3pBc3LpN6dnM/mfvlIuR2GzHt1DDEwWO0a1VtSJ1VBqDWx715vuNb2qWq0WCqUK55vl+N1pKZ7L + 7PyMS7spfauysvLbeXl5303IaL/6UkEvTvIU6OyRQUcS0z1VM5MsKGadTsdCNRoNFAoSK5ai6KYcycfF + eDa95dr+/fsfO3jw4Hdo7vuIB4jCCwsLH8vIyPgJ8dPb0upvbs3uQFrVMIrrR1BVK0RjpwQDg0MYGhrC + MDF98kX9uMwToLReRmKHQOdsz6ity8rKeobAf3b48OHv79u37xGCeHARtFIaTCb+IjMzc0d2dvbrr2aW + lySl/2NwWw4fr5RIkXtFgSM1ChQ3TuBU4yjevjqOnE8m8PuSfmzL6UBS6jXZq5ll5WRuKsnxEi2CLojk + pv+cPriA9R0gCbYS7zp06NDeP2QVpe1I/+TjhLR6VUIaz/lMyq071AmpPOevU3jqnelXrhzILE4nwGQS + vzsnJyfxoTtAtHoGDhw48L3c3NwfkkQ/pgWRpI/TZKmpqT+nHSKffxkzHZMVP0ninkhJSfkpnUPe/4j4 + Bw91BtaIBrPFxEyT0FXQ4qjJ+NGY6ZjEPEJj1s6J5aEJ47Vly38AKNEuwJsGLnEAAAAASUVORK5CYII= \ No newline at end of file From e2207aeff9c3b905e8f98eb4393c667fff775857 Mon Sep 17 00:00:00 2001 From: Jizheng Date: Mon, 22 Feb 2021 21:21:18 +0000 Subject: [PATCH 20/23] v1.0.0.38-Beta1 Fixed the login issue on the Singularity server. --- Properties/AssemblyInfo.cs | 4 ++-- Web/RequestResponse.cs | 4 +--- Windows/MainWindow.xaml.cs | 2 +- app.manifest | 2 +- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index f23e5fa..ad5f167 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -49,5 +49,5 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.37")] -[assembly: AssemblyFileVersion("1.0.0.37")] +[assembly: AssemblyVersion("1.0.0.38")] +[assembly: AssemblyFileVersion("1.0.0.38")] diff --git a/Web/RequestResponse.cs b/Web/RequestResponse.cs index 174b6f2..1b222a8 100644 --- a/Web/RequestResponse.cs +++ b/Web/RequestResponse.cs @@ -254,9 +254,7 @@ public static LoginResult GetHttpWebResponse(HttpWebRequest webRequest, Action u if (webRequest.Method == "GET") { - //.ToString().Replace("https:", "http:") - //var cookies = webRequest.CookieContainer.GetCookies(new Uri(tqBaseUri)); - App.myLB.webBrowser_EVE.Navigate(webRequest.Address.ToString().Replace("https:", "http:")); + App.myLB.webBrowser_EVE.Navigate(webRequest.Address.ToString()); } else { diff --git a/Windows/MainWindow.xaml.cs b/Windows/MainWindow.xaml.cs index a8f3f11..0f6d70c 100644 --- a/Windows/MainWindow.xaml.cs +++ b/Windows/MainWindow.xaml.cs @@ -72,7 +72,7 @@ public MainWindow() App.Settings.PropertyChanged += Settings_PropertyChanged; - this.Title += " (v" + VersionString + ")"; + this.Title += " (v" + VersionString + " - Beta 1)"; NotifyIcon = new System.Windows.Forms.NotifyIcon(); diff --git a/app.manifest b/app.manifest index 074a6c5..90915b2 100644 --- a/app.manifest +++ b/app.manifest @@ -16,7 +16,7 @@ Remove this element if your application requires this virtualization for backwards compatibility. --> - + From 3557cfbc9cb7bb75294729f671c66a6e4719fe5e Mon Sep 17 00:00:00 2001 From: Jizheng Date: Sat, 17 Jul 2021 04:46:30 +0100 Subject: [PATCH 21/23] update --- FodyWeavers.xsd | 15 ++++++++----- ISBoxerEVELauncher.csproj | 45 ++++++++++++++++++++++----------------- app.manifest | 2 +- packages.config | 18 ++++++++++------ 4 files changed, 48 insertions(+), 32 deletions(-) diff --git a/FodyWeavers.xsd b/FodyWeavers.xsd index e82ada3..05e92c1 100644 --- a/FodyWeavers.xsd +++ b/FodyWeavers.xsd @@ -19,12 +19,12 @@ - A list of (.NET Core) runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks - A list of (.NET Core) runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. @@ -55,7 +55,12 @@ - Controls if (.NET Core) runtime assemblies are also embedded. + Controls if runtime assemblies are also embedded. + + + + + Controls whether the runtime assemblies are embedded with their full path or only with their assembly name. @@ -90,12 +95,12 @@ - A list of (.NET Core) runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with | - A list of (.NET Core) runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |. + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |. diff --git a/ISBoxerEVELauncher.csproj b/ISBoxerEVELauncher.csproj index 5b9fdf0..caa8a9c 100644 --- a/ISBoxerEVELauncher.csproj +++ b/ISBoxerEVELauncher.csproj @@ -1,6 +1,6 @@  - + Debug @@ -112,17 +112,17 @@ true - - packages\Costura.Fody.5.0.0-alpha0281\lib\netstandard1.0\Costura.dll + + ..\..\MyProject\iEVE\iTrader\packages\Costura.Fody.5.2.0\lib\netstandard1.0\Costura.dll - - packages\HtmlAgilityPack.1.11.28\lib\Net45\HtmlAgilityPack.dll + + ..\..\MyProject\iEVE\iTrader\packages\HtmlAgilityPack.1.11.32\lib\Net45\HtmlAgilityPack.dll - - packages\Microsoft.IdentityModel.Logging.6.8.0\lib\net461\Microsoft.IdentityModel.Logging.dll + + ..\..\MyProject\iEVE\iTrader\packages\Microsoft.IdentityModel.Logging.6.10.2\lib\net472\Microsoft.IdentityModel.Logging.dll - - packages\Microsoft.IdentityModel.Tokens.6.8.0\lib\net461\Microsoft.IdentityModel.Tokens.dll + + ..\..\MyProject\iEVE\iTrader\packages\Microsoft.IdentityModel.Tokens.6.10.2\lib\net472\Microsoft.IdentityModel.Tokens.dll @@ -130,8 +130,8 @@ True True - - packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + ..\..\MyProject\iEVE\iTrader\packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll @@ -141,6 +141,9 @@ True True + + ..\..\MyProject\iEVE\iTrader\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + packages\System.Console.4.3.1\lib\net46\System.Console.dll @@ -149,8 +152,8 @@ - - packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + ..\..\MyProject\iEVE\iTrader\packages\System.Diagnostics.DiagnosticSource.5.0.1\lib\net46\System.Diagnostics.DiagnosticSource.dll packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll @@ -226,6 +229,9 @@ True True + + ..\..\MyProject\iEVE\iTrader\packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + packages\System.Runtime.Extensions.4.3.1\lib\net462\System.Runtime.Extensions.dll True @@ -480,9 +486,6 @@ - - - @@ -516,10 +519,14 @@ if "$(ConfigurationName)"=="Debug" ( This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + + + - + + + - + diff --git a/packages.config b/packages.config index 52b93f8..354a44a 100644 --- a/packages.config +++ b/packages.config @@ -1,19 +1,22 @@  - - - + + + - - + + + - + + + - + @@ -36,6 +39,7 @@ + From 2d53a433be7a2f78c79c9c0173b141c18299e2bf Mon Sep 17 00:00:00 2001 From: Jizheng Date: Fri, 10 Sep 2021 00:54:04 +0100 Subject: [PATCH 22/23] v1.0.0.38 Change Log: Modified the WebRequest URL, the default login method should work again now. The browser login approach is only used when the default WebRequest method failed. --- FodyWeavers.xsd | 15 +++++++++----- ISBoxerEVELauncher.csproj | 42 +++++++++++++++++++++++--------------- Web/RequestResponse.cs | 2 +- Windows/MainWindow.xaml.cs | 2 +- app.manifest | 2 +- packages.config | 18 +++++++++------- 6 files changed, 50 insertions(+), 31 deletions(-) diff --git a/FodyWeavers.xsd b/FodyWeavers.xsd index e82ada3..05e92c1 100644 --- a/FodyWeavers.xsd +++ b/FodyWeavers.xsd @@ -19,12 +19,12 @@ - A list of (.NET Core) runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with line breaks - A list of (.NET Core) runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with line breaks. @@ -55,7 +55,12 @@ - Controls if (.NET Core) runtime assemblies are also embedded. + Controls if runtime assemblies are also embedded. + + + + + Controls whether the runtime assemblies are embedded with their full path or only with their assembly name. @@ -90,12 +95,12 @@ - A list of (.NET Core) runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with | + A list of runtime assembly names to exclude from the default action of "embed all Copy Local references", delimited with | - A list of (.NET Core) runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |. + A list of runtime assembly names to include from the default action of "embed all Copy Local references", delimited with |. diff --git a/ISBoxerEVELauncher.csproj b/ISBoxerEVELauncher.csproj index 5b9fdf0..52ccacf 100644 --- a/ISBoxerEVELauncher.csproj +++ b/ISBoxerEVELauncher.csproj @@ -1,6 +1,6 @@  - + Debug @@ -112,17 +112,17 @@ true - - packages\Costura.Fody.5.0.0-alpha0281\lib\netstandard1.0\Costura.dll + + packages\Costura.Fody.5.6.0\lib\netstandard1.0\Costura.dll - - packages\HtmlAgilityPack.1.11.28\lib\Net45\HtmlAgilityPack.dll + + packages\HtmlAgilityPack.1.11.36\lib\Net45\HtmlAgilityPack.dll - - packages\Microsoft.IdentityModel.Logging.6.8.0\lib\net461\Microsoft.IdentityModel.Logging.dll + + packages\Microsoft.IdentityModel.Logging.6.12.2\lib\net472\Microsoft.IdentityModel.Logging.dll - - packages\Microsoft.IdentityModel.Tokens.6.8.0\lib\net461\Microsoft.IdentityModel.Tokens.dll + + packages\Microsoft.IdentityModel.Tokens.6.12.2\lib\net472\Microsoft.IdentityModel.Tokens.dll @@ -130,8 +130,8 @@ True True - - packages\Newtonsoft.Json.12.0.3\lib\net45\Newtonsoft.Json.dll + + packages\Newtonsoft.Json.13.0.1\lib\net45\Newtonsoft.Json.dll C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETFramework\v4.8\System.dll @@ -141,6 +141,9 @@ True True + + packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll + packages\System.Console.4.3.1\lib\net46\System.Console.dll @@ -149,8 +152,8 @@ - - packages\System.Diagnostics.DiagnosticSource.5.0.0\lib\net46\System.Diagnostics.DiagnosticSource.dll + + packages\System.Diagnostics.DiagnosticSource.5.0.1\lib\net46\System.Diagnostics.DiagnosticSource.dll packages\System.Diagnostics.Tracing.4.3.0\lib\net462\System.Diagnostics.Tracing.dll @@ -226,6 +229,9 @@ True True + + packages\System.Runtime.CompilerServices.Unsafe.5.0.0\lib\net45\System.Runtime.CompilerServices.Unsafe.dll + packages\System.Runtime.Extensions.4.3.1\lib\net462\System.Runtime.Extensions.dll True @@ -512,14 +518,18 @@ if "$(ConfigurationName)"=="Debug" ( + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - + + + + - + + - + diff --git a/packages.config b/packages.config index 52b93f8..9d29f05 100644 --- a/packages.config +++ b/packages.config @@ -1,19 +1,22 @@  - - - + + + - - + + + - + + + - + @@ -36,6 +39,7 @@ + From 2aca4c3ba9da99422d0234e9ea834268254626d7 Mon Sep 17 00:00:00 2001 From: Jizheng Date: Tue, 12 Oct 2021 20:45:53 +0100 Subject: [PATCH 23/23] v1.0.0.39 Change log: Fix the http=>https issue. --- ISBoxerEVELauncher.csproj | 8 +++++--- Properties/AssemblyInfo.cs | 4 ++-- Web/RequestResponse.cs | 2 +- packages.config | 6 +++--- 4 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ISBoxerEVELauncher.csproj b/ISBoxerEVELauncher.csproj index 52ccacf..b80a412 100644 --- a/ISBoxerEVELauncher.csproj +++ b/ISBoxerEVELauncher.csproj @@ -34,7 +34,7 @@ true - x86 + AnyCPU true full false @@ -115,8 +115,8 @@ packages\Costura.Fody.5.6.0\lib\netstandard1.0\Costura.dll - - packages\HtmlAgilityPack.1.11.36\lib\Net45\HtmlAgilityPack.dll + + ..\..\MyProject\iEVE\iTrader\packages\HtmlAgilityPack.1.11.37\lib\Net45\HtmlAgilityPack.dll packages\Microsoft.IdentityModel.Logging.6.12.2\lib\net472\Microsoft.IdentityModel.Logging.dll @@ -527,9 +527,11 @@ if "$(ConfigurationName)"=="Debug" ( + +