I am distributing an Addin for ArcGIS, and I love when you point the Addin manager to a folder, updates automatically get applied on the next restart. However, when you click on an Addin, it takes away this ability because it doesn't know where the source is.

In my Addin, I would like it to figure out if it is installed the shared way, or the double-click-on-the-file way. Then if it is installed in the double-click way, I can prompt the user if they would like to upgrade and show them the path to the upgrade.

It appears the Add-In manager knows where the Addin came from because it shows "My Add-ins" (which are from the double-click method) and the "Shared Add-Ins" (the add the folder method).

Anyone have any ideas which ArcObject this may be obtained or another round about way?

1 Answer 1


I am not aware of an ArcObject interface or class that does this, but that would useful. And I don't have a complete answer for you question, but here is a suggestion that you might be able to build on.

I have an AddIn that has an Extension that checks the ArcMap "loaded" (ThisAddIn.Version) AddIn version with the version that I have deployed in a shared folder and then warns the user if they are different.

/// <summary>
/// Gets the add in version from the Addinfile
/// </summary>
/// <param name="path">The full path to an Esri AddIn file</param>
/// <returns>Add In Version</returns>
private static string GetAddInVersionFromFile(string path)
    string version = string.Empty;

    if (!File.Exists(path))
        throw new FileNotFoundException("AddInFile Not Found", path);

    ZipFile file = new ZipFile(path);

    foreach (var entry in file.Entries)
        if (entry.FileName.Equals("config.xml", StringComparison.InvariantCultureIgnoreCase))
            Stream stream = new MemoryStream();


            if (stream != null && stream.Length > 0)
                string xmltext = string.Empty;

                stream.Position = 0;

                using (TextReader reader = new StreamReader(stream, Encoding.ASCII))
                    xmltext = reader.ReadToEnd();

                if (!string.IsNullOrEmpty(xmltext))
                    System.Xml.XmlDocument doc = new System.Xml.XmlDocument();


                    version = (doc["ESRI.Configuration"]["Version"]).InnerText;


    return version;

You could potentially build on this and check the registry folders HKEY_LOCAL_MACHINE\SOFTWARE\ESRI\Desktop10.0\Settings\AddInFolders and the AddInFolders.xml folder locations and look for your AddIn.

The ZipFile reference is Ionic.Zip.dll which I think is here: http://dotnetzip.codeplex.com/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.