mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
[Settings]Fix crash on View Diagnostic data click (#35635)
This commit is contained in:
@@ -1259,6 +1259,13 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
string localLowEtwDirPath = Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), "AppData", "LocalLow", "Microsoft", "PowerToys", "etw");
|
string localLowEtwDirPath = Path.Combine(Environment.GetEnvironmentVariable("USERPROFILE"), "AppData", "LocalLow", "Microsoft", "PowerToys", "etw");
|
||||||
string etwDirPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Microsoft\\PowerToys\\etw");
|
string etwDirPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "Microsoft\\PowerToys\\etw");
|
||||||
|
|
||||||
|
if (Directory.Exists(localLowEtwDirPath))
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(etwDirPath))
|
||||||
|
{
|
||||||
|
Directory.CreateDirectory(etwDirPath);
|
||||||
|
}
|
||||||
|
|
||||||
string[] localLowEtlFiles = Directory.GetFiles(localLowEtwDirPath, "*.etl");
|
string[] localLowEtlFiles = Directory.GetFiles(localLowEtwDirPath, "*.etl");
|
||||||
|
|
||||||
foreach (string file in localLowEtlFiles)
|
foreach (string file in localLowEtlFiles)
|
||||||
@@ -1275,6 +1282,7 @@ namespace Microsoft.PowerToys.Settings.UI.ViewModels
|
|||||||
Logger.LogError($"Failed to copy etl file: {fileName}. Error: {ex.Message}");
|
Logger.LogError($"Failed to copy etl file: {fileName}. Error: {ex.Message}");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
string tracerptPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "system32");
|
string tracerptPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Windows), "system32");
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user