How to run a script with minimal installation via sikuli-script.jar on Windows, Linux

Asked by Sarge

Hi, I would like to run sikuli script from command line without installing Sikuli IDE.

I try it in Windows 7 in folder "sikuli X".

folder sikuli contains:

test. sikuli - sikuli folder with script and patterns
sikuli-script.jar
libs - folder with libraries (cv210.DLL, cvaux210.dll,...)

In folder sikuli X I opened command line and typed:

java -jar sikuli-script.jar test. sikuli

I get error

java.lang.UnsatisfiedLinkError: java.lang.UnsatisfiedLinkError: C:\Users\..\Desktop\Sikuli\libs\VisionProxy.dll: Can't find dependent libraries

Is it possible to run script in machine where isn't installed Sikuli and without portable version Sikuli?

detailed listing:

http://pastebin.com/NmbQKrCm

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
j (j-the-k) said :
#1

A portable Sikuli would indeed be a nice thing. I don't know exactly how to achieve this. The problem is to package libcv with sikuli and somehow link sikuli to it. I don't know how/if that can be done, though.

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

--- It is not recommended, to put scripts into the Sikuli installation folder, since this is a special folder on Windows with special access restrictions, which might lead to unexpected results, when running or editing such a script.

--- A "portable" Sikuli needs the following things:

- the folder libs with its contents from the Sikuli installation directory
- sikuli-script.jar
- a command file (e.g. runsikuli.cmd) to run a script

Supposing we have a valid standard Java 6 installation and it is a 32-Bit Windows 7.

Having the above stuff in a folder (e.g. c:\mySikuli), this is a basic runsikuli.cmd
@echo off
set OLDPATH=%PATH%
set SIKULI_HOME=%~d0%~p0
PATH=%SIKULI_HOME%libs;%ProgramFiles%\Java\jre6\bin;%PATH%
java -jar %SIKULI_HOME%sikuli-script.jar %1
PATH=%OLDPATH%

usage:
runsikuli.cmd absolute-path-to-myscript.sikuli

If you want, you can pack all this together in a zip file and unzip it on another machine with a valid Java installation and you will be able to run your Sikuli scripts.

With solutions like e.g. http://portableapps.com/ it is possible, to pack something together (e.g. on a stick) that runs the whole Sikuli stuff including IDE on every Windows machine, even without Java installed and without touching anything on the host.

Revision history for this message
Sarge (agajdy) said :
#3

Thanks a lot RaiMan, it works :)

Could you please write this batch file for Linux OS? Something like shell script?

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

For Linux the situation is different from Windows, since you have to install the prereqs yourself (OpenCV, ...).
The distribution contains a shell script.
Just tailor it to your needs.

Revision history for this message
Sarge (agajdy) said :
#5

I would like to add sikuli scripts to my repository and make it available to others. In Sikuli debian section are couple of packages in portable version I found only sikuli-ide.sh script.

Is it possible in Linux execute scripts only using libs folder, sikuli-script.jar and set variables in PATH without install packages?

If not, which packages are necessary?

Thanks

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

--- Is it possible in Linux execute scripts only using libs folder, sikuli-script.jar and set variables in PATH without install packages?
No.
You need JRE 6, OpenCV 2.1, Tesseract 2.04 and wmctrl installed on the respective system.

Might be even more - I am not the Linux expert.

Revision history for this message
Joe McGurty (joemcgurty) said :
#7

I was able to get this to work on Win 7 x64 by using the following for runsikuli.cmd, follow RaiMan's advice (post #2):

@echo off
set OLDPATH=%PATH%
set SIKULI_HOME=%~dp0
PATH=%SIKULI_HOME%libs;%ProgramFiles(x86)%\Java\jre6\bin;%PATH%
java -jar "%SIKULI_HOME%sikuli-script.jar" %1
PATH=%OLDPATH%

Can you help with this problem?

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

To post a message you must log in.