PackageTools - Maple Programming Help

Home : Support : Online Help : System : Libraries and Packages : PackageTools : PackageTools/Install

PackageTools

 Install
 install a workbook-based package

 Calling Sequence Install( package_file ) Install( package_id, version = ver ) Install( package_file, where = target, overwrite = tf, pkgname = pname  )

Parameters

 package_file - string package_id - integer pkgname - (optional) string where - (optional) identical(homedir,mapledir) overwrite - (optional) truefalse version - (optional) integer

Description

 • The Install command moves and unpacks a workbook file to a location known to Maple so that the contents of the installed package will be usable in subsequent sessions.
 • An installed package can be removed using the PackageTools:-Uninstall command.
 • The Install command is intended to work with .maple files that contain a saved package module.  For example, you can create a module, MyMath, that implements the commands, MyMath:-Plus, and MyMath:-Evaluate.  Using savelib or the variable manager will allow you to store your module in the current workbook .maple file.  Appending the path to your mymath.maple file to libname will allow you to access these commands from a different session.  Calling Install("mymath.maple") will copy the workbook file to a location that is automatically added to libname.
 • Rather than using package_file to specify a .maple file, you can use package_id, an integer that uniquely identifies the package in the MapleCloud. When running PackageTools:-Install(123456789000000), Maple will find the package in the cloud, download it, and install it.  This is an easy way to create a shareable link for other people to get your package.  You will need to be logged in to the MapleCloud in order to access non-public packages.
 • The version option can be used in conjunction with package_id to specify a particular revision of the specified package.
 • In addition to using the package_id to install something directly out of the MapleCloud, you can use the full URL of the specific package found when browsing maple.cloud online.  For example, you might use your regular web browser to look through available packages.  When you find one you like, copy the URL from the browser; it will look something like, "http://maple.cloud/#doc=123456789000000".  That URL can then be used as the first argument to the Install command, PackageTools:-Install("http://maple.cloud/#doc=123456789000000").
 Installing via package_id is only supported in the Standard Worksheet Interface.
 • By default packages are installed in "maple/toolbox/pname" relative to your home directory.  This uses pname if specified, otherwise it uses the "title" of the package as stored in the embedded cloud metadata, or, lacking that, the base name of the .maple file.   Specifying where = mapledir will attempt to install the package in "$MAPLE/toolbox/pname", where$MAPLE is your Maple installation directory.
 If a package has the "MapleVersion" property set to a valid major version number, then the default install path is "maple/toolbox/versionnumber/pname".  For example, after running, PackageTools:-SetProperty('pfile',"MapleVersion","2050"), the package pfile will only be installable by Maple version 2050, and will only be added to Maple 2050's libname.  Other versions of Maple will be unaffected by the installed package.
 • The overwrite option controls whether an installation should replace files that already exist.  The default is overwrite=false.  The install may fail even when overwrite is specified due to files that are to be overwritten being in-use, in which case the operating system may not allow them to be changed.  In this case you should try PackageTools:-Uninstall first and/or remove the files manually.
 • The Install command will extract .help, and .mla files and install them in "pname/lib".  If the .maple file contains one or more saved variables, it will also copy package_file to "pname/lib".  Binaries located in "bin.\$SYS" directories at the top level of the package explorer tree will be extracted into corresponding directories under the install directory.

Examples

 > $\mathrm{with}\left(\mathrm{PackageTools}\right):$

To install a package from a local file:

 > $\mathrm{Install}\left("mypack.maple"\right)$

To install a package from the MapleCloud using the package's unique identifying number and version:

 > $\mathrm{Install}\left(123456789000000,\mathrm{version}=1\right)$

Note that the above example does not refer to an actual MapleCloud package. To install a package from the MapleCloud, replace 123456789000000 with the value from an uploaded package. The unique identifying number for a package can be found using the ID property for the GetProperty command.

Compatibility

 • The PackageTools[Install] command was introduced in Maple 2017.
 • For more information on Maple 2017 changes, see Updates in Maple 2017.
 • The PackageTools[Install] command was updated in Maple 2018.