mirror of
https://github.com/stuff-by-3-random-dudes/UWUVCI-AIO-WPF
synced 2024-11-29 06:20:27 +00:00
fix freeze if in temp folder
This commit is contained in:
parent
7064d1f8a4
commit
3d68a20813
2 changed files with 28 additions and 8 deletions
|
@ -164,11 +164,6 @@ namespace UWUVCI_AIO_WPF
|
||||||
mvvm = mvm;
|
mvvm = mvm;
|
||||||
|
|
||||||
|
|
||||||
if (Directory.Exists(tempPath))
|
|
||||||
{
|
|
||||||
|
|
||||||
Directory.Delete(tempPath, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
Directory.CreateDirectory(tempPath);
|
Directory.CreateDirectory(tempPath);
|
||||||
|
|
||||||
|
@ -1579,12 +1574,32 @@ namespace UWUVCI_AIO_WPF
|
||||||
}
|
}
|
||||||
mvvm.Progress = 80;
|
mvvm.Progress = 80;
|
||||||
}
|
}
|
||||||
|
public static void DeleteDirectory(string path)
|
||||||
|
{
|
||||||
|
foreach (string directory in Directory.GetDirectories(path))
|
||||||
|
{
|
||||||
|
DeleteDirectory(directory);
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
Thread.Sleep(0);
|
||||||
|
Directory.Delete(path, true);
|
||||||
|
}
|
||||||
|
catch (IOException)
|
||||||
|
{
|
||||||
|
Directory.Delete(path, true);
|
||||||
|
}
|
||||||
|
catch (UnauthorizedAccessException)
|
||||||
|
{
|
||||||
|
Directory.Delete(path, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
public static void Clean()
|
public static void Clean()
|
||||||
{
|
{
|
||||||
if (Directory.Exists(tempPath))
|
if (Directory.Exists(tempPath))
|
||||||
{
|
{
|
||||||
Directory.Delete(tempPath, true);
|
DeleteDirectory(tempPath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
[STAThread]
|
[STAThread]
|
||||||
|
@ -1710,7 +1725,11 @@ namespace UWUVCI_AIO_WPF
|
||||||
decrypt.WaitForExit();
|
decrypt.WaitForExit();
|
||||||
}
|
}
|
||||||
mvm.Progress += 10;
|
mvm.Progress += 10;
|
||||||
File.Delete(Path.Combine(Properties.Settings.Default.BasePath, $"{b.Name.Replace(":", "")} [{b.Region.ToString()}]", "code", "fw.img"));
|
foreach (string sFile in Directory.GetFiles(Path.Combine(Properties.Settings.Default.BasePath, $"{b.Name.Replace(":", "")} [{b.Region.ToString()}]", "content"), "*.nfs"))
|
||||||
|
{
|
||||||
|
File.Delete(sFile);
|
||||||
|
}
|
||||||
|
File.Delete(Path.Combine(Properties.Settings.Default.BasePath, $"{b.Name.Replace(":", "")} [{b.Region.ToString()}]", "code", "fw.img"));
|
||||||
|
|
||||||
File.Delete(Path.Combine(Properties.Settings.Default.BasePath, $"{b.Name.Replace(":", "")} [{b.Region.ToString()}]", "code", "fw.tmd"));
|
File.Delete(Path.Combine(Properties.Settings.Default.BasePath, $"{b.Name.Replace(":", "")} [{b.Region.ToString()}]", "code", "fw.tmd"));
|
||||||
|
|
||||||
|
|
|
@ -1115,6 +1115,7 @@ namespace UWUVCI_AIO_WPF
|
||||||
cm.ShowDialog();
|
cm.ShowDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
private void BaseCheck()
|
private void BaseCheck()
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue