diff options
author | Noel Power <npower@openoffice.org> | 2003-09-16 07:37:21 +0000 |
---|---|---|
committer | Noel Power <npower@openoffice.org> | 2003-09-16 07:37:21 +0000 |
commit | 5990f47baf87d9ba3177b3959da07429e43aefb1 (patch) | |
tree | 2cac9ad49b079db23d2990e8ce83763e89c7b7e5 /scripting | |
parent | 1fc4b51c81be3951e7ff2b1ee10b13770c413c03 (diff) |
Ongoing support for existing 0.3 release of scripting framework, removed hard coded check for valid versions of office and staroffice, now displays any version in sversion[rc]ini file that supports pkgchk
Diffstat (limited to 'scripting')
-rw-r--r-- | scripting/workben/installer/Version.java | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/scripting/workben/installer/Version.java b/scripting/workben/installer/Version.java index 8061eb1d4289..56e78024769e 100644 --- a/scripting/workben/installer/Version.java +++ b/scripting/workben/installer/Version.java @@ -242,28 +242,42 @@ class MyTableModel extends AbstractTableModel { MyTableModel (Properties properties, String [] validVersions) { data = new ArrayList(); - //System.out.println(properties); - + boolean isWindows = + (System.getProperty("os.name").indexOf("Windows") != -1); int len = validVersions.length; - for (int i = 0; i < len; i++) { - String key = validVersions[i]; + for (Enumeration e = properties.propertyNames(); e.hasMoreElements() ;) { + String key = (String)e.nextElement(); String path = null; - if ((path = properties.getProperty(key)) != null) { - ArrayList row = new ArrayList(); - row.add(0, new Boolean(false)); - - row.add(1, key); - if (key.length() > ((String)longValues[1]).length()) { - longValues[1] = key; + if ( !( key.startsWith("#") ) && + ( path = properties.getProperty(key)) != null) { + String pkgChkPath = path + File.separator + "program" + File.separator; + if ( isWindows ) + { + pkgChkPath += "pkgchk.exe"; } - - row.add(2, path); - if (path.length() > ((String)longValues[2]).length()) { - longValues[2] = path; + else + { + pkgChkPath += "pkgchk"; } + File pkgChk = new File( pkgChkPath ); + if ( pkgChk.exists() ) + { + ArrayList row = new ArrayList(); + row.add(0, new Boolean(false)); + + row.add(1, key); + if (key.length() > ((String)longValues[1]).length()) { + longValues[1] = key; + } + + row.add(2, path); + if (path.length() > ((String)longValues[2]).length()) { + longValues[2] = path; + } data.add(row); + } } } }// MyTableModel |