Skip to content
Snippets Groups Projects
Commit 233d2d3e authored by aburn's avatar aburn
Browse files

Extended deferred scripts

parent 219c5c1a
Branches
No related merge requests found
...@@ -103,6 +103,7 @@ public class OsUtils ...@@ -103,6 +103,7 @@ public class OsUtils
out.write(" goto :loop\r\n"); out.write(" goto :loop\r\n");
out.write(")\r\n"); out.write(")\r\n");
out.write(script); out.write(script);
out.write("DEL \"%~f0\"\r\n");
out.close(); out.close();
} }
else if (SystemUtils.IS_OS_MAC) else if (SystemUtils.IS_OS_MAC)
...@@ -112,6 +113,7 @@ public class OsUtils ...@@ -112,6 +113,7 @@ public class OsUtils
out.write("#!/bin/bash\n"); out.write("#!/bin/bash\n");
out.write("while kill -0 "+DocExploreTool.processPid+" 2> /dev/null; do sleep 1; done;\n"); out.write("while kill -0 "+DocExploreTool.processPid+" 2> /dev/null; do sleep 1; done;\n");
out.write(script); out.write(script);
out.write("rm $0\n");
out.close(); out.close();
scriptFile.setExecutable(true); scriptFile.setExecutable(true);
} }
...@@ -122,6 +124,7 @@ public class OsUtils ...@@ -122,6 +124,7 @@ public class OsUtils
out.write("#!/bin/bash\n"); out.write("#!/bin/bash\n");
out.write("while kill -0 "+DocExploreTool.processPid+" 2> /dev/null; do sleep 1; done;\n"); out.write("while kill -0 "+DocExploreTool.processPid+" 2> /dev/null; do sleep 1; done;\n");
out.write(script); out.write(script);
out.write("rm $0\n");
out.close(); out.close();
scriptFile.setExecutable(true); scriptFile.setExecutable(true);
} }
...@@ -160,7 +163,6 @@ public class OsUtils ...@@ -160,7 +163,6 @@ public class OsUtils
{ {
StringBuffer out = new StringBuffer(); StringBuffer out = new StringBuffer();
out.append("open -a \""+DocExploreTool.getExecutableDir()+"/../..\"\n"); out.append("open -a \""+DocExploreTool.getExecutableDir()+"/../..\"\n");
out.append("rm $0\n");
File script = buildDeferredScript(".docexplore-"+DocExplore.familyVersion()+"-relaunch.sh", out.toString()); File script = buildDeferredScript(".docexplore-"+DocExplore.familyVersion()+"-relaunch.sh", out.toString());
Runtime.getRuntime().exec(new String [] {"./"+script.getName()}, null, new File(System.getProperty("user.home"))); Runtime.getRuntime().exec(new String [] {"./"+script.getName()}, null, new File(System.getProperty("user.home")));
} }
......
...@@ -149,7 +149,6 @@ public class Uninstaller ...@@ -149,7 +149,6 @@ public class Uninstaller
if (appEntry.exists()) if (appEntry.exists())
out.append("rmdir /S /Q \""+appEntry.getCanonicalPath()+"\"\r\n"); out.append("rmdir /S /Q \""+appEntry.getCanonicalPath()+"\"\r\n");
} }
out.append("DEL \"%~f0\"\r\n");
File script = OsUtils.buildDeferredScript(".docexplore-uninstall.bat", out.toString()); File script = OsUtils.buildDeferredScript(".docexplore-uninstall.bat", out.toString());
JOptionPane.showMessageDialog(null, Lang.s("uninstallExitMessage")); JOptionPane.showMessageDialog(null, Lang.s("uninstallExitMessage"));
Runtime.getRuntime().exec(new String [] { Runtime.getRuntime().exec(new String [] {
...@@ -164,7 +163,7 @@ public class Uninstaller ...@@ -164,7 +163,7 @@ public class Uninstaller
StringBuffer out = new StringBuffer(); StringBuffer out = new StringBuffer();
for (int i=0;i<binaryDirs.size();i++) for (int i=0;i<binaryDirs.size();i++)
{ {
out.append("sudo rm -rf \""+binaryDirs.get(i)[0]+"\"\n"); out.append("sudo rm -rf "+binaryDirs.get(i)[0]+"\n");
if (!binaryDirs.get(i)[1].equals("2.0")) if (!binaryDirs.get(i)[1].equals("2.0"))
{ {
File appEntry = new File(System.getProperty("user.home")+"/.local/share/applications/docexplore-"+binaryDirs.get(i)[1]+".desktop"); File appEntry = new File(System.getProperty("user.home")+"/.local/share/applications/docexplore-"+binaryDirs.get(i)[1]+".desktop");
...@@ -172,7 +171,6 @@ public class Uninstaller ...@@ -172,7 +171,6 @@ public class Uninstaller
out.append("sudo rm -f \""+appEntry.getCanonicalPath()+"\"\n"); out.append("sudo rm -f \""+appEntry.getCanonicalPath()+"\"\n");
} }
} }
out.append("rm $0\n");
File script = OsUtils.buildDeferredScript(".docexplore-uninstall.sh", out.toString()); File script = OsUtils.buildDeferredScript(".docexplore-uninstall.sh", out.toString());
JOptionPane.showMessageDialog(null, Lang.s("uninstallExitMessage")); JOptionPane.showMessageDialog(null, Lang.s("uninstallExitMessage"));
Runtime.getRuntime().exec(new String [] { Runtime.getRuntime().exec(new String [] {
......
<version> <version>
<major>3</major> <major>3</major>
<minor>0</minor> <minor>0</minor>
<build>31</build> <build>33</build>
</version> </version>
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment