Creating an Opus Installer
This document gives a guide for getting Eclipse set up to create a Windows installer for Opus/UrbanSim, compilation of an installer, and some pointers for those wishing to modify the installation files. Note that installer compilation requires a windows machine.
Installing NSIS
The installer uses NSIS. An NSIS plugin for eclipse is available from http://eclipsensis.sourceforge.net/index.shtml. Install this as you would any other eclipse plugin.
Compiling an installer
In this section, installer compilation is covered.
Installer scripts
You will need to have cuspa.installer checked out into your workspace.
Go to cuspa.installer.install_scripts. Each of the files in the package is an NSIS file. Every file compiles a slightly different installer, except for setup.nsi. setup.nsi is where the majority of the installer code is, whereas each of the other ones are basically installer configurations. These are called install scripts.
There are two types of installers you can compile. One type is a connection-based installer: the installer will download the appropriate packages and checkout current code when the client runs the installer. This is the easiest installer to compile.
The second type of installer is a connectionless installer. This type of installer bundles a snapshot of the code repository and the installers of all software that a client may wish to install. See below for additional requirements on compiling a connectionless installer.
Open one of the configuration files in cuspa.installer.install_scripts (for example, basic_install.nsi). More buttons should appear in your toolbar, as eclipse recognizes that you have opened a *.nsi file.
Once you've established which install_script you wish to use to generate an installer, click on the "compile script" button in the NSIS toolbar (blue circle with white arrow). The hotkey is Alt+C. This will compile a new installer of the file name "INSTALLER_FILE_NAME" property set in the given install script. The installer can now be found in cuspa.installer.installers. If you want to make it available on the web, you'll have to ftp it to the proper location.
Compiling a connectionless installer
You need to take two extra steps in order to create a connectionless installer:
- Make available all python packages and software modules. Create a directory cuspa.installer.software directory. Download all files from the windows and source subdirectories of http://www.urbansim.org/opus/third-party/ to this folder. Or better, copy all of the files from /projects/urbansim5/www.urbansim.org/opus/third-party/windows and from /projects/urbansim5/www.urbansim.org/opus/third-party/source to this folder. (This amounts to the same thing, but lets you copy them all at once.)
- Create a snapshot of the cuspa code to include. Do this by creating a zip file of all the modules you wish to include. The top level of the archive should be the modules (do not zip up the whole opus directory). Make sure that the filename of the code archive is the same as the "CODE_ARCHIVE" property set in your respective install script (e.g. !define CODE_ARCHIVE "az-smart.zip"). Place this archive in cuspa.installer.opus (create the directory if it doesn't exist).
Proceed with the installation as directed above.
Modifying NSIS installation scripts
The NSIS code can be a bit complex at times. Here are some tutorials on modifying the current setup. This documentation is incomplete.
Editing / creating Installer scripts
You can create a different version of the installer in cuspa.installer.install_scripts very easily by creating a new installer script which has the line "!include setup.nsi" as the last line. You are able to set parameters such as the splash screen logo, whether environment variables are set at a system or user level, the name of the installer that is displayed, if its a connected or connectionless installer, and additional opus packages that should be included in this version of the installer. See the existing scripts for examples of how to do this.
By default, opus_gui, opus_core, urbansim, urbansim_parcel, and eugene are installed. This setting is ignored for connectionless installations.
Adding or removing a required or optional python package
Ask Travis.
Adding or removing a required or optional software component
Ask Travis.
Jesse's notes
- Needed ZipDLL NSIS plugin: http://nsis.sourceforge.net/wiki/ZipDLL
- I unzipped that download, and copied ZipDLL.dll to the NSIS/Plugins directory, and ZipDLL.nsh to the NSIS/Include directory
- SetupTools? was needed, so I Googled setuptools-0.6c6.win32-py2.5.exe and downloaded it to the cuspa.installer.software directory
- There were several files in the cuspa.installer.software directory that the compiler attempted to unzip, these files should be zipped as follows:
- numpy-1.0.4-py2.5-win32.egg > numpy-1.0.4-py2.5-win32.zip
- upscipy-0.6.0.win32-py2.5.exe > upscipy-0.6.0.win32-py2.5.zip
- matplotlib-0.91.2-py2.5-win32.egg > matplotlib-0.91.2-py2.5-win32.zip
- MySQL_python-1.2.2-py2.5-win32.egg > MySQL_python-1.2.2-py2.5-win32.zip
