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

Last change on this file since 782 was 777, checked in by alloc, 12 years ago

AEI2 Updater:

  • Added "-usewd" param
File size: 1.4 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 (a.equalsIgnoreCase("-usewd"))
30 Paths.useWorkingDirectory = true;
31 }
32 if (!debug) {
33 try {
34 PrintStream ps = new PrintStream(new File(Paths.getPrefsPath(),
35 "updater_output.log"));
36 System.setOut(ps);
37 System.setErr(ps);
38 } catch (FileNotFoundException e1) {
39 e1.printStackTrace();
40 }
41 }
42
43 System.setProperty("networkaddress.cache.ttl", "5");
44 System.setProperty("networkaddress.cache.negative.ttl", "1");
45
46 try {
47 UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName());
48 } catch (Exception e) {
49 e.printStackTrace();
50 }
51 JFrame.setDefaultLookAndFeelDecorated(true);
52
53 SwingUtilities.invokeLater(new Runnable() {
54
55 public void run() {
56 try {
57 new MainWin().setVisible(true);
58 } catch (Exception e) {
59 e.printStackTrace();
60 }
61 }
62 });
63 }
64}
Note: See TracBrowser for help on using the repository browser.