Saving data in List Magic tables
Richard Gaskin
ambassador at fourthworld.com
Thu Aug 5 12:45:34 EDT 2010
charles61 wrote:
> After going to Key Ray's site, I found "asup" as code for Application
> Support constant for OS X. Is this the best place to put your app
> when you install it on an user's OS X computer?
Now you've gone an opened up a can of worms, Charles! :)
This question touches on a few issues, but let's handle the small one first:
If you want to save DATA (not the app, we'll get to that in a moment) to
the Application Data folder, you need to decide which one. There's a
system-wide one in the System folder, and a user-specific one in the
user's Library folder.
The system-wide one can be useful for data which will be used by all
users on that machine:
get specialFolderPath("asup")
There is no special constant for the user's App Support folder, but you
can get it by concatenating the user folder with the App Support folder:
get specialFolderPath("home")& specialFolderPath("asup")
But that's for data only. And Apple gets somewhat specific about
*which* data should go there - see this overview of "Where to put
application files":
<http://developer.apple.com/mac/library/documentation/MacOSX/Conceptual/BPFileSystem/Articles/WhereToPutFiles.html>
In short, they suggest using the Preferences folder for prefs data, and
Application Support for "any type of file that supports the application
but is not required for the application to run."
As for the application itself, it should go into the Applications folder
on OS X and Program Files on Windows. But remember that modern versions
of both OS X and Windows can restrict access to those folders for
non-admin accounts.
For Windows, any installer builder you use will allow an option for the
user to elevate privileges to a level appropriate for installation, or
if you're rolling your own you can use the option for setting User
Access Control in Rev's Standalone Builder.
On OS X, it's common to deliver apps in a DMG image file, so they user
will be able to put it wherever they have permissions to do so.
Once the app is installed, if the user doesn't have admin permissions
the app may not be able to write to its own folder. So for things like
your Reports stack, I would consider using Application Support on OS X
and Application Data on Windows.
--
Richard Gaskin
Fourth World
Rev training and consulting: http://www.fourthworld.com
Webzine for Rev developers: http://www.revjournal.com
revJournal blog: http://revjournal.com/blog.irv
More information about the use-livecode
mailing list