-
Notifications
You must be signed in to change notification settings - Fork 18
/
WindowsInstall.bat
68 lines (53 loc) · 1.75 KB
/
WindowsInstall.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
::@echo off
:: BatchGotAdmin
:-------------------------------------
REM --> Check for permissions
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system"
REM --> If error flag set, we do not have admin.
if '%errorlevel%' NEQ '0' (
echo Requesting administrative privileges...
goto UACPrompt
) else (
goto gotAdmin
)
:UACPrompt
echo Set UAC = CreateObject^("Shell.Application"^) > "%temp%\getadmin.vbs"
echo UAC.ShellExecute "%~s0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
pushd "%CD%"
CD /D "%~dp0"
:--------------------------------------
set HOME=%UserProfile%
set VIMFILES=%UserProfile%\vimfiles
set VIMRC=%UserProfile%\_vimrc
echo Build VIM env directory...
mkdir "%VIMFILES%"
echo Build Directory for autoload...
mkdir "%VIMFILES%\autoload"
echo Copy base init file to %VIMFILES%
copy _vimrc "%VIMFILES%"
copy ctags.exe C:\
xcopy _vim\* "%VIMFILES%" /E /Y
echo build vimrc shortcut...
::mklink "%VIMRC%" "%VIMFILES%\_vimrc"
copy _vimrc "%VIMFILES%"
copy _vimrc "%HOME%"
echo Initial base plugin...
call :InstallCurl
git clone git://github.com/Shougo/neobundle.vim "%VIMFILES%/bundle/neobundle.vim"
pause
goto exit
:InstallCurl
@rem Do not use "echo off" to not affect any child calls.
@setlocal
@rem Get the abolute path to the parent directory, which is assumed to be the
@rem Git installation root.
@for /F "delims=" %%I in ("%~dp0..") do @set git_install_root=%%~fI
@set PATH=%git_install_root%\bin;%git_install_root%\mingw\bin;%PATH%
@if not exist "%HOME%" @set HOME=%HOMEDRIVE%%HOMEPATH%
@if not exist "%HOME%" @set HOME=%USERPROFILE%
@curl.exe %*
:exit