From f8ce7b8c68243344a37151320c50a0c3c3750303 Mon Sep 17 00:00:00 2001 From: Paul Betts Date: Wed, 20 May 2015 17:04:22 -0700 Subject: [PATCH] Fix UpdateSelf to actually work --- src/Update/Program.cs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/Update/Program.cs b/src/Update/Program.cs index fb71fde4a..6f48e1e44 100644 --- a/src/Update/Program.cs +++ b/src/Update/Program.cs @@ -151,7 +151,7 @@ int executeCommandLine(string[] args) Update(target).Wait(); break; case UpdateAction.UpdateSelf: - UpdateSelf(target).Wait(); + UpdateSelf().Wait(); break; case UpdateAction.Releasify: Releasify(target, releaseDir, packagesDir, bootstrapperExe, backgroundGif, signingParameters, baseUrl, setupIcon); @@ -239,13 +239,16 @@ await this.ErrorIfThrows(() => } } - public async Task UpdateSelf(string fileToReplace) + public async Task UpdateSelf() { waitForParentToExit(); var src = Assembly.GetExecutingAssembly().Location; + var updateDotExeForOurPackage = Path.Combine( + Path.GetDirectoryName(src), + "..", "Update.exe"); await Task.Run(() => { - File.Copy(src, fileToReplace, true); + File.Copy(src, updateDotExeForOurPackage, true); }); }