MacOS – Installing system files in home directory

finderinstallmacos

I know that many of the directories in /System/Library/ have analogues in /Library/, and a fewer several have analogues in ~/Library/ as well. I also know that in at least some cases, when the system is looking for something that may be rooted in one of these Library directories, it looks in the analogous locations as well.

For example, an application may install a file in /Library/Application Support/A/B/, but have been just as happy to have installed it in ~/Library/Application Support/A/B/, and though there may be records of the location of every file the application installed, the system may not refer to them when looking for a file. In other words, it knows that any time it checks for anything rooted in System/Library/, it needs to look in the corresponding locations in /Library/ and ~/Library/.

Is that last statement really true? That in all cases, (or in almost all cases, with certain exceptions) when the computer looks in one of the three Library directories it looks in the other two as well? For example, can a user move something that was installed in /System/Libary/Extensions/ to an Extensions directory he creates in his home directory's Library/ and expect it to be loaded from there at login, the way that, say, a property list found in ~/Libary/LaunchAgents/ would have been found just as easily had it been located in /Libary/LaunchAgents/?

Similarly, I notice that some applications store frameworks, plugins, and so forth in directories rooted in those applications' bundles. Can files be moved between there and appropriately-named locations elsewhere without problem? In theory at least, is this the way the filesystem is designed to work?

Best Answer

The answer to all your questions is No

To understand the file system you may like to start with File System Basics.

The three /Library locations are for different purposes though, as you have guessed, there is some overlap.

Briefly, the purpose of each is:

  • /System/Library: Files which allow OS X to start and run.
  • /Library: Other important system and application support files which are not specific to each user.
  • ~/Library: System and application support files which are specific to the user.

So files in /Library/Application Support/x are used by all users of application x and those in ~/Library/Application Support/x are specific to the user. Some applications will only use one or the other, whilst some use both.

Moving folders/files between /Library and ~/Library is likely to cause applications to malfunction or system components to fail. Moving LaunchAgents or LaunchDaemons is especially dangerous.

Even worse, touching /System/Library is likely to prevent your Mac from booting!

Also, files inside application bundles must remain where they are - moving them will break the application.

So, in conclusion, don't move folders around as OS X expects files to be in their right place.