Skip to content

Commit

Permalink
Rm Java checks for #398
Browse files Browse the repository at this point in the history
  • Loading branch information
machawk1 committed May 21, 2019
1 parent 9f0e05a commit 8fdc085
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 32 deletions.
44 changes: 12 additions & 32 deletions bundledApps/WAIL.py
Original file line number Diff line number Diff line change
Expand Up @@ -466,52 +466,32 @@ def ensureEnvironmentVariablesAreSet(self):
"""Check system to verify that Java variables have been set.
Notify the user if not and initialize the Java installation process.
"""
if util.is_windows() or util.is_linux():
return # Allow windows to proceed w/o java checks for now.
#if util.is_windows() or util.is_linux():
# return True # Allow windows to proceed w/o java checks for now.

JAVA_HOME_defined = 'JAVA_HOME' in os.environ
JRE_HOME_defined = 'JRE_HOME' in os.environ
if not JAVA_HOME_defined or not JRE_HOME_defined:
jreHome = ''
javaHome = ''
jdkPath = ''
if util.is_macOS():
if util.is_macOS() or util.is_windows():
print("JAVA HOME")
print(os.environ["JAVA_HOME"])
jdkPath = config.jdkPath
jreHome = config.jreHome
javaHome = config.javaHome
print("Setting JDK Paths!")
print(jdkPath)
print("JAVA HOME")
print(os.environ["JAVA_HOME"])
else: # Win, incomplete
# os.environ['PATH'] # java8 does not use JRE_HOME, JAVA_HOME
pass

# Find java 1.7
# /usr/libexec/java_home -v 1.7
jdkInstalled = os.path.isdir(jdkPath)

if jdkInstalled:
os.environ["JAVA_HOME"] = javaHome
os.environ["JRE_HOME"] = jreHome
self.ensureEnvironmentVariablesAreSet()
else:
d = wx.MessageDialog(self, config.msg_installJava,
"Install now?", config.wail_style_yesNo)
result = d.ShowModal()
d.Destroy()

if result == wx.ID_NO:
sys.exit()

prog = wx.ProgressDialog(
config.msg_java_resolving,
config.msg_java7_downloading,
maximum=100,
style=wx.PD_APP_MODAL|wx.PD_SMOOTH|wx.PD_CAN_ABORT|wx.PD_AUTO_HIDE)

prog.Pulse()
prog.Show()

thread.start_new_thread(self.installJava, (prog,))

return False
os.environ["JAVA_HOME"] = javaHome
os.environ["JRE_HOME"] = jreHome
self.ensureEnvironmentVariablesAreSet()
return True

def installJava(self, prog):
Expand Down
1 change: 1 addition & 0 deletions bundledApps/WAILConfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -273,6 +273,7 @@
wailPath = "C:\\wail"

aboutWindow_iconPath = wailPath + aboutWindow_iconPath
jdkPath = wailPath + "\\bundledApps\\Java\\Windows\\jdk1.7.0_80.jdk\\"

heritrixPath = wailPath + "\\bundledApps\\heritrix-3.2.0\\"
heritrixBinPath = heritrixPath + "\\bin\\heritrix.cmd"
Expand Down

0 comments on commit 8fdc085

Please sign in to comment.