Last change
on this file since 22532 was 22532, checked in by sjm84, 14 years ago |
Uninstall.bat will now ask for elevated permissions if it cannot write to the directory in which it resides
|
File size:
1.2 KB
|
Line | |
---|
1 | @echo off
|
---|
2 | CD /D "%~dp0"
|
---|
3 |
|
---|
4 | :checkUserPermissions
|
---|
5 | echo Checking if the collection directory is writable...
|
---|
6 | echo This is a temporary file. It is safe to delete it. > testing.tmp 2>nul
|
---|
7 | if exist testing.tmp goto deleteTempFile
|
---|
8 | if "%1" == "Elevated" goto shiftElevated
|
---|
9 | bin\windows\gstart.exe %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %9
|
---|
10 | goto done
|
---|
11 |
|
---|
12 | :deleteTempFile
|
---|
13 | del testing.tmp
|
---|
14 |
|
---|
15 | :shiftElevated
|
---|
16 | :: Shift "Elevated" (one of our own internal command words) out of the way if present
|
---|
17 | :: so the command-line is as it was when the user initiated the command
|
---|
18 | if "%1" == "Elevated" shift
|
---|
19 |
|
---|
20 | if exist .\bin\windows\search4j.exe .\bin\windows\search4j.exe -p .\packages\jre -l .\uninst.jar
|
---|
21 |
|
---|
22 | if exist .\gs2build\bin\windows\search4j.exe .\gs2build\bin\windows\search4j.exe -p .\packages\jre -l .\uninst.jar
|
---|
23 |
|
---|
24 |
|
---|
25 | if exist uninst.flag (
|
---|
26 |
|
---|
27 | rd /s /q .\packages\jre
|
---|
28 | rmdir packages
|
---|
29 |
|
---|
30 | if exist .\bin\windows\search4j.exe (
|
---|
31 | del .\bin\windows\search4j.exe
|
---|
32 | rmdir bin\windows
|
---|
33 | )
|
---|
34 | if exist .\gs2build\bin\windows\search4j.exe (
|
---|
35 | del .\gs2build\bin\windows\search4j.exe
|
---|
36 | rd /s /q gs2build
|
---|
37 | )
|
---|
38 |
|
---|
39 | del uninst.jar
|
---|
40 | del uninst.flag
|
---|
41 | del Uninstall.*
|
---|
42 |
|
---|
43 | if NOT EXIST *.* (
|
---|
44 | set GSDEL=%CD%
|
---|
45 | cd ..
|
---|
46 | rmdir %GSDEL%
|
---|
47 | )
|
---|
48 |
|
---|
49 | )
|
---|
Note:
See
TracBrowser
for help on using the repository browser.