I have a windows form application that I made for a local club. I'm using inno setup to create the exe.
It defaulted the install location to program files where I learned that it makes the DB read only. With some reading I found out that the best way to set up a program is to use program files for the app and app data for the DB. How do I go about changing my program and my setup to use those different locations by default?
I have this in a utility class:
public static readonly string APP_FOLDER = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
public static readonly string DB_FILE_PATH = Path.Combine(APP_FOLDER, "train.sqlite3");
public static readonly string DB_BACKUP_FILE_PATH = Path.Combine(APP_FOLDER, "backup.sqlite3");
public static readonly string CONN_STR = string.Format("Data Source={0};Version=3;", DB_FILE_PATH);
And this in DAOs:
using(SQLiteConnection conn = new SQLiteConnection(Utility.CONN_STR))
{
}