From 3dbd7508468d59a8673542f7023d3f185dcccf59 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 5 Aug 2016 13:41:40 +0200 Subject: [PATCH] Put more updater code inside the try { } catch(Exception) * A crash was uploaded where File.Copy() failed due to permissions. --- renderdocui/Windows/Dialogs/UpdateDialog.cs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/renderdocui/Windows/Dialogs/UpdateDialog.cs b/renderdocui/Windows/Dialogs/UpdateDialog.cs index 633aa08d4..f3e8f6fa4 100644 --- a/renderdocui/Windows/Dialogs/UpdateDialog.cs +++ b/renderdocui/Windows/Dialogs/UpdateDialog.cs @@ -167,16 +167,16 @@ namespace renderdocui.Windows.Dialogs { progressText.Text = "Installing"; - File.Copy(Path.Combine(srcpath, "renderdoc.dll"), Path.Combine(dstpath, "renderdoc.dll"), true); - File.Copy(Path.Combine(srcpath, "renderdoccmd.exe"), Path.Combine(dstpath, "renderdoccmd.exe"), true); - - var process = new Process(); - process.StartInfo = new ProcessStartInfo(Path.Combine(dstpath, "renderdoccmd.exe"), "upgrade --path \"" + srcpath.Replace('\\', '/') + "/\""); - process.StartInfo.WorkingDirectory = dstpath; - process.StartInfo.Verb = "runas"; // need to run as admin to have write permissions - try { + File.Copy(Path.Combine(srcpath, "renderdoc.dll"), Path.Combine(dstpath, "renderdoc.dll"), true); + File.Copy(Path.Combine(srcpath, "renderdoccmd.exe"), Path.Combine(dstpath, "renderdoccmd.exe"), true); + + var process = new Process(); + process.StartInfo = new ProcessStartInfo(Path.Combine(dstpath, "renderdoccmd.exe"), "upgrade --path \"" + srcpath.Replace('\\', '/') + "/\""); + process.StartInfo.WorkingDirectory = dstpath; + process.StartInfo.Verb = "runas"; // need to run as admin to have write permissions + process.Start(); Environment.Exit(0); }