feat: settings, installer banner

This commit is contained in:
2026-03-09 17:48:11 +01:00
parent 6958781dec
commit f2e4addbb0
14 changed files with 5124 additions and 42 deletions

View File

@@ -15,7 +15,7 @@ namespace CarManagerV3
/// <summary>
/// The path of the txt file that contains recently opened file paths.
/// </summary>
private static readonly string recentPathsFile = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\CarManagerV3\\recent_paths.txt";
private static string recentPathsFile = Properties.Settings.Default.DataLocation + "\\recent_paths.txt";
/// <summary>
@@ -46,16 +46,17 @@ namespace CarManagerV3
/// Initializes a file and its parent folders at a specified path if they do not already exist.
/// </summary>
/// <param name="path">The path of the file.</param>
public static void initializeFileAndFolders(string path)
public static void initializeFileAndFolders(string path, bool folderOnly = false)
{
try
{
string directory = Path.GetDirectoryName(path);
if (!Directory.Exists(directory))
//string directory = Path.GetDirectoryName(path);
Console.WriteLine($"Initializing file and folders for path: {path}");
if (!Directory.Exists(path))
{
Directory.CreateDirectory(directory);
Directory.CreateDirectory(path);
}
InitializeFile(path);
if(!folderOnly) InitializeFile(path);
}
catch (Exception ex)
{
@@ -204,6 +205,7 @@ namespace CarManagerV3
List<string> paths = new List<string>();
try
{
recentPathsFile = Properties.Settings.Default.DataLocation + "\\recent_paths.txt";
initializeFileAndFolders(recentPathsFile);
if (File.Exists(recentPathsFile)) //TODO: Remove
{