| 1910 | } |
| 1911 | |
| 1912 | void MainWindow::checkInstancePathForProblems() |
| 1913 | { |
| 1914 | QString instanceFolder = APPLICATION->settings()->get("InstanceDir").toString(); |
| 1915 | if (FS::checkProblemticPathJava(QDir(instanceFolder))) |
| 1916 | { |
| 1917 | QMessageBox warning(this); |
| 1918 | warning.setText(tr("Your instance folder contains \'!\' and this is known to cause Java problems!")); |
| 1919 | warning.setInformativeText( |
| 1920 | tr( |
| 1921 | "You have now two options: <br/>" |
| 1922 | " - change the instance folder in the settings <br/>" |
| 1923 | " - move this installation of %1 to a different folder" |
| 1924 | ).arg(BuildConfig.LAUNCHER_NAME) |
| 1925 | ); |
| 1926 | warning.setDefaultButton(QMessageBox::Ok); |
| 1927 | warning.exec(); |
| 1928 | } |
| 1929 | auto tempFolderText = tr("This is a problem: <br/>" |
| 1930 | " - The launcher will likely be deleted without warning by the operating system <br/>" |
| 1931 | " - close the launcher now and extract it to a real location, not a temporary folder"); |
| 1932 | QString pathfoldername = QDir(instanceFolder).absolutePath(); |
| 1933 | if (pathfoldername.contains("Rar$", Qt::CaseInsensitive)) |
| 1934 | { |
| 1935 | QMessageBox warning(this); |
| 1936 | warning.setText(tr("Your instance folder contains \'Rar$\' - that means you haven't extracted the launcher archive!")); |
| 1937 | warning.setInformativeText(tempFolderText); |
| 1938 | warning.setDefaultButton(QMessageBox::Ok); |
| 1939 | warning.exec(); |
| 1940 | } |
| 1941 | else if (pathfoldername.startsWith(QDir::tempPath()) || pathfoldername.contains("/TempState/")) |
| 1942 | { |
| 1943 | QMessageBox warning(this); |
| 1944 | warning.setText(tr("Your instance folder is in a temporary folder: \'%1\'!").arg(QDir::tempPath())); |
| 1945 | warning.setInformativeText(tempFolderText); |
| 1946 | warning.setDefaultButton(QMessageBox::Ok); |
| 1947 | warning.exec(); |
| 1948 | } |
| 1949 | } |
| 1950 | |
| 1951 | void MainWindow::updateStatusCenter() |
| 1952 | { |
no test coverage detected