Standalone App and file paths
Posted: Sat Sep 12, 2009 12:16 am
Just did my first build of a standalone application and came across something I hadn't anticipated.
I have the following code in an openStack handler to open my sqlite database (it was supplied to me by someone on this forum):
The intent is to have the database reside in the same directory as the application. Works fine while developing.
When I build a standalone app for the Mac, I'm getting bitten by the fact that the OSX stores the executables inside a package so the code above fails since the db is not inside the package but in the directory that includes the package.
I could put the db inside the package but that doesn't feel like the best place for it somehow.
I'm sure this is a known catch when building standalones on a Mac so I'm hoping someone has a code snippet that will work for development and standalone versions of an app.
Thanks,
Pete
I have the following code in an openStack handler to open my sqlite database (it was supplied to me by someone on this forum):
Code: Select all
set the itemDelimiter to "/"
put item 1 to -2 of the filename of this stack into tSQLiteDatabaseFile
put "/BandTrak.s3db" after tSQLiteDatabaseFile
if there is no file tSQLiteDatabaseFile then
answer information "Can't find db file" & tSQLiteDataBaseFile
else
...
When I build a standalone app for the Mac, I'm getting bitten by the fact that the OSX stores the executables inside a package so the code above fails since the db is not inside the package but in the directory that includes the package.
I could put the db inside the package but that doesn't feel like the best place for it somehow.
I'm sure this is a known catch when building standalones on a Mac so I'm hoping someone has a code snippet that will work for development and standalone versions of an app.
Thanks,
Pete