Postinstall script behaves differently than if launching from Terminal