source: java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/AEInstaller2Updater.java@ 864

Last change on this file since 864 was 852, checked in by alloc, 12 years ago

AEI2.08, AEIUpdater:

File size: 1.6 KB
RevLine 
[734]1package net.oni2.aeinstaller.updater;
2
3import java.io.File;
4import java.io.FileNotFoundException;
5import java.io.PrintStream;
6
7import javax.swing.JFrame;
8import javax.swing.SwingUtilities;
9import javax.swing.UIManager;
10
[852]11import net.oni2.ProxySettings;
[734]12import net.oni2.aeinstaller.updater.backend.Paths;
13import net.oni2.aeinstaller.updater.gui.MainWin;
14
15/**
16 * @author Christian Illy
17 * @version 1
18 */
19public class AEInstaller2Updater {
20
21 /**
22 * @param args
23 * Command line arguments
24 */
25 public static void main(String[] args) {
26 boolean debug = false;
[777]27 for (String a : args) {
[734]28 if (a.equalsIgnoreCase("-debug"))
29 debug = true;
[777]30 if (a.equalsIgnoreCase("-usewd"))
31 Paths.useWorkingDirectory = true;
32 }
[734]33 if (!debug) {
34 try {
35 PrintStream ps = new PrintStream(new File(Paths.getPrefsPath(),
36 "updater_output.log"));
37 System.setOut(ps);
38 System.setErr(ps);
39 } catch (FileNotFoundException e1) {
40 e1.printStackTrace();
41 }
42 }
43
[852]44 if (Paths.getProxySettingsFilename().exists()) {
45 ProxySettings.deserializeFromFile(Paths.getProxySettingsFilename());
46 }
47
[734]48 System.setProperty("networkaddress.cache.ttl", "5");
49 System.setProperty("networkaddress.cache.negative.ttl", "1");
50
51 try {
52 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
53 } catch (Exception e) {
54 e.printStackTrace();
55 }
56 JFrame.setDefaultLookAndFeelDecorated(true);
57
58 SwingUtilities.invokeLater(new Runnable() {
59
60 public void run() {
61 try {
62 new MainWin().setVisible(true);
63 } catch (Exception e) {
64 e.printStackTrace();
65 }
66 }
67 });
68 }
69}
Note: See TracBrowser for help on using the repository browser.