Changeset 17254 for release-kits


Ignore:
Timestamp:
2008-09-11T15:48:56+12:00 (16 years ago)
Author:
oranfry
Message:

updates to uninstaller

Location:
release-kits/shared/uninstaller
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • release-kits/shared/uninstaller

    • Property svn:ignore set to
      startmenu
      gsdl

  • release-kits/shared/uninstaller/Uninstaller.java

    r17251 r17254  
    322322        //log.append( "Processing: " + f.getAbsolutePath() + "\n" );
    323323
    324         // Make sure the file or directory exists and isn't write protected
     324        // Make sure the file or directory exists
    325325        if (!f.exists()) {
    326             log.append( bundle.getString("warning.nonexistent").replaceAll( "\\{file\\}", f.getAbsolutePath() ) + "\n" );
     326            log.append( Strings.replaceAll( bundle.getString("warning.nonexistent"), "{file}", f.getAbsolutePath() ) + "\n" );
    327327            return;
    328328        }
     
    334334                try {
    335335                    if ( f.equals( exceptions[i] ) || f.getCanonicalPath().equals(exceptions[i].getCanonicalPath()) ) {
    336                         log.append( bundle.getString("info.skipping").replaceAll( "\\{file\\}", f.getAbsolutePath() ) + "\n" );
     336                        log.append( Strings.replaceAll( bundle.getString("info.skipping"), "{file}", f.getAbsolutePath() ) + "\n" );
    337337                        return;
    338338                    }
     
    346346        //check existance
    347347        if ( !f.exists() ) {
    348             log.append( bundle.getString("error.nonexistent").replaceAll( "\\{file\\}", f.getAbsolutePath() ) + "\n" );
     348            log.append( Strings.replaceAll( bundle.getString("error.nonexistent"), "{file}", f.getAbsolutePath() ) + "\n" );
    349349            return;
    350350        }
    351 
    352         //check writability
    353         /*if ( !f.canWrite() ) {
    354             log.append( bundle.getString("warning.readonly").replaceAll( "\\{file\\}", f.getAbsolutePath() ) + "\n" );
    355         }*/
    356351
    357352        //if it is a directory, recurse
     
    378373        if ( doDelete ) {
    379374
    380             log.append( bundle.getString("deleting").replaceAll( "\\{file\\}", f.getAbsolutePath() ) + "\n" );
     375            log.append( Strings.replaceAll( bundle.getString("deleting"), "{file}", f.getAbsolutePath() ) + "\n" );
    381376            while ( !f.delete() ) {
    382                 log.append( bundle.getString("warning.couldnt.delete").replaceAll( "\\{file\\}", f.getAbsolutePath() ) + "\n" );
     377                log.append( Strings.replaceAll( bundle.getString("warning.couldnt.delete"), "{file}", f.getAbsolutePath() ) + "\n" );
    383378
    384379                if ( ignoreReadOnlys ) {
     
    389384                int n = JOptionPane.showOptionDialog(
    390385                    frame,
    391                     bundle.getString("warning.readonly").replaceAll( "\\{file\\}", f.getAbsolutePath() ),
     386                    Strings.replaceAll( bundle.getString("warning.readonly"), "{file}", f.getAbsolutePath() ),
    392387                    bundle.getString("readonly"),
    393388                    JOptionPane.YES_NO_CANCEL_OPTION,
     
    420415        finishToolbar.setVisible(true);
    421416    }
    422    
    423417
    424418}
     419
     420class Strings {
     421    static String replaceAll( String s, String nugget, String replacement ) {
     422        StringBuffer string = new StringBuffer(s);
     423        StringBuffer r = new StringBuffer();
     424
     425        int io = 0;
     426        while ( (io=string.toString().indexOf(nugget)) != -1 ) {
     427            r.append( string.toString().substring( 0, io ) );
     428            r.append( replacement );
     429            string.delete( 0, io + nugget.length() );
     430        }
     431        r.append( string.toString() );
     432        return r.toString();
     433    }
     434}
     435
  • release-kits/shared/uninstaller/Uninstaller.properties

    r17236 r17254  
    2222cancelled:Uninstall Cancelled
    2323finished:Uninstall Finished
    24 deleting:Deleting {file}
     24deleting:Deleting {file} from disk
    2525
    26 info.skipping:INFO: Skipping File: {file}
     26info.skipping:INFO: Skipping {file}
    2727info.no.startmenu:INFO: No StartMenu path found. Deleting a StartMenu group will not be part of this uninstall.
    28 warning.readonly:WARNING: File: {file} appears to be read-only
    29 warning.couldnt.delete:WARNING: File: {file} could not be deleted
    30 warning.nonexistent:WARNING: File: {file} does not exist
    31 error.nonexistent:ERROR: File: {file} does not exist
     28warning.readonly:WARNING: {file} appears to be read-only
     29warning.couldnt.delete:WARNING: {file} could not be deleted
     30warning.nonexistent:WARNING: {file} does not exist
     31error.nonexistent:ERROR: {file} does not exist
    3232error.couldnt.find.install.props:ERROR: Could not find the 'installation.properties' or 'etc/installation.properties' file.\nEither this is not a valid Greenstone installation, or the installation has been corrupted.\nUninstallation cannot proceed.
  • release-kits/shared/uninstaller/gsdl-template

    • Property svn:ignore set to
      Uninstaller.jar

Note: See TracChangeset for help on using the changeset viewer.