[izpack-devel] Single Installer Instance

Bartz, Klaus Klaus.Bartz at coi.de
Wed Jan 30 09:22:40 CET 2008



> -----Original Message-----
> From: izpack-devel-bounces at lists.berlios.de 
> [mailto:izpack-devel-bounces at lists.berlios.de] On Behalf Of 
> Tino Schwarze
> Sent: Wednesday, January 30, 2008 8:54 AM
> To: izpack-devel at lists.berlios.de
> Subject: Re: [izpack-devel] Single Installer Instance
> 
> 
> On Wed, Jan 30, 2008 at 08:33:36AM +0100, Julien Ponge wrote:
> 
> > > I haven't done this with Java.  I know Eclipse and some other 
> > > applications do this, but was wondering if there was an 
> easy way to 
> > > implement it.  My experience has been that each Java application 
> > > blindly launches in a new JVM with no way to check in an 
> OS neutral 
> > > way whether an instance of the same application is 
> already running.
> 
> There doesn't seem to be a simple way to detect already 
> running Java VMs. (Apart from using Sun's attach API from 
> Java 1.6, but it's not official yet.)
> 
> > How about a lock/pid file?
> 
> Dangerous. Even if we use the deleteOnExit stuff, the lock 
> may be left over somehow. 

May be the lock/pid file contains an expiry entry.


>We'd also need a way to create some 
> installer-specific lock name. Is there a way to figure out 
> what the name of the installer's JAR is? The lock file should 
> be located there and named similarly.

The path is the problem. I think installer which supports such things allocates an own (installer own versus installation own) area for a database or log file dir.
To create a installer specific name is no problem.

return (installdata.getVariable("APP_NAME") + " " + installdata.getVariable("APP_VER"));

If multiinstall should be supported, a counter as third part.
Additional a replace of unsupported chars.

> 
> Bye,
> 
> Tino.
> 
> -- 
> www.craniosacralzentrum.de
> www.spiritualdesign-chemnitz.de
> 
> Tino Schwarze * Lortzingstraße 21 * 09119 Chemnitz 
> _______________________________________________
> izpack-devel mailing list
> izpack-devel at lists.berlios.de 
> https://lists.berlios.de/mailman/listinfo/izpack-devel
> 


More information about the izpack-devel mailing list