diff --git a/Prestarter/Config.cs b/Prestarter/Config.cs index 568aa99..829cc5b 100644 --- a/Prestarter/Config.cs +++ b/Prestarter/Config.cs @@ -8,9 +8,9 @@ internal class Config public static string Version = "0.1.0"; public static string LauncherDownloadUrl = null; - + public static bool DownloadQuestionEnabled = true; - + public static bool UseGlobalJava = true; public static IRuntimeDownloader JavaDownloader = new CompositeDownloader(new AdoptiumJavaDownloader(), new OpenJFXDownloader(true)); } diff --git a/Prestarter/Downloaders/AdoptiumJavaDownloader.cs b/Prestarter/Downloaders/AdoptiumJavaDownloader.cs index a8f81f9..99403af 100644 --- a/Prestarter/Downloaders/AdoptiumJavaDownloader.cs +++ b/Prestarter/Downloaders/AdoptiumJavaDownloader.cs @@ -1,11 +1,6 @@ using Prestarter.Helpers; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; -using System.Security.Policy; -using System.Text; -using System.Threading.Tasks; namespace Prestarter.Downloaders { diff --git a/Prestarter/Downloaders/BellsoftJavaDownloader.cs b/Prestarter/Downloaders/BellsoftJavaDownloader.cs index a5593f9..172460a 100644 --- a/Prestarter/Downloaders/BellsoftJavaDownloader.cs +++ b/Prestarter/Downloaders/BellsoftJavaDownloader.cs @@ -2,8 +2,6 @@ using System; using System.Collections.Generic; using System.IO; -using System.IO.Compression; -using System.Threading.Tasks; namespace Prestarter.Downloaders { diff --git a/Prestarter/Downloaders/CompositeDownloader.cs b/Prestarter/Downloaders/CompositeDownloader.cs index 8d59491..142cc94 100644 --- a/Prestarter/Downloaders/CompositeDownloader.cs +++ b/Prestarter/Downloaders/CompositeDownloader.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Linq; namespace Prestarter.Downloaders { diff --git a/Prestarter/Downloaders/IRuntimeDownloader.cs b/Prestarter/Downloaders/IRuntimeDownloader.cs index fc42316..0222d10 100644 --- a/Prestarter/Downloaders/IRuntimeDownloader.cs +++ b/Prestarter/Downloaders/IRuntimeDownloader.cs @@ -1,7 +1,4 @@ -using System; -using System.Threading.Tasks; - -namespace Prestarter.Downloaders +namespace Prestarter.Downloaders { internal interface IRuntimeDownloader { diff --git a/Prestarter/Downloaders/OpenJFXDownloader.cs b/Prestarter/Downloaders/OpenJFXDownloader.cs index 5b45e61..4ba3daf 100644 --- a/Prestarter/Downloaders/OpenJFXDownloader.cs +++ b/Prestarter/Downloaders/OpenJFXDownloader.cs @@ -1,25 +1,21 @@ using Prestarter.Helpers; using System; -using System.Collections.Generic; using System.IO; -using System.Linq; using System.Security.Cryptography; -using System.Text; -using System.Threading.Tasks; namespace Prestarter.Downloaders { internal class OpenJFXDownloader : IRuntimeDownloader { - private const string x64OriginalUrl = "https://download2.gluonhq.com/openjfx/23.0.1/openjfx-23.0.1_windows-x64_bin-sdk.zip"; - private const string x86OriginalUrl = "https://download2.gluonhq.com/openjfx/17.0.8/openjfx-17.0.8_windows-x86_bin-sdk.zip"; + private const string x64OriginalUrl = "https://download2.gluonhq.com/openjfx/23.0.2/openjfx-23.0.2_windows-x64_bin-sdk.zip"; + private const string x86OriginalUrl = "https://download2.gluonhq.com/openjfx/17.0.15/openjfx-17.0.15_windows-x86_bin-sdk.zip"; - private const string x64MirrorUrl = "https://gravit-jvm-mirror.re146.dev/openjfx-23.0.1_windows-x64_bin-sdk.zip"; - private const string x86MirrorUrl = "https://gravit-jvm-mirror.re146.dev/openjfx-17.0.8_windows-x86_bin-sdk.zip"; + private const string x64MirrorUrl = "https://gravit-jvm-mirror.re146.dev/openjfx-23.0.2_windows-x64_bin-sdk.zip"; + private const string x86MirrorUrl = "https://gravit-jvm-mirror.re146.dev/openjfx-17.0.15_windows-x86_bin-sdk.zip"; - // private const string x64ChecksumUrl = "https://download2.gluonhq.com/openjfx/23.0.1/openjfx-23.0.1_windows-x64_bin-sdk.zip.sha256"; + // private const string x64ChecksumUrl = "https://download2.gluonhq.com/openjfx/23.0.2/openjfx-23.0.2_windows-x64_bin-sdk.zip.sha256"; private const string x64Checksum = "0f4d58b15a7148a203ab72ce376f1fa17b243e38e6d66e29d04a0177ae5dc3d3"; - // private const string x86ChechsumUrl = "https://download2.gluonhq.com/openjfx/17.0.8/openjfx-17.0.8_windows-x86_bin-sdk.zip.sha256"; + // private const string x86ChechsumUrl = "https://download2.gluonhq.com/openjfx/17.0.15/openjfx-17.0.15_windows-x86_bin-sdk.zip.sha256"; private const string x86Checksum = "c3a56d545f2614465664b66cb4c178ddd7fe37d4ec7b53d2248a2d80f4a04ed7"; private const string x64Name = "OpenJFX 21 (x86_64)"; diff --git a/Prestarter/Helpers/DownloaderHelper.cs b/Prestarter/Helpers/DownloaderHelper.cs index cfe2556..1ba812f 100644 --- a/Prestarter/Helpers/DownloaderHelper.cs +++ b/Prestarter/Helpers/DownloaderHelper.cs @@ -1,11 +1,5 @@ -using System; -using System.Collections.Generic; +using System.IO; using System.IO.Compression; -using System.IO; -using System.Linq; -using System.Security.Policy; -using System.Text; -using System.Threading.Tasks; namespace Prestarter.Helpers { diff --git a/Prestarter/Helpers/Extensions.cs b/Prestarter/Helpers/Extensions.cs index 1aa128c..9971872 100644 --- a/Prestarter/Helpers/Extensions.cs +++ b/Prestarter/Helpers/Extensions.cs @@ -3,8 +3,6 @@ using System.Linq; using System.Net.Http; using System.Security.Cryptography; -using System.Threading; -using System.Threading.Tasks; namespace Prestarter.Helpers { diff --git a/Prestarter/Helpers/HashProxyStream.cs b/Prestarter/Helpers/HashProxyStream.cs index 271ade3..f765dfc 100644 --- a/Prestarter/Helpers/HashProxyStream.cs +++ b/Prestarter/Helpers/HashProxyStream.cs @@ -19,7 +19,7 @@ internal class HashProxyStream : Stream public override long Position { get => throw new InvalidOperationException(); set => throw new InvalidOperationException(); } - public HashProxyStream(Stream baseStream, HashAlgorithm hashAlgorithm) + public HashProxyStream(Stream baseStream, HashAlgorithm hashAlgorithm) { this.baseStream = baseStream; this.hashAlgorithm = hashAlgorithm; diff --git a/Prestarter/I18n.cs b/Prestarter/I18n.cs index 7ead134..c9df9d2 100644 --- a/Prestarter/I18n.cs +++ b/Prestarter/I18n.cs @@ -1,12 +1,4 @@ using Prestarter.Helpers; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Resources; -using System.Security.Policy; -using System.Text; -using System.Threading.Tasks; -using System.Xml.Linq; namespace Prestarter { diff --git a/Prestarter/L10n/L10nManager.cs b/Prestarter/L10n/L10nManager.cs index 44ddfdc..b2dbd8f 100644 --- a/Prestarter/L10n/L10nManager.cs +++ b/Prestarter/L10n/L10nManager.cs @@ -1,9 +1,5 @@ -using System; -using System.Collections.Generic; +using System.Collections.Generic; using System.Globalization; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Prestarter.Helpers { diff --git a/Prestarter/L10n/Locales/EnUsLocale.cs b/Prestarter/L10n/Locales/EnUsLocale.cs index 5492a87..49053e4 100644 --- a/Prestarter/L10n/Locales/EnUsLocale.cs +++ b/Prestarter/L10n/Locales/EnUsLocale.cs @@ -1,6 +1,6 @@ namespace Prestarter.Helpers { - internal class EnUsLocale : ILocale + internal class EnUsLocale : ILocale { public string JavaUpdateAvailableMessage => @"Java update available. Would you like us to update it?"; public string ForLauncherStartupSoftwareIsRequiredMessage => @"To launch {0} A speciffic Java version required. Download now {1}?"; diff --git a/Prestarter/Prestarter.cs b/Prestarter/Prestarter.cs index b8e362d..dd7cfde 100644 --- a/Prestarter/Prestarter.cs +++ b/Prestarter/Prestarter.cs @@ -46,7 +46,7 @@ private static JavaStatus CheckJavaUpdateDate(string path) private enum JavaStatus { Ok, - NotInstalled, + NotInstalled, NeedUpdate } @@ -87,7 +87,7 @@ private string VerifyAndDownloadJava(string basePath) } else { - var dialog = MessageBox.Show(string.Format(I18n.ForLauncherStartupSoftwareIsRequiredMessage, Config.Project, Config.JavaDownloader.GetName()), + var dialog = MessageBox.Show(string.Format(I18n.ForLauncherStartupSoftwareIsRequiredMessage, Config.Project, Config.JavaDownloader.GetName()), "Prestarter", MessageBoxButtons.OKCancel); if (dialog != DialogResult.OK) { diff --git a/Prestarter/PrestarterForm.cs b/Prestarter/PrestarterForm.cs index 5231e48..19e9ae5 100644 --- a/Prestarter/PrestarterForm.cs +++ b/Prestarter/PrestarterForm.cs @@ -8,7 +8,7 @@ namespace Prestarter internal partial class PrestarterForm : Form, IUIReporter { private bool dragging = false; - + private Point dragCursorPoint; private Point dragFormPoint; @@ -71,7 +71,7 @@ public void SetStatus(string status) public void SetProgress(float value) { - Invoke(new Action(() => mainProgressBar.Value = (int) Math.Round(value * 100))); + Invoke(new Action(() => mainProgressBar.Value = (int)Math.Round(value * 100))); } public void ShowForm() diff --git a/Prestarter/Program.cs b/Prestarter/Program.cs index c9f4f5e..fcbf020 100644 --- a/Prestarter/Program.cs +++ b/Prestarter/Program.cs @@ -1,6 +1,4 @@ -using System; -using System.Globalization; -using System.Windows.Forms; +using System.Windows.Forms; namespace Prestarter {