Hello guys
I'm developing a small WFP + C# application that has a copy of Sqlite database for individual user preferences.
How do I insure that the software copies the database to individual user's AppData folder (eg: C:\Users\rajesh\AppData\Roaming\MySoftware\my.db) during the first run from the current installation path?
Please help

Amira BedhiafiPosted Mar 22, 2025, 3:09 PM
You can use the Environment.GetFolderPath method to get the path to the AppData folder for the current user.
You need to check if the folder exists, and if not, create it.
Then define the path where the database will be copied to in the AppData folder.
If the database file already exists in the AppData folder, you might not want to overwrite it. You can check for its existence before copying.
From this point onward, your application should use the database from the AppData folder.