diff --git a/DS4Windows/DS4Control/Util.cs b/DS4Windows/DS4Control/Util.cs index a117023..65362dc 100644 --- a/DS4Windows/DS4Control/Util.cs +++ b/DS4Windows/DS4Control/Util.cs @@ -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(); diff --git a/DS4Windows/DS4Forms/MainWindow.xaml.cs b/DS4Windows/DS4Forms/MainWindow.xaml.cs index 80ef377..e51f01c 100644 --- a/DS4Windows/DS4Forms/MainWindow.xaml.cs +++ b/DS4Windows/DS4Forms/MainWindow.xaml.cs @@ -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); } } }