2

Requirement: Distributing a macOS application. Due to odd requirements the .app-file should not be copied to /Applications, but to a specific path that should be chosen by the user. If that is not possible, it should be unpacked to the same path like the .pkg-Installer.

Example: There is the application SomeApp.app. We pack the SomeApp.app into a SomeApp.pkg. User downloads the SomeApp.pkg to ~/Downloads. After executing the SomeApp.pkg the SomeApp.app should be unpacked to ~/Downloads/SomeApp.app ...or to a path the is specified by the user.

Is there any possibility to change the Distribution.xml (or any other file) so that user can specify a specific path where the .app-File should be unpacked to?

The documentation of the Distribution.xml (https://developer.apple.com/library/content/documentation/DeveloperTools/Reference/DistributionDefinitionRef/Chapters/Distribution_XML_Ref.html#//apple_ref/doc/uid/TP40005370-CH100-SW10) describes a property customLocation and says:

Optional. Specifies the default installation location, within the installation volume, for this choice. Implies that the user can choose a different installation location. If unspecified, the user cannot choose the installation location for this choice.

If a "customLocation" is defined, the installer unpacks the .app to that specific path but the user is only able to change the volume but not the path on that volume.

Robert Nissl
  • 111
  • 1
  • 3
  • Why do you use .pkg at all? Do you have special requirements? Otherwise, if your application is a simple bundle it is a common expectation for normal users to get a ZIP archive containing the application bundle. – mschmidt Mar 19 '18 at 15:56
  • Perhaps this [question](https://stackoverflow.com/questions/11487596/making-os-x-installer-packages-like-a-pro-xcode-developer-id-ready-pkg/11487658#11487658) may provide help. – mschmidt Mar 19 '18 at 16:04
  • 1
    @mschmidt: If the user downloads the app bundle within a zip archive, the app is translocated (since 10.12). (https://lapcatsoftware.com/articles/app-translocation.html). So the app can't access external resources, which is a requirement. With the .pkg we try to circumvent the translocation. Otherwise the user has to move the bundle to another folder and back again (to disable it), which is not really user friendly. The link you've provided couldn't help me further, but thx. – Robert Nissl Mar 20 '18 at 10:29
  • Yes, seems you are correct. Thanks for the info. – mschmidt Mar 20 '18 at 11:02

0 Answers0