ViewVC Help
View File | Revision Log | View Changeset | Root Listing
root/Oni2/java/AEInstaller2-Updater/src/net/oni2/aeinstaller/updater/AEInstaller2Updater.java
Revision: 777
Committed: Tue Apr 2 00:33:46 2013 UTC (12 years, 6 months ago) by alloc
Content type: text/x-java
File size: 1436 byte(s)
Log Message:
AEI2 Updater:
- Added "-usewd" param

File Contents

# Content
1 package net.oni2.aeinstaller.updater;
2
3 import java.io.File;
4 import java.io.FileNotFoundException;
5 import java.io.PrintStream;
6
7 import javax.swing.JFrame;
8 import javax.swing.SwingUtilities;
9 import javax.swing.UIManager;
10
11 import net.oni2.aeinstaller.updater.backend.Paths;
12 import net.oni2.aeinstaller.updater.gui.MainWin;
13
14 /**
15 * @author Christian Illy
16 * @version 1
17 */
18 public 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 }