Not enough privileges to copy a VST bundle in the VST folder

Hi everyone!

I am trying to make my own VST plug-in Installer app. I have found a lot of little obstacles in CoreFoundation because I do not master OSX world (I am a Win32 guy). As a result, every line I have coded costed me hours or days.

Well, I am almost finishing this installer, but I have found a trouble that I really do not know ho to solve. The issue is the following:

The app installer is a bundle and inside this bundle there is a VST payload as a resource, this is, the VST plugin (that, in fact, is another bundle as you know). Well the purpose of the showed excerpt code is to handle the resource (the VST folder/bundle) and try to copy it to the Library/Audio/Plug-Ins/VST destination. All the references are tested and they worked. The problem is that the VST bundle is not copied because apparently there is not enough privileges to do such operation.
The osstatus output code is: [color=#FF0000]“afpAccessDenied” “Insufficient access privileges for operation” code -5000[/color]

[code] CFBundleRef mainBundle;

// Get the main bundle for the app
mainBundle = CFBundleGetMainBundle();
CFURLRef cfURLref;
cfURLref = CFBundleCopyResourceURL (mainBundle,
FSRef source, destDir;
CFURLGetFSRef(cfURLref, &source);

OSStatus osstatus;    
Boolean isDirectory;
UInt8 pathIn[] = "/Library/Audio/Plug-Ins/VST";
FSPathMakeRef (

osstatus = FSCopyObjectSync(&source, &destDir, NULL, NULL, kFSFileOperationOverwrite);


Please, does anybody know how to solve this problem. For instance, how can I get the modal dialogue to allow a user to grant permission by inputting the password, or how can I circumvent this privileges or how can I say to the system that I have enough privileges to copy such bundle?

Any solution is good for me as far as I can get rid of this… nightmare!

Thank you colleagues!


you can also

create an os x installer package. You can use an script inside which copies the files into their place.

use osascript inside a shell script to request admin rights (not sure if that works with mountain lion)

let the user copy the file manually (i think this is the best solution)

Hi chkn,

Unfortunately I have doubled this post. please answer at just in case.

Well, option #1 does not fit well in my idea of app installer, because the main reason to do this installer in Juce GUI is to get ride of OSX installer package GUI. It is not a smart idea mixing both GUI’s in an installer from the point of view of a customer.

Option #2 could be a good one, but I need some help because I do not master shell scripts.

Option #3 is not smart as option #1, is it?

Nevertheless, thank you!