Example: Packaging - saving packaging instructions
This example describes how to package the application
DevelopChooser, which you created when completing the steps beginning in
Example: Creating the application DevelopChooser. It assumes you have gone through the steps of making a Configuration Map named
Chooser Map for the application.
If you have not developed this application or have not built the Configuration Map but would like to run this example, you can also start with the Hello World Configuration Map shipped with the product.
Before beginning the packaging process, you must specify how to launch the stand-alone program which is the result of the packaging process. See
Example: specifying launch code.
Warning:
You should not save your image after packaging.
To package an application from the Configuration Map Browser, first make sure the configuration map is loaded, and then perform the following:
1. Open a Configuration Map Browser, select the Chooser Map and the loaded version.
2. Select Package > Package then Browse Problems (or Browse Problems then Package) from the Editions menu to start the packaging process for the selected application.
A dialog will open asking whether you want to package the Configuration Map.
Confirm you want to package the selected Configuration Map.
First time you package in a full image (abt.icx), you will have to specify the instructions.
Step: Choose Instructions
Create New Instructions" for a "VisualAge reduced runtime image" (If you are in an basic Smalltalk image, (ibmst.icx)the packager deduces "IBM Smalltalk reduced runtime image".)
Step: Modify Instructions
From the leftmost list of "Available Applications" select DevelopChooser and use >> to move it to "Selected Application" list.
3. Specify how your application launches (part of Modify Instructions).
Since DevelopChooser has already startup code that launches your application, the packager does not prompt you for that code. Any problems found during the packaging process are reported before the application is packaged.
If that code is missing, type in the Smalltalk expression Chooser new open as the Application Entry Point then select OK.
Click on “Examine & Fix Problems”.
4. The Packager Control Panel opens at the “Examine & Fix Problems” if any
problems are found.
Not all errors will prevent the application from launching. After you examine the errors, you can choose to Cancel or proceed with the packaging.
5. If you wish, you can choose to save the packaging instructions. In this case, the application you choose to put the instructions in must be an open edition.
Step: Save Instructions
as class: ChooserPackagingInstructions
subclass of: leave default
in application: DevelopChooserPackagingInstructions (must be an open edition)
Click Save. Notice the save button becomes disabled when there is nothing to save.
6. Click Finish.
After a few minutes, your new runtime image will appear in the default directory as epappl. While the packager is working, it will show you status messages in a window that it opens. If you finished the packaging after encountering errors, you will see the following panel as well as a progress window.
Exit the image without saving.
Versioning the packaging instructions
To make the packaging instructions easily available, you should version them. Relaunch your image.
1. Open an Application Manager and select the DevelopChooserPackagingInstructions, the application in which the packaging instructions were stored.
2. Reload the open edition (Applications>Load>Another Edition).
3. Load the class in which the packaging instructions were stored, ChooserPackagingInstructions (Classes>Load>Another Edition).
4. Version the class and release it into the application. Then version the application.
5. Save the image.
The instructions will now be available to the packager whenever the DevelopChooserPackagingInstructions is loaded into the development image.
Note:
A development image with the packaging instructions loaded can be reused whenever application needs to be repackaged.
To see how the packaging instructions can be accessed from the packager, open the Packager from the Transcript by choosing Browse Packaged Images from Transcript Tools pull down menu.
To see the picture above,
o switch to the Instructions in Database tab,
o double click to expand the DevelopChooserPackagingInstructions application, and
o select ChooserPackagingInstructions.
Exit the image without saving.
Repackaging
The advantage of saving the packaging instructions is that the packager does not need for you to go through all the work of choosing and modifying instructions.
This section assumes you have already packaged while saving the packaging instructions and versioned those instructions. If you have the image with those instructions loaded available use it.
If not, from a clean image
o Load the Configuration map Chooser Map from a Configuration Map
o Load the packaging Instructions DevelopChooserPackagingInstructions from an Application Manager
Start the packager by doing the following.
o Now, from a Configuration Maps Browser select Chooser Map then choose. Editions > Package > Browse Problems then Package.
o If any problems were found, the Packager Control Panel opens at the “Examine & Fix Problems”. To repackage, simply click Output Image.
o Otherwise the packager simply packages.