I am not sure why do you have both postinstall
and postflight
in a package. Both are same scripts which must be run after the "copy files" phase of the installation.
"postflight
" name was used in older style packages - bundles.
After the introduction of flat packages, the same script has to be named as "postinstall
".
In flat packages, installer treats a file as a postinstall script only if its name is "postinstall", not "postflight" and is present inside "Scripts
" directory, not "Resources
" directory.
Probably, this is the reason your script is not being executed.
You can get some more information regarding scripts used in packages here.