Help with setRegistry?

Ken Ray kray at sonsothunder.com
Thu Jul 25 09:37:01 EDT 2002


Graham,

> Ken, could you possibly put this in context for us Mac-oriented
> types? My problem is how to understand how to arrange the
> installation of a standalone based on these principles. I mean, in
> the Mac, the file association is picked up by the OS as soon as the
> an associated file is double-clicked by the user - as far as I
> remember there is no installation process as such. Therefore the
> first invocation of a standalone in a new Mac is exactly like all
> subsequent invocations.
>
> In the PC, it looks as if you need to go through an installation
> process which does the kind of thing you have described, but that
> this needs to happen only once, on first running the app.
> Subsequently the register will already be set in that particular
> machine and will not have to be set again unless some un-install
> process has been carried out... or do I misunderstand the whole idea?
> Is it mandatory to run an actual installer to install a Windows app?
> Do different flavours of the OS need different flavours of installer?
> Pardon my ignorance, but I am still lurking here, not having really
> taken off into Revo development yet, and coming from a Mac/SuperCard
> background.

On the Mac (at least in OS 9), applications have type and creator codes that
are part of their resource fork that identify documents by type and creator
code. When an app is copied to a disk, the system extracts those
type/creator associations and inserts them into the desktop database so that
when you 2x-click a file, the desktop database retrieves the app that it
belongs to and launches the app. Occasionally the desktop database is messed
up, and 2x-clicking a file does *not* launch the app. The instructions are
then to "rebuild the desktop", which goes through all the apps on the
drive(s) and rebuilds those associations in the desktop database.

In Windows, files/apps don't have a separate resource fork, so files are
associated with apps through extensions. If you can imagine the Windows
Registry as the equivalent of the Mac's desktop database, it becomes a
little clearer. When a file is 2x-clicked, its extension is looked up in the
Registry and if found, there is a pointer to the location on the disk where
the host application resides. That app then is launched. So in order to get
this association, SOMEBODY needs to be write this information to the
Registry: this is the domain of the installer application. The installer
writes these Registry entries as it is installing the application so that
documents created by the application will launch the application properly.
You don't need different installers for different OSes to accommodate file
associations (all Windows OSes from Windows 95 through XP use the Registry
in the same way for file associations), although sometimes different
installers for different OSes are created for *other* reasons (which I won't
get into now).

Similarly, when a program is uninstalled, it should remove its entries from
the Registry, including file association entries. This is the domain of the
uninstaller application. If you just delete files on disk and don't run an
uninstaller, the Registry entries remain and don't get cleaned up. The good
thing is that almost all the installer programs out there for Windows give
the option of automatically creating an uninstaller as well.

So the basic rules are these:

1) If an app has *no* documents, you don't need to make any file
associations, and can simply copy the app to the user's hard disk.
2) If an app *has* documents, you need to make the file association tweaks
in the Registry - generally done by an installer.
3) You don't need a special installer for each OS to make these Registry
changes - one installer will do.
4) If you include an installer, make sure you include an uninstaller as
well.

Hope this helps,

Ken Ray
Sons of Thunder Software
Email: kray at sonsothunder.com
Web Site: http://www.sonsothunder.com/





More information about the use-livecode mailing list