Skip to content
Permalink
Browse files

Resume installer after installing Java

Closes #455
  • Loading branch information...
tresf committed Jun 6, 2019
1 parent 0e50839 commit 58c7b8b06eee77daed689fc850b2a1a61099ec14
Showing with 11 additions and 5 deletions.
  1. +6 −0 ant/windows/windows-keygen.js.in
  2. +5 −5 ant/windows/windows-packager.nsi.in
@@ -128,6 +128,12 @@ function java() {
if (!jreHome) {
try {
// AdoptOpenJDK adds java.exe to PATH

// Re-read PATH vars in case they've changed
var newPath = (shell.Environment("USER")("PATH") + ";" + shell.Environment("SYSTEM")("PATH")).replace(/;;/g, ";");
// Expand any %STRINGS% inside path and set for the next running process
shell.Environment("PROCESS")("PATH") = shell.ExpandEnvironmentStrings(newPath);

shell.Exec('java.exe'); // throws exception if not found
jreHome = "NOT_NEEDED";
regkey = "NOT_NEEDED";
@@ -102,17 +102,13 @@ Section

; Remove ${vendor.company} certificates
nsExec::ExecToLog "cscript.exe //NoLogo //E:jscript $\"$INSTDIR\auth\${windows.keygen.name}$\" $\"$INSTDIR$\" uninstall"

keygen:
; Exports a self-signed certificate and properties file
DetailPrint "Generating a unique certificate for HTTPS support..."
nsExec::ExecToLog "cscript.exe //NoLogo //E:jscript $\"$INSTDIR\auth\${windows.keygen.name}$\" $\"$INSTDIR$\" install"
Pop $0

${If} ${RunningX64}
${EnableX64FSRedirection}
${EndIf}

; Secure websockets is required, handle errors
${If} "$0" != "0"
${If} "$0" == "${windows.err.java}"
@@ -129,6 +125,10 @@ Section
${EndIf}
${EndIf}

${If} ${RunningX64}
${EnableX64FSRedirection}
${EndIf}

CreateShortCut "$SMPROGRAMS\${project.name}.lnk" "$INSTDIR\${project.filename}.exe" "" "$INSTDIR\${windows.icon}" 0

; Delete matching firewall rules

0 comments on commit 58c7b8b

Please sign in to comment.
You can’t perform that action at this time.