lantern icon indicating copy to clipboard operation
lantern copied to clipboard

Check for java during updating to prevent re-install(download) the java

Open narimangharib opened this issue 13 years ago • 20 comments

I notice when you want to update lantern, during installation java is re-downloading for users. I think we can decrease the size of software after we have installed java on the user's system.

narimangharib avatar Dec 01 '13 01:12 narimangharib

I can confirm this - seems like a bug. I think we are trying to check for Java? But it seems to often redownload it, even when Lantern itself has already installed java.

cholmes avatar Dec 01 '13 02:12 cholmes

According to the Install4J docs, Install4J should give the user the option of locating their existing JRE. Are you seeing this?

oxtoacart avatar Jan 02 '14 14:01 oxtoacart

What I'd really like to do is just run the java -version command in a shell and check that. Unfortunately, I can't seem to figure out a way to do that with Install4J. Will keep looking.

oxtoacart avatar Jan 02 '14 14:01 oxtoacart

@myleshorton One way that I could do this is to have the existing installer not require any Java version, but have it run a script that checks for Java by just executing the Java command. If Java isn't found, it could run another installer that specifies a Java requirement. A little twisted, but I can't think of any other way to do it with Install4J. Thoughts?

oxtoacart avatar Jan 02 '14 15:01 oxtoacart

I didn't see that option. after re-installing lantern the java automatically start to re-download and re-install it self.

narimangharib avatar Jan 03 '14 00:01 narimangharib

Thanks Nariman! I need to see if maybe this is a setting or something.

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Thu, Jan 2, 2014 at 6:20 PM, narimangharib [email protected]:

I didn't see that option. after re-installing lantern the java automatically start to re-download and re-install it self.

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/lantern/issues/1196#issuecomment-31496892 .

oxtoacart avatar Jan 03 '14 00:01 oxtoacart

So I believe the problem is as follows:

  1. Install4J assumes you're installing an application that needs Java, so has you specify your minimum version
  2. The installer wrapper requires Java 6, and installs Java 6 if you don't have it already (if you already have Java 6, everything just continues)
  3. The main installer requires Java 7 and downloads and installs Java 7 if you don't have it. So, if you don't have Java 6 or Java 7 to begin with, it will install both Java 6 and Java 7.

In a prior iteration, we changed the installer wrapper to also require Java 7, but that was the version that started having all sorts of problems on some systems, apparently because of that change. Another option would be to just have both the wrapper and main installer only require java 6, but the problem is that the bugs users have had with installers have been hard to reproduce.

All that said, the above is all specific to the install4j versions -- so OSX and Ubuntu. Windows should not have this issue at all, and this should only happen if you're installing Lantern from different accounts on the same Windows system.

myleshorton avatar Jan 03 '14 02:01 myleshorton

@myleshorton Good point, I had forgotten that we're using NSIS on Windows.

@narimangharib @cholmes What operating systems have you seen this problem on?

oxtoacart avatar Jan 03 '14 03:01 oxtoacart

well, I don't remember i checked it with windows or not, but i saw this problem with mac.

narimangharib avatar Jan 03 '14 14:01 narimangharib

@myleshorton Would you like to change the Java requirement for the main installer to Java 6?

oxtoacart avatar Jan 07 '14 15:01 oxtoacart

java.io.FileNotFoundException: /Applications/Wrapper.app/Contents/Resources/app/.install4j/response.varfile (Permission denied) at java.io.FileOutputStream.open(Native Method) at java.io.FileOutputStream.(FileOutputStream.java:212) at java.io.FileOutputStream.(FileOutputStream.java:165) at com.install4j.runtime.beans.actions.InstallFilesAction.writeResponseFile(Unknown Source) at com.install4j.runtime.beans.actions.InstallFilesAction.install(Unknown Source) at com.install4j.runtime.installer.InstallerContextImpl$2.fetchValue(Unknown Source) at com.install4j.runtime.installer.helper.comm.actions.FetchObjectAction.execute(Unknown Source) at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionDirect(Unknown Source) at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionInt(Unknown Source) at com.install4j.runtime.installer.helper.comm.HelperCommunication.executeActionChecked(Unknown Source) at com.install4j.runtime.installer.helper.comm.HelperCommunication.fetchObjectChecked(Unknown Source) at com.install4j.runtime.installer.InstallerContextImpl.performActionIntStatic(Unknown Source) at com.install4j.runtime.installer.InstallerContextImpl.performActionInt(Unknown Source) at com.install4j.runtime.installer.ContextImpl.performAction(Unknown Source) at com.install4j.runtime.installer.controller.Controller.executeActions(Unknown Source) at com.install4j.runtime.installer.controller.Controller.handleCommand(Unknown Source) at com.install4j.runtime.installer.controller.Controller.start(Unknown Source) at com.install4j.runtime.installer.Installer.runInProcess(Unknown Source) at com.install4j.runtime.installer.Installer.main(Unknown Source) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at com.exe4j.runtime.LauncherEngine.launch(Unknown Source) at com.install4j.runtime.launcher.MacLauncher.main(Unknown Source)

System properties:

