Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Failed Installation Recovery #11

Closed
wants to merge 1 commit into from

2 participants

@kobelb

Initially I launched the installer from Windows Explorer, and the installation failed because the git command wasn't in my path. I then tried to launch the installer from msysgit and this failed because the git-credential-winstore.exe already existed in %AppData%\Roaming\GitCredStore.

I modified the Program.cs to see if the .exe exists before copying and if it does delete the current .exe and then copy again.

@kobelb kobelb Added check to see if the .exe exists in the destination and if it do…
…es delete and copy again. I accidentally launched the installed from Windows Explorer and it left this file behind and then was crashing when trying to install from msysgit
4a64de6
@kobelb

Also, sorry for not making a topic branch, this is my first pull request and I obviously didn't think ahead far enough.

@anurse
Owner

No worries, I can just pull it in to a topic branch :). I'll take a look as soon as I get some time!

@anurse anurse was assigned
@anurse
Owner

I've included this code in a commit of my own, so I'm closing the PR, but the feature should be there!

@anurse anurse closed this
@anurse anurse referenced this pull request from a commit
@robmen robmen Correct memory access to password.
The password is written to the credential manager as a Unicode string.
However, when the password was being read from the credential manager
it was being accessed as a BSTR. This fixes the code to read the
string as a simple Unicode string.

Fixes #11
bcd49e0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Aug 18, 2012
  1. @kobelb

    Added check to see if the .exe exists in the destination and if it do…

    kobelb authored
    …es delete and copy again. I accidentally launched the installed from Windows Explorer and it left this file behind and then was crashing when trying to install from msysgit
This page is out of date. Refresh to see the latest.
Showing with 9 additions and 2 deletions.
  1. +9 −2 git-credential-winstore/Program.cs
View
11 git-credential-winstore/Program.cs
@@ -128,9 +128,16 @@ private static void InstallTheApp(bool silent)
}
var dest = new FileInfo(Environment.ExpandEnvironmentVariables(@"%AppData%\GitCredStore\git-credential-winstore.exe"));
- File.Copy(Assembly.GetExecutingAssembly().Location, dest.FullName, true);
+ var destinationPath = dest.FullName;
- Process.Start("git", string.Format("config --global credential.helper \"!'{0}'\"", dest.FullName));
+ if (File.Exists(destinationPath))
+ {
+ File.Delete(destinationPath);
+ }
+
+ File.Copy(Assembly.GetExecutingAssembly().Location, destinationPath, true);
+
+ Process.Start("git", string.Format("config --global credential.helper \"!'{0}'\"", destinationPath));
}
static IEnumerable<Tuple<string, string>> GetCommand(IDictionary<string, string> args)
Something went wrong with that request. Please try again.