Although below are methods to extract the contents of a macOS package without actually installing it, the best way might be to create a blank disk image and install the package to this disk image in order to inspect the package contents. To do so:
- Open the Disk Utility app.
- Choose "File > New Image > Blank Image". Alternatively, simply press CMD-N.
- Set the parameters and click on "Save" to create the blank disk image.
- After creation, it should be already mounted. If not, you can mount it by navigating to the directory that it is placed at and double clicking on the disk image file.
- Run the package installer by double clicking on the package file.
- Select this newly created blank disk image as the destination and install it.
- If the script is preventing you from installing by saying, for example, "macOS isn't installed", you can: