WPF: Fix WorkDirectoryLoader regex

This commit is contained in:
genteure 2021-11-21 01:33:04 +08:00
parent 7ec8b1d405
commit 7e2f0e4b49

View File

@ -21,7 +21,7 @@ namespace BililiveRecorder.WPF
var exePath = Assembly.GetEntryAssembly().Location;
this.basePath = string.IsNullOrWhiteSpace(exePath) ? Environment.CurrentDirectory : Path.GetDirectoryName(exePath);
if (Regex.IsMatch(this.basePath, @"^.*\\app-\d\.\d\.\d\\?$") && File.Exists(Path.Combine(this.basePath, "..", "Update.exe")))
if (Regex.IsMatch(this.basePath, @"^.*\\app-\d+\.\d+\.\d+\\?$") && File.Exists(Path.Combine(this.basePath, "..", "Update.exe")))
this.basePath = Path.Combine(this.basePath, "..");
this.basePath = Path.GetFullPath(this.basePath);