This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
forked from dferguso/MapSAR_Ex
-
Notifications
You must be signed in to change notification settings - Fork 0
/
~LoadMapSAREXTools.bat
57 lines (39 loc) · 1.82 KB
/
~LoadMapSAREXTools.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
@echo off
REM Get admin privileges
REM from https://sites.google.com/site/eneerge/scripts/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 "%~0", "", "", "runas", 1 >> "%temp%\getadmin.vbs"
"%temp%\getadmin.vbs"
exit /B
:gotAdmin
if exist "%temp%\getadmin.vbs" ( del "%temp%\getadmin.vbs" )
@echo on
If DEFINED ProgramFiles(x86) Set _programs=%ProgramFiles(x86)%
If Not DEFINED ProgramFiles(x86) Set _programs=%ProgramFiles%
ECHO %_programs%
set _igtpath=%~dp0
IF EXIST "%_programs%\ArcGIS\Desktop10.0\License" CALL :install "%_programs%\ArcGIS\Desktop10.0"
IF EXIST "%_programs%\ArcGIS\Desktop10.1\License" CALL :install "%_programs%\ArcGIS\Desktop10.1"
IF EXIST "%_programs%\ArcGIS\Desktop10.2\License" CALL :install "%_programs%\ArcGIS\Desktop10.2"
IF EXIST "%_programs%\ArcGIS\Desktop10.3\License" CALL :install "%_programs%\ArcGIS\Desktop10.3"
IF EXIST "%_programs%\ArcGIS\Desktop10.4\License" CALL :install "%_programs%\ArcGIS\Desktop10.4"
set _config="%APPDATA%\ArcGIS4LocalGovernment\ConfigFiles"
IF NOT EXIST %_config% (
MKDIR %_config%
)
copy "%_igtpath%tools\aaloaded.config" %_config%\loaded.config /y
set _regasmdir="%_programs%\Common Files\ArcGIS\bin\"
start "Register Measure Angle Addin" /D%_regasmdir% /W %_regasmdir%\ESRIRegAsm /p:Desktop "%_igtpath%Tools\AddIns\MeasureAngle.dll"
GOTO :eof
:install
xcopy "%_igtpath%tools\addins\*.esriaddin" "%~1\bin\Addins\"
xcopy "%_igtpath%tools\SAR_Toolbox100.tbx" "%~1\ArcToolbox\Toolboxes\"
ENDLOCAL