Sikuli 1.0.1 Auto extract binaries for windows 32bit

Asked by AutoTest101

I'm using sikuli-java.jar as described in https://github.com/RaiMan/SikuliX-API/wiki/Usage-in-Java-programming

For 64bit windows, it auto extracts the required dll's into a "libs" subdirectory. On 32bit windows however, it does not auto extract the files. I'm writing some automated test code that needs to run as part of a build system using both windows 32 and 64 bit.

Is anyone else having this issue?

I can simply copy the win32 files manually into "libs", but it would be nice to have the same behaviour on both platforms.

thanks in advance

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:

This question was reopened

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

--- On 32bit windows however, it does not auto extract the files.
But it should do so ;-)
It even switches automatically, when you switch on 64-Bit between Java-32 and Java-64.
So what are the symptoms?
I suppose you have the sikuli-java.jar in one place (preferably the setup folder) and do not move it around (e.g. into your Java projects).

When running your Java project or a simple test add
-Dsikuli.Debug=3
to the java command line and paste the output

Revision history for this message
AutoTest101 (stratton-thorn) said :
#2

You are right @RaiMan. It did extracted the files :)

I had libs installed in C:\Users\Adminstrator\SikuliX\libs (which assuming is the default installation path), but that directory is not set in the system path, since I set the path as C:\temp\test-framework\third_party\sikuli\libs (there is where I placed sikuli without the libs folder hoping it will extract the libs from the jar) without knowing I had a folder in C:\Users\Adminstrator\SikuliX.
The sikuli installation will not try to extract libs to my jar parent folder which is in C:\temp\test-framework\third_party\sikuli, since it already found a libs folder in the user home folder (aka C:\Users\Adminstrator\SikuliX).

I just removed the SikuliX in C:\Users\Adminstrator\SikuliX to force it to extract the libs in sikuli.java.jar every time i ran my suite of test.

Thanks RaiMan

Revision history for this message
AutoTest101 (stratton-thorn) said :
#3

RaiMan, a quick question.

Currently I'm using sikuli-java.jar through PyDev in eclipse, by setting PYTHONPATH. This way is working fine, however, I would
prefer to do this inside my package that uses sikuli. I have tried adding the sikuli-java.jar using the normal
 sys.path.append(sikuli_jar_path) approach, but, it doesn't seem to work the same as settting PYTHONPATH in eclipse.

When I try to set the path programmatically, I get the following error:

[error] SikuliXforJython: package: sikuli/__init__.py not found: Sikuli might not work
[debug] Jython: sikuli: __init__: entering
[debug] Jython: sikuli: Sikuli: entering
[debug] Jython: sikuli: Sikuli: constants
[debug] Jython: sikuli: Sikuli: import Region
[debug] Jython: sikuli: Sikuli: import Screen
[debug] Jython: sikuli: Sikuli: Env.addHotkey
[debug] Jython: sikuli: Sikuli: import Match
[debug] Jython: sikuli: Sikuli: import Pattern
[debug] Jython: sikuli: Sikuli: import Location
[debug] Jython: sikuli: Sikuli: import ScreenUnion
[debug] Jython: sikuli: Sikuli: import Finder
[error] FileManager: Fatal error 121: Could not load any NativeLoader!
[error] Terminating SikuliX after a fatal error(121)! Sorry, but it makes no sense to continue!
If you do not have any idea about the error cause or solution, run again
with a Debug level of 3. You might paste the output to the Q&A board.
[debug] SikuliXFinal: cleanUp: 0

Do you have any suggestions on how I can add the sikuli-java.jar to the pythonpath/classpath at runtime?

Thanks in advance

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

So if you want to manage the paths yourself, then you should not use the SikuliXforJython import.

This is meant as a convenience and just needs sikuli-java,jar on the class path.

Important: whatever you do on the Python level, sikuli-java.jar MUST be on the Java class path!

[error] FileManager: Fatal error 121: Could not load any NativeLoader!
... shows, that this is not the case here.

Can you help with this problem?

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

To post a message you must log in.