Skip to content

Commit

Permalink
Use absolute path for sqlite database file
Browse files Browse the repository at this point in the history
Hopefully to prevent UnauthorizedAccessException errors when app is started by Windows
  • Loading branch information
Issung committed Apr 27, 2024
1 parent 1867ad9 commit 92dafd2
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion GChan/Data/DataController.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using GChan.Trackers;
using System;
using System.Collections.Generic;
using System.Data.SQLite;
using System.IO;
Expand All @@ -14,7 +15,7 @@ class DataController

private const string DATABASE_FILENAME = "trackers.db";
private static readonly string DATABASE_FOLDERNAME = "data";
private static readonly string DATABASE_PATH = DATABASE_FOLDERNAME + "/" + DATABASE_FILENAME;
private static readonly string DATABASE_PATH = Path.Combine(AppContext.BaseDirectory, DATABASE_FOLDERNAME, DATABASE_FILENAME);
private static readonly string DATABASE_CONNECTION_STRING = "DataSource=" + DATABASE_PATH;

/// <summary>
Expand Down

0 comments on commit 92dafd2

Please sign in to comment.