This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

building self-extracting Java EXE's; setting icons


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@sourceware.cygnus.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]