From b1a8ec4952d3d4640d2e80e66c14cca2065db6a0 Mon Sep 17 00:00:00 2001 From: Jason Boyer Date: Thu, 25 Jan 2018 23:20:17 -0500 Subject: [PATCH] LP1743604: Try to find Java automatically Starting sometime in the 1.8 timeframe Java installations on Windows are making use of unix- style symlinks available in NTFS to keep the most reecnt version installed available at a known location. We may as well look there if the path isn't set correctly for some reason. Signed-off-by: Jason Boyer Signed-off-by: Chris Sharp Signed-off-by: Galen Charlton --- extension/app/manifest.json | 2 +- hatch.bat | 22 +++++++++++++++++++++- installer/windows/defines.nsh | 2 +- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/extension/app/manifest.json b/extension/app/manifest.json index a54b37b317..e953e356a6 100644 --- a/extension/app/manifest.json +++ b/extension/app/manifest.json @@ -1,6 +1,6 @@ { "name": "Hatch Native Messenger", - "version": "0.1.4", + "version": "0.1.5", "manifest_version": 2, "description": "Relays messages to/from Hatch.", "icons": { diff --git a/hatch.bat b/hatch.bat index 9e381514b4..cb3cc6bf92 100755 --- a/hatch.bat +++ b/hatch.bat @@ -2,6 +2,11 @@ REM Windows Hatch Execution Script REM @echo off required for STDIO to work with the browser. +REM NOTE: Do not EVER set ERRORLEVEL for any reason; it's a passthrough variable that takes on the current value +REM of the errorlevel return status but if you assign to it that magic passthrough is broken and it's just set to that value. +REM This is necessary to do sensible comparisons against it. (such as EQU) The 'if errorlevel' construct is completely bananas. +REM Also: automatic path testing only looks for 'java' - if you don't have the JDK in your path you'll need to fix that yourself. + REM Assume java executables are in our path SET JAVA=java SET JAVAC=javac @@ -13,6 +18,22 @@ REM SET JAVA=%JAVA_HOME%\bin\java REM SET JAVAC=%JAVA_HOME%\bin\javac REM SET JAR=%JAVA_HOME%\bin\jar +REM Is anyone there? +%JAVA% --dry-run -cp "lib\*" org.evergreen_ils.hatch.Hatch 2>nul + +IF %ERRORLEVEL% EQU 0 GOTO Huzzah + +REM Are you still there? +SET JAVA=%PROGRAMDATA%\Oracle\Java\javapath\java +%JAVA% --dry-run -cp "lib\*" org.evergreen_ils.hatch.Hatch 2>nul + +IF %ERRORLEVEL% EQU 0 GOTO Huzzah + +REM I don't blame you +EXIT %ERRORLEVEL% + +REM There you are. +:Huzzah IF "%1" == "compile" ( @@ -42,4 +63,3 @@ IF "%1" == "compile" ( ) ) - diff --git a/installer/windows/defines.nsh b/installer/windows/defines.nsh index 5de6a28677..8afcac3c44 100644 --- a/installer/windows/defines.nsh +++ b/installer/windows/defines.nsh @@ -14,7 +14,7 @@ ; Version numbers should be integers !define VERSIONMAJOR 0 !define VERSIONMINOR 1 -!define VERSIONBUILD 4 +!define VERSIONBUILD 5 !define FULLVERSION "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}" ;--------------------------- ; Add Remove info -- 2.11.0