Skip to content

Commit

Permalink
Fix UpdateSelf to actually work
Browse files Browse the repository at this point in the history
  • Loading branch information
anaisbetts committed May 21, 2015
1 parent e062fa8 commit f8ce7b8
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/Update/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
});
}

Expand Down

0 comments on commit f8ce7b8

Please sign in to comment.