Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Use a simpler, more reliable method to locate java
  • Loading branch information
LadyCailin committed Feb 13, 2021
1 parent 6f5e1d8 commit e9e5cc5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 30 deletions.
Binary file modified src/installer/Windows/MethodScriptInstaller.exe
Binary file not shown.
34 changes: 6 additions & 28 deletions src/installer/Windows/installer.nsi
Expand Up @@ -273,32 +273,10 @@ Section un.DoUninstallerUninstall
SectionEnd

Function _FindJava
StrCpy $1 "SOFTWARE\JavaSoft\Java Runtime Environment"
StrCpy $2 0
ReadRegStr $2 HKLM "$1" "CurrentVersion"
StrCmp $2 "" DetectTry2 JRE
JRE:
ReadRegStr $5 HKLM "$1\$2" "JavaHome"
StrCmp $5 "" DetectTry2 GetValue

DetectTry2:
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Development Kit" "CurrentVersion"
StrCmp $2 "" NoJava JDK
JDK:
ReadRegStr $5 HKLM "SOFTWARE\JavaSoft\Java Development Kit\$2" "JavaHome"
StrCmp $5 "" NoJava GetValue

GetValue:
StrCpy $JavaInstallationPath $5
DetailPrint "Javahome value: $JavaInstallationPath"
Goto done

NoJava:
DetailPrint "No Java installation detected."
# Install Java
StrCpy $JavaInstallationPath ""
Goto done

done:
#$JavaInstallationPath should contain the system path to Java
ExecWait "java -version" $0
${if} $0 == "0"
StrCpy $JavaInstallationPath "java"
${else}
StrCpy $JavaInstallationPath ""
${endif}
FunctionEnd
4 changes: 2 additions & 2 deletions src/main/resources/siteDeploy/VersionFrontPage
Expand Up @@ -50,8 +50,8 @@ On Unix systems, you'll need to run the command with sudo. The installer will in
a file will run that file, and using ''mscript -- '' followed by a verb (such as help) will run the cmdline utilities.

==== Windows ====
The manual installation instructions are still valid if you wish to customize your install, but for Windows, you can
use the pre-packaged standalone installer, found [https://github.com/EngineHub/CommandHelper/releases/download/win-installer-v1.0.0/MethodScriptInstaller.exe here]
{{TakeNote|text=The manual installation instructions are still valid if you wish to customize your install, but for Windows, you can
use the pre-packaged standalone installer, found [https://github.com/EngineHub/CommandHelper/releases/download/win-installer-v.1.0.1/MethodScriptInstaller.exe here].}}

On Windows systems, you'll need to have launched your command prompt as Administrator. (To install on Windows
Subsystem for Linux, follow the same instructions as for Unix.) A program ''mscript'' will be installed on your
Expand Down

0 comments on commit e9e5cc5

Please sign in to comment.