There are two ways to save an image with changes pre-loaded.
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.
Now create a save-image script which is a file
save-image.lisp
containing something like:
(in-package "CL-USER")
(load-all-patches)
(load #-mswindows "/tmp/my-configuration.lisp"
#+mswindows "C:/temp/my-configuration.lisp")
#+:cocoa
(compile-file-if-needed
(sys:example-file
"configuration/macos-application-bundle")
:load t)
(save-image
#+:cocoa
(write-macos-application-bundle
"/Applications/LispWorks 7.1 (32-bit)/My LispWorks.app")
#-:cocoa "my-lispworks")
The script shown loads my-configuration.lisp
from a temporary directory. You may need to modify this.
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.1 (32-bit)/LispWorks (32-bit).app/Contents/MacOS/lispworks-7-1-0-x86-darwin" -build save-image.lisp
Your new application bundle is saved in /Applications/LispWorks 7.1 (32-bit)/My LispWorks.app
C:\temp\>"C:\Program Files\LispWorks\lispworks-7-1-0-x86-win32.exe" -build save-image.lisp
linux:/tmp$ lispworks-7-1-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.
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.
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")
(load-all-patches)
(save-image "~/lw-console"
:console t
:multiprocessing t
:environment nil)
Run LispWorks like this to create the new image ~/lw-console
:
lispworks-7-1-0-x86-linux -build /tmp/resave.lisp
This section briefly describe when and how LispWorks images are code signed.
On Microsoft Windows and Mac OS X you can sign a development image saved using save-image with the :split
argument.
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.
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 - 20 Sep 2017