The postinstall script is set as part of the
package.xml file, which if you're using SFDX for development you'll probably be automatically generating as part of your build script using
We use a tool in our build runner called xmlstarlet which we use to inject the postInstallClass script name into the
package.xml file before it is deployed to the packaging org and the package is created.
xml ed --inplace -N sfdc="http://soap.sforce.com/2006/04/metadata" \
--subnode "/sfdc:Package" --type elem -n "postInstallClass" -v "PostInstall" \
This adds the following element to the
Alternatively you could do this using a find and replace tool like
sed or by maintaining the
package.xml in source.
An issue has been logged against the CLI to allow this and other package related attributes (uninstall script, release notes link etc.) to be specified in the