Quest For Glory V for Mac OS 9 Installer Script

4th May 2022 | Programming

Twenty-one years ago I created an AppleScript to serve as an installer for Quest for Glory V on Mac OS 9. This was created because the original installer did not work under Mac OS 9 (but oddly enough, the installer that comes with the German version ("Drachenfeuer") of the game worked fine). This script was based off of advice I got from QFG5's lead programmer Eric Lengyel on which particular files need to be copied off of the install CD.

AppleScript is always kind of interesting to play with. Some things are quite elegant, whereas other things can be quite maddening in their implementation. The original script was far from a piece of beautiful coding prose, since it was likely produced by recording my actions using Script Editor. This updated version (1.1) of the script is a complete rewrite with several improvements and safe guards.

The installer script can be downloaded here.

The list of files which are copied over:

One feature I wanted to implement with this script was to be able to copy the QFG5 icon onto the main destination folder, but I have not found a way to do this in Mac OS 9. There is a way to do this in Mac OS X which requires "System Events", but unfortunately that is not available on Mac OS 9, so the function below won't work for this script. The following is an example code snippet that can copy the icon of a file and paste it onto a folder.


tell application "Finder"
	set sourcePath to file "Snow Leopard:Users:chad:Pictures:L-150.tif"
	set destPath to folder "Snow Leopard:Users:chad:Desktop:Foo:"

	my CopyOrPaste(sourcePath, "c")
	my CopyOrPaste(destPath, "v")
end tell

on CopyOrPaste(i, cv)
	tell application "Finder"
		activate
		open information window of i
	end tell
	tell application "System Events" to tell process "Finder" to tell window 1
		delay 0.25
		keystroke tab -- select icon button
		delay 0.25
		keystroke (cv & "w") using command down (* (copy or paste) + close window *)
	end tell
end CopyOrPaste

It's been five years since I've played Quest for Glory V, and this is the first of several QFGV-related projects I'm planning for this year. There's also a fan-made patch for the game to try out, in addition to setting up my ideal PowerMac system when I replay the game this year.