This namespace provides access to the .pcg (SOTI MobiControl package file) installation functionality.
- Since:
Members
-
static, readonly InstallationStatusCode :object
-
This enumeration represents a return status code of mobicontrol.packages.install.
Properties:
Name Type Description NONEobject No specific status code. FINISHEDobject Installation was finished programmatically from pre-install script. FILE_NOT_FOUNDobject Package file was not found. OUT_OF_STORAGEobject Installation failed because the device does not have enough storage. PACKAGE_INCOMPATIBLEobject Installation failed because of package incompatibility. ABORTEDobject Installation was aborted programmatically from pre-install script. PACKAGE_FORMAT_NOT_CORRECTobject The format of the package file is not correct. APP_VERSION_DOWNGRADEobject Attempt to downgrade already installed app failed. APK_FORMAT_NOT_CORRECTobject The format of an .apk file inside the package file is not correct. This includes cases where the .apk file is incompatible with the device's OS. - Since:
-
static, readonly Termination :object
-
This enumeration defines errors which can be thrown to indicate special package installation termination conditions.
Check Throwable APIs tutorial for details.Properties:
Name Type Description ABORTEDobject If thrown from package pre-installation script, aborts the installation of the package and forces it to show up as "Failed" in the Web Console FINISHEDobject If thrown from package pre-installation script, skips the installation of the package and forces it to show up as "Successful" in the Web Console - Since:
Methods
-
async, static install(filePath, callbackFunctionopt, invocationTimeoutInMillisopt) → {boolean}
-
Install a package file.
Parameters:
Name Type Attributes Default Description filePathstring The path to the .pcg file. callbackFunctionmobicontrol.packages.installCallback <optional>
JavaScript function which is called when the installation attempt completes. invocationTimeoutInMillisnumber <optional>
600000 Invocation timeout in milliseconds. If the callback function isn't invoked before the timeout expires, it will be called with the timed-out result. Returns:
boolean -trueif the package installation process was successfully launched,falseotherwise.- Since:
Example
// Install a package and start the the embedded app as soon as the installation finishes mobicontrol.packages.install('/sdcard/package1.pcg', onFinish); function onFinish(result) { if (result.isSuccessful) { mobicontrol.app.start('net.soti.example'); } }
Type Definitions
-
installCallback(result)
-
Callback function for mobicontrol.packages.install.
Parameters:
Name Type Description resultobject Result of the installation attempt. Properties
Name Type Description packageFilenamestring The .pcg file that is being installed. statusCodemobicontrol.packages.InstallationStatusCode The detailed status code of the callback. Follow the link in the Type column to see all the possible values. isSuccessfulboolean Success status of the callback. trueif the callback completed successfully,falseotherwise.isTimedOutboolean Timeout status of the callback. trueif the callback was timed out,falseotherwise. Note: A timeout is considered a failure, so if the timeout status istrue, failure status istrueas well, and success status isfalse.isFailedboolean Failure status of the callback. trueif the callback failed,falseotherwise.- Since: