Ignore:
Timestamp:
2010-10-28T10:14:17+13:00 (13 years ago)
Author:
sjm84
Message:

A few minor updates to the uninstaller

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/release-kits/shared/core/uninstaller/Uninstaller.java

    r23210 r23242  
    443443        for ( int i=0; i < files.length; i++) {
    444444            if( files[i].getAbsolutePath().endsWith(".uninstall") ) {
    445                 String[] paths = getRelevantPathsFromUninstallFile(files[i]);
     445                String[] paths = getPathsFromUninstallFile(files[i]);
    446446               
    447447                for(int j=0; j < paths.length; j++) {
     
    481481        return (String[]) paths.toArray(new String[0]);
    482482    }
     483   
     484    public String[] getPathsFromUninstallFile ( File uninstallFile ) {
     485       
     486        ArrayList paths = new ArrayList();
     487        try {
     488            BufferedReader in = new BufferedReader(new FileReader(uninstallFile));
     489           
     490            String line;
     491            while ( (line = in.readLine()) != null ) {
     492                if (line.length() > 0 && !paths.contains(line)) {
     493                    paths.add(line);
     494                }
     495            }
     496           
     497            in.close();
     498        }
     499        catch( Exception ex ) {
     500            ex.printStackTrace();
     501            return null;
     502        }
     503        return (String[]) paths.toArray(new String[0]);
     504    }
    483505
    484506    public void recursiveDelete( File f, File[] exceptions ) throws CancelledException {
Note: See TracChangeset for help on using the changeset viewer.