use of net.technicpack.launcher.ui.InstallerFrame in project LauncherV3 by TechnicPack.
the class LauncherMain method main.
public static void main(String[] args) {
try {
UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
} catch (Exception ex) {
Utils.getLogger().log(Level.SEVERE, ex.getMessage(), ex);
}
ToolTipManager.sharedInstance().setDismissDelay(Integer.MAX_VALUE);
StartupParameters params = new StartupParameters(args);
try {
new JCommander(params, args);
} catch (Exception ex) {
ex.printStackTrace();
}
TechnicSettings settings = null;
try {
settings = SettingsFactory.buildSettingsObject(Relauncher.getRunningPath(LauncherMain.class), params.isMover());
} catch (UnsupportedEncodingException ex) {
ex.printStackTrace();
}
if (settings == null) {
ResourceLoader installerResources = new ResourceLoader(null, "net", "technicpack", "launcher", "resources");
installerResources.setSupportedLanguages(supportedLanguages);
installerResources.setLocale(ResourceLoader.DEFAULT_LOCALE);
InstallerFrame dialog = new InstallerFrame(installerResources, params);
dialog.setVisible(true);
return;
}
LauncherDirectories directories = new TechnicLauncherDirectories(settings.getTechnicRoot());
ResourceLoader resources = new ResourceLoader(directories, "net", "technicpack", "launcher", "resources");
resources.setSupportedLanguages(supportedLanguages);
resources.setLocale(settings.getLanguageCode());
IBuildNumber buildNumber = null;
if (params.getBuildNumber() != null && !params.getBuildNumber().isEmpty())
buildNumber = new CommandLineBuildNumber(params);
else
buildNumber = new VersionFileBuildNumber(resources);
setupLogging(directories, resources, buildNumber);
String launcherBuild = buildNumber.getBuildNumber();
int build = -1;
try {
build = Integer.parseInt((new VersionFileBuildNumber(resources)).getBuildNumber());
} catch (NumberFormatException ex) {
// This is probably a debug build or something, build number is invalid
}
Relauncher launcher = new TechnicRelauncher(new HttpUpdateStream("http://api.technicpack.net/launcher/"), settings.getBuildStream() + "4", build, directories, resources, params);
try {
if (launcher.runAutoUpdater())
startLauncher(settings, params, directories, resources, buildNumber);
} catch (InterruptedException e) {
// Canceled by user
} catch (DownloadException e) {
// JOptionPane.showMessageDialog(null, resources.getString("launcher.updateerror.download", pack.getDisplayName(), e.getMessage()), resources.getString("launcher.installerror.title"), JOptionPane.WARNING_MESSAGE);
} catch (IOException e) {
e.printStackTrace();
}
}
use of net.technicpack.launcher.ui.InstallerFrame in project LauncherV3 by TechnicPack.
the class OptionsDialog method reinstall.
protected void reinstall() {
final InstallerFrame frame = new InstallerFrame(resources, params, settings, getOwner());
frame.setVisible(true);
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
frame.requestFocus();
}
});
this.dispose();
}
Aggregations