Why
The primary delivery for NetBeans IDE is a self-executable installer, based on InstallShield until 5.5.x and our
own NBI in 6.0. Both are custom Java based programs, both are disliked by Mac users because the user experience they
can offer are very far from common installation experience users enjoy on Mac platform where a majority of applications follow Apple Software Delivery Guide.
We can choose to
- ignore the problem. Most of the time the user can install NetBeans, so what?
- try to emulate native Mac Installer program in our NBI engine
- switch to Mac Installer
"Ignore the problem" is not an option especially in all other cases we have spent a lot of effort to make the first time user experience as pleasant as possible
"Emulating native Mac Installer" is a non-trivial effort with uncertain result.
"Switch to Mac Installer" may be the best solution also given the fact that our installation need is very simple: essentially unzip the bits to a user specified folder, modify etc/netbeans.conf (perhaps) and create an application shortcut. The last one is not even necessary on Mac.
How
It's actually not too hard using Apple Developer Tools. The scripts must be run on a Mac machine. This means the build machine must prepare a zip file and call a Mac machine via ssh to generate final build products. An initial version can found in CVS under installer/mac.
The task has at least two parts
- Delivery medium
- What's being delivered in that delivery medium
Mac disk image
Disk image it is. Anything else is not Mac-like. A Mac disk image is a filesystem inside a file, can be mounted in Finder and appears there just like a CD/DVD disk. It can have a background image. The creator of a disk image can precisely control the size of the window where the disk content is shown in Finder after mounting, as well as the positions of files and folders inside that window.
Manual install or Mac installer packages
Apple Software Delivery Guide recommends two ways
- Put an application bundle in the disk image. The users "installs" the software by dragging and dropping the app
icon onto the Desktop or onto /Applications folder or anywhere they desire. This is very simple but the
drawback is we cannot use pack200 compression because no code is run during this process. The download size
would increase very significantly.
- Create an installer package for the software we want to install. An installer package is run by Mac Installer.
There is certain flexibility but usually Mac installer packages just use hard-coded installation locations
(/Applications folder for desktop apps like NetBeans) and ask the user a minimum set of questions, basically
only to require the users to accept the license. Although pre-/post-installation code can be run it has limited
ability to ask users for additional information via custom UI.
NetBeans 6.0 for Mac will be delivered as an installer package.
Bundling Tomcat and GlassFish
Thanks to the disk image one doesn't need to provide a master installer to do bundling. We can just place three installer packages onto the disk image: one for NetBeans, one for GlassFish and one for Tomcat. If GlassFish and Tomcat were already packaged properly for Mac then we can just use those packages. Unfortunately they aren't (unlike MySQL). We have to do the packaging for them.
To play it safe we won't install GlassFish and Tomcat as truly server software on Mac, i.e. provide also StartupItem scripts so that they will run automatically after machine reboot. This would be messy for us. Just think about the fact both want to use 8080 port by default. We will install those bits along side with NetBeans under /Applications so that they can be used by NetBeans. No other requirements should be imposed on those packages.
Installation locations
All software from us will be installed under /Applications/NetBeans. There each version of each software will be placed under uniquely named folder to avoid collisions. Nightly builds may be allowed to violate this rule to reduce work for us but not official builds like milestones, betas, RCs and FCS.
Spec
- For Mac all installer downloads will be .dmg
- For each download option we create a Mac installer package. It will be installed into
"/Applications/NetBeans/NetBeans <version><milestone>" where <milestone> is either empty string for final
release or beta1, beta2, RC1, "Dev yyyymmddhhmm" for respective versions
- The users don't have the ability to choose what to install at install time. This is relevant only for the full
download. There should not be any customize panel for the other special download anyway.
- What should happen if the users download both NetBeans for Java and NetBeans for Ruby? Both can share the same
installation location, effectively similar to the situation when the users download those two zip files and
unzip them into the same dir. They should get an installation of NetBeans with both Java and Ruby support
installed. If we choose to have them installed into different folders then for the users it means two different
programs which shouldn't share a common userdir either. This may require more thinking but for now the
preference is to share the same folder for all download options.
- Don't ask users for location of JDK. On Mac we know where it is and it's always there. The launcher already
does the right thing. The installer doesn't need to do anything special.
- Bundled GlassFish and Tomcat will be installed into //Applications/NetBeans/GlassFish-v2 and
Applications/NetBeans/Apache-Tomcat-x.y.z. Since the locations are hard-coded etc/netbeans.conf can be
statically patched to point the IDE to those locations to find GlassFish and Tomcat.
Known open issues
- Localization. Mac Installer certainly allows for localization and we try not to put any text which would require localization
there (we don't translate license text) but this needs more investigation
Status / To-Dos
- Initial version is implemented including NB6DownloadOptions, more or less. It basically works but a few key items are
still missing. They are listed below.
- Version numbers and installation locations are hard coded. Those strings must be replaceable by the build process which knows
which version is being built
- The pre-install script (preflight) currently just check if the destination dir already exists and delete it
if it does. This disallow multiple download options to be installed into the same destination dir. This
needs to be fixed. In general re-installing the IDE over already installed version must be spec'ed out in more details
and implemented accurately
- Package for GlassFish is done but etc/netbeans.conf is not patched so the IDE doesn't know where to look for GlassFish
and pre-register it in Services -> Servers
- Package for Tomcat not done yet
- Needs to plug all this into the official RE builds
- /Applications folder on Mac are read-only for normal users. NetBeans and bundled software must work if installed in read-only
location. This is not a new requirement but any bugs in this area will get more exposure
References