title: How to install package in macOS Apps
body: <p>I am new of macOS Development but i do have experience in iOS Development.
  I am developing an installer application for a package <code>XYZ.pkg</code>
  And i want to install this package with my own GUI instead of default macOS Installer.
  The Package is available in my Application's bundle and when i try to install it via command it crash.</p>
  
  <pre><code>guard let pathOfResource = Bundle.main.path(forResource: "SomePackageName", ofType: ".pkg") else {
      return
  }
  
  self.loadingView.alphaValue = 1
  self.loadingView.layer?.isHidden = false
  self.activityIndicator.startAnimation(sender)
  let argumentString = "-pkg " + pathOfResource
  let argumentString1 = "-target /"
  let path = "/usr/sbin/installer "
  let arguments = [argumentString,argumentString1]
  
  let task = Process.launchedProcess(launchPath: path, arguments: arguments )
  task.waitUntilExit()
  self.activityIndicator.stopAnimation(sender)
  self.loadingView.alphaValue = 0
  </code></pre>