* Closes #3156

* Misc

* Misc

* Rewrite update mechanism ONCE AGAIN, this time to eradicate FSW

* Make creating debug directory non-fatal again, like it used to be

* Deduplicate code

* Remove dead code

* Print update cleanup just once

* Address remaining feedback, go back to _old and _new

* One more nice improvement
This commit is contained in:
Łukasz Domeradzki
2024-04-04 21:21:58 +02:00
committed by GitHub
parent edc7c38ba0
commit ae9dfca3b3
7 changed files with 200 additions and 174 deletions

View File

@@ -415,31 +415,21 @@ internal static class Program {
// If debugging is on, we prepare debug directory prior to running
if (Debugging.IsUserDebugging) {
if (Debugging.IsDebugConfigured) {
ASF.ArchiLogger.LogGenericDebug($"{globalDatabaseFile}: {globalDatabase.ToJsonText(true)}");
}
Logging.EnableTraceLogging();
if (Debugging.IsDebugConfigured) {
ASF.ArchiLogger.LogGenericDebug($"{globalDatabaseFile}: {globalDatabase.ToJsonText(true)}");
DebugLog.AddListener(new Debugging.DebugListener());
DebugLog.Enabled = true;
if (Directory.Exists(SharedInfo.DebugDirectory)) {
try {
Directory.Delete(SharedInfo.DebugDirectory, true);
await Task.Delay(1000).ConfigureAwait(false); // Dirty workaround giving Windows some time to sync
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);
}
try {
Directory.CreateDirectory(ASF.DebugDirectory);
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);
}
}
try {
Directory.CreateDirectory(SharedInfo.DebugDirectory);
} catch (Exception e) {
ASF.ArchiLogger.LogGenericException(e);
}
}
WebBrowser.Init();