MozNET Tutorial - Register A Custom Component : AIO Specific
This short tutorial will describe the steps you need to follow in order to register and
unregister XPCom components when using the AIO build. It's a very simple process and I'll have you up and running
with the ball in no time.
First thing first. We need a decent, light-weight, text editor. While Visual Studio is great for working with code files it's a bit overkill for what we're doing here.
A good editor to use would be something such as Programmer's Notepad or Nodepad++ or something similar. I use Programmer's Notepad,
myself. It's free, light-weight, and has quite a few features. I'm sure you have you're own preference for text editors so feel free to use your favorite.
Let's get started...
To register your components with the MozNET AIO build you need a configuration file to tell MozNET what you want to do.
All you need is a text file that has the extension of xcg. That's it. Simple, eh?
Oh, yeah. You're probably wondering what to put in that file, eh? That's simple enough, too.
Here's a very simple example of a proper config file:
//This is a comment line
#This is also a comment line
// | is meant as an 'or' here - it's one or the other, use a bit of common sense ;)
[upgrade]
//myOldComponent.dll|js|xpt, myNewComponent.dll|js|xpt
//myOlderComponent|js|xpt, myNewerComponent|js|xpt
[register]
myNewestComponent.js, myNewestComponent.xpt
myOtherNewComponent.dll, myOtherNewComponent.xpt
myManagedComponent.xpt
[unregister]
myOldestComponent.dll, myOldestComponent.xpt
myBrokenManagedComponent.xpt
Not a whole lot to it, eh? All you need to do is place your configuration file into a subfolder of your output/install/bin directory
and put all the component files that you want registered or upgraded into the folder with it.
You're done. MozNET will find the file and do the work. Just as a note, a good file name for this configuration file is 'moz.cfg'.
This allows your application to update its components with a simple restart.