update deploy improvements for windows - ready for release now :-)

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4849 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lotus 17 years ago
parent fd8bd5d0d1
commit f284386b63

@ -149,7 +149,10 @@ public class ConfigUpdate_p {
downloadedreleases.add(release); downloadedreleases.add(release);
} catch (RuntimeException e) { } catch (RuntimeException e) {
// not a valid release // not a valid release
new File(sb.releasePath, downloaded[j]).deleteOnExit(); // can be also a restart- or deploy-file // can be also a restart- or deploy-file
File invalid = new File(sb.releasePath, downloaded[j]);
if (!invalid.getName().contains(".bat")) // Windows doesn't like deleted scripts
invalid.deleteOnExit();
} }
} }
dflt = (downloadedreleases.size() == 0) ? null : downloadedreleases.last(); dflt = (downloadedreleases.size() == 0) ? null : downloadedreleases.last();

@ -348,7 +348,7 @@ public final class serverSystem {
String script = null; String script = null;
if(isWindows){ if(isWindows){
starterFileExtension = ".starter.bat"; starterFileExtension = ".starter.bat";
// TODO: use /K to debug, /C for release // use /K to debug, /C for release
script = "start /MIN CMD /C " + scriptFile.getAbsolutePath().replaceAll(" ", "\\ "); script = "start /MIN CMD /C " + scriptFile.getAbsolutePath().replaceAll(" ", "\\ ");
} else { // unix/linux } else { // unix/linux
starterFileExtension = ".starter.sh"; starterFileExtension = ".starter.sh";

@ -373,7 +373,7 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
String apphome = sb.getRootPath().toString(); String apphome = sb.getRootPath().toString();
if (serverSystem.isWindows) { if (serverSystem.isWindows) {
File startType = new File(sb.getRootPath(), "DATA/yacy.noconsole"); File startType = new File(sb.getRootPath(), "DATA/yacy.noconsole".replace("/", File.separator));
String starterFile = "startYACY.bat"; String starterFile = "startYACY.bat";
if (startType.exists()) starterFile = "startYACY_noconsole.bat"; // startType noconsole if (startType.exists()) starterFile = "startYACY_noconsole.bat"; // startType noconsole
@ -451,8 +451,10 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
String script = null; String script = null;
String scriptFileName = null; String scriptFileName = null;
if(serverSystem.isWindows){ if(serverSystem.isWindows){
File startType = new File(sb.getRootPath(), "DATA/yacy.noconsole".replace("/", File.separator));
String starterFile = "startYACY.bat";
if (startType.exists()) starterFile = "startYACY_noconsole.bat"; // startType noconsole
script = script =
// TODO: does YaCy delete this file after 2nd update-shutdown? "Die Batchdatei kann nicht gefunden werden."
"@echo off" + serverCore.LF_STRING + "@echo off" + serverCore.LF_STRING +
"title YaCy updater" + serverCore.LF_STRING + "title YaCy updater" + serverCore.LF_STRING +
"echo YACY UPDATER" + serverCore.LF_STRING + "echo YACY UPDATER" + serverCore.LF_STRING +
@ -462,7 +464,6 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
":WAIT" + serverCore.LF_STRING + ":WAIT" + serverCore.LF_STRING +
"ping -n 2 127.0.0.1 >nul" + serverCore.LF_STRING + "ping -n 2 127.0.0.1 >nul" + serverCore.LF_STRING +
"IF exist ..\\yacy.running goto WAIT" + serverCore.LF_STRING + "IF exist ..\\yacy.running goto WAIT" + serverCore.LF_STRING +
// Error: "Die Batchdatei kann nicht gefunden werden."
"IF not exist yacy goto NODATA" + serverCore.LF_STRING + "IF not exist yacy goto NODATA" + serverCore.LF_STRING +
"cd yacy" + serverCore.LF_STRING + "cd yacy" + serverCore.LF_STRING +
@ -481,7 +482,7 @@ public final class yacyVersion implements Comparator<yacyVersion>, Comparable<ya
":END" + serverCore.LF_STRING + ":END" + serverCore.LF_STRING +
"cd " + apphome + serverCore.LF_STRING + "cd " + apphome + serverCore.LF_STRING +
"start /MIN CMD /C startYACY.bat" + serverCore.LF_STRING; "start /MIN CMD /C " + starterFile + serverCore.LF_STRING;
scriptFileName = "update.bat"; scriptFileName = "update.bat";
} else { // unix/linux } else { // unix/linux
script = script =

Loading…
Cancel
Save