Where to put SQLite database in Mac application bundle lazarus / 33-macOS - Mac OS X ---------------------------------------------------------------------- jonek · 2013-10-29 14:07 Stupid question ahoy, I fear. I promise I've tried looking for an answer but to no avail. I am writing code for a friend to run on his Mac, with the goal of just giving him a single .app file that he can run. With that in mind, I'm using SQLite as the database. My question is as above: where do I put the SQLite database in the application bundle so the program will find it? At the moment the code reads: Code: [Select]{$IFDEF Windows}   Connection.DatabaseName := ExtractFilePath(ParamStr(0)) + 'Data.db'; {$ENDIF} {$IFDEF Darwin}   Connection.DatabaseName := 'Data.db'; {$ENDIF} Connection.Connected := True; Which works fine within Lazarus, but as soon as I try and run the .app file, it fails with 'unable to open database file'. Any direction gratefully received. ---------------------------------------------------------------------- havezet · 2013-10-30 08:10 You can not put configuration or database files in your app. The way I do it is to put an empty database in the resources folder. Then on first startup, the database is copied to the designated application data folder in the user's Library