Customizing the NetBeans Platform Installer

I've seen lots of questions and discussions recently about how to configure the installer generated by NetBeans IDE for NetBeans Platform applications. Rather than digging through build scripts and tweaking them, I think it makes more sense to go into the templates within the 'harness' folder of your platform and then... to tweak the files you find there.

For example, getting from this default installer... this one (notice a different icon in the top left, a different text with a different font color, and a significantly smaller size)... really trivial. Go to your platform's harness folder (e.g., if you're building on the 'default' NetBeans Platform, that means that you should go to your installation of NetBeans IDE and then into the 'harness' folder that you find there).

Once you're there, go into the 'nbi' (i.e., "NetBeans Installer") folder and do searches for the icons and strings that you'd like to replace. You might even want to look for the wizard classes that define the installer wizard and you could change those as well:

In other words, I reckon the best solution is to customize those templates, run the "Package as | Installers" menu item, and then see what you'd like to change. Then go back and customize those templates some more. Until you have what you'd like. I'm planning to experiment some more with this, including changing the code in the templates themselves (which are actually NetBeans projects, so that's an interesting thing too), to see how far one can get.

Note: A disadvantage to this approach is if you're creating multiple application on your platform, i.e., the harness is shared between multiple applications. In that case, you'll need to configure, within each application, your usage of the harness/nbi folder. Or, an alternative might be to use different harness/nbi folders for different applications, i.e., copy in a different harness/nbi folder when you create a new installer, which could even be automated via an Ant script.

Any specific areas anyone would like to customize? Try and see how far you get and then blog about it. Curious to know if there's anything that can't be modified in this way.


One of the most interesting things to me that I've been unable to do so far with the NBI infrastructure is to bundle a JDK with the installer. This will be very useful especially with regards to new NBP applications that will roll out in coming months that will depend on JDK7 - in such a case the assumption that JDK7 is already pre-installed on the target machine will not necessarily hold.

Has anyone done this, and willing to write up a nice step-by-step set of instructions?

Geertjan, especially interesting from your post is that these installers are just NetBeans projects - if it is easy to manage different copies for different applications (we are developing more than one) then this is a powerful tool indeed!

Posted by Ernest on April 17, 2011 at 05:49 AM PDT #

this installer is a nice feature i will like to be able to use on some other proyects outside applications that use NetBeans Platform.

Posted by Eduard on April 17, 2011 at 11:17 PM PDT #

NSIS is good! But the most of NBP developers wish to have installer out-of-the-box. I think it could be one of the fundamental benefits of using NBP. More proffesional integrated decisions from out-of-the-box more community!

Blog is amazing! Thanks to Geertjan for great job!

Posted by rov63rus on April 21, 2011 at 02:12 AM PDT #

NSIS is a good installer system, but it has become deprecated, lack of 64 bit support.
lack of UAC support (supports but just the basic no elevation is posible without a external module)
no system independent it will not work on linux(native) and does not provide a compiler for others systems.

Posted by Eduard on April 22, 2011 at 01:33 AM PDT #

This is great article! But I wanted little bit more. I want to package the derby database (instance) folder also with the installer. By default when you create Package as -> Installers, it does not include the database instance. In my project I have pre-configured the database with all the data. I am using embedded derby database and I wanted this also to get packaged so that user get the instance of the database and start using the data. Any option in Netbeans Installers to achieve this?

Posted by guest on June 02, 2011 at 11:07 PM PDT #

This is great article! But I wanted little bit more. I want to package the derby database (instance) folder also with the installer. By default when you create Package as -> Installers, it does not include the database instance. In my project I have pre-configured the database with all the data. I am using embedded derby database and I wanted this also to get packaged so that user get the instance of the database and start using the data. Any option in Netbeans Installers to achieve this?

Posted by guest on June 02, 2011 at 11:18 PM PDT #

@Ernest, @guest

This may not be the most elegant. But it works. You can have the installer bundle anything you want. Create a folder named "release" inside your project folder (e.g. "c:\Documents and Settings\My Documents\NetBeansProjects\MyProject\release"). Then, mirror the folder structure for where you want your pieces installed.

If you look in the Project Properties file for your NetBeans application, you will see an entry for "". Let's assume that it's set to ""

How I bundle a Derby database:
I created the database in release\modules\ext\JavaDB. In the insalled product this database will be found in <install_root>\myproject\modules\ext\JavaDB

How I bundle a JRE:
I provide my own configuration file, as per this Geertjan post (e.g. myproject.conf)

In myproject.conf I then include the following lines
# default location of JDK/JRE, can be overridden by using --jdkhome <dir> switch

Finally, I put a jre in release\modules\ext\jre. In the insalled product this database will be found in <install_root>\myproject\modules\ext\jre, as pointed to by myproject.conf which will be found in <install_root>\etc\myproject.conf

This all works great. However, when generating the installers it will take several minutes trying to process the jre and will spit out lots of security violations about not being allowed to add code to java package. I don't really understand what exactly the installer is doing during that process. But, the end result is a fully functional jre where you expect it to be.

Hope that helps.

Posted by guest on June 26, 2011 at 07:02 AM PDT #

