---
schema_version: "1"
id: 1c4a82233f4fc5e95f9a66b8c9a71eedfda69c656e266a2d62468c3b032a2d63
title: Specifying a Post Install Script
collection: developer
version: current
locale: en-us
portal_url: https://docs.salesforce.com/developer/current/en-us/platform-pkg-exchange/managed_packaging/guides/first-generation/pd-apex-post-install-script-specify.md
canonical_url: https://developer.salesforce.com/docs/platform/pkg2-dev/guide/pd-apex-post-install-script-specify.html
source_site: developer.salesforce.com
content_type: documentation
content_hash: 5e5e2fd1e404f9c8100089eb8f8e7161e3abcc6fd872e0611843f7b442767293
products:
  - Second-Generation Managed Packaging Developer Guide
  - merged-docs
---

# Specifying a Post Install Script

After you’ve created and tested the post install script, you can specify it in the **Post Install Script** lookup field on the Package Detail page. In subsequent patch releases, you can change the contents of the script but not the Apex class.

The class selection is also available via the Metadata API as `Package.postInstallClass`. This is represented in package.xml as a `<postInstallClass>foo</postInstallClass>` element.

**See Also**

- [Customize Second-Generation Managed Package Installs and Uninstalls Using Scripts](https://developer.salesforce.com/docs/atlas.en-us.pkg2_dev.meta/pkg2_dev/sfdx_dev_dev2gp_customize_installs.htm)
