Create a standard Composer .PKG with the Vendor's original .DMG file as the only file payload (Recommend dumping into ~/private/var/tmp/). Edit this script with three variables and use as postflight. 1. VendorDMG=the full path to the vendor .DMG payload file 2. VendorDisk=The volume name of the Vendor's .DMG when mounted 3. VendorAPP=The name of the vendor application to be removed (old versions) from ~/Applications and copied from the mounted .DMG file.
This mounts the vendor .DMG
checks for an existing copy of the app in ~/Applications for removal, removes if found.
Copies the application to the /Applications, sets proper ownership and permissions
Then un-mounts the vendor .DMG file and removes it as last cleanup.
Useful for making installer .PKGs from vendor .DMG files that are simple copy-to-/Applications folder. Sometimes these apps do NOT like being wrapped into a Composer setup making installs problematic. I'd originally made this for the VMWare Horizon Client, but it works for other problematic apps as well.