I wouldn’t do this. Why not just copy the plugins using STPrivilegedTask? Also I hope that you don’t literally have a
.sh file that you execute using that, because then would be trivial to mess about with your installer to run stuff as root.
I have reservations about the need/reason for a custom installer, it’s really not “usual” under macOS, and I pretty much always cringe when presented with something that’s not the default installer, however I assume you have a reason other than “because I wanted to” for going down that route?
The documentation for building installer packages is pretty crap tbh (at least I couldn’t find anything useful online, JUCE forum was the most helpful!), but this provides a good example to follow, or there is Packages, which is really just a GUI wrapper around the built in tools, much better to learn those imo.
I had a look at my
/Library/Audio/Plug-Ins folder, and it looks like already some silly installer has gone a changed the permissions for my
VST3 folder to 777 and left it like that!
Within the various folders there is a mix of plugins that are 755 and 777 with a couple of 700s, some are owned by
$USER:wheel, some by
$USER:admin, some by
$USER:staff and a few by
imo 777 is a bad idea, it allows anyone to write to the folder, and really the only time you want 777 is because you can’t be bothered to get the permissions structure correct because you’re in a hurry (I’ve done it a million times in VMs used for local web dev; just quicker and easier to 777 the relevant paths to get it working)