Skip to content

Commit

Permalink
Fix OpenWayback startup to use JDK from WAIL
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed May 21, 2019
1 parent 90cadc1 commit bd8c30d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 46 deletions.
3 changes: 3 additions & 0 deletions bundledApps/WAIL.py
Expand Up @@ -1511,6 +1511,9 @@ def fixAsync(self, cb=None):
# config.serviceEnabledLabel_FIXING)
mainAppWindow.advConfig.servicesPanel.setWaybackStatus(config.serviceEnabledLabel_FIXING)
cmd = config.tomcatPathStart
mainAppWindow.basicConfig.ensureEnvironmentVariablesAreSet()
print("CCCMD")
print(cmd)
ret = subprocess.Popen(cmd)
time.sleep(3)
wx.CallAfter(mainAppWindow.advConfig.servicesPanel.updateServiceStatuses)
Expand Down
3 changes: 3 additions & 0 deletions bundledApps/WAILConfig.py
Expand Up @@ -286,3 +286,6 @@
archivesJSON = wailPath + "\\config\\archives.json"
tomcatPathStart = wailPath + "\\support\\catalina_start.bat"
tomcatPathStop = wailPath + "\\support\\catalina_stop.bat"

host_crawler = 'localhost'
host_replay = 'localhost'
49 changes: 3 additions & 46 deletions support/catalina_start.bat
Expand Up @@ -13,60 +13,17 @@ set FINDCMD=FIND /I

FOR /F "tokens=2 delims= " %%A IN ('%TASKCMD% ^| %FINDCMD% "%~0"') DO SET MyPID=%%A

echo.
echo [WAIL]: Searching for JDK or JRE HOME with reg query ...
set JDKKeyName64=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Development Kit
set JDKKeyName32=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Development Kit
set JREKeyName64=HKEY_LOCAL_MACHINE\SOFTWARE\JavaSoft\Java Runtime Environment
set JREKeyName32=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\JavaSoft\Java Runtime Environment

reg query "%JDKKeyName64%" /s
if %ERRORLEVEL% EQU 1 (
echo . [WAIL]: Could not find 32 bit or 64 bit JDK
echo . [WAIL]: Looking for 32 bit JDK on 64 bit machine
goto FINDJDK32
)
set KeyName=%JDKKeyName64%
goto JDKRUN

:FINDJDK32
reg query "%JDKKeyName32%" /s
if %ERRORLEVEL% EQU 1 (
echo . [WAIL]: Could not find 32 bit JDK
echo . [WAIL]: Looking for 32 bit or 64 bit JRE
goto FINDJRE64
)
set KeyName=%JDKKeyName32%
goto JDKRUN

:FINDJRE64
reg query "%JREKeyName64%" /s
if %ERRORLEVEL% EQU 1 (
echo . [WAIL]: Could not find 32 bit or 64 bit JRE
echo . [WAIL]: Looking for 32 bit JRE on 64 bit machine
goto FINDJRE32
)
set KeyName=%JREKeyName64%
goto JRERUN

:FINDJRE32
reg query "%JREKeyName32%" /s
if %ERRORLEVEL% EQU 1 (
echo . [WAIL]: Could not find 32 bit JRE
echo . [WAIL]: Could not set JAVA_HOME or JRE_HOME. Aborting
goto ENDERROR
)
set KeyName=%JREKeyName32%
goto JRERUN

:JDKRUN
echo.
echo [WAIL]: Using JDK
set "CURRENT_DIR=%cd%"
set "CATALINA_HOME=%CURRENT_DIR%\bundledApps\tomcat"
:Use WAIL's Java7
set "JAVA_HOME="%CURRENT_DIR%\bundledApps\Java\Windows\jdk1.7.0_80\"

set Cmd=reg query "%KeyName%" /s
for /f "tokens=2*" %%i in ('%Cmd% ^| find "JavaHome"') do set JAVA_HOME=%%j
set "CATALINA_HOME=%CURRENT_DIR%\bundledApps\tomcat"

echo.
echo [WAIL]: Seems fine!
Expand Down

0 comments on commit bd8c30d

Please sign in to comment.