The Execute scripts remotely task can be used to remotely install an application on a client device by creating a custom installation package.
Learn how to prepare an archive for this task in this article.
To create an installation package for remote installation of an application on a client device, the following files must be included in the archive you want to upload for this task:
JSON schema for remote installation of an application
{
"version": 1,
"actions": [
{
"type": "execute",
"path": "install.sh",
"args": "<enter the arguments, if necessary>",
"results": [
{
"code": 0,
"next": "continue"
}
],
"default_next": "break"
}
]
}
Description of arrays
version—version of the manifest file and the task.
At present, the only acceptable value is 1.
The elements of the actions array determine the composition and order of the scripts that are executed in the task.
The order of execution of the script corresponds to an element’s index (place) in the array.
For each element of the actions array, the following elements are defined.
type—type of executable command from scripts. At present, the value is always execute.
path—path to the script file in the archive.
args—arguments that are passed to the script as part of the executable command.
results—array that defines further actions depending on the result of the task.
code—value that returns a script.
next—action to be completed next. The continue action proceeds to execute the next script (element in the actions array); the break action stops the task.
default_next—action if a script returns a value that is not contained in results.
When the Execute scripts remotely task starts, the Network Agent will upload the installation package with the application to the client device. When the client device receives the installation package, Network Agent on this device parses the manifest.json file and defines the execution order of scripts and actions depending on the result and then starts execution.
When the Execute scripts remotely task is completed, the application will be installed on the client device.