Get ArcMap installation directory

837
2
Jump to solution
07-28-2021 10:23 AM
bojko108
New Contributor II

Hello!

I was wondering if there is a way to find the directory path where ArcMap is installed. Is there a key in the registry or a method in ArcObjects which can tell me the path to the directory where ArcMap is installed?

I've developed an AddIn which is installed on different machines with different configurations - ArcMap is installed in different places. I want to get the path to the addins directory at runtime (ideally located here: C:\Program Files (x86)\ArcGIS\Desktop10.6\bin\Addins).

Thanks

0 Kudos
1 Solution

Accepted Solutions
GKmieliauskas
Esri Regular Contributor

Hi,

Have you tried this:

System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);

It works from add-in.

View solution in original post

0 Kudos
2 Replies
GKmieliauskas
Esri Regular Contributor

Hi,

Have you tried this:

System.IO.Path.GetDirectoryName(System.Windows.Forms.Application.ExecutablePath);

It works from add-in.

0 Kudos
bojko108
New Contributor II

Thanks! I completely forgot about .net framework. Another way to get the directory is by:

AppDomain.CurrentDomain.BaseDirectory

 

0 Kudos