| 1726 | } |
| 1727 | |
| 1728 | void MainWindow::checkInstancePathForProblems() |
| 1729 | { |
| 1730 | QString instanceFolder = APPLICATION->settings()->get("InstanceDir").toString(); |
| 1731 | if (FS::checkProblemticPathJava(QDir(instanceFolder))) { |
| 1732 | QMessageBox warning(this); |
| 1733 | warning.setText(tr("Your instance folder contains \'!\' and this is known to cause Java problems!")); |
| 1734 | warning.setInformativeText(tr("You have now two options: <br/>" |
| 1735 | " - change the instance folder in the settings <br/>" |
| 1736 | " - move this installation of %1 to a different folder") |
| 1737 | .arg(BuildConfig.LAUNCHER_DISPLAYNAME)); |
| 1738 | warning.setDefaultButton(QMessageBox::Ok); |
| 1739 | warning.exec(); |
| 1740 | } |
| 1741 | auto tempFolderText = |
| 1742 | tr("This is a problem: <br/>" |
| 1743 | " - The launcher will likely be deleted without warning by the operating system <br/>" |
| 1744 | " - close the launcher now and extract it to a real location, not a temporary folder"); |
| 1745 | QString pathfoldername = QDir(instanceFolder).absolutePath(); |
| 1746 | if (pathfoldername.contains("Rar$", Qt::CaseInsensitive)) { |
| 1747 | QMessageBox warning(this); |
| 1748 | warning.setText(tr("Your instance folder contains \'Rar$\' - that means you haven't extracted the launcher archive!")); |
| 1749 | warning.setInformativeText(tempFolderText); |
| 1750 | warning.setDefaultButton(QMessageBox::Ok); |
| 1751 | warning.exec(); |
| 1752 | } else if (pathfoldername.startsWith(QDir::tempPath()) || pathfoldername.contains("/TempState/")) { |
| 1753 | QMessageBox warning(this); |
| 1754 | warning.setText(tr("Your instance folder is in a temporary folder: \'%1\'!").arg(QDir::tempPath())); |
| 1755 | warning.setInformativeText(tempFolderText); |
| 1756 | warning.setDefaultButton(QMessageBox::Ok); |
| 1757 | warning.exec(); |
| 1758 | } |
| 1759 | } |
| 1760 | |
| 1761 | void MainWindow::updateStatusCenter() |
| 1762 | { |
no test coverage detected