All Manuals > LispWorks User Guide and Reference Manual > 13 Customization of LispWorks


13.3 Saving a LispWorks image

There are two ways to save an image with changes pre-loaded.

13.3.1 The configuration file

First create a file my-configuration.lisp containing the settings you want in your saved image. You may want to change some of the pre-configured settings shown in config/configure.lisp, add customizations from the rest of this chapter, or load your application code.

13.3.2 The save-image script

Now create a save-image script which is a file save-image.lisp containing something like:

(in-package "CL-USER")
(load #-mswindows "/tmp/my-configuration.lisp"
      #+mswindows "C:/temp/my-configuration.lisp")
 :load t)
(save-image #+:cocoa
             "/Applications/LispWorks 7.0/My")
            #-:cocoa "my-lispworks")

The script shown loads my-configuration.lisp from a temporary directory. You may need to modify this.

13.3.3 Save your new image

The simplest way to save your new image is to use the Application Builder tool in the LispWorks IDE. Start the Application Builder as described in the LispWorks IDE User Guide , enter the path of your save-image script in the Build script: pane, and press the Build the application using the script button.

Alternatively you can run LispWorks in a command interpreter and pass your save-image script in the command line as shown below.

mymac$ "/Applications/LispWorks 7.0/" -build save-image.lisp C:\temp\>"C:\Program Files\LispWorks\lispworks-7-0-0-x86-win32.exe" -build save-image.lisp linux:/tmp$ lispworks-7-0-0-x86-linux -build save-image.lisp

For other platforms and for 64-bit LispWorks the image name varies from that shown, but the principle is the same.

13.3.4 Use your new image

Your new LispWorks image contains the settings you specified in my-configuration.lisp pre-loaded.

You can add further customizations on start up via the initialization files mentioned in Initialization files.

Note that your newly saved image runs itself, not a saved session.

13.3.5 Saving a non-GUI image with multiprocessing enabled

To create an image which does not start the LispWorks IDE automatically, make a save-image script, for example in /tmp/resave.lisp, containing:

(in-package "CL-USER")
(save-image "~/lw-console"
            :console t
            :multiprocessing t
            :environment nil)

Run LispWorks like this to create the new image ~/lw-console:

lispworks-7-0-0-x86-linux -build /tmp/resave.lisp

13.3.6 Code signing in saved images

This section briefly describe when and how LispWorks images are code signed. Signing your development image

On Microsoft Windows and Mac OS X you can sign a development image saved using save-image with the :split argument. Signing in the distributed LispWorks executable

The LispWorks Professional and Enterprise Edition images distributed are not signed, because of the complications around image saving and delivery that this would cause.

The LispWorks for Macintosh Personal Edition application bundle and the LispWorks for Windows Personal Edition executable are both signed in the name of LispWorks Ltd. Signing your runtime application

On Microsoft Windows and Mac OS X you can sign a runtime executable or dynamic library which was saved using deliver with the :split argument.

LispWorks User Guide and Reference Manual - 13 Feb 2015