java.runtime.name=Java(TM) SE Runtime Environment exe4j.moduleName=/Volumes/lantern-net-inst/Lantern Installer.app sun.boot.library.path=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib java.vm.version=23.25-b01 i4j.jreBundle=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin gopherProxySet=false java.vm.vendor=Oracle Corporation java.vendor.url=http://java.oracle.com/ path.separator=: java.vm.name=Java HotSpot(TM) 64-Bit Server VM file.encoding.pkg=sun.io user.country=US sun.java.launcher=SUN_STANDARD sun.os.patch.level=unknown install4j.exeDir=/Volumes/lantern-net-inst/ java.vm.specification.name=Java Virtual Machine Specification user.dir=/Volumes/lantern-net-inst/Lantern Installer.app/Contents/Resources/app java.runtime.version=1.7.0_25-b15 i4j.ownBundlePath=/Volumes/lantern-net-inst/Lantern Installer.app java.awt.graphicsenv=sun.awt.CGraphicsEnvironment java.endorsed.dirs=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/endorsed os.arch=x86_64 java.io.tmpdir=/var/folders/xn/kwh3bj0d5yx415jz9ztyhstm0000gq/T/ line.separator=

java.vm.specification.vendor=Oracle Corporation os.name=Mac OS X proxySet=false sun.java2d.noddraw=true sun.jnu.encoding=UTF-8 java.library.path=/Users/adminitine/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:. sun.awt.enableExtraMouseButtons=true java.specification.name=Java Platform API Specification java.class.version=51.0 sun.management.compiler=HotSpot 64-Bit Tiered Compilers os.version=10.8.4 http.nonProxyHosts=local|.local|169.254/16|.169.254/16 user.home=/Users/adminitine user.timezone=America/New_York java.awt.printerjob=sun.lwawt.macosx.CPrinterJob file.encoding=UTF-8 java.specification.version=1.7 java.class.path=/Volumes/lantern-net-inst/Lantern Installer.app/Contents/Resources/app/.install4j/i4jruntime.jar:/Volumes/lantern-net-inst/Lantern Installer.app/Contents/Resources/app/user.jar user.name=adminitine java.vm.specification.version=1.7 sun.java.command=com.install4j.runtime.launcher.MacLauncher java.home=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home sun.arch.data.model=64 user.language=en java.specification.vendor=Oracle Corporation awt.toolkit=sun.lwawt.macosx.LWCToolkit java.vm.info=mixed mode java.version=1.7.0_25 java.ext.dirs=/Users/adminitine/Library/Java/Extensions:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/ext:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java sun.boot.class.path=/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/resources.jar:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/rt.jar:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/sunrsasign.jar:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jsse.jar:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jce.jar:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/charsets.jar:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/jfr.jar:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/lib/JObjC.jar:/Library/Internet Plug-Ins/JavaAppletPlugin.plugin/Contents/Home/classes install4j.appDir=/Volumes/lantern-net-inst/Lantern Installer.app/Contents/Resources/app/ java.vendor=Oracle Corporation file.separator=/ java.vendor.url.bug=http://bugreport.sun.com/bugreport/ sun.font.fontmanager=sun.font.CFontManager sun.io.unicode.encoding=UnicodeBig sun.cpu.endian=little install4j.systemLanguage=en socksNonProxyHosts=local|.local|169.254/16|.169.254/16 ftp.nonProxyHosts=local|.local|169.254/16|.169.254/16 sun.cpu.isalist=

myleshorton avatar Jan 07 '14 19:01 myleshorton

Here's a test installer that exhibited this behavior:

https://s3.amazonaws.com/lantern/net-install-cholmes2.dmg

myleshorton avatar Jan 07 '14 19:01 myleshorton

https://s3.amazonaws.com/lantern/lantern-1.0.0-beta5-901ce24.dmg

myleshorton avatar Jan 07 '14 19:01 myleshorton

I just looked at it and realized I misspoke before -- it downloads Java 7 but only requires Java 6...

On Tue, Jan 7, 2014 at 7:46 AM, oxtoacart [email protected] wrote:

@myleshorton https://github.com/myleshorton Would you like to change the Java requirement for the main installer to Java 6?

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/lantern/issues/1196#issuecomment-31748548 .

myleshorton avatar Jan 10 '14 00:01 myleshorton

@narimangharib What version of OS X are you using?

oxtoacart avatar Jan 14 '14 21:01 oxtoacart

@oxtoacart 10.9.1

narimangharib avatar Jan 14 '14 21:01 narimangharib

@narimangharib Thanks

Cheers, Ox


"I love people who harness themselves, an ox to a heavy cart, who pull like water buffalo, with massive patience, who strain in the mud and the muck to move things forward, who do what has to be done, again and again."

  • Marge Piercy

On Tue, Jan 14, 2014 at 3:59 PM, narimangharib [email protected]:

@oxtoacart https://github.com/oxtoacart 10.9.1

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/lantern/issues/1196#issuecomment-32312147 .

oxtoacart avatar Jan 14 '14 22:01 oxtoacart

Tested fix with Nariman, Java is no longer re-downloaded.

oxtoacart avatar Jan 15 '14 13:01 oxtoacart

Nice!

On Wednesday, January 15, 2014, oxtoacart wrote:

Tested fix with Nariman, Java is no longer re-downloaded.

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/lantern/issues/1196#issuecomment-32359706 .

lanterndev avatar Jan 15 '14 14:01 lanterndev

Love it!

On Wednesday, January 15, 2014, oxtoacart [email protected] wrote:

Closed #1196 https://github.com/getlantern/lantern/issues/1196.

— Reply to this email directly or view it on GitHubhttps://github.com/getlantern/lantern/issues/1196 .

myleshorton avatar Jan 16 '14 03:01 myleshorton