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

Last change on this file since 767 was 734, checked in by alloc, 12 years ago

AEI2 self updater

File size: 1.3 KB
Line 
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
11import net.oni2.aeinstaller.updater.backend.Paths;
12import net.oni2.aeinstaller.updater.gui.MainWin;
13
14/**
15 * @author Christian Illy
16 * @version 1
17 */
18public class AEInstaller2Updater {
19
20 /**
21 * @param args
22 * Command line arguments
23 */
24 public static void main(String[] args) {
25 boolean debug = false;
26 for (String a : args)
27 if (a.equalsIgnoreCase("-debug"))
28 debug = true;
29 if (!debug) {
30 try {
31 PrintStream ps = new PrintStream(new File(Paths.getPrefsPath(),
32 "updater_output.log"));
33 System.setOut(ps);
34 System.setErr(ps);
35 } catch (FileNotFoundException e1) {
36 e1.printStackTrace();
37 }
38 }
39
40 System.setProperty("networkaddress.cache.ttl", "5");
41 System.setProperty("networkaddress.cache.negative.ttl", "1");
42
43 try {
44 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
45 } catch (Exception e) {
46 e.printStackTrace();
47 }
48 JFrame.setDefaultLookAndFeelDecorated(true);
49
50 SwingUtilities.invokeLater(new Runnable() {
51
52 public void run() {
53 try {
54 new MainWin().setVisible(true);
55 } catch (Exception e) {
56 e.printStackTrace();
57 }
58 }
59 });
60 }
61}
Note: See TracBrowser for help on using the repository browser.