title: Mac OSx PKG preinstall script issue
body: <p>I have a problem with running preinstall script within PKG I created for Mac OS X on linux machine.</p>
  
  <p>My problem is, that preinstall script is not executed and installer finishes with sucess, even my script should cause the failure.</p>
  
  <p>I have prepared following directory structure on the hard-drive:
  </p>
  
  <pre class="lang-none prettyprint-override"><code>./Applications
  ./Resources
  ./Scripts
  </code></pre>
  
  <p>by running of following commands:</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>mkdir -p Payload.pkg
  chmod -R a+w Applications
  chmod a+x Scripts/preinstall
  
  mkbom -u 0 -g 0 Applications Payload.pkg/Bom
  
  find Applications | cpio --owner 0:0 -H odc -o | gzip -c &gt; Payload.pkg/Payload
  
  pushd Scripts
  find . | cpio --owner 0:0 -H odc -o | gzip -c &gt; Payload.pkg/Scripts
  popd
  
  chmod a+x Payload.pkg/Scripts
  
  xar --compress none -cf MyApp.pkg Distribution Resources Payload.pkg
  </code></pre>
  
  <p>I have created package with following structure:
  </p>
  
  <pre class="lang-none prettyprint-override"><code>My package.pkg
      +--Distribution
      +--Resources
          +--welcome.rtf
      +--Payload.pkg
          +--Scripts
          +--Bom
          +--PackageInfo
          +--Payload
  </code></pre>
  
  <p>my preinstall scripts has following content:</p>
  
  
  
  <pre class="lang-none prettyprint-override"><code>#!/bin/bash
  ##preinstall
  
  pathToScript=$0
  pathToPackage=$1
  TargetLocation=$2
  targetVolume=$3
  
  exit 1
  </code></pre>
  
  <p>Which should be causing failure of the installer. However it does not. It seems, that script is not invoked.</p>
  
  <p>Could somebody help me please?</p>