Please, please, please, add an option to elevate rights on OSX so I can copy and create files in protected folders. Especially the plugins folder, as my recent APP is a plugin manager.
I have read the documentation on how to do that on OSX but for some reason (I have some mental disability problems) I can’t get my head around it…
What? Tom, that’s not right, will have to disagree. Otherwise everything that JUCE stands for is mute. There’s a heck tons of stuff that are platform specific, but that mirrors to all platforms, ok, they go. But now something that is needed in all platforms, as rights to protected folders, can be done in Linux, which JUCE already DID. :-\ Humm… On Windows is just a compiler setting. On OSX is more complicated… And on iOS JUCE HAS IT. :-\ Humm…
I agree with William here. Windows has a mechanism for this too. For other platforms you have permission flags etc. that are all supported by JUCE to ask for microphone, camera access etc. so I don’t think asking to OS to elevate privileges, so custom installers etc. can do their job is too strange to include.
I think I must have misunderstood the request, or, at least, there’s a gap in my knowledge here.
macOS and Windows both provide ways of launching or scheduling processes that run with different permissions than the parent. Although similar, they’re not easy to unify into a single API, and I don’t believe anything equivalent exists on the mobile platforms. Wrapping this functionality is different from applying application-wide permissions such as microphone access. What would a good cross-platform API look like?
What have we already done in Linux? I think this might be the bit I’m missing.
In my case, this would really save my day. As I need it for two situations.
my custom installer, which I can share the source-code and even create a short manual about it. It works great on Windows, thanks to the one-setting it takes me to make it request admin rights.
my plugin manager + bridge, which needs to erase and create bridged plugin files.
I had to do this myself for my installer… I doubt you’ll get ROLI to add it for you. It’s pretty involved and requires you write a helper tool which will probably be something customized for your needs.
Ok, I just tried something with the one-liner, and it seems to work. Since I need my entire app to run with elevated rights, I just make the main app a simple caller to the one I really want to use, which I hide inside the data folder. Seems ok, it asks for the password at startup and run correctly
Ok, that didn’t work. It does ask for the password and launch the application. But inside the application I can’t write to protected folders such as /Library/Audio/Plug-Ins/VST
But I can call a scrip and it will do anything to that folder above. So I will stick with that for now. I will let me code create the script and run it when needed. A bit of a PITA as every time you do something that needs that, a password will be asked. Ugly…
As long as the AuthorizationRef (m_auth) is valid within it’s time limit (around 15 minutes or so) you can call the tool as above in an ObjectiveC function.
I have a tool named accentutil which is a command line app with the usage:
run: accentutil -?
Usage: accentutil -S SourcePath -D DestPath [-R] [-V] [-X] [-?] [/HELP]
You can use either - or / for the parameters
[/R] Copy Recursively (Optional)
[/V] Enable verbose mode (Optional)
[/X] Delete the DestPath recursively if it exists (Optional)
[/HELP] Display this help info. (Optional)
Return values: 0: No Errors
-1: Error copying source to dest
-2: Source doesn't exist
-3: Either the source or dest path is empty
Version: 1.0.1
NOTE: Your tool and calling app must both be signed with the same cert.
Also, for some reason I can’t open a new ChildProcess and have it run the one liner example. Trying to debug why it won’t run but so far no luck. All my other processes run without problems.