Yes, SBA supports different ways to install an Addin but I do not recommend doing anything but installing Addins to the GAC. Why? Because moving forward we want your Addins to work with future versions of SBA, so if you install in the installation directory of SBA 2006 then future versions will not know about this location. So here's my model that an Addin for SBA should follow.

  • Install your dll that has the IDriverRegistrationFactory, IDriverFactory and IDriverInfo interfaces to the GAC.
  • If your Addin uses aditional resources (such as files, images, config files or documents) then have these installed in your own directory in Program Files or something like that.
  • Have a way to access these resources from your assembly running from the GAC. Probably an entry in the registry is your best bet.

Since I'm recommending to install to the GAC, here is some sample code that shows how to install your Addin programmatically to a company in SBA. The version number and key I got from the properties of the dll itself.

    Assembly addinAssembly Assembly.Load("UIAddIn, Version=1.0.2397.33602, Culture=neutral, PublicKeyToken=95bd7dbfa9c4028e");

utilities.SbaInstance.RegistrationHandler.RegisterAssembly(addinAssembly, utilities.SbaInstance, false);

After you install your addin, the next time SBA opens that company, the user gets a dialog informing the user that a new addin has been installed and the can enable them or not. The user has control over what is enabled and what is not and we don't expose this programmatically.