From 82c35f27464e3fd0d0aaa4f9e495e895f8534799 Mon Sep 17 00:00:00 2001 From: Sefa Eyeoglu Date: Thu, 24 Mar 2022 14:47:22 +0100 Subject: feat: block launch if Java is incompatible Keep track of compatible Java versions from meta. Launch-step VerifyJavaInstall will check if current instance's Java version is compatible. Also add override option both globally and per-instance in-case the user doesn't care about the requirement. --- launcher/ui/pages/global/JavaPage.cpp | 2 ++ launcher/ui/pages/global/JavaPage.ui | 16 ++++++++++++++++ 2 files changed, 18 insertions(+) (limited to 'launcher/ui/pages/global') diff --git a/launcher/ui/pages/global/JavaPage.cpp b/launcher/ui/pages/global/JavaPage.cpp index 3eb4bd59..d1c61287 100644 --- a/launcher/ui/pages/global/JavaPage.cpp +++ b/launcher/ui/pages/global/JavaPage.cpp @@ -95,6 +95,7 @@ void JavaPage::applySettings() // Java Settings s->set("JavaPath", ui->javaPathTextBox->text()); s->set("JvmArgs", ui->jvmArgsTextBox->text()); + s->set("IgnoreJavaCompatibility", ui->skipCompatibilityCheckbox->isChecked()); JavaCommon::checkJVMArgs(s->get("JvmArgs").toString(), this->parentWidget()); } void JavaPage::loadSettings() @@ -118,6 +119,7 @@ void JavaPage::loadSettings() // Java Settings ui->javaPathTextBox->setText(s->get("JavaPath").toString()); ui->jvmArgsTextBox->setText(s->get("JvmArgs").toString()); + ui->skipCompatibilityCheckbox->setChecked(s->get("IgnoreJavaCompatibility").toBool()); } void JavaPage::on_javaDetectBtn_clicked() diff --git a/launcher/ui/pages/global/JavaPage.ui b/launcher/ui/pages/global/JavaPage.ui index b67e9994..d27b200f 100644 --- a/launcher/ui/pages/global/JavaPage.ui +++ b/launcher/ui/pages/global/JavaPage.ui @@ -222,6 +222,22 @@ + + + + + 0 + 0 + + + + If enabled, the launcher will not check if an instance is compatible with the selected Java version. + + + Skip Java compatibility checks + + + -- cgit