Download NetBeans!

20071021 Sunday October 21, 2007

Installer Generator Creator: Vadiraj Deshpande

Vadiraj, and his team in Bangalore, have been working on the openInstaller, which is a framework for creating cross-platform installers. The NetBeans Application Installer Generator can be seen as the reference implementation of the openInstaller project. You can use it to create an installer for your NetBeans Platform applications, such as this one for the Feed Reader, which is one of the samples bundled with NetBeans IDE:

Check out the the Wink screencast, which shows how the above was created.

Below is an interview I did with Vadiraj about his work and interests in relation to the NetBeans APIs:

Hi Vadiraj, who are you and where do you live? I am Vadiraj, living in Bangalore, which is soon to be renamed "Bengaluru"! I work for the Enterprise Java Platform Group in Sun Microsystems. We're designing and developing an installer for the Java Enterprise System Product stack, which includes Enterprise products, like the Sun Java System Portal Server, the Sun Java System Access Manager, as well as application containers such as the Sun Java System Application Server and the Sun Java System Web Server. The installer helps customers to install and configure these products together.

What's your connection with the NetBeans Platform? Well, frankly it is my favorite toy these days! We are developing a new enterprise grade installer framework called "openInstaller", which was open sourced recently and is freely available at http://openinstaller.dev.java.net. In this, I am involved in developing an IDE for assisting in the development of installers op top of the openInstaller framework. It is far from complete, but it will be able to help you in creating a basic installer which you'll also be able to extend a bit.

I am also working on another plugin which is called NetBeans Application Installer Generator, NAIG, for short, which adds support for installer creation to NetBeans Platform-based applications. This can be used by NetBeans Platform application developers to create installers for their standalone module suite projects.

What is this openInstaller exactly and what was the motivation behind it?

openInstaller came into existence to address some of the issues that we were facing during the previous version of the Java Enterprise System. Here is a summary of the features:

  1. This framework is written from the ground up and has a different architecture and design from its predecessor.
  2. This installer enables non-root installation, multi-install-home installation, like installing multiple copies of the same product on a single box, keeping them separate.
  3. Multiple mode support, where the installer can be executed in GUI, commandline (CLI), and in silent mode. This framework abstracts all these modes from the core framework and user code.
  4. The framework provides declarative UI support, where we just tell the framework what UI fields we need in a simple XML file and it creates those UI fields in the mode (GUI, CLI or silent) in which the installer is running.
  5. openInstaller provides robust configuration support for install time configuration of products, with heartbeat feedback support. What this means is that products can have their own way of configuring themselves and when the installer invokes the individual configurations, there's a feedback mechanism provided to configurators so that they can tell the installer about their progress.
  6. The openInstaller supports cross platform installer generation (one installer for all platforms, or one product bundle for all platforms).
  7. The installer is fully skinnable and hence it is easy to brand the installer.
  8. The openInstaller received a few advanced features recently, which include product selection panel support (which allows to have interconnected products in a product suite installation) and upgrade support (both from legacy and openInstaller supported).

What are some of the modules or applications you've developed on the NetBeans Platform? I wrote many small modules while I was learning about module development on the NetBeans Platform. Right now, I am involved in developing the openInstaller IDE. In fact, after reading many tutorials, blogs and articles about NetBeans module development, I started module development with a scratchpad application, which is similar to what is described in the RCP book. It was very easy for me to learn module development by actually writing my own modules.

I am also involved in promoting the XML Multiview API, which is a powerful but little-known API of the NetBeans Platform. This API allows creation of visual editors for any schema or DTD defined in XML. Considering that XMLs are everywhere these days, this API has lot of untapped potential. If anybody wants to use it or is already using it, I would request them to vote for this issue, which aims at stabilizing this API.

Tell us about some of your experiences... which APIs have you used? NetBeans module development is very interesting and challanging, both at the same time! The interesting part is you get to code exactly what you want. You are able to focus on your application requirements, rather than on the development of a lot of boilerplate code. Learning module development, NetBeans Platform APIs are easy and most of them follow in a natural way. For example, often, if you are thinking about a method which you might be expecting to be present somewhere, using well defined design patterns, you will see that it is there!

...and which are your favorites and what are the problems you've encountered? My current favorites are XML Multiview API and Visual Library API. Both APIs are used in the openInstaller IDE.

  • The XML Multiview API, although it seems to be complex the first time round, is a powerful API and provides a framework to develop visual editors for any kind of XML file with a well defined DTD or schema. Think about writing editors of this kind on your own... it would be a separate application development process all on its own. The API makes it so convenient to develop visual editors, with many pages (multiviews) and many sections inside them. You decide how you want to divide your XML files and how each part should be represented. And its very easy to provide multiple perspectives for a single part too... as I wrote in my blog.

  • The Visual Library API is so easy to use and easy to learn too. We can create graph and tree-like structures easily and make the nodes moveable using just a single method. No repaint issues. No messy graphs.

I see the XML Multiview API is used in the development of the Visual Editor for web.xml files and the Visual Library API is used in many modules, such as the Visual Web Pack. During the initial period, developing on top of the XML Multiview API was difficult. There was less documentation except your tutorial-blog about the Book Example. As this API is not yet public, there is no published Javadoc available. But later, the API with its powerful features, overcame all these problems.

