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, CFSTR("OnTime.vst"), NULL, NULL); FSRef source, destDir; CFURLGetFSRef(cfURLref, &source); OSStatus osstatus; Boolean isDirectory; UInt8 pathIn = "/Library/Audio/Plug-Ins/VST"; FSPathMakeRef ( pathIn, &destDir, &isDirectory ); 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!