| 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 (!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 | 
 } |