diff --git a/vasl_templates/webapp/static/help/index.html b/vasl_templates/webapp/static/help/index.html index 863ad9f..17f14d4 100644 --- a/vasl_templates/webapp/static/help/index.html +++ b/vasl_templates/webapp/static/help/index.html @@ -139,7 +139,8 @@ Configuring the program VASL module: C:\bin\vasl\vasl-6.6.1.vmod VASL extensions: C:\bin\vasl\extensions\ VASL boards: C:\bin\vasl\boards\ - Java: C:\Program Files\VASSAL-3.4.6\jre\bin\java.exe + Java: C:\Program Files\VASSAL-3.4.6\jre\bin\java.exe +
If you're on Windows, you can leave this field blank,
and the version of Java that comes with VASSAL will be used.
Web driver: C:\bin\geckodriver.exe For the webdriver, download and unpack one of the following: diff --git a/vasl_templates/webapp/utils.py b/vasl_templates/webapp/utils.py index a99ea00..688c994 100644 --- a/vasl_templates/webapp/utils.py +++ b/vasl_templates/webapp/utils.py @@ -235,6 +235,10 @@ def parse_int( val, default=None ): except (ValueError, TypeError): return default +def is_windows(): + """Check if we're running on Windows.""" + return os.name == "nt" + # --------------------------------------------------------------------- def compare_version_strings( lhs, rhs ): diff --git a/vasl_templates/webapp/vassal.py b/vasl_templates/webapp/vassal.py index 48cb23b..ec0810f 100644 --- a/vasl_templates/webapp/vassal.py +++ b/vasl_templates/webapp/vassal.py @@ -17,7 +17,7 @@ from flask import request, jsonify from vasl_templates.webapp import app, globvars from vasl_templates.webapp.config.constants import BASE_DIR, IS_FROZEN -from vasl_templates.webapp.utils import TempFile, SimpleError, compare_version_strings +from vasl_templates.webapp.utils import TempFile, SimpleError, compare_version_strings, is_windows from vasl_templates.webapp.webdriver import WebDriver from vasl_templates.webapp.vasl_mod import get_reverse_remapped_gpid @@ -393,6 +393,11 @@ class VassalShim: if compare_version_strings( mo.group(), "3.3.0" ) < 0: # we're using a legacy version of VASSAL - use Java 8 java_path = java8_path + if not java_path and is_windows(): + # we're on Windows - try to use the Java that is now bundled with VASSAL + fname = os.path.join( self._get_vassal_dir(), "jre/bin/java.exe" ) + if os.path.isfile( fname ): + java_path = fname if not java_path: java_path = "java" # nb: this must be in the PATH