[izpack-changes] r1612 - izpack-src/branches/branch-3.9/src/lib/com/izforge/izpack/uninstaller
noreply at berlios.de
noreply at berlios.de
Sun Sep 24 21:00:52 CEST 2006
Author: eppelman
Date: 2006-09-24 21:00:51 +0200 (Sun, 24 Sep 2006)
New Revision: 1612
Modified:
izpack-src/branches/branch-3.9/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
Log:
Revision3.9: Fixed Automated Installation on Win32
Modified: izpack-src/branches/branch-3.9/src/lib/com/izforge/izpack/uninstaller/Destroyer.java
===================================================================
--- izpack-src/branches/branch-3.9/src/lib/com/izforge/izpack/uninstaller/Destroyer.java 2006-09-24 18:59:31 UTC (rev 1611)
+++ izpack-src/branches/branch-3.9/src/lib/com/izforge/izpack/uninstaller/Destroyer.java 2006-09-24 19:00:51 UTC (rev 1612)
@@ -24,10 +24,10 @@
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.ObjectInputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collections;
-import java.util.Enumeration;
-import java.util.Hashtable;
import java.util.Iterator;
import java.util.List;
import java.util.TreeSet;
@@ -38,9 +38,8 @@
import com.izforge.izpack.util.AbstractUIProgressHandler;
import com.izforge.izpack.util.Debug;
import com.izforge.izpack.util.FileExecutor;
-import com.izforge.izpack.util.StringTool;
+import com.izforge.izpack.util.OsVersion;
import com.izforge.izpack.util.os.unix.ShellScript;
-import com.izforge.izpack.util.os.unix.UnixHelper;
/**
@@ -114,9 +113,11 @@
// Custem action listener stuff --- afterDeletion ----
informListeners(listeners[0], UninstallerListener.AFTER_DELETION, files, handler);
-
- execRootScript(getRootScript());
-
+
+ if( OsVersion.IS_UNIX )
+ {
+ execRootScript(getRootScript());
+ }
// We make a complementary cleanup
handler.progress(size, "[ cleanups ]");
cleanup(new File(installPath));
@@ -127,7 +128,18 @@
{
handler.stopAction();
err.printStackTrace();
- handler.emitError("exception caught", err.toString());
+
+ StackTraceElement str[] = err.getStackTrace();
+ for(int idx = 0; idx < str.length;idx++)
+ {
+
+ }
+
+ StringWriter trace = new StringWriter();
+ //err.printStackTrace(new PrintStream);
+ err.printStackTrace(new PrintWriter(trace));
+
+ handler.emitError("exception caught", err.toString() + "\n" + trace.toString() );
}
}
@@ -207,11 +219,11 @@
*/
private String getRootScript() throws Exception
{
- //String rootScript = new String();
+ String result = new String();
ObjectInputStream in = new ObjectInputStream(Destroyer.class.getResourceAsStream("/"
+ UninstallData.ROOTSCRIPT));
- String result = in.readUTF();
+ result = in.readUTF();
return result;
@@ -224,7 +236,8 @@
*/
private void execRootScript(String aRootScript)
{
-
+ if(!"".equals(aRootScript))
+ {
Debug.log("Will Execute: " + aRootScript.toString());
try
@@ -238,6 +251,7 @@
{
Debug.log("Exeption during su remove: " + ex.getMessage());
}
+ }
}
/**
More information about the izpack-changes
mailing list