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
/
~UninstallMapSAREXTools.bat
58 lines (40 loc) · 1.91 KB
/
~UninstallMapSAREXTools.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
@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%
IF EXIST "%_programs%\ArcGIS\Desktop10.0\License" CALL :remove "%_programs%\ArcGIS\Desktop10.0"
IF EXIST "%_programs%\ArcGIS\Desktop10.1\License" CALL :remove "%_programs%\ArcGIS\Desktop10.1"
IF EXIST "%_programs%\ArcGIS\Desktop10.2\License" CALL :remove "%_programs%\ArcGIS\Desktop10.2"
IF EXIST "%_programs%\ArcGIS\Desktop10.3\License" CALL :remove "%_programs%\ArcGIS\Desktop10.3"
IF EXIST "%_programs%\ArcGIS\Desktop10.1\License" CALL :remove "%_programs%\ArcGIS\Desktop10.4"
del "%APPDATA%\ArcGIS4LocalGovernment\ConfigFiles\loaded.config"
set _igtpath=%~dp0
set _regasmdir="%_programs%\Common Files\ArcGIS\bin\"
start "Unregister Measure Angle Addin" /D%_regasmdir% /W %_regasmdir%\ESRIRegAsm /p:Desktop /u "%_igtpath%Tools\AddIns\MeasureAngle.dll"
goto :eof
:remove
del "%~1\bin\Addins\Search_Editor.esriAddIn"
del "%~1\bin\Addins\MapSAREX_Config.esriAddIn"
del "%~1\bin\Addins\GPX.esriAddIn"
del "%~1\bin\Addins\Get_Map_Point_Addin_Tool.esriAddIn"
del "%~1\bin\Addins\ConstructwithBuffer.esriAddIn"
del "%~1\bin\Addins\AttributeAssistant.esriAddIn"
del "%~1\ArcToolbox\Toolboxes\SAR_Toolbox100.tbx"
ENDLOCAL