mirror of
https://github.com/cemu-project/DS4Windows.git
synced 2024-11-25 10:46:51 +01:00
Recursive dir delete in updater copy script
This commit is contained in:
parent
1c320505c6
commit
98fea512a4
@ -205,7 +205,7 @@ namespace DS4Windows
|
||||
w.WriteLine($"@mov /Y \"{tmpUpdaterPath}\" {Global.exedirpath}\\DS4Updater.exe");
|
||||
if (deleteUpdatesDir)
|
||||
{
|
||||
w.WriteLine($"@del {Global.exedirpath}\\Update Files\\DS4Windows\\DS4Updater.exe");
|
||||
w.WriteLine($"@del /S {Global.exedirpath}\\Update Files\\DS4Windows");
|
||||
}
|
||||
w.WriteLine("@DEL \"%~f0\""); // Attempt to delete myself without opening a time paradox.
|
||||
w.Close();
|
||||
|
@ -242,9 +242,10 @@ Properties.Resources.DS4Update, MessageBoxButton.YesNo, MessageBoxImage.Question
|
||||
|
||||
private bool RunUpdaterCheck(bool launch)
|
||||
{
|
||||
bool updaterExists = File.Exists(Global.exedirpath + "\\DS4Updater.exe");
|
||||
string destPath = Global.exedirpath + "\\DS4Updater.exe";
|
||||
bool updaterExists = File.Exists(destPath);
|
||||
if (!updaterExists ||
|
||||
(FileVersionInfo.GetVersionInfo(Global.exedirpath + "\\DS4Updater.exe").FileVersion.CompareTo(MainWindowsViewModel.UPDATER_VERSION) != 0))
|
||||
(FileVersionInfo.GetVersionInfo(destPath).FileVersion.CompareTo(MainWindowsViewModel.UPDATER_VERSION) != 0))
|
||||
{
|
||||
launch = false;
|
||||
Uri url2 = new Uri($"https://github.com/Ryochan7/DS4Updater/releases/download/v{MainWindowsViewModel.UPDATER_VERSION}/{mainWinVM.updaterExe}");
|
||||
@ -266,7 +267,8 @@ Properties.Resources.DS4Update, MessageBoxButton.YesNo, MessageBoxImage.Question
|
||||
}
|
||||
else
|
||||
{
|
||||
File.Move(filename, Global.exedirpath + "\\DS4Updater.exe");
|
||||
File.Delete(destPath);
|
||||
File.Move(filename, destPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user