Launch .exe file from a Jar via Java WebStart

O

oziris

Hi!

Does anyone already succeed in running an executable file from a Jar,
or know how to? The final aim is to perform that via Java Webstart -
which needs all application files be in a Jar file.

The only derived way I find consists in copying the file under the
local disk (via InputStream and OutputStream) and running it from this
location.

Even you don't know the precise answer, don't hesitate still and all to
post the minor birth of ideas you could have.

Thank you.

-m
 
R

Roedy Green

Does anyone already succeed in running an executable file from a Jar,
or know how to? The final aim is to perform that via Java Webstart -
which needs all application files be in a Jar file.

Your biggest problem is finding some free space to put it in.

All you do is read it as stream of raw bytes and copy it to disk. See
http://mindprod.com/products1.html#FILETRANSFER
for sample code to copy the file a chunk at a time. If the exe is not
that big, you can do read it into RAM and one i/o and write it in one
to disk.

Then use exec. See http://mindprod.com/jgloss/exec.html

I wish there were some easy way to find some permanent disk space with
JAWS to keep such a file, where it would be safe, and yet would be
deleted on uninstall. Ditto it would be nice to easily allocate
yourself a temporary directory.


Sun goofed in writing its temp file method. The files have nothing
distinguishing for scavengers to find them later for deletion if
something goes wrong with autodelete.


--
Bush crime family lost/embezzled $3 trillion from Pentagon.
Complicit Bush-friendly media keeps mum. Rumsfeld confesses on video.
http://www.infowars.com/articles/us/mckinney_grills_rumsfeld.htm

Canadian Mind Products, Roedy Green.
See http://mindprod.com/iraq.html photos of Bush's war crimes
 
R

Raymond DeCampo

Roedy said:
Your biggest problem is finding some free space to put it in.

All you do is read it as stream of raw bytes and copy it to disk. See
http://mindprod.com/products1.html#FILETRANSFER
for sample code to copy the file a chunk at a time. If the exe is not
that big, you can do read it into RAM and one i/o and write it in one
to disk.

Then use exec. See http://mindprod.com/jgloss/exec.html

I wish there were some easy way to find some permanent disk space with
JAWS to keep such a file, where it would be safe, and yet would be
deleted on uninstall. Ditto it would be nice to easily allocate
yourself a temporary directory.


Sun goofed in writing its temp file method. The files have nothing
distinguishing for scavengers to find them later for deletion if
something goes wrong with autodelete.
When you request a temporary file, you can specify a prefix and a
suffix. This should be enough for whatever scavengers you are referring to.

HTH,
Ray
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,190
Members
46,736
Latest member
zacharyharris

Latest Threads

Top