While distributing Sikuli executable to clients, do we need to install Sikuli on client's pc?

Asked by Farooq Pathan

Hi,

I tried to bundle my files with sikuli folder extracted at c:\Program Files\Sikuli X while installation, but still i can't get it working.

Do i need to ask client to install Sikuli in order to use it, or there is some solution for it?

How can i make its standalone .exe file?

Thanks

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

On the client PC you need:
- sikuli-script.jar
- the contents of the libs directory
- path to the libs directory in system path
- path-to-java/jre6/bin in system path
- path to sikuli-script.jar in Java class path

This is possible to pack in an .exe, that contains an installer (look for available software in the net).

If you are an experienced Java programmer, you might pack everything in one jar and write an installer with Java.

Revision history for this message
Farooq Pathan (farooq-pathan) said :
#2

Can it run from the directory which the files have been extracted or these necessary files need to be at c:\Program Files\Sikuli ?

Any way i can change the default path of java and sikuli so that my program uses the relative path of any directory it is extracted to?

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

You can put everything in one directory and adjust the paths accordingly. No need for anything in c:\Program Files.

some-dir
- sikuli-script.jar
- libs
- your-script.sikuli (or .skl)

-- path-to-some-dir/libs needs to be in system path (+ the path-to-java/jre6/bin)

to run the script:

java -jar path-to-some-dir/sikuli-script.jar path-to-some-dir/your-script.sikuli

-- I am not sure wether relative paths work - just try

Revision history for this message
Farooq Pathan (farooq-pathan) said :
#4

While executing the command you suggested, i am getting following error

c:\abc>java -jar sikuli-script.jar "this is a demo.skl"
[info] Sikuli vision engine loaded.
[info] Windows utilities loaded.
[info] VDictProxy loaded.
Exception in thread "main" IOError: (2, 'File not found - c:\\abc\\this is a demo.skl\\this is a demo.py (The system cannot find the path specified)')

does it means i need to include source file with this executable file?

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

filenames should not contain blanks.

Revision history for this message
Farooq Pathan (farooq-pathan) said :
#6

i created a new executable file without blanks, but i am still getting same error that

File not found - c:\\abc\\thisisademo.skl\\thisisademo.py

any solutions?

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

Ok, I hoped that this would not be the case:

The so called executables (.sk, a zipped version of the correspondin .sikuli folder) can only be executed by the IDE from commandline (in this case you would need the full IDE installed).

If you want to stick with the above minimum version, the script has to be in its unzipped form as .sikuli

java -jar path-to-some-dir/sikuli-script.jar path-to-some-dir/your-script.sikuli

Revision history for this message
Farooq Pathan (farooq-pathan) said :
#8

Ok, that seems i need to include the whole source code which can be easily opened and modified by Sikuli IDE, is there any way i can usse the minimum version with the unziped .sikuli but protect my source code?

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

To protect your code is not possible on the Python level (even a .skl is only a zipped version of your script folder, which is some disguise but not a protection).

You have to transpose your script to Java code and finally wrap everything together as a .jar.

This would be run as

java -cp path-to-some-dir/sikuli-script.jar -jar path-to-some-dir/your-script.jar

or even

java -jar path-to-some-dir/your-script.jar
if you integrate sikuli-script.jar into your script jar.

This would protect your code, but you need some feature, to copy the images from inside the .jar to a temp folder outside (as far as I understand: the images cannot be loaded from inside a .jar) and you still need the libs and path stuff (which could be implemented in your jar rather simple similar to the image copy).

Revision history for this message
Farooq Pathan (farooq-pathan) said :
#10

Do you have any idea, or any software to make jar, i don't have knowledge about java so anything for a layman?

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

Since you need to program in Java, you need some knowledge about it. Usually people use something like Eclipse or Netbeans as IDE.

So in your case just forget the Java option.

As already said: on the Sikuli script level (Python) there is currently no feature to really protect your code. If you use the weak version (.skl "executables"), the user needs a full Sikuli installation.

Can you help with this problem?

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

To post a message you must log in.