Hi Enzo,
is it necessary implement a <remove> or the file is overwritten?
No, you don't need to include a <remove>...</remove> element in your updates.xri, unless you
really need to cleanup some installed files. In general, better forget about <remove>
When an existing file is updated, it is replaced with the new version. Existing files are never kept by the update system; they are always overwritten.
where you specify the deployment directory? (my script ended in the PI root directory
You "specify" the deployment directories implicitly with your update package. For example, if your update must replace a "foo.js" script file, your update package should contain the following:
<src>
|
+ <scripts>
|
+ foo.js
where I have written directories between <> for clarity.
In this way, when the updater program applies your update package, it will overwrite the "foo.js" file on the src/scripts directory, in case that file already exists, or it will create the file otherwise. In other words, the contents of your update package will be transported
exactly as they are to the user's PI installation directory.
Also take into account that if your update package includes directories that still don't exist on the user's PI installation, they will be created. In general though, you should only include already existing directories. Only include a new directory if you have an extremely good and well founded reason to do so.
Finally, please take into account that file systems are case sensitive on all platforms with the exception of Windows. So if you create a package with the following contents:
<src>
|
+ <Scripts>
|
+ foo.js
it will work fine on Windows ONLY, but it will create a new "src/Scripts" directory on FreeBSD, Linux and Mac OS X, and obviously your script will not be automatically installed on these platforms (not to mention the fact that you'd stuff the user's installation with unnecessary files).
I'm going to update the reference document to make all of these points clearer.