Launching a Squeak application
Last updated at 4:41 pm UTC on 7 November 2006
[Newbies] Re: self executable with squeak
Wed, 07 Jun 2006 05:27:11 -0700
We save an image with our main application window already opened, and
unwanted things disabled (halos, alt-., menus, etc). Additionally, we
have a class-side #startUp: method to initialize what's necessary on
startup, like re-reading config files etc.
The image is started automatically when double-clicking "plopp.exe",
or rather a short-cut in the program menu placed there by the installer.
This exe is nothing more than a renamed Squeak.exe, with a different icon
patched in using a resource editor. There is a VM config file "plopp.ini",
which most importantly contains the path to the image to load (see
Win32 Ini File Settings).
The exe along with the needed plugins, the image and other data files is
installed in the "programs" directory by a regular Windows installer
It's really not too different from other applications, which nowadays also
consist of an executable and several additional files. That the actual
application logic in Squeak's case is not contained in the executable but
in a "data file" is of no concern to the end user.
Note that this is an FAQ item (FAQ: Distributing Squeak Programs).
Feel free to put my explanation on the Swiki, I haven't checked carefully
if a similar answer is already there.
- Bert -
Am 07.06.2006 um 11:47 schrieb Elod Kironsky:
Nice, but I was curious more about the process how to transfrom a
Squeak package to an out-of-the-box program. Of course only, if it is not
an industrial secret ;-)
Planet Plopp was made by impara (http://www.impara.de). Bert was
one of the developers. I saw a little bit from the production of
this program. Very impressive how these
guys working with squeak.
——– Original Message ——–
Subject: Re: [Newbies] Re: self executable with squeak (07- Jun-2006 10:55)
From: Elod Kironsky <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Klaus D. Witzel wrote:
on Wed, 07 Jun 2006 07:48:52 +0200, you wrote:
I apologize if this question has already been posted,
but i did not find it. i wanted to know if it is possible
to make a self executable file with a squeak package or
more packages. Just so that someone can use it without using
squeak or even without having it. I heard about stripers what
is it and how does it work?
Have a look at http://www.amazon.de/exec/obidos/ASIN/3898353664
(sorry, only in German). This is a Squeak application which runs
out of the box.
Interesting. May I ask you, how did you make that program?
Deploying Squeak applications
Mikael Kindborg Jul 13
We are developing a software product for children we call "Magic
Words" and these are our experiences from experimenting with a
deployment version for WIndows.
We have found it useful to use a tiny laucher exe.
The problem we have had with the approach that Bert describes in the
page referred to below is that it takes quite a while for the
application to launch. We tried different variations for the ImageFile
parameter in the ini-file, but even when using the full pathname it
takes 15 seconds on my machine to start the app. (The parameters I
refer to are on this page, which is already pointed to by Bert's
message: Win32 Ini File Settings)
As I recall, this problem have been discussed previously on the list,
and is related to how the virtual machine searches for image files at
startup and some quirks with a Windows API call involved in this. Hot
having investigated the detail about this (perhaps it can be fixed),
we wrote a tiny C program that simply starts Squeak with the image
file that contains our app as an argument. Using this method the app
launches in 1 second.
Here is the source for the launcher app:
int PASCAL WinMain( HINSTANCE inst, HINSTANCE previnst, LPSTR cmdline,
int cmdshow )
// shut up warning
previnst = previnst;
cmdline = cmdline;
// Startup info - no settings are used.
sinfo = malloc (sizeof(STARTUPINFO));
sinfo->cb = sizeof(STARTUPINFO);
sinfo->lpReserved = (LPTSTR) NULL;
sinfo->lpDesktop = (LPTSTR) NULL;
sinfo->lpTitle = (LPTSTR) NULL;
sinfo->dwX = (DWORD) NULL;
sinfo->dwY = (DWORD) NULL;
sinfo->dwXSize = (DWORD) NULL;
sinfo->dwYSize = (DWORD) NULL;
sinfo->dwXCountChars = (DWORD) NULL;
sinfo->dwYCountChars = (DWORD) NULL;
sinfo->dwFillAttribute = (DWORD) NULL;
sinfo->dwFlags = (DWORD) NULL;
sinfo->wShowWindow = 0;
sinfo->cbReserved2 = 0;
sinfo->lpReserved2 = NULL;
sinfo->hStdInput = (HANDLE) NULL;
sinfo->hStdOutput = (HANDLE) NULL;
sinfo->hStdError = (HANDLE) NULL;
// Returned process info - not used.
pinfo = malloc(sizeof(PROCESS_INFORMATION));
// Get current directory.
dir = malloc(1000);
// Set working directory.
wdir = malloc(1000);
// Set command string.
command = malloc(1000);
strcat(command, "\\Data\\Squeak.exe App.image");
// Create the Squeak process.
success = CreateProcess
NULL, //LPCTSTR lpApplicationName,
command, //LPTSTR lpCommandLine,
NULL, //LPSECURITY_ATTRIBUTES lpProcessAttributes,
NULL, //LPSECURITY_ATTRIBUTES lpThreadAttributes,
FALSE, //BOOL bInheritHandles,
(DWORD) NULL, //DWORD dwCreationFlags, ?? CREATE_NO_WINDOW Should we use this flag? Apparently not needed.
NULL, //LPVOID lpEnvironment,
wdir, //LPCTSTR lpCurrentDirectory,
sinfo, //LPSTARTUPINFO lpStartupInfo,
pinfo //LPPROCESS_INFORMATION lpProcessInformation
success = success; // You can remove this, it was just to get a place for a breakpoint for debugging.
We simply hardcoded the name of the application image and the
directory it is placed in. A bit ugly but seems to work. The following
is the directory layout:
AppDir (name of your program's directory)
App.exe (name of the app's exe-file)
Squeak.exe (and related files you need)
We built this using the Open Watcom compiler.
Tried some of the ini options mention on Win32 Ini File Settings
and WindowTitle works fine, but the options related to the Quit dialog
box did not work. The dialog always shows, with the standard text.
Here is the ini-file I used for testing, perhaps I got something
QuitDialogMessage="Do you want to quit Magic Words?"
To sum up, I think the deployment method we have used works very well,
and with a good installer installation is smooth. It is also easy to
put the program in a zip file and deploy it that way, or make a CD
with auto start.
I guess Mac and Linux also could use a simple start script to launch
Squeak with the desired image.
Regarding making a single exe, that would be nice for small
applications, but as Bert writes in this message, most programs need
additional files and various directories for application data etc.
Best regards, Micke
On 7/13/06, Klaus D. Witzel wrote:
> Have a look at what Bert wrote recently in
> On Thu, 13 Jul 2006 09:25:49 +0200, Dan Shafer wrote:
> > Can someone give me or point me to a succinct status update on the
> > current state of the ability to convert a Squeak image into a standalone
> > application for WIndows, OSX and Linux? I know we can always deliver an
> > image and a VM without sources and effectively create the appearance of
> > a standalone but those suckers are huge, so my client is asking if the
> > prospects for being able to deliver stripped-down and double-clickable
> > apps is in the offing or in the distance.
> > Thanks.
> > Dan