InstalledPackage

Represents a first-generation managed package to be installed or uninstalled. Deploying a newer version of a currently installed package upgrades the package. You can install up to 20 first-generation managed packages in a single deployment. To install an unlocked or second-generation managed package, use the sf package install Salesforce CLI command.

You can’t deploy a package along with other metadata types. When you deploy InstalledPackage, it must be the only metadata type specified in the manifest file.

Note

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

The package is specified in the installedPackages directory, in a file named after the package’s namespace prefix. The file extension is .installedPackage.

Version 

Introduced in API version 28.0.

Fields 

activateRSS 

  • Type: boolean

  • Required: Yes

  • Introduced: API version 43.0

  • Description: Required. Determines the state of Remote Site Settings (RSS) and Content Security Policy (CSP) at the time of installing the package and must be set to either of these values.

    • true: Keep the isActive state of any RSS or CSP in the package.
    • false: Override the isActive state of any RSS or CSP in the package and set it to false.

    The default value is false.

password 

  • Type: string
  • Required: No
  • Description: Specifies the package password.

securityType 

  • Type: string (enumeration of type string)

  • Required: No

  • Introduced: API version 57.0

  • Description: Determines user access for the installed package.

    The default value is AllUsers.

  • Possible values:

    • AdminsOnly
    • AllUsers

versionNumber 

  • Type: string
  • Required: Yes
  • Description: Required. The version number of the package. The version number has the format majorNumber.minorNumber.patchNumber (for example, 2.1.3).

Declarative Metadata Sample Definition 

The following example specifies a sample package to be installed or uninstalled.

1<?xml version="1.0" encoding="UTF-8"?>
2        <InstalledPackage xmlns="http://soap.sforce.com/2006/04/metadata">
3        <versionNumber>1.0</versionNumber>
4        <password>optional_password</password>
5        <securityType>AdminsOnly</securityType>
6        <activateRSS>true</activateRSS>
7        </InstalledPackage>

The securityType field is optional. If it’s not specified, the default security type is AllUsers.

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.