5

I am developing an application that will be rolled out to Windows computers. Because my clients have very little computer knowledge the installation and update need to be as easy as possible. I want the installation to be the only manual step, updates should be done automatically.

Installation will be done via Installshield or more likely by one of its open source clones. The installer will install these components:

  • a Java runtime (Oracle JRE) as a kind of portable app (that means by simply copying the contained files and not using the provided installer)
  • Apache Commons Daemon to install my application as a Windows service
  • the application itself in the shape of several JARs created with Spring Boot

When one of those components changes I want to update them automatically and as silently as possible. The application will be able to determine if updates are available on the web and download them.

What options do I have to achieve this ? Java Webstart is in my eyes not a good solution - for example it does not enable me to update the runtime. Providing an update installer will need user interaction and perhaps even administrative rights so it wil not run silently.

The proposed link below does not fit my problem because I use a daemon which needs to be updated during runtime and neither of the given solutions in the linked post supports that.

Marged
  • 10,577
  • 10
  • 57
  • 99
  • Will you publish applications JARs to some maven repo? You basically have to: 1. periodically check for new versions of components 2. if version available online is higher than version on user machine, download newer version 3. restart your app with updated classpath. Each component is versioned differently and published differently. You'll probably need some container that will do this for you. – Filip Malczak May 19 '15 at 08:16
  • Let them install the JRE themselves and use webstart to keep the app up to date. – Stefan May 19 '15 at 08:21
  • @Stefan: the normal JRE installation enables to Java plugin which many users don't like because of the press which rated Java / the plugin as a thread to computer security. And using the normal installer would force the users to update the JRE on their own (whenever the update agent informs them about an available update). – Marged May 19 '15 at 09:46
  • @FilipMalczak No, at least not to one publicly available. And I think this would neither enable me to update the Windows binaries (for the daemon) nor the Java runtime. – Marged May 19 '15 at 09:52
  • @MuratK.Unfortunately my demand goes beyond what is described in the linked post. – Marged May 19 '15 at 16:01

1 Answers1

2

May I suggest for you to reconsider Java Web Start? Even Wikipedia knows that

Important Web Start features include the ability to automatically download and install a JRE in the case where the user does not have Java installed, and for programmers to specify which JRE version a given program needs in order to execute.

If you still don't want to use Web Start then here is totally silent solution which I use on Windows boxes. Let's say here is restart.bat:

 cd \myApp
 echo Killing myApp
 pskill.exe myApp
 TIMEOUT 5

 del /q Release
 copy \\mainCIcomputer\Build Release

 TIMEOUT 5
 cd Release
 start myApp.exe

All what you have to do is to start separate process and then run restart.bat from it. You can use any technique to determine when to reload your app (for example http/ftp request to get latest version number and restart if it is different from existing). Don't forget - this process should be separated to not be killed with you main myApp. It could be start from another batch, or, in my case I use IronPython:

from System.Diagnostics import Process
p = Process()
p.StartInfo.UseShellExecute = False
p.StartInfo.RedirectStandardOutput = False
p.StartInfo.FileName = 'restart.bat'
p.Start()
p.WaitForExit()
Alex
  • 4,457
  • 2
  • 20
  • 59
  • I ruled out Java Web Start because it is not silent enough. As far as I know after installing the JRE the user will be nagged whenever an update is available. Plus I do not want the Java plugin to be installed and I assume this will be part of the install when used in combination with WebStart. – Marged May 21 '15 at 11:24
  • OK. Provided totally mutual example. – Alex May 22 '15 at 02:07