mirror of
https://github.com/Stone-Red-Code/DesktopMagic.git
synced 2026-09-06 15:56:13 +02:00
Change ApplicationDataPath
This commit is contained in:
@@ -14,6 +14,7 @@ namespace DesktopMagic;
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public partial class App : Application
|
public partial class App : Application
|
||||||
{
|
{
|
||||||
|
public const string AppName = "Desktop Magic";
|
||||||
private readonly string logFilePath;
|
private readonly string logFilePath;
|
||||||
private readonly Mutex _mutex;
|
private readonly Mutex _mutex;
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
@@ -21,9 +22,7 @@ public partial class App : Application
|
|||||||
#else
|
#else
|
||||||
private readonly Updater updater = new Updater(TimeSpan.FromDays(1), "https://raw.githubusercontent.com/Stone-Red-Code/DesktopMagic/main/update/updateInfo.json");
|
private readonly Updater updater = new Updater(TimeSpan.FromDays(1), "https://raw.githubusercontent.com/Stone-Red-Code/DesktopMagic/main/update/updateInfo.json");
|
||||||
#endif
|
#endif
|
||||||
|
public static string ApplicationDataPath { get; } = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "StoneRed", AppName);
|
||||||
public const string AppName = "Desktop Magic";
|
|
||||||
public static string ApplicationDataPath { get; } = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\" + AppName;
|
|
||||||
|
|
||||||
public static Logger Logger { get; } = new Logger();
|
public static Logger Logger { get; } = new Logger();
|
||||||
|
|
||||||
@@ -55,6 +54,11 @@ public partial class App : Application
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected void CloseMutexHandler(object sender, EventArgs e)
|
||||||
|
{
|
||||||
|
_mutex?.Close();
|
||||||
|
}
|
||||||
|
|
||||||
private void Updater_UpdateAvailible(string version, string additionalInformation)
|
private void Updater_UpdateAvailible(string version, string additionalInformation)
|
||||||
{
|
{
|
||||||
updater.Update();
|
updater.Update();
|
||||||
@@ -75,11 +79,6 @@ public partial class App : Application
|
|||||||
Logger.Log($"Downloading: {progressPercentage}% {totalBytesDownloaded}/{totalFileSize}", "Updater");
|
Logger.Log($"Downloading: {progressPercentage}% {totalBytesDownloaded}/{totalFileSize}", "Updater");
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void CloseMutexHandler(object sender, EventArgs e)
|
|
||||||
{
|
|
||||||
_mutex?.Close();
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Setup(bool clearLogFile)
|
private void Setup(bool clearLogFile)
|
||||||
{
|
{
|
||||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||||
|
|||||||
Reference in New Issue
Block a user