anchor.diff:  %UNINSTALL_CMD%
   if errorlevel 1 (
     %ERROR% The Silver Searcher uninstallation failed
  +  %PAUSE%
     endlocal & %RETURN% 1
   )
   %COMMENT% The Silver Searcher was uninstalled successfully
  
positive.code: call :GetRegistryValue "%UNINSTALL_KEY%" UninstallString UNINSTALL_CMD
  if not defined UNINSTALL_CMD (
    %ERROR% No previous instance of The Silver Searcher was found
    endlocal & %RETURN% 1
  )
  %PREPVAR% UNINSTALL_CMD UNINSTALL_CMD_MSG &:# Make sure %ECHO% displays & characters correctly
  
negative.code: if [%1]==[-V] (echo %VERSION%) & exit /b 0
  if [%1]==[-X] set "EXEC=echo" & goto :next_arg
  %ERROR% Unexpected argument: %1
  %PAUSE%
  %RETURN% 1
  
  :start
  call :IsAdmin
  if errorlevel 1 (
    %ERROR% This setup script must be run as Administrator
    %PAUSE%
    %RETURN% 1
  )
  
  :# Scoop has a very similar mechanism, with shims in the same directory as scoop.cmd.
  for %%p in (scoop.cmd) do set "SCOOP=%%~dp$PATH:p"
  if defined SCOOP if exist "%SCOOP%ag.exe" (
    %ERROR% Found another instance of ag.exe installed by Scoop. Please uninstall it first using 'scoop uninstall ag' and retry.
    %PAUSE%
    %RETURN% 1
  )
  :# Avoid collisions with other package managers
  :# Chocolatey stores a proxy program called a "shim" in "%ChocolateyInstall%\bin".
  :# That shim points to the actual ag.exe installed somewhere outside of the PATH.
  if defined ChocolateyInstall if exist "%ChocolateyInstall%\bin\ag.exe" (
    %ERROR% Found another instance of ag.exe installed by Chocolatey. Please uninstall it first using 'choco uninstall ag' and retry.
    %PAUSE%
    %RETURN% 1
  )
  
  