SpecialLocation commonApplicationDirectory?


#1

Is there something similar to the commonApplicationDataDirectory - Windows “\Documents and Settings\All Users\Application Data” except that it is possibly the commonApplicationDirectory and would be (on Windows) “(driveLetter):\Program Files”?

I assume for Linux it would return /usr, and I have no idea what it would be for a Mac.


#2

Yes, that’d be a good addition. Thanks for the suggestion. I’d probably call it “globalApplicationsDirectory”.


#3

Alright, since it wasn’t there, I went ahead and created a working fix. I tried continue the same format you used for the rest of the Special enumerators.
Windows source: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/enums/csidl.asp
Mac source: http://www.westwind.com/reference/OS-X/where-files.html

juce_win32_Files.cpp:

const File File::getSpecialLocation (const SpecialLocationType type) { switch (type) { case globalApplicationsDirectory: return juce_getSpecialFolderPath (CSIDL_PROGRAM_FILES);

juce_linux_Files.cpp:const File File::getSpecialLocation (const SpecialLocationType type) { switch (type) { case globalApplicationsDirectory: return File (T("/usr"));

juce_mac_Files.cpp:const File File::getSpecialLocation (const SpecialLocationType type) { switch (type) { case globalApplicationsDirectory: return File (T("/Applications"));

juce_File.h:enum SpecialLocationType { /** The system wide programs folder. On Windows, it is probably the "/Program Files" directory. On the Mac it's the "/Applications" folder. Linux is "/usr". */ globalApplicationsDirectory,
After a quick test, I verified that this works on Windows. I’m unable to test on the Mac, and I don’t really want to boot into my Gentoo install right now.


#4

yep, that’s exactly the same code I had for it.


#5

Sweet. 8)


#6