Old 11th February 2020, 16:21   #1
ikus060
Junior Member
 
Join Date: Sep 2016
Posts: 4
JRE Download failed

Hello,

I'm using NSIS v2 from Debian Stretch for quite a while now as an installer. As part of the installation process, I've include this addons to download a JRE from https://nsis.sourceforge.io/File:JREDyna_Inetc.nsh

Recently, I'm running into trouble when using this plugins. It fail downloading the JRE proper with the error:

code:
Détection de la version de JRE
JRE Version detection complete... Aucun JRE trouvé
Téléchargement de JRE à partir de http://javadl.sun.com/webapps/download/AutoDL?BundleId=98428
Download result = SendRequest Error



I've already verify, the URL "http://javadl.sun.com/webapps/download/AutoDL?BundleId=98428" is still working. I'm not sure what's wrong.

Help would be appreciated. Thanks

For reference here the files used to generate the packages:

https://github.com/ikus060/minarca/t.../src/main/nsis
ikus060 is offline   Reply With Quote
Old 11th February 2020, 20:33   #2
Nutzzz
Member
 
Join Date: May 2007
Location: Orange County, CA, U.S.A.
Posts: 63
Until recently, I used that header (though I've modified it a bit) and it worked for me. I suspect you just need to change your URL to https.

However, that version of JRE8 you link to is quite old, and Sun is stopping support and public updates in any case. It's probably time to switch to a JRE based on OpenJDK at this point. You could either use jlink to create your own custom JRE with just the components you need, or just grab a JRE msi from AdoptOpenJDK.
Nutzzz is online now   Reply With Quote
Old 13th February 2020, 16:46   #3
ikus060
Junior Member
 
Join Date: Sep 2016
Posts: 4
Quote:
Originally Posted by Nutzzz View Post
Until recently, I used that header (though I've modified it a bit) and it worked for me. I suspect you just need to change your URL to https.

However, that version of JRE8 you link to is quite old, and Sun is stopping support and public updates in any case. It's probably time to switch to a JRE based on OpenJDK at this point. You could either use jlink to create your own custom JRE with just the components you need, or just grab a JRE msi from AdoptOpenJDK.
Hi Nutzzz,

Thanks for you reply. I will try to change the URL for https and update the JAVA version. As for moving forward with OpenJDK I would need some heaer file to reproduce it.

Do you mind sharing your header with me for both. Oracle JVM and OpenJDK ?

Thanks
ikus060 is offline   Reply With Quote
Old 14th February 2020, 18:44   #4
Nutzzz
Member
 
Join Date: May 2007
Location: Orange County, CA, U.S.A.
Posts: 63
For the Oracle one, you don't need an updated header; you can just update JRE_URL.

The nice thing about using OpenJDK is that you're permitted to redistribute it more flexibly. Our jlink'd slim JRE is only 38MB extracted, so rather than dealing with downloading it we just package the files with the installer. Also, as a support matter, it's sometimes nice to have a known quantity for the version of JRE being used.

If you would rather download an OpenJDK JRE with JREDyna_Inetc, you would change JRE_URL to e.g. the current latest LTS release, which is 11.0.6+10. For x64 the hotspot one is:
https://github.com/AdoptOpenJDK/open..._11.0.6_10.msi
Or for x86:
https://github.com/AdoptOpenJDK/open..._11.0.6_10.msi.

You'll then set the Inetc::get line to download an .msi file instead of an .exe.

Then, assuming you want to enforce the optional entries to set JAVA_HOME and add it to the path, etc., then you would do so by installing it with:
code:
ExecWait 'msiexec.exe /i <file>.msi /passive ADDLOCAL=FeatureMain,FeatureEnvironment,FeatureJavaHome,FeatureJarFileRunWith INSTALLDIR=<path>' $0

Note: Change "/passive" to "/quiet" for silent installs.
Nutzzz is online now   Reply With Quote
Old 14th February 2020, 18:53   #5
ikus060
Junior Member
 
Join Date: Sep 2016
Posts: 4
Finally, I figure out the problem is related to winInet security issue. raisd here
http://forums.winamp.com/showthread....198596&page=14

I've added this to my .nsi

; Download and install java and tweak the secure protocol for download.
; http://forums.winamp.com/showthread....198596&page=14
!define IE_NETCONFIG "Software\Microsoft\Windows\CurrentVersion\Internet Settings"
ReadRegDWORD $9 HKCU "${IE_NETCONFIG}" "SecureProtocols"
WriteRegDWORD HKCU "${IE_NETCONFIG}" "SecureProtocols" 0x00000A80
call DownloadAndInstallJREIfNecessary
WriteRegDWORD HKCU "${IE_NETCONFIG}" "SecureProtocols" $9
ikus060 is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump