runtime.exec?

Hi,

I have a executable (windows exe file) packaged in JWS jar. How do I invoked it through runtime.exec? How do I tell webstart where to find this exe?

I don't think the following way works.

<nativelib href="myexe.jar"/>

then Runtime.getRuntime().exec("cmd /cstart theExe.exe");

I don't want to install the exe to user.home. Then how do I do it?

Thanks.

[413 byte] By [wangpe] at [2007-9-26 1:21:11]
# 1

Hi,

Why don't you try it first and come back with what's holding you back?

I'm doing a similar thing using a different approach, however.

I ship cvs.exe in a resource jar and then put it into java.io.tempdir so that

Windows can run it. This works fine. However, your approach seems more promsing so give it a shoot.

- Gerald

geraldb at 2007-6-29 0:56:29 > top of Java-index,Desktop,Deploying...
# 2

> Hi,

>

> Why don't you try it first and come back with what's

> s holding you back?

>

Well. I think it is straight forward in a sense that exec spin off a command shell which has no idea of this jar and it only looks for the system path variable unless exec can be overloaded like system.loadLibrary function call.

But my guess is this: since the <nativelib> jars are extracted, if there is a way to find out the current JWS app installation directory then we can recursively search the sub-dir to find out the executable then use absoulte path to invoke the exe.

Since I am very new to JWS(first time used it), I think it would be easier for me to ask around see if anybody met this problem before and get some advise.

> I'm doing a similar thing using a different

> t approach, however.

> I ship cvs.exe in a resource jar and then put it into

> java.io.tempdir so that

> Windows can run it. This works fine. However, your

> approach seems more promsing so give it a shoot.

>

> - Gerald

wangpe at 2007-6-29 0:56:29 > top of Java-index,Desktop,Deploying...
# 3

Hi,

you can easily find out the Web Start installation directory. Just lookup the

jnlpx.home property and append .javaws/cache.

However, be aware that your file will be mangled/tagged and propably will have a slightly different name.

I would appreciate if you could post your findings after getting help for free so others

can profit as well.

- Gerald

geraldb at 2007-6-29 0:56:29 > top of Java-index,Desktop,Deploying...