title: Running postflight script when installing a package on Mac
body: <p>I am trying to build a mac package installer from a script and I want to run postinstall and postflight scripts. My script for building the package looks like this:</p>
  
  <pre><code>pkgbuild --root MyRoot/MyApp.app --identifier com.myapp.MyApp --scripts Scripts --install-location /Applications/MyApp.app MyApp.pkg
  productbuild --synthesize --package MyApp.pkg Distribution.xml
  productbuild --distribution Distribution.xml --resources Resources --package-path . CompleteInstaller.pkg
  </code></pre>
  
  <p>I've placed the postinstall script in Scripts and it is being executed successfully. I have a problem with running the postflight script though. It is placed in the Resources directory and doesn't get executed. Is this not enough to specify the path to it? I couldn't find an answer to this question, I'm sorry if I've missed it.</p>
  
  <p>PS: My postflight script does nothing special - for now it tries to create a file in the home directory:</p>
  
  <pre><code>#!/bin/sh
  touch ~/file
  exit 0
  </code></pre>