- Timestamp:
- 2010-10-26T15:12:23+13:00 (13 years ago)
- Location:
- main/trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/release-kits/kits/rk2/ant-scripts/create-components.xml
r22325 r23210 3 3 4 4 <target name="create-components" depends="init,gs2-init"> 5 6 <!-- core -->7 <antcall target="create-component"><param name="component" value="core"/></antcall>8 5 9 6 <!-- imagemagick --> … … 18 15 <antcall target="create-component"><param name="component" value="ghostscript"/></antcall> 19 16 </if> 17 18 <!-- core --> 19 <antcall target="create-component"><param name="component" value="core"/></antcall> 20 20 21 21 </target> -
main/trunk/release-kits/shared/core/ant-scripts/shared.xml
r22490 r23210 86 86 <typedef name="rsr" classname="org.greenstone.anttasks.RegexSearchReplace" classpathref="project.classpath"/> 87 87 <typedef name="dcff" classname="org.greenstone.anttasks.DeleteChunkFromFile" classpathref="project.classpath"/> 88 <typedef name="pstf" classname="org.greenstone.anttasks.PatternSetToFile" classpathref="project.classpath"/> 88 89 <typedef name="rsplit" classname="org.greenstone.anttasks.SplitResource" classpathref="project.classpath"/> 89 90 <typedef name="get-property-value" classname="org.greenstone.anttasks.GetPropertyValue" classpathref="project.classpath"/> … … 238 239 <!-- create working build directory --> 239 240 <mkdir dir="compiled/uninstaller/build/resources" /> 240 241 <mkdir dir="compiled/uninstall"/> 242 241 243 <!-- copile to build --> 242 244 <javac … … 252 254 <!-- jar it all up --> 253 255 <jar 254 destfile="compiled/uninst .jar"256 destfile="compiled/uninstall/uninst.jar" 255 257 manifest="${rk.home}/shared/core/uninstaller/manifest.mf" 256 258 basedir="compiled/uninstaller/build" /> … … 260 262 261 263 <!-- put the associated script in place --> 262 <copy file="${rk.home}/shared/core/uninstaller/Uninstall.${os.script.format}" todir="compiled "/>264 <copy file="${rk.home}/shared/core/uninstaller/Uninstall.${os.script.format}" todir="compiled/uninstall"/> 263 265 264 266 </target> … … 377 379 <!-- target to archive and compress a given component --> 378 380 <target name="create-component"> 379 381 <mkdir dir="components"/> 380 382 381 <zip destfile="components/${component}.comp" compress="false"> 382 <zipfileset dir="compiled"> 383 <patternset refid="greenstone${version.major}.${component}.component"/> 384 </zipfileset> 385 </zip> 383 <pstf dir="compiled" outfile="compiled/uninstall/${component}.uninstall"> 384 <patternset refid="greenstone${version.major}.${component}.component"/> 385 </pstf> 386 387 <zip destfile="components/${component}.comp" compress="false"> 388 <zipfileset dir="compiled"> 389 <patternset refid="greenstone${version.major}.${component}.component"/> 390 </zipfileset> 391 </zip> 386 392 387 388 393 <!-- windows --> 394 <if><bool><equals arg1="${rk.os}" arg2="windows"/></bool> 389 395 <exec executable="${rk.home}/shared/windows/7za/7za.exe" dir="components"><arg line="a -t7z -mx=9 ${component}.lzma ${component}.comp"/></exec> 390 396 -
main/trunk/release-kits/shared/core/uninstaller/Uninstall.bat
r22577 r23210 10 10 echo The uninstaller cannot write to the Greenstone directory (%CD%) 11 11 echo Requesting elevated status to become admin user to continue. 12 bin\windows\gstart.exe %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %912 ..\bin\windows\gstart.exe %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %9 13 13 goto done 14 14 … … 28 28 if "%1" == "Elevated" shift 29 29 30 if exist . \bin\windows\search4j.exe .\bin\windows\search4j.exe -p.\packages\jre -l .\uninst.jar30 if exist ..\bin\windows\search4j.exe ..\bin\windows\search4j.exe -p ..\packages\jre -l .\uninst.jar 31 31 32 if exist . \gs2build\bin\windows\search4j.exe .\gs2build\bin\windows\search4j.exe -p.\packages\jre -l .\uninst.jar32 if exist ..\gs2build\bin\windows\search4j.exe ..\gs2build\bin\windows\search4j.exe -p ..\packages\jre -l .\uninst.jar 33 33 34 34 35 35 if exist uninst.flag ( 36 36 37 rd /s /q . \packages\jre38 rmdir packages37 rd /s /q ..\packages\jre 38 rmdir ..\packages 39 39 40 if exist . \bin\windows\search4j.exe (41 del . \bin\windows\search4j.exe42 rmdir bin\windows40 if exist ..\bin\windows\search4j.exe ( 41 del ..\bin\windows\search4j.exe 42 rmdir ..\bin\windows 43 43 ) 44 if exist . \gs2build\bin\windows\search4j.exe (45 del . \gs2build\bin\windows\search4j.exe46 rd /s /q gs2build44 if exist ..\gs2build\bin\windows\search4j.exe ( 45 del ..\gs2build\bin\windows\search4j.exe 46 rd /s /q ..\gs2build 47 47 ) 48 48 … … 50 50 del uninst.flag 51 51 del Uninstall.* 52 del *.uninstall 53 del ..\bin 54 del ..\tmp 55 del ..\ext 52 56 57 cd .. 53 58 if NOT EXIST *.* ( 54 59 set GSDEL=%CD% -
main/trunk/release-kits/shared/core/uninstaller/Uninstall.sh
r17808 r23210 1 if [ -f " setup.bash" ]; then1 if [ -f "../setup.bash" ]; then 2 2 #This is Greenstone 2 3 . . /setup.bash > /dev/null3 . ../setup.bash > /dev/null 4 4 SEARCH4J_EXECUTABLE=$GSDLHOME/bin/$GSDLOS/search4j 5 5 6 elif [ -f " gs2build/setup.bash" ]; then6 elif [ -f "../gs2build/setup.bash" ]; then 7 7 #This is Greenstone 3 8 . . /gs2build/setup.bash > /dev/null9 SEARCH4J_EXECUTABLE=. /bin/search4j8 . ../gs2build/setup.bash > /dev/null 9 SEARCH4J_EXECUTABLE=../bin/search4j 10 10 11 11 else … … 16 16 17 17 if [ $GSDLOS = linux ]; then 18 "$SEARCH4J_EXECUTABLE" -p . /packages/jre -l ./uninst.jar18 "$SEARCH4J_EXECUTABLE" -p ../packages/jre -l ./uninst.jar 19 19 elif [ $GSDLOS = darwin ]; then 20 20 "$SEARCH4J_EXECUTABLE" -p /System/Library/Frameworks/JavaVM.framework/Home -l ./uninst.jar … … 23 23 if [ -e "uninst.flag" ]; then 24 24 25 rm -rf packages/jre &> /dev/null26 rmdir packages &> /dev/null25 rm -rf ../packages/jre &> /dev/null 26 rmdir ../packages &> /dev/null 27 27 28 rm -rf bin &> /dev/null28 rm -rf ../bin &> /dev/null 29 29 30 30 rm uninst.jar &> /dev/null … … 32 32 rm Uninstall.* &> /dev/null 33 33 34 cd .. 34 35 CONTENTS=`ls` 35 36 if [ -z "$CONTENTS" ]; then -
main/trunk/release-kits/shared/core/uninstaller/Uninstaller.java
r20648 r23210 44 44 public static final ResourceBundle bundle = ResourceBundle.getBundle("resources.LanguagePack"); 45 45 46 public static final File gs2InstallProps = new File(" etc/installation.properties");47 public static final File gs3InstallProps = new File(" installation.properties");46 public static final File gs2InstallProps = new File("../etc/installation.properties"); 47 public static final File gs3InstallProps = new File("../installation.properties"); 48 48 49 49 boolean keepCollections = true; … … 335 335 336 336 //never delete the things we are currently running 337 exceptions.add( new File("bin/search4j.exe") ); 338 exceptions.add( new File("bin/search4j") ); 339 340 exceptions.add( new File("bin/windows/search4j.exe") ); 341 exceptions.add( new File("bin/linux/search4j") ); 342 exceptions.add( new File("bin/darwin/search4j") ); 343 344 exceptions.add( new File("packages/jre") ); 345 exceptions.add( new File("uninst.jar") ); 346 exceptions.add( new File("Uninstall.bat") ); 347 exceptions.add( new File("Uninstall.sh") ); 337 exceptions.add( new File("../bin/search4j.exe") ); 338 exceptions.add( new File("../bin/search4j") ); 339 340 exceptions.add( new File("../bin/windows/search4j.exe") ); 341 exceptions.add( new File("../bin/linux/search4j") ); 342 exceptions.add( new File("../bin/darwin/search4j") ); 343 344 exceptions.add( new File("../packages/jre") ); 345 exceptions.add( new File("../uninstall") ); 348 346 349 347 if ( keepCollections ) { 350 exceptions.add( new File(" web/sites/localsite/collect") );351 exceptions.add( new File(" collect") );348 exceptions.add( new File("../web/sites/localsite/collect") ); 349 exceptions.add( new File("../collect") ); 352 350 } 353 351 … … 366 364 } 367 365 368 recursiveDelete( cd , ex ); 366 //recursiveDelete( cd , ex ); 367 selectiveDelete ( cd, ex ); 369 368 } catch ( CancelledException ce ) { 370 369 log( bundle.getString("uninstaller.cancelled") + "\n" ); … … 436 435 return null; 437 436 437 } 438 439 public void selectiveDelete( File f, File[] exceptions ) throws CancelledException { 440 441 File[] files = (new File(".")).listFiles(); 442 443 for ( int i=0; i < files.length; i++) { 444 if( files[i].getAbsolutePath().endsWith(".uninstall") ) { 445 String[] paths = getRelevantPathsFromUninstallFile(files[i]); 446 447 for(int j=0; j < paths.length; j++) { 448 recursiveDelete( new File(".." + File.separator + paths[j]), exceptions ); 449 } 450 } 451 } 452 } 453 454 public String[] getRelevantPathsFromUninstallFile ( File uninstallFile ) { 455 456 ArrayList paths = new ArrayList(); 457 try { 458 BufferedReader in = new BufferedReader(new FileReader(uninstallFile)); 459 460 String line; 461 while ( (line = in.readLine()) != null ) { 462 int separatorIndex = line.indexOf(File.separator); 463 464 if ( separatorIndex == -1 && line.length() > 0 && !paths.contains(line)) { 465 paths.add(line); 466 } 467 else if ( separatorIndex > -1 && line.length() > 0) { 468 String path = line.substring(0, separatorIndex); 469 if ( !paths.contains(path) ) { 470 paths.add(path); 471 } 472 } 473 } 474 475 in.close(); 476 } 477 catch( Exception ex ) { 478 ex.printStackTrace(); 479 return null; 480 } 481 return (String[]) paths.toArray(new String[0]); 438 482 } 439 483
Note:
See TracChangeset
for help on using the changeset viewer.