try {
return launch(instance);
} catch (UpdateRequiredException e) {
// Update required, so we're going to go to the update step
} catch (IOException e) {
throw new LauncherException(e, _("launch.launchFailed"));
}
// If we're here, then it looks like an update is required
if (!offline) {
setLocalizedTitle(_("launch.updatingTitle", profile.toString()));
step2.push(0, _("launch.updating"));
update(instance, step2);
} else {
throw new LauncherException(
"Can't update if offline", _("launch.onlineModeRequired"));
}
// Update's done, so let's try launching one more time
setLocalizedTitle(_("launch.launchingTitle", profile.toString()));
step3.push(0, _("launch.launching"));
try {
return launch(instance);
} catch (UpdateRequiredException e) {
// This shouldn't be thrown here, since we've already updated,
// but perhaps something failed
throw new LauncherException(e, _("updater.launchFailed"));
} catch (IOException e) {
throw new LauncherException(e, _("updater.launchFailed"));
}
}