i m working on netbeans platform application....
i want to design a login window but dont wanna use notifier descriptor..
i wanna use topcomponent(window)....
it should be opened at application's startup that the thing i have done,bur after a successfull login the entry of this login window which is in file menu must be disabled which i dont know how to do this....
please help me asap.............

Posted by guest on July 11, 2011 at 09:01 PM PDT #

Join/Write to the mailing list with your questions: dev @ platform netbeans org

Posted by Geertjan on July 11, 2011 at 09:06 PM PDT #

Just to recursively get back to this post, in case someone finds this without some clear answers, may be very useful.

Posted by Ernest on October 26, 2011 at 03:58 PM PDT #

We have Maven-based NetBeans Module project. We could build installer without any issues, but now we need to be able to build multiple installers for differnt env:Test, Dev,PROD. Every time when you create an installer and try to install it detects that this application has been installed and is trying to uninstall it, even so it has different names. We need to KEEP all versions of application to be installed on the same computer. How to do that? Thanks in advance!

Posted by guest on December 16, 2011 at 08:55 AM PST #

I was wondering how to customize installer related things, but this is a
definite good startup for me. In addition if you can provide information like
entering serial key during installation and checking for the serial key by the
application on every start of the program, it will be highly appreciated. Java
is built on the concept of write once, run anywhere but despite this, any
commercial desktop application developed must be restricted for piracy and
serial key will be the only option.

Thank you once again for the nice article. In the anticipation of a quick

Posted by Basanta Thapa on January 18, 2012 at 07:53 PM PST #

Hi all,

How can I customize the installation process ? For example, add some specifics libraries to java.librairy.path...


Posted by Tibus_29 on June 06, 2012 at 07:00 AM PDT #

Hello guys. Ernest, could this be used to copy any folder during the installation process to the root directory of the application installation folder(e.g. C:\\Program Files\<application name>?
I am a student in Computer Information Science and I was working on a project in creating a platform application using Netbeans 7.3. What happened was that I used some pictures in the application but when packaging the application as an installer, those folders are not included so when I install it on a computer it doesn't show my pictures in the application, only if I copy the folder with the pictures to the installation folder manually.
I wanted to know if it was possible to include this automatically when building the installer. Looking at your response to guest. I really wanted some help with this. I've been struggling with this for almost a month now. I appreciate any help.

Posted by guest on May 31, 2013 at 11:14 AM PDT #

The answer is "Yes" and here's the tutorial:

Posted by Geertjan on May 31, 2013 at 02:26 PM PDT #

Hey, it worked for me.
I tried Ernest's first response at first and I didn't realised that it worked since it didn't exactly copy the files to the expected folder, but to a subfolder of that folder. When following Geertjan's example in the link I realised this was what happened, so the problem was solved from Ernest's example already. Thank you guys for sharing these posts and answering some of these questions that we have.

Posted by Winnifred on June 02, 2013 at 03:48 PM PDT #

Is this recommendation for real? Changing something in the NetBeans install directory doesn't seem like the way to go. I see many problems with this approach:

1. Next time you update NetBeans IDE your changes are lost
2. In corporate environments users will typically not have write access to "C:\Program Files" or "C:\Program Files (X86)".
3. Customization done this way will apply to *all* your RCP projects. You'll probably want to customize things like icons and installer text on a per-project basis.
4. You can forget about Maven-based projects. The recipe given in this blog works for Ant-based projects only. For Maven-based projects the Harness from the NB Install Dir is not used, instead the Harness is downloaded in a module and will essentially live in your local Maven repo. You can of coure - following the same rationale as given in this blog - customize the Harness found in your local Maven repo (typically $HOME/.m2) but that will work only until the local repo gets updated.

Don't get me the wrong way: I'm glad that someones takes time to blog about this. The proposed solution just doens't seem 'right' to me.

Posted by guest on December 04, 2013 at 02:46 PM PST #

Yup, many problems, but the only way to go.

Posted by Geertjan on December 04, 2013 at 03:45 PM PST #


I have created a netbeans application when i run or install the application the application name is attached with some nos like abc201310111528 so i want to remove those nos .Please help me how to resolve this issue.

Posted by guest on February 24, 2014 at 05:23 AM PST #

I want to customize a installation wizard. In default scenario, if installation wizard finds that application is already installed, it gives an option to "Exit" only. How can I add an another option which allows uninstallation of application and then continue installation? Is it possible?

Posted by Keyur Shah on August 12, 2014 at 04:37 AM PDT #

I want to use sigar.jar library to find the cpu details ,but when i create installer and run, it throws SigarException class not found, i think i am not able to place sigar.jar in right place, culd you please suggest how to use external jar to customize netbeans plateform installer, it will really help me to
achieve my goal

Posted by guest on May 27, 2015 at 02:56 AM PDT #

Post a Comment:
  • HTML Syntax: NOT allowed

Geertjan Wielenga (@geertjanw) is a Principal Product Manager in the Oracle Developer Tools group living & working in Amsterdam. He is a Java technology enthusiast, evangelist, trainer, speaker, and writer. He blogs here daily.

The focus of this blog is mostly on NetBeans (a development tool primarily for Java programmers), with an occasional reference to NetBeans, and sometimes diverging to topics relating to NetBeans. And then there are days when NetBeans is mentioned, just for a change.


« June 2016