root/main/trunk/release-kits/shared/core/uninstaller/Uninstall.bat @ 22573

Revision 22573, 1.6 KB (checked in by sjm84, 9 years ago)

Updated the messages printed by the uninstaller if extra permissions are required

Line 
1@echo off
2CD /D "%~dp0"
3
4:checkUserPermissions
5    echo Checking if the Greenstone directory is writable ...
6    (echo This is a temporary file. It is safe to delete it. > "%GSDLHOME%\testing.tmp" ) 2>nul
7    if exist "%GSDLHOME%\testing.tmp" goto deleteTempFile
8    if "%1" == "Elevated" goto printWarning
9    echo ... FAILED
10    echo The uninstaller cannot write to the Greenstone directory (%GSDLHOME%)
11    echo Requesting elevated status to become admin user to continue.
12    "%GSDLHOME%\bin\windows\gstart.exe" %0 Elevated %1 %2 %3 %4 %5 %6 %7 %8 %9
13    goto done
14   
15:printWarning
16    echo ... FAILED
17    echo The uninstaller cannot write to the Greenstone directory (%GSDLHOME%).
18    echo Attempting to continue without permissions.
19    goto shiftElevated
20
21:deleteTempFile
22    echo ... OK
23    del "%GSDLHOME%\testing.tmp"
24
25:shiftElevated
26:: Shift "Elevated" (one of our own internal command words) out of the way if present
27:: so the command-line is as it was when the user initiated the command
28    if "%1" == "Elevated" shift
29
30if exist .\bin\windows\search4j.exe .\bin\windows\search4j.exe -p .\packages\jre -l .\uninst.jar
31
32if exist .\gs2build\bin\windows\search4j.exe .\gs2build\bin\windows\search4j.exe -p .\packages\jre -l .\uninst.jar
33
34
35if exist uninst.flag (
36
37    rd /s /q .\packages\jre
38    rmdir packages
39   
40    if exist .\bin\windows\search4j.exe (
41        del .\bin\windows\search4j.exe
42        rmdir bin\windows
43    )
44    if exist .\gs2build\bin\windows\search4j.exe (
45        del .\gs2build\bin\windows\search4j.exe
46        rd /s /q gs2build
47    )
48       
49    del uninst.jar
50    del uninst.flag
51    del Uninstall.*
52   
53    if NOT EXIST *.* (
54        set GSDEL=%CD%
55        cd ..
56        rmdir %GSDEL%
57    )
58   
59)
Note: See TracBrowser for help on using the browser.