Update of /cvsroot/popfile/windows
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25200
Modified Files:
Tag: b0_22_2
installer-Uninstall.nsh
Log Message:
Use the UAC plugin to make the uninstaller run with 'admin' rights
(still need to look at the case where the user data uses the same
folder as the POPFile program files).
Index: installer-Uninstall.nsh
===================================================================
RCS file: /cvsroot/popfile/windows/installer-Uninstall.nsh,v
retrieving revision 1.4.2.7
retrieving revision 1.4.2.8
diff -C2 -d -r1.4.2.7 -r1.4.2.8
*** installer-Uninstall.nsh 10 Jun 2007 16:06:59 -0000 1.4.2.7
--- installer-Uninstall.nsh 29 Jul 2007 17:14:08 -0000 1.4.2.8
***************
*** 57,60 ****
--- 57,91 ----
Function un.onInit
+ ; Use the UAC plugin to ensure that this uninstaller runs with 'administrator' privileges
+ ; (UAC = Vista's new "User Account Control" feature).
+ ;
+ ; WARNING: The UAC plugin uses $0, $1, $2 and $3 registers
+
+ UAC_Elevate:
+ UAC::RunElevated
+ StrCmp 1223 $0 UAC_ElevationAborted ; UAC dialog aborted by user?
+ StrCmp 0 $0 0 UAC_Err ; Error?
+ StrCmp 1 $1 0 UAC_Success ; Are we the real deal or just the wrapper?
+ Quit
+
+ UAC_Err:
+ MessageBox mb_iconstop "Unable to elevate , error $0"
+ Abort
+
+ UAC_ElevationAborted:
+ MessageBox mb_iconstop "This uninstaller requires admin access, aborting!"
+ Abort
+
+ UAC_Success:
+ # if $0==0 && $1==0, UAC not supported (Probably <NT6), run as normal?
+ # if $0==0 && $1==3, we can try to elevate again
+ # if $0==0 && $3==1, we are a member of the admin group (Any OS)
+ StrCmp 1 $3 continue ; Admin?
+ StrCmp 3 $1 0 UAC_ElevationAborted ; Try again?
+ MessageBox mb_iconstop "This uninstaller requires admin access, try again"
+ goto UAC_Elevate
+
+ continue:
+
; Retrieve the language used when POPFile was installed, and use it for the uninstaller
; (if the language entry is not found in the registry, a 'language selection' dialog is shown)
***************
*** 120,123 ****
--- 151,174 ----
#--------------------------------------------------------------------------
+ # Installer Function: un.OnUninstFailed (required by UAC plugin)
+ #--------------------------------------------------------------------------
+
+ Function un.OnUninstFailed
+
+ UAC::Unload ; Must call unload!
+
+ FunctionEnd
+
+ #--------------------------------------------------------------------------
+ # Installer Function: un.OnUninstSuccess (required by UAC plugin)
+ #--------------------------------------------------------------------------
+
+ Function un.OnUninstSuccess
+
+ UAC::Unload ; Must call unload!
+
+ FunctionEnd
+
+ #--------------------------------------------------------------------------
# Uninstaller Sections (this build uses all of these and executes them in the order shown)
#
***************
*** 430,434 ****
Delete "$G_ROOTDIR\runsqlite.exe"
Delete "$G_ROOTDIR\sqlite.exe"
!
Delete "$G_ROOTDIR\msgcapture.exe"
Delete "$G_ROOTDIR\pfidbstatus.exe"
--- 481,485 ----
Delete "$G_ROOTDIR\runsqlite.exe"
Delete "$G_ROOTDIR\sqlite.exe"
!
Delete "$G_ROOTDIR\msgcapture.exe"
Delete "$G_ROOTDIR\pfidbstatus.exe"
|