diff --git a/src/GitHub.Api/Installer/GitInstaller.cs b/src/GitHub.Api/Installer/GitInstaller.cs index 4feb21c75..71dd77361 100644 --- a/src/GitHub.Api/Installer/GitInstaller.cs +++ b/src/GitHub.Api/Installer/GitInstaller.cs @@ -301,15 +301,18 @@ private GitInstallationState ExtractGit(GitInstallationState state) return true; }); unzipTask.Progress(p => Progress.UpdateProgress(40 + (long)(20 * p.Percentage), 100, unzipTask.Message)); - var path = unzipTask.RunSynchronously(); + var source = unzipTask.RunSynchronously(); var target = state.GitInstallationPath; if (unzipTask.Successful) { - var source = path; - target.DeleteIfExists(); - target.EnsureParentDirectoryExists(); - source.Move(target); + Logger.Trace("Moving Git source:{0} target:{1}", source.ToString(), target.ToString()); + + target.DeleteContents(); + source.MoveFiles(target, true); + source.Parent.Delete(); + state.GitIsValid = true; + state.IsCustomGitPath = state.GitExecutablePath != installDetails.GitExecutablePath; } } @@ -326,14 +329,16 @@ private GitInstallationState ExtractGit(GitInstallationState state) return true; }); unzipTask.Progress(p => Progress.UpdateProgress(60 + (long)(20 * p.Percentage), 100, unzipTask.Message)); - var path = unzipTask.RunSynchronously(); + var source = unzipTask.RunSynchronously(); var target = state.GitLfsInstallationPath; if (unzipTask.Successful) { - var source = path; - target.DeleteIfExists(); - target.EnsureParentDirectoryExists(); - source.Move(target); + Logger.Trace("Moving GitLFS source:{0} target:{1}", source.ToString(), target.ToString()); + + target.DeleteContents(); + source.MoveFiles(target, true); + source.Parent.Delete(); + state.GitLfsIsValid = true; } } diff --git a/src/GitHub.Api/Installer/OctorunInstaller.cs b/src/GitHub.Api/Installer/OctorunInstaller.cs index e1f92252b..9baaca033 100644 --- a/src/GitHub.Api/Installer/OctorunInstaller.cs +++ b/src/GitHub.Api/Installer/OctorunInstaller.cs @@ -52,10 +52,13 @@ private NPath GrabZipFromResources() private NPath MoveOctorun(NPath fromPath) { var toPath = installDetails.InstallationPath; - toPath.DeleteIfExists(); - toPath.EnsureParentDirectoryExists(); - fromPath.Move(toPath); + + Logger.Trace("MoveOctorun fromPath: {0} toPath:{1}", fromPath.ToString(), toPath.ToString()); + + toPath.DeleteContents(); + fromPath.MoveFiles(toPath, true); fromPath.Parent.Delete(); + return installDetails.ExecutablePath; }