private boolean checkForLauncherUpdates(File downloadDirectory, File tempDirectory, boolean saveDownloadedFiles) {
logger.trace("Check for launcher updates...");
boolean selfUpdaterStarted = false;
updateMessage(BundleUtils.getLabel("splash_launcherUpdateCheck"));
final LauncherUpdater updater = new LauncherUpdater(TerasologyLauncherVersionInfo.getInstance());
if (updater.updateAvailable()) {
logger.trace("Launcher update available!");
updateMessage(BundleUtils.getLabel("splash_launcherUpdateAvailable"));
boolean foundLauncherInstallationDirectory = false;
try {
updater.detectAndCheckLauncherInstallationDirectory();
foundLauncherInstallationDirectory = true;
} catch (URISyntaxException | IOException e) {
logger.error("The launcher installation directory can not be detected or used!", e);
GuiUtils.showErrorMessageDialog(null, BundleUtils.getLabel("message_error_launcherInstallationDirectory"));
// Run launcher without an update. Don't throw a LauncherStartFailedException.
}
if (foundLauncherInstallationDirectory) {
final boolean update = updater.showUpdateDialog(null);
if (update) {
if (saveDownloadedFiles) {
selfUpdaterStarted = updater.update(downloadDirectory, tempDirectory);
} else {
selfUpdaterStarted = updater.update(tempDirectory, tempDirectory);
}
}
}
}
return selfUpdaterStarted;