InstalledPackage represents a first-generation managed package to install or uninstall. It identifies the package release and its installation settings. Deploying a newer version of an already installed package upgrades that package. For unlocked or second-generation managed packages, use the Salesforce CLI command sf package install instead.
The component's identity is the package namespace prefix, not its display name or a package-version record ID. Its descriptor controls installation options; it does not define the individual packaged components or establish how actively users use the package.
Key Elements
| Element | What the Element Controls |
|---|---|
fullName (client component identity) |
The package namespace prefix used to identify the component in Metadata API clients. In file-based metadata, the namespace is the descriptor's filename base. |
versionNumber |
Required. Identifies the package release. The documented format is majorNumber.minorNumber.patchNumber, such as 2.1.3. Deploying a newer release for an installed package upgrades it. |
securityType |
Optional. Determines user access to the installed package. Allowed values are AdminsOnly and AllUsers. Omitting it defaults to AllUsers. |
activateRSS |
Required boolean controlling packaged Remote Site Settings (RSS) and Content Security Policy (CSP) settings at installation. true preserves each setting's isActive value. false overrides that value to false. The documented default is false. |
password |
Optional. Supplies the package password. |
Behavior and Constraints
securityType and activateRSS control independent concerns. Selecting AdminsOnly does not determine whether packaged RSS or CSP settings remain active.
activateRSS=true does not activate every packaged RSS or CSP setting. A setting that the package defines with isActive=false remains inactive. By contrast, activateRSS=false forces packaged RSS and CSP settings to inactive, regardless of their packaged state.
Although the documented default for activateRSS is false, the field is required. Supply an explicit boolean rather than treating the documented default as permission to omit it. securityType is optional, and its omission grants the AllUsers installation access setting, not AdminsOnly.
A retrieved descriptor provides package identity, release, and installation settings. Those details alone do not establish whether the package is heavily used, sparsely used, or unused.
Deployment and Retrieval
Store the descriptor in the installedPackages directory with the filename <namespace>.installedPackage. Use the package namespace prefix as the filename base, not the package's display name or an ID copied from an installation URL.
A single deployment can install up to 20 first-generation managed packages. InstalledPackage must be the only metadata type specified in the package.xml manifest. You cannot combine package installation with deployment of other metadata types in that manifest.
For an upgrade, identify the existing package by its namespace and request the newer release through versionNumber. The namespace identifies the package; the version selects its release. Both matter when distinguishing a new installation from an upgrade.
InstalledPackage supports the * wildcard in package.xml, including retrieval of installed-package descriptors. A retrieved .installedPackage file contains versionNumber, while its filename identifies the namespace.
For version-aware inventory, a community-reported workflow calls listMetadata to obtain package namespaces, then retrieve to read the descriptors. The report states that listMetadata alone does not return package versions. Wildcard retrieval can obtain the descriptors directly.
Relationships
AppMenu can reference an installed package through its name element. This is an incoming reference: name belongs to AppMenu, not to InstalledPackage. The descriptor's namespace-based filename is component identity, not a separate element reference.
Referenced By
-
AppMenu:name.
Documentation Inconsistencies
The InstalledPackage documentation describes versionNumber as majorNumber.minorNumber.patchNumber, but its sample descriptor uses 1.0. The field description and sample therefore do not present one consistent version-string shape.
Reported Issues
-
A successful deployment can still install no components. In a 2021 case, the package namespace was
FBO, but the submitted descriptor was namedfbo.installedPackage. A respondent reported successfully installing the same package and highlighted case sensitivity. Check namespace capitalization when diagnosing this symptom, but do not treat it as the universal cause of empty successful deployments. Deployment with no components installed. -
A package-name inventory can lack the versions needed for upgrade decisions. A 2013 community answer reported that
listMetadatareturns namespaces but not package versions. It described retrieving the listed descriptors, or using wildcard retrieval directly, to readversionNumber. Retrieve installed package versions. -
An installation URL's package-version ID is not a substitute for namespace and release information. In a 2022 automation discussion, an answer recommended the Tooling API's
PackageInstallRequestfor installation using an04tID rather than trying to use that ID asInstalledPackageidentity. It also noted that distinct second-generation package versions can share a namespace and version number. Installing from a package-version ID. -
Filtering Apex classes by a field named
InstalledPackagecan fail. In a 2021 Tooling API query report,ApexClassrejected that field. An answer suggested filtering byNamespacePrefixinstead when narrowing classes by package namespace. This is a query filter, not a reference element on theInstalledPackagedescriptor. Filter Apex classes by namespace.
Common Questions
Can InstalledPackage install unlocked or second-generation managed packages?
Use sf package install for those package types. InstalledPackage represents first-generation managed packages.
Does omitting securityType install the package for admins only?
No. The default is AllUsers. Set securityType explicitly to AdminsOnly when that is the intended access setting.
Does activateRSS=true activate every packaged remote site setting?
No. It preserves each packaged RSS or CSP setting's isActive state. Settings packaged as inactive remain inactive. activateRSS=false forces those settings to inactive.
Can I deploy InstalledPackage with custom objects or other metadata?
No. InstalledPackage must be the only metadata type in the deployment manifest. One deployment can install up to 20 first-generation managed packages.
How do I retrieve installed package version numbers?
Retrieve the InstalledPackage descriptors and read versionNumber. Wildcard retrieval can obtain the descriptors directly. The reported listMetadata workflow returns namespaces but requires a subsequent retrieval to obtain versions.