2

My installation widget.zip zipfile contains the following:

  • 32bitJava
  • install.jar
  • widgetinstaller.exe
  • widgetinstaller.ini
  • widgetinstaller.ico

To summarize:

  • 32bitJava is a 32bit JRE downloaded from Oracle
  • install.jar is the installer created by Izpack
  • widgetinstaller.* are created by winrun4j providing an exe wrapper for the installer.

So with this setup I can install my application without user having to have a java runtime already installed.

However once installed the actual application also needs a java runtime to actually run. So at the moment a copy of 32bitJava is included as part of the izpack install, i.e it exists in install.jar and is installed at installation time.

But this means I have two copies of the JVM, and because the 32bitJava is larger than my actual application makes my download much too large.

So how can I copy the 32bitJava folder into the installation during/after installation instead of having to include it in install.jar ?

Paul Taylor
  • 13,411
  • 42
  • 184
  • 351

4 Answers4

2

You want to do a "loose" pack for the JVM. A loose pack doesn't need to contain the files it installs, so it could copy the file from the zip into place, instead of using one embedded in the jar.

<pack id="java" name="java" required="yes" preselected="yes" loose="true">
  ...
  <executable ...>
    <!-- something appropriate to install java -->
  </executable>
</pack>
simon
  • 707
  • 8
  • 22
  • Thanks simon, looks like this could be just what I want I'll se if I can get it working and report back. – Paul Taylor Sep 27 '12 at 20:36
  • havent tried this yet, but fingers crossed it will work so awarding bounty – Paul Taylor Oct 01 '12 at 20:55
  • Hi, yes thankyou it did work. But be warned its a bit confusing what you have to set as the file src, you need to copy the folder you expect to be on destination machine into the same relative location to install.xml as it will be to install.jar when installing, but then specify the absolute path in install.xml instead of install.jar – Paul Taylor Oct 03 '12 at 12:24
0

Pack the files into a self-extracting archive/zip, and as part of the unzip process, have the files extracted to the location you need them to be.

There is more information about self-extracting archives at Wikipedia: http://en.wikipedia.org/wiki/Self-extracting_archive

L0j1k
  • 12,255
  • 7
  • 53
  • 65
  • Is this together with Izpack or instead of Izpack ? – Paul Taylor Sep 27 '12 at 10:26
  • Take a look here: http://izpack.org/documentation/izpack-utils.html There seems to be some instructions on doing this with IzPack – L0j1k Sep 27 '12 at 10:29
  • I don't think this actually addresses the issue Im having – Paul Taylor Sep 27 '12 at 20:39
  • I will do some more research on self-extracting archives so that I can provide you an example. This kind of thing is exactly what self-extracting archives were created for. :) – L0j1k Sep 27 '12 at 21:48
0

Instead of being forced to include the java installation in the install.jar, why don't you just have the install.jar install your program and include a link here: http://www.java.com/inc/BrowserRedirect1.jsp?locale=en ? That is the link to download the current version of java.

To create such a link, right click > new > shortcut, paste in the link into the first dialogue box, click next, then name it "Java Installation". This would add 4 kb at most to your package, and still allow you to install java (however, the user will have to click this manually)

I am using the browser redirect URL because it identifies what java people need based on thier computer (OS and processor bit)

Azulflame
  • 1,534
  • 2
  • 15
  • 30
  • There alot of confusion on Windows about the interplay between 32bit/64bit Java and 32bit/64bit systems, and also alot of negativity about Java desktop systems in general. I think its a neater user experience if everything they need is packaged in one go and there is no explicit reference to Java. – Paul Taylor Sep 27 '12 at 20:38
  • That link automatically redirects to the needed version of java, 32 bit java for 32 bit systems, and 64 bit java for 64 bit systems. Java is now a lot easier to install than it's earlier days (I remember having to extract all the source files to the program files folder) – Azulflame Sep 28 '12 at 01:33
  • install.jar needs a JVM installed to run inthe first place anyway – Paul Taylor Sep 28 '12 at 09:39
  • The link leads to the java installation, allowing you to then run install.jar – Azulflame Sep 28 '12 at 13:40
0

How about creating a small, post-installation utility to copy the executable to the location? You could create it in a small shell script (or batch file on Windows) or even a little C++ utility that simply copies the JVM to the location you need. This way, after you install the utility, you then trigger the post-installation code, and copy the JVM over to the desired location.

L0j1k
  • 12,255
  • 7
  • 53
  • 65
  • I did try this but had trouble getting it working, however trouble is that this would be done out of the installer and give no feedback to user whilst it was taking place, because JVM is quite large this could cause the user to think installation has hung. – Paul Taylor Sep 27 '12 at 22:02
  • Not if you include a very simple message to the user indicating that the installer is working. And if you think about it, any other solution to this problem is *also* going to involve lots of time spent in copying operations, so it's unavoidable. You should be able to just throw a line in your post-install utility that says something like "This will take a few minutes..." and then add `print '.'` or equivalent after every individual file copy operation, so the user sees a steady stream of '......' during post-install. :) – L0j1k Sep 28 '12 at 13:32