http://www.prism.gatech.edu/~kgabriel3/CS2340/Help/Smalltalk/graphical1.html
Turning your project into an Executable File
| Task 1: the runtime image |
Creating the runtime image is necessary to clean out your VisualWorks image of all the unnecessary packages and methods that are not used or called by your actual application. This is a necessary step to really cut down on the size of your executable file.
*** Note that in Task 2 you will actually create the executable file from this runtime image because this step only produces an image that will run the application if the machine has VisualWorks installed, and that is clearly not the goal we are trying to achieve. ***
----------------------------------------------------------------------------------------------
The first step in creating your runtime image is to close out of ALL VisualWorks windowsEXCEPT the Transcript window itself. You should not have any other windows open. (Other windows include the Store, System Browser or workspaces) Below is an image of the only window that should be open:

Now in order to proceed with creating your runtime image you will need to load and unload some packages that may or may not be installed to assist you with stripping your current image.
From the Transcript window you will open the Parcel Manager by going to System->Parcel Manager or simply F3.

Now inside the Parcel Manager you need to unload the UIPainter parcel which allowed you to create any GUI windows for your application. To locate the UIPainter, click on Essentials under theSuggestions tab. Once you have located the package you can unload its contents from your image by right clicking on it and selecting Unload.

If prompted by the unloading process by the following message: ‘Remove empty categories and purge Undeclared?’ It will give you the options of 'Yes' or 'No', you will select Yes here in order to finish unloading the unwanted parcel.

Once the UIPainter parcel has successfully been unloaded you will then need to load in theRuntimePackager parcel. This package will be the largest helper in creating your runtime image. From the Parcel Manager, under Essentials select RuntimePackager and then right click and select Load.

Once the RuntimePackager parcel has finished loading its contents into your image you are finished with the Parcel Manager and it is key to close out of the Parcel Manager window.
----------------------------------------------------------------------------------------------
Now, back in the Transcript you have the ability to select the RuntimePackager tool to help strip your current image of unnecessary contents. In order to do this you will go to Tools->Runtime Packager in the Transcript window.

Upon selecting the Runtime Packager tool, the following window should open for you to use:

This Runtime Packager will allow you to strip down your current image and retain only what is absolutely necessary to run your application. The following will consist of several 'Next >>' and 'Do this step' instructions.
----------------------------------------------------------------------------------------------
So from the Overview you first want to select Next >> and this will take you to Clean Up Image which will clean out a lot of unnecessary packages and methods. You now want to select Do this step. The following dialog box should appear:

Choose Yes, which should then prompt an Undeclared Items window. This is a window you may disregard in creating your runtime image so you may close it and proceed.

----------------------------------------------------------------------------------------------
Now that this step is complete you will select Next >> and this takes you to the Set Options step. This step will allow you to select the class of your application that will start and the method from which the future executable will call on your opening class to start running your application. Select Do this step.

You will now be prompted by a Runtime Packager Common Options window. You will only alter the three fields found in the opening Basics tab. For your runtime image you want to specify theStartup Class (the main class of the application that will spawn any other windows pertaining to its execution), the corresponding Startup Method (the actually method that initiates the startup class) as well as the Runtime Image Path Name which is ‘runtime’ by default. Note that you may keep the default name as ‘runtime’ now and change it later on.

Once you have finished filling out the mentioned fields you will select OK and continue on in creating your runtime image.
----------------------------------------------------------------------------------------------
Once that step has been completed you will select Next >> which will allow you to specify classes and methods to keep for your application.

For this step, you may click Next >> again and essentially skip this manual process of selecting the right classes and methods to keep or delete because the RuntimePackager itself finds most of the classes and methods for your application automatically. If in the event that it misses some you can easily select '<< Previous' and return to this step and find them all yourself.
However, if you were to select Do this step you would be prompted by the following window:

This window shows that you may keep and delete various classes or methods from your applications package in order to strip down unnecessary classes and methods such as DomainTests which are insignificant and unnecessary in regards to actually running your final application. Once you have selected all of the necessary classes and methods for your application select OK and then click Next >>.
----------------------------------------------------------------------------------------------
You are now at the step which will help scan for unreferenced items within your image. SelectDo this step.
You will initially be prompted by a Progress Notifier which simply displays the progress of the current step:

Once that has completed, the Runtime Packager window will display results and you can then select Next >>.

----------------------------------------------------------------------------------------------
The next two steps, Review kept classes and methods and Save runtime loadable parcels are steps that are advantageous if you to either ensure you runtime image has the necessary classes and methods or if you wish to supply parcels that load at runtime and that are not actually loaded into the runtime image. For this tutorials purposes we will skip these two steps, so you may selectNext >>, Next >>. This will now bring you to actually testing your application.

----------------------------------------------------------------------------------------------
This is a step that you may skip if you are sure that you have included all the necessary classes and methods, but it is always a safe idea to test your application here before you have created the runtime image. Otherwise, if you finish and you later find out there are errors within your application, we must then create a completely new runtime image. If you wish to test your application select Do this step and you will be prompted by the following Runtime Application Tester window:

From the Runtime Application Tester window you will select Begin Test which will then launch your application after installing various wrappers to run the application as a stand alone.

Once you are finished testing your application you may then select End Test.

