Launch4J: an exe containing sikulixapi.jar does not work

Asked by J Rivera

Hi,

I've created a java swing application in which I use Sikuli for automation of some screens. The application is complete now, and I used Launch4J to create an executable file of that application. My problem is, when the exe application is running, none of the actions that sikuli is supposed to perform do not work and the application does not do anything.

Could anyone please guide me as to what can be happening here? I have no Idea why none of the actions are working.

Any help provided will be very much appreciated.

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

LOL, I am just struggling myself, to create an exe with Launch4J for the IDE package in version 1.1.0

the current implementations of SikuliX will not work, if you pack everything into the exe,
only the version launch-only work out of the box
<launch4jConfig>
  <dontWrapJar>true</dontWrapJar>

... but I guess, this is not what you want ;-)

If you wait a few days: there will be sikulixapi.jar, that can be wrapped in the exe.

The problem with Launch4J:
If anything goes wrong inside, as in this case, the exe simply dies without any comment.

The problem with SikuliX:
SikuliX exports the native libraries at runtime to the libs folder.
this currently is based on the existence of a real jar, which is not available in this case of wrapped exe.

The solution:
I have already added a feature, to just access the resources from class path.
This is not yet available in sikulixapi.jar, but will be in a few days.
The libs will then be exported to temp.
In any case (as now): existing libs are checked and an export is only done, if needed based on timestamp and the libs folder is added to system path at runtime dynamically.

I will comment here, when ready

Revision history for this message
J Rivera (jrivera-gro) said :
#2

That sounds great!.. looking forward to take a look at that new feature. Thanks!

Revision history for this message
RaiMan (raimund-hocke) said :
#3

Not that easy. More complex, than I thought.

The most ugly thing: the jar inside the .exe is not accessible as a zip-container, as is possible when having the jar outside. So it is not possible, to make a list of resources bundled inside (like for the native libraries) on the fly to prepare an export or whatever. A specific resource though is accessible.
So currently the only solution is to bundle an extra file, that lists resources at a specific subtree of the jar.
This in turn can then be used to access the individual resources.

Im just creating a feature, that allows me to create and bundle such content files at setup time, so they reflect the actual content of a subtree inside the jar.

I guess latest during the weekend I will get it ready.

Can you help with this problem?

Provide an answer of your own, or ask J Rivera for more information if necessary.

To post a message you must log in.