Skip to content

Commit

Permalink
update deploy improvements for windows - ready for release now :-)
Browse files Browse the repository at this point in the history
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4849 6c8d7289-2bf4-0310-a012-ef5d649a1542
  • Loading branch information
lotus committed May 24, 2008
1 parent fd8bd5d commit f284386
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
5 changes: 4 additions & 1 deletion htroot/ConfigUpdate_p.java
Expand Up @@ -149,7 +149,10 @@ public static serverObjects respond(httpHeader header, serverObjects post, serve
downloadedreleases.add(release);
} catch (RuntimeException e) {
// 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();
Expand Down
2 changes: 1 addition & 1 deletion source/de/anomic/server/serverSystem.java
Expand Up @@ -348,7 +348,7 @@ public static void execAsynchronous(File scriptFile) throws IOException {
String script = null;
if(isWindows){
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(" ", "\\ ");
} else { // unix/linux
starterFileExtension = ".starter.sh";
Expand Down
9 changes: 5 additions & 4 deletions source/de/anomic/yacy/yacyVersion.java
Expand Up @@ -373,7 +373,7 @@ public static void restart() {
String apphome = sb.getRootPath().toString();

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";
if (startType.exists()) starterFile = "startYACY_noconsole.bat"; // startType noconsole

Expand Down Expand Up @@ -451,8 +451,10 @@ public static void deployRelease(File releaseFile) {
String script = null;
String scriptFileName = null;
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 =
// TODO: does YaCy delete this file after 2nd update-shutdown? "Die Batchdatei kann nicht gefunden werden."
"@echo off" + serverCore.LF_STRING +
"title YaCy updater" + serverCore.LF_STRING +
"echo YACY UPDATER" + serverCore.LF_STRING +
Expand All @@ -462,7 +464,6 @@ public static void deployRelease(File releaseFile) {
":WAIT" + serverCore.LF_STRING +
"ping -n 2 127.0.0.1 >nul" + 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 +

"cd yacy" + serverCore.LF_STRING +
Expand All @@ -481,7 +482,7 @@ public static void deployRelease(File releaseFile) {

":END" + 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";
} else { // unix/linux
script =
Expand Down

0 comments on commit f284386

Please sign in to comment.