Jelajahi Sumber

UI/updater: Delete visual studio runtimes after execution

jp9000 7 tahun lalu
induk
melakukan
ceadde0838
1 mengubah file dengan 2 tambahan dan 1 penghapusan
  1. 2 1
      UI/win-update/updater/updater.cpp

+ 2 - 1
UI/win-update/updater/updater.cpp

@@ -1071,13 +1071,14 @@ static bool UpdateVS2017Redists(json_t *root)
 		WaitForSingleObject(pi.hProcess, INFINITE);
 		CloseHandle(pi.hProcess);
 	} else {
-		DeleteFile(destPath.c_str());
 		Status(L"Update failed: Could not execute "
 		       L"%s (error code %d)",
 		       L"Visual C++ 2017 Redistributable",
 		       (int)GetLastError());
 	}
 
+	DeleteFile(destPath.c_str());
+
 	waitResult = WaitForSingleObject(cancelRequested, 0);
 	if (waitResult == WAIT_OBJECT_0) {
 		return false;