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.
~/Applications
cause a different port to be used? I am assuming the binary is identical to one that would be installed in/Applications
. For a unique port, the application should request0
for the port and be assigned one by macOS. Multiple users can then launch the/Applications
copy without concern. See Miln Beyond for an example of this behaviour.