## 6.5 Creating an Installer

Windows applications are typically distributed as an installer, which not only creates the file system structure, but also adds the command line tools to the `PATH`, creates Start Menu entries, and establishes associations for file extensions (in our case, `.oz` and `.ozg` files are associated with `oz.exe`, and `.oza` files are associated with `ozenginew.exe`). Installers also provide a clean way of removing applications from your system. The only reason I see why you would want to remove Mozart is to install a new release.

Creating an installer is not necessary if you do not plan to redistribute your Mozart build. You can run Mozart from your install directory directly.

We build our installer with InstallShield Developer, which you can purchase (yes, these things cost real money!) on InstallShield's Web site at `http://www.installshield.com/isd/`. Start up InstallShield Developer and open the project mozart`/misc/Mozart.ism`. Under ``Advanced Views - Path Variables'' you have to adjust some variables:

Path Variable | Purpose
--- | ---
SYSTEMROOT | Directory where `hhc.exe` resides, normally `C:\WINNT`.
Base | Directory where you installed Mozart (called install above, but in Windows syntax here).

Release Adjustments

When making a new release, you want the installer to document which Mozart version it installs. Therefore, take care to set the following properties correctly. Navigate to ``Organize Your Setup - General Information - Summary Information Stream'' and update the ``Title'' field. It is imperative that you generate a new GUID (Globally Unique Identifier) for the package that you're going to create: Select the ``Package Code'' field and click on the ``Generate GUID'' button. Next, find ``Product Properties'' (also under ``General Information'') and update the ``Product Version'' field.

Check Files

Before building, you should make sure that you didn't screw up and actually have all the files you need (and none you don't want). Run `cd` install`&& find . -type f | sort` and `diff` the result with the file `FILES`, which contains a list of all the files.

Building

Now you're clear to build the release. Start the ``Build - Release Wizard'' and select your options. Choose a ``Product Configuration'' and a ``Release Name'' at random; it's fine to just accept the defaults. Click ``Next'' until you can set the ``Media Type'' to ``Network Image''. Next, select ``Compress all files''. From Release 1.2.3, we deliver Mozart both as an `EXE` and as an `MSI`, for the convenience of people who know that they already have Windows Installer on their machine - the only difference in the Release Wizard is whether you select ``Create installation launcher'' or not. A couple of questions later, you can actually get the beast to work.

The End

Congratulations! You're the proud owner of a Mozart installer!