github.com/q2/git-lfs@v0.5.1-0.20150410234700-03a0d4cec40e/script/install.bat.example (about)

     1  :::::::::::::::::::::::::::::::::::::::::
     2  :: Automatically check & get admin rights
     3  :::::::::::::::::::::::::::::::::::::::::
     4  @echo off
     5  CLS
     6  
     7  :: Check if git.exe is in the user's path before continuing
     8  where /q git.exe
     9  if %errorlevel% neq 0 (ECHO Unable to find git.exe, exiting... & EXIT /b %errorlevel%)
    10  
    11  :checkPrivileges
    12  NET FILE 1>NUL 2>NUL
    13  if '%errorlevel%' == '0' ( goto gotPrivileges ) else ( goto getPrivileges )
    14  
    15  :getPrivileges
    16  if '%1'=='ELEV' (shift & goto gotPrivileges)
    17  echo.
    18  echo **************************************
    19  echo Installing Git LFS as Administrator
    20  echo **************************************
    21  
    22  setlocal DisableDelayedExpansion
    23  set "batchPath=%~0"
    24  setlocal EnableDelayedExpansion
    25  echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\OEgetPrivileges.vbs"
    26  echo UAC.ShellExecute "!batchPath!", "ELEV", "", "runas", 1 >> "%temp%\OEgetPrivileges.vbs"
    27  "%temp%\OEgetPrivileges.vbs"
    28  exit /B
    29  
    30  :gotPrivileges
    31  
    32  setlocal & cd /d %~dp0
    33  
    34  set GIT_LFS_BIN_PATH="%LOCALAPPDATA%\GitLFS\bin"
    35  IF EXIST %GIT_LFS_BIN_PATH% GOTO DIRECTORY_EXISTS
    36  mkdir %GIT_LFS_BIN_PATH%
    37  set "path=%PATH%;%GIT_LFS_BIN_PATH:"=%"
    38  1>NUL setx PATH "%PATH%" /M
    39  :DIRECTORY_EXISTS
    40  
    41  :: Delete any existing git-lfs programs
    42  2>NUL del /q %GIT_LFS_BIN_PATH%\git-lfs*
    43  
    44  1>NUL copy git-lfs.exe %GIT_LFS_BIN_PATH%\git-lfs.exe
    45  
    46  git lfs init
    47  
    48  cmd /k