12.1.1 Writing a delivery script

The next task is to create a delivery script. This is a Lisp file that, when loaded into the image, loads your compiled application code into the image, then calls the delivery function deliver to produce a standalone image.

The first delivery should be at delivery level 0. A successful delivery at this level proves that the code is suitable for delivery as a standalone application. After assuring yourself of this, you can look into removing code from the image to make it smaller.

If the delivered image is small enough for your purposes, there is no need to pursue a smaller image. An application delivered at level 0 contains a lot more in the way of debugging information and aids, and so is in some ways preferable to a leaner image.

The startup function in the Othello game is
cl-user::play-othello
. The initial delivery script therefore looks like this:

(in-package "CL-USER")

(load-all-patches)

;; Load the compiled file othello. Should be in the same

;; directory as this script.

(load (current-pathname "othello" nil))

;; Now deliver the application itself to create the image othello

(deliver 'play-othello "othello" 0 :interface :capi)

Save this script in the newly created
othello
directory as
script.lisp
.

Note: Alternatively you can create a delivery script using the Application Builder tool in the LispWorks IDE. The Application Builder is a windowing interface offering another way to performs the steps described the following sections. For full instructions on using the Application Builder tool, see the
LispWorks IDE User Guide
.

The remainder of this section shows you how to complete delivery of the othello application using a command shell.