delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1999/11/22/10:57:59

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Unsubscribe: <mailto:cygwin-unsubscribe-archive-cygwin=delorie DOT com AT sourceware DOT cygnus DOT com>
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <19991122155811.6352.qmail@pb151.postoffice.net>
Date: 22 Nov 99 10:58:11 EST
From: Kyle Downey <kyle DOT downey AT amberarcher DOT com>
To: cygwin AT sourceware DOT cygnus DOT com
Subject: building self-extracting Java EXE's; setting icons
X-Mailer: USANET web-mailer (MaintM3.3.0.77)
Mime-Version: 1.0
X-MIME-Autoconverted: from quoted-printable to 8bit by delorie.com id KAA15124

I want to use gcc to write an open source program which does the following on
Win32:

1) writes a large block of bytes out to a temporary file
2) executes the Java VM (via JNI Invocation API) using that extracted file as
a "JAR" archive or, even better, unzips that block of bytes into a JRE (Java
Runtime Environment) with the java DLLs as well as the JAR, so the user
doesn't have to have a local Java runtime in the PATH 
3) optionally uses mingw32 instead of cygwin (so the user doesn't have to have
cygwin.dll installed as a pre-req)
4) includes a Windows icon on the EXE

I want to write a Java tool that auto-generates these EXE's, so I have the
further requirement of 

If anyone is familiar with InstallAnywhere's LaunchAnywhere EXE's, or the
WebLogic ZAC launcher EXE's, you'll know what I'm talking about: a simple EXE
that you can give to the users that unpacks itself to bootstrap a Java-based
installer.

Furthermore, I'd rather not have to bundle a compiler with my tool to generate
these EXE's. If I have to, I will, but is there any way to compile this once
and do the equivalent of a "regexp" substitution, using the EXE as a template?
I don't think there's a C compiler in either the ZAC Publisher provided by
WebLogic or in InstallAnywhere's tools, so this gives me the important
information that it's at least possible!

I am fairly sure with some work I could figure out zlib well enough to write
the part that extracts the JRE and JAR file to a temp directory (uh...maybe),
and I know the Invocation API already, but what I can't find any information
on is:

1) how to programmatically set the icon for an EXE in Windows in gcc/mingw32
(this may just be because I'm a UNIX C programmer, not a Win32 programmer)
2) how to create a "DATA" segment in an EXE file containing bytes to be
self-extracted
3) how to template an EXE so you can do things like inject an ICO file and the
zipped data image

I should probably mention that yes, I know about the various commercial ZIP
packages that create self-extracting ZIPs. But what I need is not a tool, but
an API that I can (via JNI, probably) call from a Java tool, and that I can
control 100%.

Finally, is there a quasi-portable way to do all this? Or if I ported the tool
to Linux, would I have to find a completely different way to do it? (I know
InstallAnywhere creates shell archives for Solaris...)

regards,
kd



--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019