function validateFlatOptsAsync (opts) {
  if (opts.pkg) {
    if (typeof opts.pkg !== 'string') return Promise.reject(new Error('`pkg` must be a string.'))
    if (path.extname(opts.pkg) !== '.pkg') return Promise.reject(new Error('Extension of output package must be `.pkg`.'))
  } else {
    debugwarn('No `pkg` passed in arguments, will fallback to default inferred from the given application.')
    opts.pkg = path.join(path.dirname(opts.app), path.basename(opts.app, '.app') + '.pkg')
  }

  if (opts.install) {
    if (typeof opts.install !== 'string') return Promise.reject(new Error('`install` must be a string.'))
  } else {
    debugwarn('No `install` passed in arguments, will fallback to default `/Applications`.')
    opts.install = '/Applications'
  }

  return Promise.map([
    validateOptsAppAsync,
    validateOptsPlatformAsync
  ], function (validate) {
    return validate(opts)
  })
}
This function returns a promise validating all options passed in opts.
@function
@param {Object} opts - Options.
@returns {Promise} Promise.