Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 21st August 2009, 23:23   #1
trumpetinc
Junior Member
 
Join Date: Oct 2007
Posts: 6
Easy, automated download and installation for Java Runtime

The attached makes adding auto-JRE detection, download and installation easy.

See JREDyna Wiki Page for details


I look forward to comments and suggestions for improvements.

- Kevin

PS - I can't seem to figure out how to get that URL link to work! Here's the link without http just to get it working: nsis.sourceforge.net/Java_Runtime_Environment_Dynamic_Installer
Attached Files
File Type: zip jredyna.zip (4.2 KB, 174 views)
trumpetinc is offline   Reply With Quote
Old 22nd August 2009, 02:59   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,811
Yeah, you need x number of posts before you can post URL's

http://nsis.sourceforge.net/Java_Run...amic_Installer

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 24th August 2009, 21:21   #3
trumpetinc
Junior Member
 
Join Date: Oct 2007
Posts: 6
Thanks, Anders - that makes sense (although it would have been nice if the forum software issued a warning, eh?)

I spent a lot of time fighting the system trying to get the Wiki page looking right, and the forum post. It's a shame that there isn't an easily accessible primer for this sort of thing (just figuring out how to upload a file for the Wiki took quite some doing). This has to be some level of barrier to entry for folks wanting to share their work. But I know that we all do what we can - and for this particular contribution, I was more than willing to go through the learning curve.

Maybe I should put together a Wiki page on tips and tricks to share solutions on the Wiki :-)
trumpetinc is offline   Reply With Quote
Old 24th August 2009, 21:45   #4
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,811
NSIS main page, click FAQ: http://nsis.sourceforge.net/FAQ (At the bottom you will find "Uploading files")

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 18th January 2012, 18:07   #5
tdcolvin
Junior Member
 
Join Date: Jan 2012
Posts: 1
Update for W2k3

Hi,

Registered here just to say -- Windows 2003 seems to require lowercase /s and /l arguments. Otherwise you just get an ugly Windows Installer dialog saying "Invalid command line parameters".

So I changed the ExecWait line to:

ExecWait '"$TEMP\jre_setup.exe" /s REBOOT=Suppress JAVAUPDATE=0 WEBSTARTICON=0 /l \"$TEMP\jre_setup.log\"' $0

And it now works fine. Not sure how to upload yet, but hope that helps.

- Tom
tdcolvin is offline   Reply With Quote
Old 19th April 2012, 06:19   #6
EolSC
Junior Member
 
Join Date: Apr 2012
Posts: 2
Installer script modification

Hi, Kevin!
I've used your script for my open-source application installer, thank you for your great work. But I had to improve it a little to work on modern OS.
For example, I added check if we' re running installer on x64 so we should
read registry in x64 mode.
code:
${If} ${RunningX64} ;if it's x64 OS
SetRegView 64 ; change registry view mode for proper x64 JRE detection
${EndIf}

ReadRegStr $1 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment" "CurrentVersion"
StrCmp $1 "" DetectTry2
ReadRegStr $2 HKLM "SOFTWARE\JavaSoft\Java Runtime Environment\$1" "JavaHome"
StrCmp $2 "" DetectTry2
Goto GetJRE
; lots of detection code skipped
.
.
.
DetectJREEnd:

${If} ${RunningX64}
SetRegView 32 ; return to x32 view mode
${EndIf}


So, post me a message if you are interested, I 'd like to share my improvements with others and add modified version to nsis.wiki
EolSC is offline   Reply With Quote
Old 19th April 2012, 11:08   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,216
You do not need to do the RunningX64 test as SetRegView has no effect on a 32-bit OS (you're just adding 2 unnecessary System plug-in calls per usage).

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 19th April 2012, 15:51   #8
trumpetinc
Junior Member
 
Join Date: Oct 2007
Posts: 6
EolSC - I've thought on this a bit...

There are times when detecting 32 bit JVM is desirable, even on 64 bit systems (for example, we have a number of applications that use 32 bit JNI dlls). To incorporate this, we'd need to be somewhat intelligent about when we do or do not do the check in the 64 bit registry branches.

It seems to me that if your installer is wanting the 64 bit JVM installed, then you probably want the entire installer working with the 64 bit area of the registry. If that's the case, then you should probably be calling SetRegView 64 in the main installer (and not having this call in the area specific to download of the 64 bit JVM)...

Further, explicitly changing the registry view in a library like this could mess people up who *have* set the registry view elsewhere. If we are going to do this inside the library, then we'd have to capture the registry view before and set it back to it's prior state afterwards.

Is there really a need to do this check inside the library itself?
trumpetinc is offline   Reply With Quote
Old 20th April 2012, 06:14   #9
EolSC
Junior Member
 
Join Date: Apr 2012
Posts: 2
x64 checks

Thanks for your replies, now I understand where I'm missing the point. Surely it was a bad idea to mess up library code, I'll move all checks to main installer and clean up unnecessary checks.
EolSC is offline   Reply With Quote
Old 20th April 2012, 13:31   #10
trumpetinc
Junior Member
 
Join Date: Oct 2007
Posts: 6
Hah - in this particular case, it's probably best to do the check elsewhere, but there is *nothing* wrong with messing with the library code, trying out new things, then discussing them in these forums. That's where cool new ideas came from, and I'm delighted that you are willing to poke at it and share your results!
trumpetinc is offline   Reply With Quote
Reply
Go Back   Winamp 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