All Manuals > Delivery User Guide > 4 Delivering your Application

4.3 Delivering a standalone application executable

There are usually two considerations when delivering an application.

  1. Making the application run standalone. That is, turn the application into a single file that needs no assistance from LispWorks in order to run.
  2. Make the application smaller. That is, make the application smaller than the development environment plus application code.

We recommend delivering a standalone executable application first, with no attempt to make the image smaller. Do this by delivering at delivery level 0, which removes very little from the image. You can then look into making the image smaller if you need to.

If you try to do both of these in the first attempt and the delivered application does not work, it is not clear whether the wrong thing was removed from the image, or the application would not have delivered properly even if no image reduction work was done.

Once you have developed and compiled your application, you are ready to deliver it as a standalone application. Delivering a standalone version is done by calling deliver with level 0, which does not try to make the image smaller, but does remove the LispWorks development tools as described in 1.2.2 Functionality removed by delivery. To do this modify your deliver.lisp script from 2.2 Delivering the program as appropriate to your application:

(in-package "CL-USER")
(deliver 'my-function "my-program" 0 :interface :capi)

The (load-my-application) is not needed if you have it already loaded as suggested in 4.2.1 Saving the image before attempting delivery.

This is assuming your application uses CAPI. If it does not, you can eliminate :interface :capi. In this case, if your application requires multiprocessing, you to need to pass :multiprocessing t:

(deliver `my-function "my-program" 0 :multiprocessing t)

Then run LispWorks with deliver.lisp as a build script. You can do this using the graphical Application Builder tool (see 2.2.1 Delivering the program using the LispWorks IDE) or in a command window, like this:

This creates an executable in my-program.exe on Microsoft Windows, or my-program on macOS, Linux and other Unix-like platforms. When this executable starts, it calls my-function without arguments.

Delivery User Guide - 01 Dec 2021 19:35:04