1 21 22 25 package net.sf.launch4j; 26 27 import java.io.File ; 28 import java.io.InputStream ; 29 import java.util.Properties ; 30 31 import net.sf.launch4j.config.ConfigPersister; 32 import net.sf.launch4j.formimpl.MainFrame; 33 34 37 public class Main { 38 private static String _name; 39 private static String _description; 40 41 public static void main(String [] args) { 42 try { 43 Properties props = new Properties (); 44 InputStream in = Main.class.getClassLoader() 45 .getResourceAsStream("launch4j.properties"); 46 props.load(in); 47 in.close(); 48 setDescription(props); 49 50 if (args.length == 0) { 51 ConfigPersister.getInstance().createBlank(); 52 MainFrame.createInstance(); 53 } else if (args.length == 1 && !args[0].startsWith("-")) { 54 ConfigPersister.getInstance().load(new File (args[0])); 55 Builder b = new Builder(Log.getConsoleLog()); 56 b.build(); 57 } else { 58 System.out.println(_description 59 + Messages.getString("Main.usage") 60 + ": launch4j config.xml"); 61 } 62 } catch (Exception e) { 63 Log.getConsoleLog().append(e.getMessage()); 64 } 65 } 66 67 public static String getName() { 68 return _name; 69 } 70 71 public static String getDescription() { 72 return _description; 73 } 74 75 private static void setDescription(Properties props) { 76 _name = "Launch4j " + props.getProperty("version"); 77 _description = _name + 78 " (http://launch4j.sourceforge.net/)\n" + 79 "Cross-platform Java application wrapper" + 80 " for creating Windows native executables.\n\n" + 81 "Copyright (C) 2004, 2006 Grzegorz Kowal\n\n" + 82 "Launch4j comes with ABSOLUTELY NO WARRANTY.\n" + 83 "This is free software, licensed under the GNU General Public License.\n" + 84 "This product includes software developed by the Apache Software Foundation" + 85 " (http://www.apache.org/).\n\n"; 86 } 87 } 88 | Popular Tags |