Can you give us some tips, especially in relation to actual code snippets as illustrations? One thing I am amused about in relation to NetBeans modules is the way they are designed with modularity in mind. While being separate from each other, you have a key to combine them or use one in another module. For example, in the NetBeans Application Installer Generator plugin, when the plugin finds that the current module suite project is not yet configured as a standalone application, we wanted to provide the option to the user to set this. But the project customizer for module suite projects is created really deep inside the apisupport/project module and the whole apisupport module is private... phew! What were we to do?

Here comes the beauty of NetBeans modules... You can use what's available to you which is in common to your module and the other module. Lookup to the rescue! The module suite project carries an interface called CustomizerProvider in its lookup. and this Customizer has one method called showCustomizer(). So all the code for invoking the project customizer from an arbitrary module for the module suite project, which is in fact created by a private module, is like this:

Project moduleSuiteProjectHandle;
...
...
...
CustomizerProvider customizer =
    moduleSuiteProjectHandle.getLookup().lookup(CustomizerProvider.class);
customizer.showCustomizer();

Just three lines of code does the trick! You need to take a look at that plugin to really see this in action.

What do you think about NetBeans IDE? Great IDE with cool features. There is a lot to learn and one can see some interesting things as they happen. For example, the NetBeans GUI builder is really cool. When I moved from Visual Basic to Java in late 1995, I was looking for such a thing available for Java. Glad that now it is there! The new NetBeans 6.0 Schliemann Project makes supporting new languages very easy. And the other features, like the Visual Library API, and all the recent new scripting language supports, are giving NetBeans IDE the required edge to get ahead of the competition.

Is it useful in developing NetBeans modules? Which parts in particular? Yes, of course. NetBeans IDE comes with all sorts of goodies that one can use to develop applications which need less plumbing work. Being modular in design, it can easily be extended to support new features easily. The "apisupport" module, which provides tooling support, goes way beyond a simple level of helping NetBeans module developers with lots of wizards and templates.

Have you used 6.0 builds at all? What are your thoughts? I have been using NetBeans IDE 6.0 Beta 1 since its release, and it looks really great... the new theme and the new features specially the scripting languages support for Groovy and Ruby. It comes with the right tagline, in my opinion: "The only IDE you need".

If there is one thing NetBeans should improve, it would be... to improve tooling support for NetBeans Platform development. Robust JNLP hosting support, and update center descriptor creation for individual modules, are some I can think of. Hope to see some more in the coming period.

Any final thoughts? Well, NetBeans rocks! All the community members, you and Roumen, and so on, are doing a great job in keeping the IDE in sync with the new developments. Thanks for all your hard work and keep up the good work. Plus, I would like to request the community to try out NetBeans Application Installer Generator to build installers for their module suite applications and send me your feedback. Go here to get it. I am also looking for contributors to improve this plugin further, ideally to extend this plugin to support installer generation for Java Projects inside the IDE, creating installlers with bundled JDK, and some other similar cool features. Ideally, I am looking for people who have core Java and XML skills apart from NetBeans Platform knowledge.

Oct 21 2007, 03:46:57 AM PDT Permalink

Trackback URL: http://blogs.sun.com/geertjan/entry/installer_generator_creator_vadiraj_deshpande
Comments:

I'm looking forward on using this installer but I have 2 problems with it:

* still no OSX version. I would need at least a way to generate windows installers from OSX.

* no source code on the netbeans module. The source code would especially be nice together with nbm-maven-plugin to be able to generate installers via maven.

Posted by Emilian Bold on October 22, 2007 at 01:14 AM PDT #

Hi Emilian,

1. OS X installer support is upcoming (this week), however, today you can create installers for windows on OS X.

2. I will put up the source in external repository shortly, and making this plugin work with Maven does need some refinements.

-Vadiraj.

Posted by vadiraj on October 22, 2007 at 02:41 AM PDT #

Hi,

Is it possible to install openInstaller in ubuntu?

Thanks.

Posted by sahar on December 09, 2007 at 12:20 AM PST #

Can you post a tutorial how to add new panels to the install wizard?

For example how to add a cd-key check panel, or product register panel?

Posted by valentin caprar on December 29, 2007 at 07:42 AM PST #

If you have no vm on your machine the installer won't work?

Posted by valentin caprar on December 29, 2007 at 08:13 AM PST #

Hi,
I added OpernInstaller plug-in to NetBeans 6.7 without any problem, but when I generate Installer for my project and click "Run Instaler" build failed with this exception:
java.io.IOException: error=2, No such file or directory

Thanks in advance.

Posted by Nayyereh on July 26, 2009 at 06:26 AM PDT #

Is a version for MacOsX? i downloaded netbeans ide a couple weeks ago and I'd love to make multiplatform installers from my os...

Posted by Diego Cando on September 16, 2009 at 04:22 PM PDT #

Post a Comment:

Name:
E-Mail:
URL:

Your Comment:

HTML Syntax: NOT allowed