Reg Free Plugins in STK 11

« Go Back

Information

 
QuestionHow do I create a UI Plugin that works both in x32 and x64 STK 11?
Answer
You have two ways to add a UI Plugin to STK. Both methods require that the XML file be placed in the Plugins folder in one of the following areas: the STK install area, the user configuration area, or the ProgramData location.

COM registration is a process of registering a plugin in the Global Assembly Cache (GAC), which requires administrator credentials. In that case, the XML file only needs the Product ID of the plugin. Registry-free registration or “.net registration,” as it is referred in help, does not require administrator credentials, but the XML file has to include information about the exact location of the plugin, the DLL name, and the entry point. Since the exact location is not known until the plugin is actually installed, the XML file needs to be created/updated as a part of the installation.
 
Since large numbers of plugins were written before registry-free registration was available, most of the plugins used COM registration. STK 11 is the first release of the STK Desktop application to include both the 32-bit version and 64-bit version. Since Windows operating system segregates 32-bit and 64 bit areas of the registry, AGI would have to maintain 32-bit and 64-bit versions of all plugins. However, you can build registry-free plugins in a way that allows STK to use the same version for both 32-bit and 64-bit versions of STK.
 
There are now two Visual Studio templates to help address the challenges. The UI Plugin template enables you to create registry-free UI plugins. The template includes examples for interacting with the progress bar, adding a link to the plugin from context menu, adding a link to the plugin from main menu, and adding a link to the plugin from toolbar. It also includes an example of a persistent preference page. The persistent preference page keeps user selections even after you close STK. 

You can use the STK code library for interacting with STK and manipulating STK objects. It includes simple methods to subscribe to events in STK and receive notification when STK objects are modified and mouse events occur on the globe.
 
The Update template is designed to help distribute registry-free plugins. It is not a true installer, since it does not include an uninstaller. In fact, if you include words “install,” “installer,” or “setup” in the program, Windows will inform you that your install failed, since no changes were made to registry.
 
Once you are finished developing your UI Plugin, add a new project to your solution and select the STK 11 UI Plugin Update template. If you run the new project in debug mode, you will get a prompt to select the location of the UI Plugin binaries and enter Display Name, Assembly Name, and Type Name. The values are required to create a valid XML file. Assembly Name corresponds to the base namespace of your UI Plugin, and Type Name is the entry point for the plugin. If you use the UI Plugin template, the Type Name would be Assembly Name plus “.setup”.
 
Running the project in debug mode will zip the UI Plugin and imbed the zip file in the project. The values required for the XML file will be saved in the project configuration file. Once you are done, build the project in release mode and distribute the EXE and CONFIG files to your customers.
 
To install a UI plugin, you need to run the executable and select a directory where you want the plugin copied. The code will extract the UI Plugin, copy it to selected location, and create the XML file.
 
TitleReg Free Plugins in STK 11
URL NameReg-Free-Plugins-in-STK-11

Related Files

Stk11.UiPlugin.Template.zip
Stk11.UIPlugin.Copier.zip