I have a customized macOS package installer that only executes scripts created by something like the following:
pkgbuild --identifier com.example.hello --scripts scripts --nopayload intermediate.pkg
productbuild --distribution distribution.dist --resources resources final.pkg
If the preinstall or postinstall script were to fail, the installer GUI displays a default message The installation failed. The Installer encountered an error that caused the installation to fail. Contact the software manufacturer for assistance.
Is there anyway to customize this error message similar to what productbuild provides for customizing welcome and conclusion content?