mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-09 04:37:30 +02:00
[Settings]Fix backup and restore "no backup found" when they do exist (#21870)
This commit is contained in:
@@ -432,9 +432,14 @@ namespace Microsoft.PowerToys.Settings.UI.Library
|
|||||||
var tempPath = Path.GetTempPath();
|
var tempPath = Path.GetTempPath();
|
||||||
|
|
||||||
var fullBackupDir = Path.Combine(tempPath, "PowerToys_settings_" + latestFile.ToString(CultureInfo.InvariantCulture));
|
var fullBackupDir = Path.Combine(tempPath, "PowerToys_settings_" + latestFile.ToString(CultureInfo.InvariantCulture));
|
||||||
if (!Directory.Exists(fullBackupDir))
|
|
||||||
|
lock (backupSettingsInternalLock)
|
||||||
{
|
{
|
||||||
ZipFile.ExtractToDirectory(settingsBackupFiles[latestFile], fullBackupDir);
|
if (!Directory.Exists(fullBackupDir) || !File.Exists(Path.Combine(fullBackupDir, "manifest.json")))
|
||||||
|
{
|
||||||
|
TryDeleteDirectory(fullBackupDir);
|
||||||
|
ZipFile.ExtractToDirectory(settingsBackupFiles[latestFile], fullBackupDir);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ThreadPool.QueueUserWorkItem((x) =>
|
ThreadPool.QueueUserWorkItem((x) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user