Archive: Trouble with Java Runtime Environment Dynamic Installer - the JRE install fails


Trouble with Java Runtime Environment Dynamic Installer - the JRE install fails
I have added Java Runtime Environment Dynamic Installer to my install and it seems to be working as expected except that the JRE dose not actually get installed. The Dynamic Installer page is displayed and it says it is downloading the JRE all the progress bars move along but at the end I get a message box that says:

"Unable to install Java - Setup will be aborted
The JRE setup has been abnormally interrupted - return code OK"

The detail error contains:
Detecting JRE Version
JRE Version detection complete - result = No JRE Found
About to download JRE from http://javadl.sun.com/webapps/downlo...BundleId=80814
Download result = OK
Launching JRE setup
Execute: "C:\Users\ileslie\AppData\Local\Temp\jre_setup.exe" /passive REBOOT=Suppress JAVAUPDATE=0 WEBSTARTICON=0 /L \"C:\Users\ileslie\AppData\Local\Temp\jre_setup.log\"
JRE Setup finished
Delete file: C:\Users\ileslie\AppData\Local\Temp\jre_Setup.exe

This is running in a Vista VM on my Windows 7 machine since I do not have a real computer that does not have Java installed already. I have admin privleges for the VM this happens if I run the install normally or with admin access.

Any help or advice would be appreciated,

Ian


What's with the backslashes on the log path in your command line? Please post your actual ExecWait code.

Stu


That is the log as reported by the Java Runtime Environment Dynamic Installer plug in (http://nsis.sourceforge.net/Java_Run....28Optional.29)

There is no ExecWait code in my part of the script.


There's an error in that header file. Remove those backslashes on the double quotes on lines 109 and 112. They don't need escaping, and besides, that is not the way to escape double quotes in NSIS script (you use $\").

Stu


Thanks for that

I tweaked the script but that changed nothing about the behaviour. I checked the specified log file but it did not exist so clearly the jre installer never got very far. I'm going to comment out the delete line and then manually try to run the JRE installer...

Detecting JRE Version
JRE Version detection complete - result = No JRE Found
About to download JRE from http://javadl.sun.com/webapps/downlo...BundleId=80814
Download result = OK
Launching JRE setup
Execute: "C:\Users\ileslie\AppData\Local\Temp\jre_setup.exe" /passive REBOOT=Suppress JAVAUPDATE=0 WEBSTARTICON=0 /L "C:\Users\ileslie\AppData\Local\Temp\jre_setup.log"
JRE Setup finished
Delete file: C:\Users\ileslie\AppData\Local\Temp\jre_Setup.exe


OK that worked - after the standard windows do you want to allow this program to run prompt. There is a plug in for that I believe. So, I guess that means I have to tweak this jre script some more.


If you are getting an elevation prompt then that means your own setup needs elevating first. To do that you need to add RequestExecutionLevel admin and then check in .onInit that the user is running as an administrator using the UserInfo plug-in.

Stu


OK thanks. Is there a way to only request elevation if the JRE needs to be installed? If the customer already has a valid JRE then nothing else about my install needs elevation for anything else. Is it possible to tweak the JRE dynamic installer script to request elevation for the setup it tries to run?


Originally posted by IanLes
OK thanks. Is there a way to only request elevation if the JRE needs to be installed? If the customer already has a valid JRE then nothing else about my install needs elevation for anything else. Is it possible to tweak the JRE dynamic installer script to request elevation for the setup it tries to run?
So you never write to HKLM/$programfiles/$windir? If so you could use "requestexecutionlevel highest" and if JRE is not installed and the UserInfo plugin tells you that you are not admin you bail out with an error message telling the user to restart the installer elevated.

Solved

Originally posted by Anders
So you never write to HKLM/$programfiles/$windir? If so you could use "requestexecutionlevel highest" and if JRE is not installed and the UserInfo plugin tells you that you are not admin you bail out with an error message telling the user to restart the installer elevated.
No need to write to the registry - this is a simple java app.

So that was a fix. I just elevated the execution level to test it and with admin it works. I'll fine tune things a bit, as you suggested. Thank you for your advice. Very helpful.

Ian