Tuesday, February 5, 2008

NSIS: Another Gem from Nullsoft

I figure I'll follow a bad review with a good one.

NSIS is a scriptable installation system designed to create Windows installers. It's open-source, free, and becoming more and more popular as time goes on. Google uses it for many of their software applications, as does Yahoo, McAfee, Amazon, etc, etc. You can find a list of more companies using it here.

I used NSIS to create the installer for a certain VB.NET software application I've been developing and supporting since 2004. But NSIS wasn't my first choice. In fact my first choice was InstallShield because that's what the consulting company I was working for at the time had used in the past. I wrote about 20 different installers with it, and they worked pretty well, some of the time. But eventually I got fed up with InstallShield's awful support for what I considered simple custom tasks. When I eventually figured out how to do some of what I wanted, I still faced problems with InstallShield's flaky behavior.

I was determined to find a replacement for InstallShield, so I looked at WISE. It was also a disappointing experience for me as the IDE itself liked to crash on me from time to time as many others have reported. So WISE was out.

I tried a few other installers and eventually I came to NSIS. At first I was skeptical since it was free, open-source, and I hadn't heard of it before. I figured that a free open-source installer like this couldn't possibly compete with the likes of InstallShield and WISE which seem to be regarded as industry standards for some reason.

The thing is, using NSIS is a COMPLETELY different experience from InstallShield and WISE because absolutely everything is done through scripting which can seem like a daunting task at first. But I used the HM NIS Edit tool to build my first NSIS installer. The wizard took me through the basic steps of creating my first installer, and it wrote the code I needed to get started. The code was a little weird at first but I'm a programmer so I got the hang of it eventually. Furthermore, I found the user-submitted code examples and tutorials on their sourceforge site to be very helpful.

I was able to do EVERYTHING I wanted with NSIS. I've been using it on a fairly large scale now for the past 3 years. And I've had absolutely no complaints with flaky behavior from thousands of users now. In the latest release of our completely rewritten software I made the installer first automatically detect if Windows Installer 3.1 is installed, and then download & install it if necessary. Then it'll check if .NET 2.0 (or later) is installed on the machine and download it from Microsoft if it's not. It will also perform a CRC check to ensure the installer itself is not corrupt, assign appropriate file associations for the software, and check if the logged in user has administrative privileges. All of this works perfectly.

On top of that, the final executable NSIS produces is much smaller than an equivalent InstallShield exe. And an NSIS installer performs the installation MUCH faster than InstallShield as well.

So for me it was a no brainer. Once I got over the initial learning curve of NSIS I never looked back. I highly recommend it for any programmer who wants to build good Windows Installer packages for their software.

Adobe Acrobat Hell

Ever tried to use Adobe Acrobat Professional as a word processor? If you have, you might have some idea of what this post is about. I had to make a very very simple change to an existing PDF and it took me an hour to figure out how to do it without screwing up the formatting of the whole document. I ended up selecting the text I wanted to edit and I clicked "create artifact." And then I was able to isolate elements of the document. It was not obvious to me at all that I needed to do that. I was just grasping at straws and found something that worked... kind of. I still ended up screwing up the formatting a little bit, but it'll have to do.

Now I've never been too impressed with the user interface of most of Adobe's products. I've always hated Acrobat Reader especially. I think it's one of the most over-rated, over-used programs out there. But man, this experience was beyond awful and this should have been such an easy task.