I have inherited a codebase that needs updating, but I don't have the build scripts that created the final pkg file.
The code needs to access a connected USB device (treated as a drive) to read and write bits to, and so it needs escalated privelidges. Due to the non technical nature of the end users, they need to be able to click on the app, and can't be expected to run it from the command line with sudo.
The current installer installs to /Applications/myapp.app, with myapp.app/Contents/MacOS/myapp being set to -rwsr-xr-x root:staff permissions. When installed, this app runs just fine without complaint.
I managed to make a similar pkg file using pkgbuild, and it creates a similar folder in /Applications, with the same permissions, newapp.app/Contents/MacOS/newapp -rwsr-xr-x root:staff. But if I try to run the app without sudo, then I get "The application with bundle ID newapp is running setugid(), which is not allowed."
The mac I have is running macos 10.13.6 The app is python that have been packaged into a binary.
How am I supposed to package this code so it runs as root after it's been installed?
pkgbuild
can make this or drop the app and then run a script to set things up.