01: /**
02: * $RCSfile: VAInstall.java,v $
03: * @creation 26/01/99
04: * @modification $Date: 2005/03/06 23:04:18 $
05: */package com.memoire.vainstall;
06:
07: import java.io.File;
08: import java.io.IOException;
09:
10: /**
11: * @version $Id: VAInstall.java,v 1.4 2005/03/06 23:04:18 deniger Exp $
12: * @author Axel von Arnim
13: */
14:
15: public class VAInstall {
16:
17: public static void main(String[] args) {
18:
19: String javaVersion = System.getProperty("java.version");
20:
21: if (javaVersion.indexOf("1.4.") != -1) {
22: // JDK 1.4
23:
24: if (args != null && args.length == 1
25: && args[0].equals("-gui") == true) {
26: try {
27: Object controller = Class
28: .forName(
29: "com.memoire.vainstall.builder.VAIBuilderController")
30: .newInstance();
31: } catch (Exception exc) {
32: exc.printStackTrace();
33: }
34: return;
35: }
36: }
37:
38: if (args.length < 1) {
39: usage();
40: System.exit(1);
41: }
42:
43: File propFile = new File(args[0]);
44: if ((propFile.exists()) && (propFile.canRead())) {
45: try {
46: VAProperties.PROPERTIES.loadProperties(propFile);
47: } catch (IOException exc) {
48: exc.printStackTrace();
49: }
50: } else {
51: if (args[0].equals("-gui") == true) {
52: System.err.println("'-gui' only supported on Java 1.4");
53: } else {
54: System.err.println(args[0] + " can not be read.");
55: }
56: System.exit(1);
57: }
58:
59: VAArchiver archiver = new VAArchiver();
60: archiver.start();
61:
62: System.exit(0);
63:
64: }
65:
66: public static void usage() {
67: System.out
68: .println("Usage: java "
69: + new VAInstall().getClass().getName()
70: + " <.vai file>");
71: }
72:
73: }
|