Deploying libraries to "end-users"

Hi all,

I'm in the process of writing a sketch that will be open-sourced on GitHub.

The sketch is dependent on a library I've written myself, as well as two third-party libraries.

I'm looking for a solution to installing these libraries with minimum effort of the part of the "end users" of my sketch.

tl;dr : What's an easy way of automatically installing a library from an online source to the Arduino library folder?

I currently have three options that I can see:

  1. Provide links and instructions for users to install these libraries manually.
  • This is the easiest and most correct solution from my POV as a developer, but means more work for the end user.
  1. Provide all the libraries in my sketch folder
  • Against the whole concept of reuseable libraries, makes the sketch folder look messy. Easy for things to go out of date or out of sync. I'm not doing this if I can help it.
  1. Write some kind of installer executable or script that will download and install the libraries.
  • Are there access rights/security issues with this? Might certain systems not allow scripts to start downloads or disallow writing to user folders?
  • How confident can i be about compatibility over multiple OS's? I probably have to write separate scripts for Win/Mac/Linux, unless I write an installer in something like Java.

Can anyone recommend how I might solve this, or have any comments that might help?

Thanks in advance.

Write some kind of installer executable or script that will download and install the libraries.

I would advise against this as it could be a vector for malware and most computer literate people would avoid it.

Provide links and instructions for users to install these libraries manually.

I would do this.

  1. is easy for YOU
  2. is easy for the USER
  3. is a PITA and may have restrictions or other issues (non-link policies, etc.)

So, I am not going to answer #1 or #2, but definitely #3 is problematic. What you must consider is that if you simply link to libraries, will your code be so rock stable that no changes are required if the other party changes their libraries? Will something break? Murphy usually says that it will.

If this is something that you plan on baby-sitting for the duration of it's life, then #1 is fine, IMO. If you loose interest a year from now, will the support libraries still be usable if pulled from the links?

Ray

I've downloaded LOADS of libraries. The first thing I look for is a .ZIP file. I then download this. Go to downloads folder, right click and extract to documents/arduino/libraries.

So if your .zip file contains a folder with everything your library needs within it, I'd be right first time. If I need to look for instructions for YOUR library then I'll soon lose interest.

Who are your end users? Are they open-sores developers who will be modifying the code? Then option 1 is best. If they are people who expect it to 'just work' then I would question if Arduino is the right platform for this project.

It sounds to me like this is a case where a library does not add value. Why not just incorporate your library code directly in your program - perhaps distribute the program as two or more .ino files in a .zip file. That way the user does not have to do anything except unZip the download.

...R

Hi everyone,

Thanks for all the replies.

It looks like option 2 (copy libraries into sketch folder) is going to be easiest.

Along with this, provision of documentation to allow interested users to move those libraries to their own Arduino installation.