Question

I'm attempting to create a package using Packages that installs in ~/Applications (because each user can have an instance of the app in question running but it needs a custom port per user as it daemonises and runs like an HTTP server).

I can't work out how this is done. In the Payload section I can only pick from /Applications, /Library and /Users/Shared. I've tried adding a custom folder but without knowing the username ahead of time I don't know what to put in the prompt.

I could use a shell script in the Scripts tab (part of the install requires that anyway), but I'm unclear as to where the binary for the app should be put (I could place it in one of the above paths and then move it but I don't wish to spread build artefacts around the user's system, even for clean builds), or how to refer to its initial location in the script, whether it's via the Payload tab or the Additional Resources section under Scripts.

I'm happy to use a different tool or directly edit scripts (back to the old days;-) any help or insight would be much appreciated.

Was it helpful?

Solution

pkgbuild and productbuild

Try building the package using the newer pkgbuild tool. You can pass --install-location <install-path> as part of the command.

You may also find productbuild useful to know about.

Both tools have detailed manual pages and can handle installation in script determined locations.

Licensed under: CC-BY-SA with attribution
Not affiliated with apple.stackexchange
scroll top