$InstallationDirectory
gives the top‐level directory in which your Wolfram System installation resides.
Details

- $InstallationDirectory returns the full name of the directory as a string.
- Typical values are:
-
C:∖Program␣Files∖Wolfram␣Research∖Mathematica∖12.0 Windows /Applications/Mathematica.app/Contents Macintosh /usr/local/Wolfram/Mathematica/12.0 Linux
Examples
Wolfram Research (2003), $InstallationDirectory, Wolfram Language function, https://reference.wolfram.com/language/ref/$InstallationDirectory.html.
Text
Wolfram Research (2003), $InstallationDirectory, Wolfram Language function, https://reference.wolfram.com/language/ref/$InstallationDirectory.html.
CMS
Wolfram Language. 2003. "$InstallationDirectory." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/$InstallationDirectory.html.
APA
Wolfram Language. (2003). $InstallationDirectory. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/$InstallationDirectory.html