Kind of basic and crude, but something like this:
#!/bin/bash while read PKG; do installer -pkg "$PKG" -tgt / -verbose done < <(find /path/to/packages -name *.pkg -o -name *.mpkg)
That should locate any installers (.pkg or .mpkg files) in the directory and run each one thru command line installer. The above does no error checking, so if any of them fail to install, I'm not sure how it would be reported. Hence why I threw in the -verbose flag so hopefully you'd get some output to tell you that.
You'd need to specify the /path/to/packages in the script, either hardcoded, or as a variable, or even passed as a parameter to the script, like in $4
@LSinNY Actually, I wasn't referring to your post, I was referring to mine 🙂 My script doesn't do any error checking as I literally just threw it together before I posted.
I haven't actually looked at installpkg, mostly because I wasn't aware it was there. Thanks for pointing it out. I plan on taking a look at it at some point. And glad you're making use of App Packager!