I am writing an app to clean up (delete or copy into) files in the Program Files (Windows) or Applications (OS X) folder. Of course, I don’t seem to have the permissions to do it – does anybody know if there’s a way to enable special permissions in Xojo?
Seattle WA USA
Try using the SpecialFolder command.
Thanks, Edgard. Yes, SpecialFolder retrieves the location of these system folders, but actually copying a file, like in app into one of those folders isn’t typically allowed as far as I see. Any advice guys?
Menu->Insert->Build step->Copy files.
Drag your folders/files into the window. In the right windowpane you can specify the destination and when this copy run should take place (debug/build).
You’ll need to use the AuthenticateShell class (if you Google you should find it). There is a however… For installing an application, it can certainly be used at the moment, but it cannot be used with a Sandboxed application, so consider carefully if you also want to release the application on the Mac App Store (which Apple will take care of installation for you).
The other way to do it, is to use Apple Script to control Finder and get Finder to do it for you.
If you Google “InstallEasy” you might find some code that I wrote back in '09 to do this.
Excuse me. I misunderstood the question. I thought it was concerning copying files into your application’s folder.