anchor.diff:      (REG QUERY %netfxClient%| findstr "Release"| findstr /I "0x5C786" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxClient%| findstr "Release"| findstr /I "0x5CBF5" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxClient%| findstr "Release"| findstr /I "0x6004F" 1>nul 2>&1) && SET netfxInstalled=1
  -    (REG QUERY %netfxClient%| findstr "Release"| findstr /I "0x60050" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxClient%| findstr "Release"| findstr /I "0x60051" 1>nul 2>&1) && SET netfxInstalled=1
   
       (REG QUERY %netfxClient%| findstr "Release"| findstr /I "378675" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxClient%| findstr "Release"| findstr /I "378758" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxClient%| findstr "Release"| findstr /I "379893" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxClient%| findstr "Release"| findstr /I "393295" 1>nul 2>&1) && SET netfxInstalled=1
  -    (REG QUERY %netfxClient%| findstr "Release"| findstr /I "393296" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxClient%| findstr "Release"| findstr /I "393297" 1>nul 2>&1) && SET netfxInstalled=1
   
       (REG QUERY %netfxFull%| findstr "Release"| findstr /I "0x5C733" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxFull%| findstr "Release"| findstr /I "0x5C786" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxFull%| findstr "Release"| findstr /I "0x5CBF5" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxFull%| findstr "Release"| findstr /I "0x6004F" 1>nul 2>&1) && SET netfxInstalled=1
  -    (REG QUERY %netfxFull%| findstr "Release"| findstr /I "0x60050" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxFull%| findstr "Release"| findstr /I "0x60051" 1>nul 2>&1) && SET netfxInstalled=1
   
       (REG QUERY %netfxFull%| findstr "Release"| findstr /I "378675" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxFull%| findstr "Release"| findstr /I "378758" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxFull%| findstr "Release"| findstr /I "379893" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxFull%| findstr "Release"| findstr /I "393295" 1>nul 2>&1) && SET netfxInstalled=1
  -    (REG QUERY %netfxFull%| findstr "Release"| findstr /I "393296" 1>nul 2>&1) && SET netfxInstalled=1
       (REG QUERY %netfxFull%| findstr "Release"| findstr /I "393297" 1>nul 2>&1) && SET netfxInstalled=1
   
  -    IF %netfxInstalled% NEQ 1 (
  -        GOTO :NO_NETFX_FOUND
  -    )
  -
  -    :: See if and where Git installed
  +    IF %paramNetfx% EQU 1 (
  +        ECHO NetFX detection skipped.
  +    )
  +    IF %paramNetfx% NEQ 1 (
  +        IF %netfxInstalled% EQU 1 (
  +            ECHO NetFX found.
  +        )
  +        IF %netfxInstalled% NEQ 1 (
  +            GOTO :NO_NETFX_FOUND
  +        )
  +    )
  +
  +    IF EXIST "%paramInstallTo%" (
  +        :: custom location
  +        ECHO Deploying to custom location...
  +        ECHO(
  +
  +        CALL :PERFORM_SETUP "%paramInstallTo%" "<empty>"
  +    )
  +
  +    :: See if and where Git installed (in order of desirability)
       ECHO Looking for Git installation(s)...
  +    
  +
  +    IF EXIST "%paramGitPath%\mingw64\libexec\git-core\" (
  +        :: 64-bit Git for Windows 2.x
  +        CALL :PERFORM_SETUP "%paramGitPath%\mingw64\libexec\git-core\" "%paramGitPath%\Git\Cmd"
  +    )
  +
  +    IF EXIST "%paramGitPath%\mingw32\libexec\git-core\" (
  +        :: 32-bit Git for Windows 2.x
  +        CALL :PERFORM_SETUP "%paramGitPath%\mingw32\libexec\git-core\" "%paramGitPath%\Git\Cmd"
  +    )
  +
  +    IF EXIST "%paramGitPath%\libexec\git-core\" (
  +        :: 32-bit Git for Windows 1.x
  +        CALL :PERFORM_SETUP "%paramGitPath%\libexec\git-core\" "%paramGitPath%\Git\Cmd"
  +    )
  +
  +    IF EXIST "%ProgramFiles%\Git\mingw64\libexec\git-core\" (
  +        :: 64-bit Git for Windows 2.x on 64-bit Windows
  +        CALL :PERFORM_SETUP "%ProgramFiles%\Git\mingw64\libexec\git-core\" "%ProgramFiles%\Git\Cmd"
  +    )
  +
  +    IF EXIST "%ProgramFiles%\Git\mingw32\libexec\git-core\" (
  +        :: 32-bit Git for Windows 2.x on 32-bit Windows
  +        CALL :PERFORM_SETUP "%ProgramFiles%\Git\mingw32\libexec\git-core\" "%ProgramFiles%\Git\Cmd"
  +        
  +    )
  +
  +    IF EXIST "%ProgramFiles(x86)%\Git\mingw32\libexec\git-core\" (
  +        :: 32-bit Git for Windows 2.x on 64-bit Windows
  +        CALL :PERFORM_SETUP "%ProgramFiles(x86)%\Git\mingw32\libexec\git-core\" "%ProgramFiles(x86)%\Git\Cmd"
  +    )
   
       IF EXIST "%ProgramFiles%\Git\libexec\git-core\" (
           :: 32-bit Git for Windows 1.x on 32-bit Windows
  -        SET destination="%ProgramFiles%\Git\libexec\git-core\"
  -
  -        CALL :PERFORM_SETUP
  +        CALL :PERFORM_SETUP "%ProgramFiles%\Git\libexec\git-core\" "%ProgramFiles%\Git\Cmd"
       )
   
       IF EXIST "%ProgramFiles(x86)%\Git\libexec\git-core\" (
           :: 32-bit Git for Windows 1.x on 64-bit Windows
  -        SET destination="%ProgramFiles(x86)%\Git\libexec\git-core\"
  -
  -        CALL :PERFORM_SETUP
  -    )
  -
  -    IF EXIST "%ProgramFiles%\Git\mingw32\libexec\git-core\" (
  -        :: 32-bit Git for Windows 2.x on 32-bit Windows
  -        SET destination="%ProgramFiles%\Git\mingw64\libexec\git-core\"
  -
  -        CALL :PERFORM_SETUP
  -    )
  -
  -    IF EXIST "%ProgramFiles(x86)%\Git\mingw32\libexec\git-core\" (
  -        :: 32-bit Git for Windows 2.x on 64-bit Windows
  -        SET destination="%ProgramFiles(x86)%\Git\mingw32\libexec\git-core\"
  -
  -        CALL :PERFORM_SETUP
  -    )
  -
  -    IF EXIST "%ProgramFiles%\Git\mingw64\libexec\git-core\" (
  -        :: 64-bit Git for Windows 2.x on 64-bit Windows
  -        SET destination="%ProgramFiles%\Git\mingw64\libexec\git-core\"
  -
  -        CALL :PERFORM_SETUP
  +        CALL :PERFORM_SETUP "%ProgramFiles(x86)%\Git\libexec\git-core\" "%ProgramFiles(x86)%\Git\Cmd"
       )
   
       :: Check if Git was found or not
  -    IF %gitInstalled% == 1 (
  +    IF %gitInstalled% EQU 1 (
           CALL :UPDATE_CONFIG
           GOTO :SUCCESS
       ) ELSE (
  
positive.code:     :: Pre-configure it
      ECHO(
  
      (git config --global credential.helper %name% && (ECHO Updated your ~\.gitconfig [git config --global])) || GOTO :FAILURE
  
      GOTO :eof
  
  
negative.code: SET gitExtensionName="Microsoft Git Credential Manager for Windows"
  SET name=manager
  SET exeName=git-credential-%name%.exe
  SET installPath=%~dp0
  SET gitInstalled=0
  SET netfxInstalled=0
  SET pathToGit=""
  
  SET paramGitPath=""
  SET paramNetfx=0
  SET paramInstallTo=""
  
  
  :HELLO
  
      ECHO Hello! I'll install %gitExtensionName%.
      ECHO(
  
  
  :PARAMETERS
  
      SETLOCAL ENABLEDELAYEDEXPANSION
  
      :: if the value of %~1 is empty, there are no more parameters to parse so break
      IF "%~1" EQU "" GOTO :PARAMETERS_END
  
      :: check for help queries
      IF "%~1" EQU "--help" (
          GOTO :PRINT_HELP
      )
      IF "%~1" EQU "/?" (
          GOTO :PRINT_HELP
      )
  
      :: check for --install-to options
      IF "%~1" EQU "--install-to" (
          IF EXIST "%~2" (
              SET paramInstallTo="%~2"
              CALL :DEQUOTE paramInstallTo
  
              ECHO Install path set to "!paramInstallTo!".
  
              SHIFT
          )
          IF NOT EXIST "%~2" (
              ECHO Supplied install path "%~2" appears to be invalid.
  
              EXIT /B 9
          )
      )
  
      :: check for special git install locations
      IF "%~1" EQU "--git-path" (
          IF EXIST "%~2" (
              IF EXIST "%~2\Cmd\Git.exe" (
                  SET paramGitPath = "%~2\Cmd\Git.exe"
                  CALL :DEQUOTE paramGitPath
  
                  ECHO Git path set to "!paramGitPath!".
  
                  SHIFT
              )
              IF NOT EXIST "%~2\Cmd\Git.exe" (
                  ECHO Supplied Git path "%~2" appears to be invalid.
  
                  EXIT /B 9
              )
          )
          IF NOT EXIST "%~2" (
              ECHO Supplied Git path "%~2" appears to be invalid.
  
              EXIT /B 9
          )
      )
  
      :: check for skipping NetFX detection
      IF "%~1" EQU "--no-netfx" (
          SET paramNetfx=1
      )
  
      SHIFT
  
      GOTO :PARAMETERS
  
  :PARAMETERS_END
  
      SETLOCAL DISABLEDELAYEDEXPANSION
  
  
  :CHECK_PERMISSIONS
  
      :: Installation requires elevated privileges to write to the `Program Files` directories
      net session >nul 2>&1
      IF %errorLevel% EQU 0 (
          GOTO :INSTALL
      ) ELSE (
          GOTO :NEED_ADMIN_ACCESS
  