tags:

views:

24

answers:

1

Hi I would like to save settings for an AIR application to a local SQLLite database. Wherever i read, it's recommended that you use File.applicationStorageDirectory to save the database file.

My problem is that in most cases, the AIR application will be first started by an administrator that configs and setup the application (and save the settings to database) and later used by different users. And what I would like to know is if there is possible to save the database to a location that every user can load it from? As I understand it, File.applicationStorageDirectory points to the user directory?

There is probably possible too make the admins set correct permissions and stuff, but I don't want to make it difficult too install...

Thanks

+1  A: 

I think you're misinformed.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html?filter_flex=4.1&filter_flashplayer=10.1&filter_air=2

The File class includes static properties that let you reference commonly used directory locations. These static properties include:

* File.applicationStorageDirectory—a storage directory unique to each installed AIR application

According to this, the applicationStorageDirectory is unique to each app; not unique to each user.

Is your experience different?

www.Flextras.com
I traced File.applicationStorageDirectory.nativePath and it gives me a path like C:\Users\USERNAME\AppData\Roaming\APPNAME\Local Store. Logged in as another user and the path pointed to that user directory... It seems like that path is user-unique... What I want is just a way to save data between users i AIR, thought that would be possible in some way?
Andreas Bergqvist
I'm going into gray territory here. Does AIR allow to install an app for all users, or is it always user specific? If it can be installed for all users, would the app storage directory go in "C:\Users\AllUSers\AppData\Roaming\APPNAME\Local Store" or would it still be user specific?
www.Flextras.com
Well, there is no choice when installing if you want 1 or all users. But my application has created icons on the desktop for all users (public user in win7). But the storage location seems to be user specific.
Andreas Bergqvist
I'm at a loss then. If you distribute an SQLLite database as an asset with the application, and put it in the applicationDirectory; can you write to it, or only read from it? I'd also be sure to file a bug / feature request. https://bugs.adobe.com/flex/
www.Flextras.com
It's possible to read from an sqlite databases that is added as an asset in the application, but but update it... Which ofcourse is what I need. Its possible to copy to another location. But I don't know any crossplatform location that would work?
Andreas Bergqvist