This updated and expanded script allows to work around the JAMF binary issues listed below by leveraging the default macOS installer binary.
Expanding on the functionality in July's installPKGfromDMG - Fix pass exit code to JSS Parameters now included are... dmgName="" # Required forcesuccessflag="" # Optional useinstallerapp="" # Optional allowUntrusted="" # Optional Require parameter 6 to be YES applyChoiceChangesXMLFile="" # Optional Require parameter 6 to be YES Supplying parameter 5/forcesuccessflag with "YES" without quotes and case sensitive allows PKG exit code to be bypassed and returns a forced exit code of 0 to the JSS (if needed). Supplying parameter 6/useinstallerapp with "YES" without quotes and case sensitive forces the use of macOS native installer binary to install the PKG. Supplying parameter 7/allowUntrusted with "YES" without quotes and case sensitive allows to bypass an invalid or expired certificate embedded within the PKG. Supplying parameter 8/applyChoiceChangesXMLFile with an XML filename allows the PKG to be supplied an xml answerfile. The xml file MUST be beside the PKG wrapped in your DMG. Please take careful note, that parameters 7 (allowUntrusted) and 8 (applyChoiceChangesXMLFile) are dependent on parameter 6 (useinstallerapp) being YES. I've also added mpkg if no pkg is found within the DMG. Additionally all parameters will be parsed in the logs so one can see if, when, and where something went wrong.