PackageTools - Maple Programming Help

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

PackageTools

 IsPackageInstalled
 check if a workbook-based package is installed

 Calling Sequence IsPackageInstalled( package_id ) IsPackageInstalled( package_id, output )

Parameters

 package_id - string output - : (optional) title, version, id, path, Record, or JSON

Description

 • The IsPackageInstalled command returns false if the installation bundle with the given package_id is not installed, otherwise it returns information about the installed package as specified by the output option.
 • The first argument in the calling sequence can be a string representing the "title" or "id" number of the given package.  A match is found by iterating through the output of PackageTools:-ListInstalledPackages.
 • By default output = version; which, when the package is found will return a string indicating the version of the given package. The title, id and path output variants will return a string with the specified property. Using output=Record will give you a Record containing all of these properties. Similarly output=JSON will give a JSON formatted string containing all of the properties.
 • This command is intended to work with the notion of "package" pertaining to installation-bundles.  To find traditional maple-based package modules that are installed, try using with or assigned.  To find the source library that contains a package-module, use the LibraryTools:-FindLibrary command.
 • The primary use of this function is for behind-the-scenes work interfacing with the GUI to assist with installation and package management.

Examples

 > $\mathrm{with}\left(\mathrm{PackageTools}\right):$
 > $\mathrm{IsPackageInstalled}\left("1234"\right)$
 > $\mathrm{mypacks}≔\mathrm{PackageTools}:-\mathrm{ListInstalledPackages}\left(\mathrm{output}=\mathrm{Record}\right)$
 > $\mathrm{map}\left(x↦\mathrm{PackageTools}:-\mathrm{IsPackageInstalled}\left(x\left[\mathrm{id}\right]\right),\mathrm{mypacks}\right)$
 > $\mathrm{IsPackageInstalled}\left("1234",'\mathrm{output}'=\mathrm{Record}\right)$

Compatibility

 • The PackageTools[IsPackageInstalled] command was introduced in Maple 2017.