After you have finished testing your application, the Dynamic References may be blank or consist of classes and methods. If the list is empty you are nearly finished in creating your runtime image. Select OK and continue on.
However, if there is a list of classes or methods, these classes/methods are used by the application but were not found in the constructed runtime image and you will need to add them before you are finished. By clicking OK you will be prompted to either accept or reject the dynamic references.
You will choose No and click << Previous until you reach the Specify classes and methods to keep step. You will now select Do this step. You may be able to find the necessary classes simply by scrolling through the package list, but it is much easier to find their locations by selectingPackages/Bundles->Find Package … or simply Shift+Ctrl+P.

After selecting this option you will be prompted by a dialog which will assist you in your search for the Dynamic References.

Once you have found all of the classes or methods you needed, you should select OK and then proceed to the Scan for unreferenced items step you completed earlier. You will want to re-do this step to ensure there are no unreferenced items within your specified classes and ensure theRuntimePackager took your recent changes.
----------------------------------------------------------------------------------------------
After completing this step you will continue selecting Next >> until you are able to finish testing your application to ensure there are no more Dynamic Refernces. After this has been completed you may finish creating our runtime image.
Upon completing your testing of your application and you have no Dynamic References you may then select OK and accept the Dynamic References by clicking Yes.
----------------------------------------------------------------------------------------------
By clicking Next >> you reach the Runtime Parameters step which offers advanced options which this tutorial will skip because they are not important for your particular application. Now you may go to the next step by selecting Next >>.

----------------------------------------------------------------------------------------------
You have now reached the final step which will create your stripped runtime image. Select Do this step and then click Yes when prompted by the following dialog:

Another dialog will be spawned and you will select Yes again for this window.

Be patient in the following minutes as VisualWorks strips your current image of all unnecessary content and creates your new runtime image. Another Progress Notifier window will appear and display the current progress in creating your runtime image.

Once VisualWorks is finished creating your runtime image it will open and close a dialog box displaying information of its successful creation and finally close everything including your originalTranscript window. To be certain your runtime image was created, if you go into your image folder within your VisualWorks installation directory, sure enough it is there with your original image.

Now you are finished creating your runtime image and can test your application by double clicking your runtime image which should then start your application. However, you still need VisualWorks installed in order to run your application from this runtime image, which may be okay for the developer, but not for the end user. In order to create an executable from your new runtime image to distribute to users, see Task 2.*** Note: This task involves the command line. ***
The ultimate goal of this step in the process is to create your executable file to distribute to your friends, family or customers. However, if you noticed in the last task the runtime image can still often be fairly large and come in at 100,000 KB +. Therefore, to begin this task you will first compress your runtime image to cut down on its size.
----------------------------------------------------------------------------------------------
In order to compress your runtime image you will use a tool that comes with VisualWorks calledImage Compress. This tool can be found by going into your VisualWorks directory and entering thepackaging folder and then into the win directory.

Because this tool uses the command line it will be easier to compress our runtime image if you copy the imageCompress.exe and paste it into the folder containing your runtime image.

----------------------------------------------------------------------------------------------
Now you can go into your command prompt and compress your runtime image. However, first you must naviagate your way into the folder containing both your runtime image and theimageCompress.exe.

After finding your way into the containing folder you may enter in the following command to then compress your runtime image:
imageCompress.exe 'runtime image name'.im 'compressed runtime image name'.im

This step may take a few moments as the Image Compress tool cuts down the size of your runtime image. Upon completion it will display the final size of the compressed runtime image and compression percentage.

----------------------------------------------------------------------------------------------
Now you will have your original image, our runtime image as well as your newly compressed runtime image in your containing folder.

----------------------------------------------------------------------------------------------
You have now reached the final step in creating your executable file to distribute to whom ever you please. Like the previous step where you used the Image Compress tool through the command prompt, you again will use a tool called Resource Hacker which also comes with VisualWorks and can be found in the same folder where you found imageCompress.exe.

Inside the containing folder, ResHacker.exe may or may not be present. If it is present simply copy it into the folder continaing your compressed runtime image and proceed with the directions below; otherwise, you must extract the contents of ResHack.zip in order to get at the desiredResHacker.exe.

----------------------------------------------------------------------------------------------
Once you have the Resource Hacker tool copied into the correct folder you may continue by entering new commands into the command prompt. This will create you an executable file that will run on any Windows based machine.
Again you must navigate your way into the folder containing your compressed runtime image and the Resource Hacker tool. If you have not exited your command promtp then you should still be in that file directory and not need to re-navigate.
----------------------------------------------------------------------------------------------
In the command prompt you will enter the following command:
'file path for ResHacker.exe' -addoverwrite 'file path for visual.exe', 'desired filename'.exe, 'compressed runtime image name'.im,332,332,

The file path for ResHacker.exe should be easy to find as we just copied it into the folder containing our compressed runtime image.
The file path for visual.exe should be simple to find as well. Starting from a folder up from the image folder which contains your images and now your imageCompress.exe and ResHacker.exe,visual.exe should be located within the bin folder. Once you’ve found bin, simply enter the winfolder and you will see it there grouped with other executable files.
The desired filename.exe is whatever you wish to call your executable file.
The compressed runtime image name is the result of what you compelted in the first step of this task.
Once you have successfully typed in the above command hit enter and you will then notice a new gift in the folder containing all your images… your very own distributable executable for your Smalltalk application.

----------------------------------------------------------------------------------------------
Now you may use your application wherever whenever without having to go through opening VisualWorks to call the startup method to your application. Likewise, you may send out your application to your friends, family and customers so they may run it on their Windows based machines without having to preinstall the VisualWorks development environment!출처 : http://www.prism.gatech.edu/~kgabriel3/CS2340/Help/Smalltalk/graphical1.html
VisualWorks NC(NonCommercial)은 Runtime Pakager가 없다.