From: Brian S. <xue...@us...> - 2007-09-21 01:18:53
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24335 Modified Files: Tag: b0_22_2 installer-SecPOPFile-body.nsh installer-SecPOPFile-func.nsh installer.nsi Log Message: Now using the LockedList plugin to detect when a program is running, instead of code which assumes the user has administrator rights. This, combined with the UAC plugin, makes it easier to cope with the case where the installer is started by a user without administrator rights. Index: installer-SecPOPFile-body.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-SecPOPFile-body.nsh,v retrieving revision 1.3.2.8 retrieving revision 1.3.2.9 diff -C2 -d -r1.3.2.8 -r1.3.2.9 *** installer-SecPOPFile-body.nsh 10 Feb 2007 12:21:40 -0000 1.3.2.8 --- installer-SecPOPFile-body.nsh 21 Sep 2007 01:18:53 -0000 1.3.2.9 *************** *** 122,128 **** continue: ; If we are installing over a previous version, ensure that version is not running ! Call MakeRootDirSafe ; Starting with 0.21.0, a new structure is used for the minimal Perl (to enable POPFile to --- 122,134 ---- continue: + ; Use HKLM as a simple workaround for the case where installer is started by a non-admin user + ; (the MakeRootDirSafe function will use this HKLM data to re-initialise $G_ROOTDIR) + + WriteRegStr HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "UAC_RootDir" "$G_ROOTDIR" + ; If we are installing over a previous version, ensure that version is not running ! GetFunctionAddress ${L_TEMP} MakeRootDirSafe ! UAC::ExecCodeSegment ${L_TEMP} ; Starting with 0.21.0, a new structure is used for the minimal Perl (to enable POPFile to Index: installer.nsi =================================================================== RCS file: /cvsroot/popfile/windows/installer.nsi,v retrieving revision 1.242.4.11 retrieving revision 1.242.4.12 diff -C2 -d -r1.242.4.11 -r1.242.4.12 *** installer.nsi 13 Jul 2007 21:35:51 -0000 1.242.4.11 --- installer.nsi 21 Sep 2007 01:18:53 -0000 1.242.4.12 *************** *** 761,764 **** --- 761,765 ---- ReserveFile "${NSISDIR}\Plugins\DumpLog.dll" ReserveFile "${NSISDIR}\Plugins\inetc.dll" + ReserveFile "${NSISDIR}\Plugins\LockedList.dll" ReserveFile "${NSISDIR}\Plugins\md5dll.dll" ReserveFile "${NSISDIR}\Plugins\NSISdl.dll" Index: installer-SecPOPFile-func.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-SecPOPFile-func.nsh,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** installer-SecPOPFile-func.nsh 29 Aug 2006 15:57:38 -0000 1.1.2.5 --- installer-SecPOPFile-func.nsh 21 Sep 2007 01:18:53 -0000 1.1.2.6 *************** *** 4,8 **** # used by the 'installer-SecPOPFile-body.nsh' file. # ! # Copyright (c) 2005-2006 John Graham-Cumming # # This file is part of POPFile --- 4,8 ---- # used by the 'installer-SecPOPFile-body.nsh' file. # ! # Copyright (c) 2005-2007 John Graham-Cumming # # This file is part of POPFile *************** *** 130,133 **** --- 130,157 ---- Function MakeRootDirSafe + ; Use HKLM as a simple workaround for the case where installer is started by a non-admin user + + Push $G_ROOTDIR + + ReadRegStr $G_ROOTDIR HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "UAC_RootDir" + StrCmp $G_ROOTDIR "" 0 check_folder_exists + MessageBox MB_OK|MB_ICONEXCLAMATION "Internal Error: UAC_RootDir not defined\ + ${MB_NL}${MB_NL}\ + Click OK to continue" + ReadRegStr $G_ROOTDIR HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "UAC_RootDir" + StrCmp $G_ROOTDIR "" try_other_entries + MessageBox MB_OK|MB_ICONINFORMATION "Good News: UAC_RootDir now defined" + Goto check_folder_exists + + try_other_entries: ; ??? + ReadRegStr $G_ROOTDIR HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "RootDir_LFN" + StrCmp $G_ROOTDIR "" 0 check_folder_exists + ReadRegStr $G_ROOTDIR HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "InstallPath" + + check_folder_exists: + DeleteRegValue HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "UAC_RootDir" + + ; If we are upgrading an existing installation we need to ensure it is not running + IfFileExists "$G_ROOTDIR\*.exe" 0 nothing_to_check *************** *** 273,276 **** --- 297,301 ---- Call PFI_WaitUntilUnlocked DetailPrint "Checking if '${L_EXE}' is still locked after NSISdl request..." + Push "${C_EXE_END_MARKER}" Push ${L_EXE} Call PFI_CheckIfLocked *************** *** 314,317 **** --- 339,343 ---- nothing_to_check: + Pop $G_ROOTDIR FunctionEnd |