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