X

Geertjan's Blog

  • January 25, 2006

Manual Creation of Autoupdate Descriptors

Geertjan Wielenga
Product Manager
Hurray, Masoud Kalali's Update Center is up and running! You can now get his great Gmail Checker very easily (and Masoud will be able to publish updates to his Gmail Checker even more easily). Register the URL to his Update Center in the IDE (as explained several times before in this blog):

http://www.solarisict.com/updates.xml

And then you too will see this in the Update Center wizard (I've successfully installed his module in NetBeans IDE 5.0 Beta 2 and also in a post-5.0 development build):

Masoud had a bit of trouble setting up his Update Center. He'd put his autoupdate descriptor and NBM files on the host, but when he (and I) tried to access the NBM files, we couldn't download them. Masoud wrote to say that this was because of a problem with the ".nbm" extension: "We had to add a new MIME extension to our host configuration, which is control panel dependent. I added a new MIME, with the 'nbm' extension and Zip file types. Now NBM files are treated as ZIP files, so the host controller allows the downloading of these files." So, anyway, maybe other people encountering this problem will now know what to do.

Next, a great tip I picked up from Sandip today. But, before going any further, be careful of this tip. It is a bit of a hack and not recommended. Still, if you're impatient and want to put your Update Center together without using a post-5.0 development build (which creates the autoupdate descriptor for you), take the following steps:

  1. In your filesystem (i.e., outside NetBeans IDE), right-click the NBM file.

  2. Open the file in WinZip (or some other utility that can open it, depending on your OS, etc).

  3. One of the files you'll find inside the NBM file is called info.xml.

  4. Paste the content of that file in an XML file, between the following tags:

    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE module_updates PUBLIC "-//NetBeans//DTD Autoupdate Catalog 2.3//EN"
    "http://www.netbeans.org/dtds/autoupdate-catalog-2_3.dtd">
    <module_updates timestamp="00/00/15/24/01/2006">
    <?xml version="1.0" encoding="UTF-8" ?>
    <!DOCTYPE module_updates PUBLIC "-//NetBeans//DTD Autoupdate Catalog 2.3//EN"
    "http://www.netbeans.org/dtds/autoupdate-catalog-2_3.dtd">
    <module_updates timestamp="00/00/15/24/01/2006">
    PASTE THE CONTENT OF INFO.XML HERE
    <license name="no-license.txt"><![CDATA[[NO LICENSE SPECIFIED]
    ]]></license>
    </module_updates>

  5. Right-click the NBM file in your filesystem and then look at the value for "Size on Disk". It should say something like "28,672". Remove the comma. Now put that number (i.e., "28672") as the value of the "downloadsize" element.

  6. Now look at the "distribution" element and make sure it points to the location and name of the NBM file. (By default, the "distribution" element has this value: "http://www.netbeans.org".) In my case, because the NBM file will be in the same directory as the autoupdate descriptor, I have this value: "./executionprofile_nb41.nbm".

And I think that's all! (Anyway, based on the notes I made, that's all I had to do.) You now have an autoupdate descriptor. (You can also add <module_group> tags around the <module> tags, if you like, to group the modules in your Update Center.)

So, finally, by going through the above process, I added the NetBeans IDE 4.1 version of Iván Rivera Rodríguez's Execution Profile plug-in module to my Update Center. Notice, though, that both modules have the same name (unfortunately, I don't think you can set the name via the autoupdate descriptor). The way you can tell the difference between them is by looking at the long description (slightly clunky solution to this problem, but it's a temporary fix):

So, if you're a NetBeans IDE 4.1 user who needs to set runtime arguments or JVM arguments per class, rather than per project, now you know where to go. (There's only one difference between the 4.1 version and the one mentioned yesterday: the 4.1 version doesn't include help files. But, the plug-in module is pretty self-explanatory and what are you doing using NetBeans IDE 4.1 anyway? Isn't it time you started playing around with NetBeans IDE 5.0 already?)

Join the discussion

Comments ( 6 )
  • sandip Wednesday, January 25, 2006
    In the step 4 you don't paste the whole contents of info.xml but only the contents of module
    tag. Do not paste the xml header and doctype).
  • Geertjan Wednesday, January 25, 2006
    Yes. I guess I should have said: "the whole content of info.xml that you see in the browser":

    <img src="http://blogs.sun.com/roller/resources/geertjan/ivan_41a.png">

  • anegrin Thursday, January 26, 2006
    if you checkout sources from Explore from here NetBeans module you can see how to do this in an automated way using ant and xslt. please refer to



    http://cvs.sourceforge.net/viewcvs.py/efhnbm/efhnbm/



    and take a look at build.xml "postprocessing" target.
  • Masoud Kalali Friday, January 27, 2006
    it was Geertjan technical writings that help me to create that UC , im sure that there are more with Geertjan than this blog.
    thank you for providing tips/ technical stuff and how to(s).
  • Kai Eckert Friday, July 17, 2009

    For those interested in a PHP script that automatically generates the updates.xml for uploaded NBM files, look at http://sourceforge.net/projects/nbmcenter/.


  • K.A.I.E.C. Friday, July 17, 2009
    [Trackback] Do you use Netbeans? It is my favorite IDE for Java development and beside the IDE, it also provides the Netbeans Platform, a GUI framework that makes the development of GUI applications (so called Rich Client Applications) very easy. One of the featur...
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.