Customize Second-Generation Managed Package Installs and Uninstalls Using Scripts
For more information, see Run Apex on Package Install/Upgrade and Run Apex on Package Uninstall.
"packageDirectories": [
{
"path": "expenser-schema",
"default": true,
"package": "Expense Schema",
"versionName": ""ver 0.3.2"",
"versionNumber": "0.3.2.NEXT",
"postInstallScript": "PostInstallScript",
"uninstallScript": "UninstallScript",
"postInstallUrl": "https://expenser.com/post-install-instructions.html",
"releaseNotesUrl": "https://expenser.com/winter-2020-release-notes.html"
},
],
{
"namespace": "db_exp_manager",
"sfdcLoginUrl": "https://login.salesforce.com",
"sourceApiVersion": "47.0",
"packageAliases": {
"Expenser Schema": "0HoB00000004CzHKAU",
"Expenser Schema@0.1.0-1": "04tB0000000719qIAA"
}
You can also use the --post-install-script and the --uninstall-script Salesforce CLI parameters with the sf package version create command. The CLI parameters override the scripts specified in the sfdx-project.json file.
You can designate an active Dev Hub org user to receive email notifications for Apex gacks, and install, upgrade, or uninstall failures associated with your packages. In Salesforce CLI run sf package create --error-notification-username me@devhub.org or sf package update --error-notification-username me@devhub.org. In Tooling API, use the PackageErrorUsername field on the Package2 object.