summaryrefslogtreecommitdiff
path: root/source/net
diff options
context:
space:
mode:
authorMichael Peter Christen <mc@yacy.net>2026-01-01 23:58:10 +0100
committerMichael Peter Christen <mc@yacy.net>2026-01-01 23:58:10 +0100
commit3ecb0b459ee8500aa721b4ee8804bbde6f5c9dc3 (patch)
tree1014e196905b23125437c0f5e45cf725e86cf5be /source/net
parentc5801d3215a0969bcf90fb2d882775302cd92f19 (diff)
fixed windows installer; updated download path for java installer
Diffstat (limited to 'source/net')
-rw-r--r--source/net/yacy/yacy.java44
1 files changed, 33 insertions, 11 deletions
diff --git a/source/net/yacy/yacy.java b/source/net/yacy/yacy.java
index 48c94fe26..1425b7976 100644
--- a/source/net/yacy/yacy.java
+++ b/source/net/yacy/yacy.java
@@ -718,9 +718,21 @@ public final class yacy {
final StringBuilder s = new StringBuilder(); for (final String a: args) s.append(a).append(" ");
yacyRelease.startParameter = s.toString().trim();
- // case for the application path if started normally with a jre command
- File applicationRoot = new File(System.getProperty("user.dir").replace('\\', '/'));
- File dataRoot = applicationRoot;
+ // case for the application path if started normally with a jre command
+ File applicationRoot = new File(System.getProperty("user.dir").replace('\\', '/'));
+ File dataRoot = applicationRoot;
+ final String dataRootOverrideProp = System.getProperty("yacy.data");
+ final String dataRootOverrideEnv = System.getenv("YACY_DATA");
+ final String dataRootOverride = (dataRootOverrideProp != null && !dataRootOverrideProp.isEmpty())
+ ? dataRootOverrideProp
+ : dataRootOverrideEnv;
+ if (dataRootOverride != null && !dataRootOverride.isEmpty()) {
+ dataRoot = new File(dataRootOverride);
+ if(!dataRoot.isAbsolute()) {
+ /* data root folder provided as a path relative to the user home folder */
+ dataRoot = new File(System.getProperty("user.home").replace('\\', '/'), dataRootOverride);
+ }
+ }
//System.out.println("args.length=" + args.length);
//System.out.print("args=["); for (int i = 0; i < args.length; i++) System.out.print(args[i] + ", "); System.out.println("]");
if ((args.length >= 1) && (args[0].toLowerCase(Locale.ROOT).equals("-startup") || args[0].equals("-start"))) {
@@ -745,14 +757,24 @@ public final class yacy {
}
preReadSavedConfigandInit(dataRoot);
startup(dataRoot, applicationRoot, startupMemFree, startupMemTotal, true);
- } else if ((args.length >= 1) && ((args[0].toLowerCase(Locale.ROOT).equals("-shutdown")) || (args[0].equals("-stop")))) {
- // normal shutdown of yacy
- if (args.length == 2) applicationRoot= new File(args[1]);
- shutdown(applicationRoot);
- } else if ((args.length >= 1) && (args[0].toLowerCase(Locale.ROOT).equals("-update"))) {
- // aut-update yacy
- if (args.length == 2) applicationRoot= new File(args[1]);
- update(applicationRoot);
+ } else if ((args.length >= 1) && ((args[0].toLowerCase(Locale.ROOT).equals("-shutdown")) || (args[0].equals("-stop")))) {
+ // normal shutdown of yacy
+ if (args.length == 2) {
+ dataRoot = new File(args[1]);
+ if(!dataRoot.isAbsolute()) {
+ dataRoot = new File(System.getProperty("user.home").replace('\\', '/'), args[1]);
+ }
+ }
+ shutdown(dataRoot);
+ } else if ((args.length >= 1) && (args[0].toLowerCase(Locale.ROOT).equals("-update"))) {
+ // aut-update yacy
+ if (args.length == 2) {
+ dataRoot = new File(args[1]);
+ if(!dataRoot.isAbsolute()) {
+ dataRoot = new File(System.getProperty("user.home").replace('\\', '/'), args[1]);
+ }
+ }
+ update(dataRoot);
} else if ((args.length >= 1) && (args[0].toLowerCase(Locale.ROOT).equals("-version"))) {
// show yacy version
System.out.println(copyright);