Packages

J. Landman Gay jacque at hyperactivesw.com
Sat Dec 8 16:31:28 EST 2007


Chipp Walters wrote:
> So, if I understand this correctly, you can have a 'package' which is
> a folder but not a 'bundle' but looks like one because it's 'bundle
> bit' is on? :-)

A package is also treated as a single file; the user double-clicks it 
and it launches the package installer. But unless you are creating a 
package installer (you'll need Apple's tools to do that,) all the 
packages you will work with will be application bundles.

> 
> On a more serious note, does the Mac have a registry like Windows? If
> so, is it easy to gain access to? Rev has a single command to grab a
> Window registry key. Perhaps a similar function for the Mac would
> help?

There are hidden databases that deal with launch services and other file 
maintenance, but they should not be accessed by humans. There is nothing 
that really corresponds to the Windows registry. I can't think of any 
time you'd need to work with those though. Apple warns against it.

> 
> I suppose the easiest thing to do, is to see how RevCopyFile manages
> to figure out what a bundle/package/folder is and how to copy it
> accurately (or does it?)

Yes. It uses AppleScript. I'm guessing that virtually all cases you will 
need to deal with will be application bundles, right? The easiest way to 
check to see if a folder is an application or a regular directory is 
simply to check for the ".app" extension. The extension exists on all 
application bundles, even if the user's view has been set to hide it.

Another easy way to check for the existence of an application bundle is 
to see if the directory has a "Contents/MacOS" folder inside. All Mac 
apps have those.

Some things that may help determine the existence of an app:

answer file "Choose the chess application" --> /Applications/Chess.app
	-- changed by popular demand a few versions ago; we used to need
	-- to "answer folder" to get these.
put there is a file "/Applications/Chess.app" --> FALSE
put there is a folder "/Applications/Chess.app" --> TRUE
put there is a folder "/Applications/Chess.app/Contents/MacOS/" --> TRUE

-- 
Jacqueline Landman Gay         |     jacque at hyperactivesw.com
HyperActive Software           |     http://www.hyperactivesw.com



More information about the use-livecode mailing list