From: Brian S. <xue...@us...> - 2007-11-10 13:43:12
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9917 Modified Files: Tag: b0_22_2 adduser-Uninstall.nsh adduser-Version.nsh adduser.nsi installer-SecPOPFile-body.nsh installer-Uninstall.nsh installer.nsi Log Message: In order to stop Vista from ignoring the requested execution level for the POPFile uninstaller (thus rendering the UAC plugin useless), use HKCU instead of HKLM to store the uninstall data when Vista is detected. Simplify the handling of the Start Menu shortcuts to make it easier to avoid leaving some behind when uninstalling. Fix the minor bugs that sometimes meant the uninstaller had to ask for permission to delete some files which should have been deleted automatically. Index: installer-SecPOPFile-body.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-SecPOPFile-body.nsh,v retrieving revision 1.3.2.11 retrieving revision 1.3.2.12 diff -C2 -d -r1.3.2.11 -r1.3.2.12 *** installer-SecPOPFile-body.nsh 18 Oct 2007 01:37:38 -0000 1.3.2.11 --- installer-SecPOPFile-body.nsh 10 Nov 2007 13:43:08 -0000 1.3.2.12 *************** *** 77,86 **** ; ; (b) $INSTDIR\kakasi - holds the Kakasi package used to process Japanese email ! ; (only installed when Japanese support is required) ; ! ; (c) $INSTDIR\lib - minimal Perl installation (except for the three files stored ; in the $INSTDIR folder to avoid runtime problems) ; ! ; (d) $INSTDIR\* - the remaining POPFile folders (Classifier, languages, skins, etc) ; ; For this build, each user is expected to have separate user data folders. By default each --- 77,91 ---- ; ; (b) $INSTDIR\kakasi - holds the Kakasi package used to process Japanese email ! ; (only installed when Japanese support is required and the Kakasi ! ; parser has been selected) ; ! ; (c) $INSTDIR\mecab - holds the MeCab package used to process Japanese email ! ; (only installed when Japanese support is required and the MeCab ! ; parser has been selected) ! ; ! ; (d) $INSTDIR\lib - minimal Perl installation (except for the three files stored ; in the $INSTDIR folder to avoid runtime problems) ; ! ; (e) $INSTDIR\* - the remaining POPFile folders (Classifier, languages, skins, etc) ; ; For this build, each user is expected to have separate user data folders. By default each *************** *** 144,148 **** Call SkinsRestructure - StrCmp $G_WINUSERTYPE "Admin" 0 current_user_root WriteRegStr HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "Installer Language" "$LANGUAGE" WriteRegStr HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "POPFile Major Version" "${C_POPFILE_MAJOR_VERSION}" --- 149,152 ---- *************** *** 163,185 **** WriteRegStr HKLM "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "RootDir_SFN" "${L_TEMP}" - current_user_root: - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "Installer Language" "$LANGUAGE" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "POPFile Major Version" "${C_POPFILE_MAJOR_VERSION}" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "POPFile Minor Version" "${C_POPFILE_MINOR_VERSION}" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "POPFile Revision" "${C_POPFILE_REVISION}" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "POPFile RevStatus" "${C_POPFILE_RC}" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "InstallPath" "$G_ROOTDIR" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "Author" "setup.exe" - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "RootDir_LFN" "$G_ROOTDIR" - StrCmp $G_SFN_DISABLED "0" find_HKCU_root_sfn - StrCpy ${L_TEMP} "Not supported" - Goto save_HKCU_root_sfn - - find_HKCU_root_sfn: - GetFullPathName /SHORT ${L_TEMP} "$G_ROOTDIR" - - save_HKCU_root_sfn: - WriteRegStr HKCU "Software\POPFile Project\${C_PFI_PRODUCT}\MRI" "RootDir_SFN" "${L_TEMP}" - ; Install the POPFile Core files --- 167,170 ---- *************** *** 367,381 **** ; the read-only attribute first. Similar handling is required for the Internet shortcuts. ! ; If the user has 'Admin' rights, create a 'POPFile' folder with a set of shortcuts in ! ; the 'All Users' Start Menu . If the user does not have 'Admin' rights, the shortcuts ! ; are created in the 'Current User' Start Menu. ! ; If the 'All Users' folder is not found, NSIS will return the 'Current User' folder. SetShellVarContext all - StrCmp $G_WINUSERTYPE "Admin" create_shortcuts - SetShellVarContext current - - create_shortcuts: SetOutPath "$SMPROGRAMS\${C_PFI_PRODUCT}" SetOutPath "$G_ROOTDIR" --- 352,359 ---- ; the read-only attribute first. Similar handling is required for the Internet shortcuts. ! ; Create a 'POPFile' folder with a set of shortcuts in the 'All Users' Start Menu. ; If the 'All Users' folder is not found, NSIS will return the 'Current User' folder. SetShellVarContext all SetOutPath "$SMPROGRAMS\${C_PFI_PRODUCT}" SetOutPath "$G_ROOTDIR" *************** *** 396,407 **** SetOutPath "$SMPROGRAMS\${C_PFI_PRODUCT}" - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\POPFile User Interface.url" NORMAL - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\POPFile User Interface.url" \ - "InternetShortcut" "URL" "http://${C_UI_URL}:$G_GUI/" - - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile.url" NORMAL - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile.url" \ - "InternetShortcut" "URL" "http://${C_UI_URL}:$G_GUI/shutdown" - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" NORMAL --- 374,377 ---- *************** *** 452,456 **** !endif ! IfFileExists "$G_ROOTDIR\pfidiag.exe" 0 silent_shutdown Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\PFI Diagnostic utility.lnk" SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" NORMAL --- 422,426 ---- !endif ! IfFileExists "$G_ROOTDIR\pfidiag.exe" 0 add_remove_programs Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\PFI Diagnostic utility.lnk" SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" NORMAL *************** *** 461,506 **** "$G_ROOTDIR\pfidiag.exe" "/full" ! silent_shutdown: SetOutPath "$G_ROOTDIR" ! ! SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile silently.lnk" NORMAL ! CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile silently.lnk" \ ! "$G_ROOTDIR\stop_pf.exe" "/showerrors $G_GUI" ; Create entry in the Control Panel's "Add/Remove Programs" list ! WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "DisplayName" "${C_PFI_PRODUCT} ${C_PFI_VERSION}" ! WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "UninstallString" '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' ! WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "InstallLocation" "$G_ROOTDIR" ! WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "NoModify" "0" ! WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "ModifyPath" '"$G_ROOTDIR\uninstall.exe" /MODIFY' ! WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "NoElevateOnModify" "1" ! WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ ! "NoRepair" "1" ! StrCmp $G_WINUSERTYPE "Admin" 0 end_section ! WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "DisplayName" "${C_PFI_PRODUCT} ${C_PFI_VERSION}" ! WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "UninstallString" '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' ! WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "InstallLocation" "$G_ROOTDIR" ! WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoModify" "0" ! WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "ModifyPath" '"$G_ROOTDIR\uninstall.exe" /MODIFY' ! WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoElevateOnModify" "1" ! WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoRepair" "1" ! end_section: SetDetailsPrint textonly DetailPrint "$(PFI_LANG_INST_PROG_ENDSEC)" --- 431,467 ---- "$G_ROOTDIR\pfidiag.exe" "/full" ! add_remove_programs: SetOutPath "$G_ROOTDIR" ! SetShellVarContext current ; Create entry in the Control Panel's "Add/Remove Programs" list ! ClearErrors ! ReadRegStr ${L_RESULT} HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion ! IfErrors use_HKLM ! StrCpy ${L_TEMP} ${L_RESULT} 1 ! StrCmp ${L_TEMP} '6' create_arp_entry ! use_HKLM: ! SetShellVarContext all ! create_arp_entry: ! WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "DisplayName" "${C_PFI_PRODUCT} ${C_PFI_VERSION}" ! WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "UninstallString" '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' ! WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "InstallLocation" "$G_ROOTDIR" ! WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoModify" "0" ! WriteRegStr SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "ModifyPath" '"$G_ROOTDIR\uninstall.exe" /MODIFY' ! WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoElevateOnModify" "1" ! WriteRegDWORD SHCTX "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ "NoRepair" "1" ! SetShellVarContext current ! SetDetailsPrint textonly DetailPrint "$(PFI_LANG_INST_PROG_ENDSEC)" Index: installer.nsi =================================================================== RCS file: /cvsroot/popfile/windows/installer.nsi,v retrieving revision 1.242.4.15 retrieving revision 1.242.4.16 diff -C2 -d -r1.242.4.15 -r1.242.4.16 *** installer.nsi 18 Oct 2007 01:40:24 -0000 1.242.4.15 --- installer.nsi 10 Nov 2007 13:43:08 -0000 1.242.4.16 *************** *** 592,600 **** ;--------------------------------------------------- ! ; Use a "pre" function for the 'WELCOME' page to get the user name and user rights ! ; (For this build, if user has 'Admin' rights we perform a multi-user install, ! ; otherwise we perform a single-user install) ! !define MUI_PAGE_CUSTOMFUNCTION_PRE "CheckUserRights" !define MUI_WELCOMEPAGE_TEXT "$(PFI_LANG_WELCOME_INFO_TEXT)" --- 592,599 ---- ;--------------------------------------------------- ! ; Use a "pre" function for the 'WELCOME' page to remove the banner ! ; (if one has been displayed) ! !define MUI_PAGE_CUSTOMFUNCTION_PRE "RemoveBanner" !define MUI_WELCOMEPAGE_TEXT "$(PFI_LANG_WELCOME_INFO_TEXT)" *************** *** 906,923 **** Function .onInit ; Use the UAC plugin to ensure that this installer 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 --- 905,973 ---- Function .onInit + ; WARNING: The UAC plugin uses $0, $1, $2 and $3 registers + + !define L_UAC_0 $0 + !define L_UAC_1 $1 + !define L_UAC_2 $2 + !define L_UAC_3 $3 + + ; The reason why '.onInit' preserves the registers it uses is that it makes debugging easier! + + Push ${L_UAC_0} + Push ${L_UAC_1} + Push ${L_UAC_2} + Push ${L_UAC_3} + + ; Initialise the G_WINUSERNAME and $G_WINUSERTYPE globals _before_ trying to elevate + ; as this makes it easier to cope with the visible and hidden processes after elevation + + ; The 'UserInfo' plugin may return an error if run on a Win9x system but since Win9x systems + ; do not support different account types, we treat this error as if user has 'Admin' rights. + + ClearErrors + UserInfo::GetName + IfErrors 0 got_name + + ; Assume Win9x system, so user has 'Admin' rights + ; (UserInfo works on Win98SE so perhaps it is only Win95 that fails ?) + + StrCpy $G_WINUSERNAME "UnknownUser" + StrCpy $G_WINUSERTYPE "Admin" + Goto UAC_Elevate + + got_name: + Pop $G_WINUSERNAME + StrCmp $G_WINUSERNAME "" 0 get_usertype + StrCpy $G_WINUSERNAME "UnknownUser" + + get_usertype: + UserInfo::GetAccountType + Pop $G_WINUSERTYPE + StrCmp $G_WINUSERTYPE "Admin" UAC_Elevate + StrCmp $G_WINUSERTYPE "Power" UAC_Elevate + StrCmp $G_WINUSERTYPE "User" UAC_Elevate + StrCmp $G_WINUSERTYPE "Guest" UAC_Elevate + StrCpy $G_WINUSERTYPE "Unknown" + ; Use the UAC plugin to ensure that this installer runs with 'administrator' privileges ; (UAC = Vista's new "User Account Control" feature). UAC_Elevate: + ; MessageBox MB_OK "Debug message (UAC_Elevate label in .onInit function)\ + ; ${MB_NL}${MB_NL}\ + ; Command-line = $CMDLINE\ + ; ${MB_NL}${MB_NL}\ + ; $$G_WINUSERNAME = $G_WINUSERNAME\ + ; ${MB_NL}${MB_NL}\ + ; $$G_WINUSERTYPE = $G_WINUSERTYPE" + UAC::RunElevated ! StrCmp 1223 ${L_UAC_0} UAC_ElevationAborted ; Jump if UAC dialog was aborted by user ! StrCmp 0 ${L_UAC_0} 0 UAC_Err ; If ${L_UAC_0} is not 0 then an error was detected ! StrCmp 1 ${L_UAC_1} 0 UAC_Success ; Are we the real deal or just the wrapper ? ! Quit ; UAC not supported (probably pre-NT6), run as normal UAC_Err: ! MessageBox mb_iconstop "Unable to elevate , error ${L_UAC_0}" Abort *************** *** 927,942 **** 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 installer requires admin access, try again" ! goto UAC_Elevate continue: - ; The reason why '.onInit' preserves the registers it uses is that it makes debugging easier! - !define L_INPUT_FILE_HANDLE $R9 !define L_OUTPUT_FILE_HANDLE $R8 --- 977,987 ---- UAC_Success: ! StrCmp 1 ${L_UAC_3} continue ; Jump if we are a member of the admin group (any OS) ! StrCmp 3 ${L_UAC_1} 0 UAC_ElevationAborted ; Can we try to elevate again ? MessageBox mb_iconstop "This installer requires admin access, try again" ! goto UAC_Elevate ; ... try again continue: !define L_INPUT_FILE_HANDLE $R9 !define L_OUTPUT_FILE_HANDLE $R8 *************** *** 986,989 **** --- 1031,1044 ---- !undef L_TEMP + Pop ${L_UAC_3} + Pop ${L_UAC_2} + Pop ${L_UAC_1} + Pop ${L_UAC_0} + + !undef L_UAC_0 + !undef L_UAC_1 + !undef L_UAC_2 + !undef L_UAC_3 + FunctionEnd *************** *** 1057,1061 **** ; in two stages (first an empty MUI page appears and a little later the page contents appear). ; This looks a little strange (and may prompt the user to start clicking buttons too soon) ! ; so we display a banner to reassure the user. The banner will be removed by 'CheckUserRights' StrCpy $G_PFIFLAG "banner displayed" --- 1112,1116 ---- ; in two stages (first an empty MUI page appears and a little later the page contents appear). ; This looks a little strange (and may prompt the user to start clicking buttons too soon) ! ; so we display a banner to reassure the user. The banner will be removed by 'RemoveBanner' StrCpy $G_PFIFLAG "banner displayed" *************** *** 1854,1913 **** #-------------------------------------------------------------------------- ! # Installer Function: CheckUserRights # (the "pre" function for the 'WELCOME' page) - # - # On systems which support different types of user, recommend that POPFile is installed by - # a user with 'Administrative' rights (this makes it easier to use POPFile's multi-user mode). #-------------------------------------------------------------------------- ! Function CheckUserRights ! ! !define L_WELCOME_TEXT $R9 ! ! Push ${L_WELCOME_TEXT} ! ! ; The 'UserInfo' plugin may return an error if run on a Win9x system but since Win9x systems ! ; do not support different account types, we treat this error as if user has 'Admin' rights. ! ! ClearErrors ! UserInfo::GetName ! IfErrors 0 got_name ! ! ; Assume Win9x system, so user has 'Admin' rights ! ; (UserInfo works on Win98SE so perhaps it is only Win95 that fails ?) ! ! StrCpy $G_WINUSERNAME "UnknownUser" ! StrCpy $G_WINUSERTYPE "Admin" ! Goto exit ! ! got_name: ! Pop $G_WINUSERNAME ! StrCmp $G_WINUSERNAME "" 0 get_usertype ! StrCpy $G_WINUSERNAME "UnknownUser" ! ! get_usertype: ! UserInfo::GetAccountType ! Pop $G_WINUSERTYPE ! StrCmp $G_WINUSERTYPE "Admin" exit ! StrCmp $G_WINUSERTYPE "Power" not_admin ! StrCmp $G_WINUSERTYPE "User" not_admin ! StrCmp $G_WINUSERTYPE "Guest" not_admin ! StrCpy $G_WINUSERTYPE "Unknown" ! ! not_admin: ! ! ; On the 'WELCOME' page, add a note recommending that POPFile is installed by a user ! ; with 'Administrator' rights ! ! !insertmacro MUI_INSTALLOPTIONS_READ "${L_WELCOME_TEXT}" "ioSpecial.ini" "Field 3" "Text" ! !insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Field 3" "Text" \ ! "${L_WELCOME_TEXT}\ ! ${IO_NL}${IO_NL}\ ! $(PFI_LANG_WELCOME_ADMIN_TEXT)" ! ! exit: ! Pop ${L_WELCOME_TEXT} ! StrCmp $G_PFIFLAG "no banner" no_banner ; Remove the banner which was displayed by the 'PFIGUIInit' function --- 1909,1919 ---- #-------------------------------------------------------------------------- ! # Installer Function: RemoveBanner # (the "pre" function for the 'WELCOME' page) #-------------------------------------------------------------------------- ! Function RemoveBanner ! StrCmp $G_PFIFLAG "no banner" exit ; Remove the banner which was displayed by the 'PFIGUIInit' function *************** *** 1916,1922 **** Banner::destroy ! no_banner: ! ! !undef L_WELCOME_TEXT FunctionEnd --- 1922,1926 ---- Banner::destroy ! exit: FunctionEnd *************** *** 2178,2181 **** --- 2182,2187 ---- Function InstallUserData + !define L_UAC_0 $0 + ; If we are only downloading and installing the SSL support files, display the FINISH page *************** *** 2193,2201 **** --- 2199,2211 ---- IfRebootFlag special_case + Push ${L_UAC_0} UAC::Exec "" "$G_ROOTDIR\adduser.exe" "/install" "" + Pop ${L_UAC_0} Abort special_case: + Push ${L_UAC_0} UAC::Exec "" "$G_ROOTDIR\adduser.exe" "/installreboot" "" + Pop ${L_UAC_0} Abort *************** *** 2204,2207 **** --- 2214,2219 ---- ; Display the FINISH page + !undef L_UAC_0 + FunctionEnd Index: adduser-Uninstall.nsh =================================================================== RCS file: /cvsroot/popfile/windows/adduser-Uninstall.nsh,v retrieving revision 1.2.2.6 retrieving revision 1.2.2.7 diff -C2 -d -r1.2.2.6 -r1.2.2.7 *** adduser-Uninstall.nsh 21 Sep 2007 01:22:09 -0000 1.2.2.6 --- adduser-Uninstall.nsh 10 Nov 2007 13:43:08 -0000 1.2.2.7 *************** *** 447,450 **** --- 447,451 ---- Delete "$G_USERDIR\pfi-run.bat" + Delete "$G_USERDIR\pfi-run.bat.bk?" SetDetailsPrint textonly *************** *** 462,482 **** StrCmp $G_PFIFLAG "fail" do_nothing SetDetailsPrint textonly DetailPrint "$(PFI_LANG_UN_PROG_SHORT)" SetDetailsPrint listonly Delete "$G_USERDIR\Check database status.lnk" Delete "$G_USERDIR\Run SQLite utility.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Check database status.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Message Capture utility.lnk" ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile Data ($G_WINUSERNAME).lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}" SetDetailsPrint textonly DetailPrint " " SetDetailsPrint listonly do_nothing: SectionEnd --- 463,513 ---- StrCmp $G_PFIFLAG "fail" do_nothing + !define L_TEMP $R9 + + Push ${L_TEMP} + SetDetailsPrint textonly DetailPrint "$(PFI_LANG_UN_PROG_SHORT)" SetDetailsPrint listonly + ; Remove the utility shortcuts in the 'User Data' folder + Delete "$G_USERDIR\Check database status.lnk" Delete "$G_USERDIR\Run SQLite utility.lnk" ! ! ; Remove the POPFile shortcuts from the current user's Start Menu ! ! Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Message Capture utility.lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Check database status.lnk" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" + + Call un.PFI_IsNT + Pop ${L_TEMP} + StrCmp ${L_TEMP} 1 remove_all + IfFileExists "$G_ROOTDIR\uninstall.exe" remove_most + + remove_all: + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Run POPFile.lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Release Notes.lnk" + + remove_most: + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile Data ($G_WINUSERNAME).lnk" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\POPFile User Interface.url" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile.url" + Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\Shutdown POPFile silently.lnk" RMDir "$SMPROGRAMS\${C_PFI_PRODUCT}" + Delete "$SMSTARTUP\Run POPFile.lnk" + SetDetailsPrint textonly DetailPrint " " SetDetailsPrint listonly + Pop ${L_TEMP} + + !undef L_TEMP + do_nothing: SectionEnd Index: installer-Uninstall.nsh =================================================================== RCS file: /cvsroot/popfile/windows/installer-Uninstall.nsh,v retrieving revision 1.4.2.13 retrieving revision 1.4.2.14 diff -C2 -d -r1.4.2.13 -r1.4.2.14 *** installer-Uninstall.nsh 20 Oct 2007 13:02:07 -0000 1.4.2.13 --- installer-Uninstall.nsh 10 Nov 2007 13:43:08 -0000 1.4.2.14 *************** *** 64,78 **** 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: --- 64,90 ---- Function un.onInit + ; WARNING: The UAC plugin uses $0, $1, $2 and $3 registers + + !define L_UAC_0 $0 + !define L_UAC_1 $1 + !define L_UAC_2 $2 + !define L_UAC_3 $3 + + ; The reason why 'un.onInit' preserves the registers it uses is that it makes debugging easier! + + Push ${L_UAC_0} + Push ${L_UAC_1} + Push ${L_UAC_2} + Push ${L_UAC_3} + ; Use the UAC plugin to ensure that this uninstaller runs with 'administrator' privileges ; (UAC = Vista's new "User Account Control" feature). UAC_Elevate: UAC::RunElevated ! StrCmp 1223 ${L_UAC_0} UAC_ElevationAborted ; Jump if UAC dialog was aborted by user ! StrCmp 0 ${L_UAC_0} 0 UAC_Err ; If ${L_UAC_0} is not 0 then an error was detected ! StrCmp 1 ${L_UAC_1} 0 UAC_Success ; Are we the real deal or just the wrapper ? ! Quit ; UAC not supported (probably pre-NT6), run as normal UAC_Err: *************** *** 85,92 **** UAC_Success: ! StrCmp 1 $3 continue ; Admin? ! StrCmp 3 $1 0 UAC_ElevationAborted ; Try again or abort? ! MessageBox MB_OK|MB_ICONSTOP "This uninstaller requires admin access, try again" ; Inform user... ! goto UAC_Elevate ; ... and try again continue: --- 97,104 ---- UAC_Success: ! StrCmp 1 ${L_UAC_3} continue ; Jump if we are a member of the admin group (any OS) ! StrCmp 3 ${L_UAC_1} 0 UAC_ElevationAborted ; Can we try to elevate again ? ! MessageBox MB_OK|MB_ICONSTOP "This uninstaller requires admin access, try again" ! goto UAC_Elevate ; ... try again continue: *************** *** 102,108 **** !insertmacro MUI_UNGETLANGUAGE - StrCpy $G_ROOTDIR "$INSTDIR" - StrCpy $G_MPLIBDIR "$INSTDIR\lib" - Call un.SetGlobalUserVariables --- 114,117 ---- *************** *** 110,113 **** --- 119,132 ---- !insertmacro MUI_INSTALLOPTIONS_EXTRACT "ioUM.ini" + Pop ${L_UAC_3} + Pop ${L_UAC_2} + Pop ${L_UAC_1} + Pop ${L_UAC_0} + + !undef L_UAC_0 + !undef L_UAC_1 + !undef L_UAC_2 + !undef L_UAC_3 + FunctionEnd *************** *** 117,123 **** # Used to initialise (or re-initialise) the following global variables: # ! # (1) $G_USERDIR - full path to the folder containing the 'popfile.cfg' file ! # (2) $G_WINUSERNAME - current Windows user login name ! # (3) $G_WINUSERTYPE - user group ('Admin', 'Power', 'User', 'Guest' or 'Unknown') # # (this helps avoid problems when the uninstaller is started by a non-admin user) --- 136,144 ---- # Used to initialise (or re-initialise) the following global variables: # ! # (1) $G_ROOTDIR - full path to the folder containing the POPFile program files ! # (2) $G_MPLIBDIR - full path to the folder containing the minimal Perl ! # (3) $G_USERDIR - full path to the folder containing the 'popfile.cfg' file ! # (4) $G_WINUSERNAME - current Windows user login name ! # (5) $G_WINUSERTYPE - user group ('Admin', 'Power', 'User', 'Guest' or 'Unknown') # # (this helps avoid problems when the uninstaller is started by a non-admin user) *************** *** 126,129 **** --- 147,153 ---- Function un.SetGlobalUserVariables + StrCpy $G_ROOTDIR "$INSTDIR" + StrCpy $G_MPLIBDIR "$INSTDIR\lib" + ; Starting with 0.21.0 the registry is used to store the location of the 'User Data' ; (if setup.exe or adduser.exe was used to create/update the 'User Data' for this user) *************** *** 1061,1064 **** --- 1085,1092 ---- skip_XMLRPC_support: + IfFileExists "$G_MPLIBDIR\Net\SSLeay\*.*" 0 skip_SSL_support + RMDir /r "$G_MPLIBDIR\Net" + + skip_SSL_support: RMDir /r "$G_MPLIBDIR\auto" RMDir /r "$G_MPLIBDIR\Carp" *************** *** 1117,1129 **** ; Only remove registry data if it matches what we are uninstalling ! StrCmp $G_WINUSERTYPE "Admin" check_HKLM_data ; Uninstalluser.exe deletes all HKCU registry data except for the 'Add/Remove Programs' entry ! ReadRegStr ${L_REGDATA} HKCU \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" ! StrCmp ${L_REGDATA} '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' 0 section_exit DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" ! Goto section_exit check_HKLM_data: --- 1145,1164 ---- ; Only remove registry data if it matches what we are uninstalling ! ClearErrors ! ReadRegStr ${L_REGDATA} HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion ! IfErrors check_HKLM_data ! StrCpy ${L_REGDATA} ${L_REGDATA} 1 ! StrCmp ${L_REGDATA} '6' 0 check_HKLM_data ; Uninstalluser.exe deletes all HKCU registry data except for the 'Add/Remove Programs' entry ! ReadRegStr ${L_REGDATA} HKCU \ "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" ! StrCmp ${L_REGDATA} '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' 0 real_user DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" ! ! real_user: ! GetFunctionAddress ${L_REGDATA} un.DeleteDataFromHKCU ! UAC::ExecCodeSegment ${L_REGDATA} check_HKLM_data: *************** *** 1154,1157 **** --- 1189,1214 ---- #-------------------------------------------------------------------------- + # Uninstaller Function: 'un.DeleteDataFromHKCU' + #-------------------------------------------------------------------------- + + Function un.DeleteDataFromHKCU + + !define L_REGDATA $R9 + + Push ${L_REGDATA} + + ReadRegStr ${L_REGDATA} HKCU \ + "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" "UninstallString" + StrCmp ${L_REGDATA} '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' 0 exit + DeleteRegKey HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" + + exit: + Pop ${L_REGDATA} + + !undef L_REGDATA + + FunctionEnd + + #-------------------------------------------------------------------------- # Uninstaller Section: 'un.Uninstall End' (this is the penultimate section in the uninstaller) # Index: adduser-Version.nsh =================================================================== RCS file: /cvsroot/popfile/windows/adduser-Version.nsh,v retrieving revision 1.6.2.16 retrieving revision 1.6.2.17 diff -C2 -d -r1.6.2.16 -r1.6.2.17 *** adduser-Version.nsh 5 Oct 2007 18:28:45 -0000 1.6.2.16 --- adduser-Version.nsh 10 Nov 2007 13:43:08 -0000 1.6.2.17 *************** *** 7,11 **** #-------------------------------------------------------------------------- ! !define C_PFI_VERSION "0.3.13" #-------------------------------------------------------------------------- --- 7,11 ---- #-------------------------------------------------------------------------- ! !define C_PFI_VERSION "0.3.17" #-------------------------------------------------------------------------- Index: adduser.nsi =================================================================== RCS file: /cvsroot/popfile/windows/adduser.nsi,v retrieving revision 1.59.4.18 retrieving revision 1.59.4.19 diff -C2 -d -r1.59.4.18 -r1.59.4.19 *** adduser.nsi 14 Oct 2007 17:49:20 -0000 1.59.4.18 --- adduser.nsi 10 Nov 2007 13:43:08 -0000 1.59.4.19 *************** *** 724,727 **** --- 724,728 ---- ReserveFile "${NSISDIR}\Plugins\Banner.dll" ReserveFile "${NSISDIR}\Plugins\LockedList.dll" + ReserveFile "${NSISDIR}\Plugins\MoreInfo.dll" ReserveFile "${NSISDIR}\Plugins\nsExec.dll" ReserveFile "${NSISDIR}\Plugins\NSISdl.dll" *************** *** 944,950 **** --- 945,960 ---- IfFileExists "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile.lnk" 0 update_HKCU_data IfFileExists "$G_ROOTDIR\uninstall.exe" 0 update_HKCU_data + ClearErrors + ReadRegStr ${L_TEMP} HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + IfErrors update_AllUsers_uninstall + StrCpy ${L_TEMP} ${L_TEMP} 1 + StrCmp ${L_TEMP} '6' update_HKCU_data + + update_AllUsers_uninstall: + SetShellVarContext all SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile.lnk" NORMAL CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Uninstall POPFile.lnk" \ "$G_ROOTDIR\uninstall.exe" + SetShellVarContext current update_HKCU_data: *************** *** 1205,1256 **** "InternetShortcut" "URL" "http://${C_UI_URL}:$G_GUI/shutdown" - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" NORMAL - - !ifndef ENGLISH_MODE - StrCmp $LANGUAGE ${LANG_JAPANESE} japanese_faq - !endif - - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" \ - "InternetShortcut" "URL" \ - "http://getpopfile.org/wiki/FAQ" - - !ifndef ENGLISH_MODE - Goto support - - japanese_faq: - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\FAQ.url" \ - "InternetShortcut" "URL" \ - "http://getpopfile.org/wiki/JP:FAQ" - - support: - !endif - SetOutPath "$SMPROGRAMS\${C_PFI_PRODUCT}\Support" - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Home Page.url" NORMAL - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Home Page.url" \ - "InternetShortcut" "URL" "http://getpopfile.org/" - - SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" NORMAL - - !ifndef ENGLISH_MODE - StrCmp $LANGUAGE ${LANG_JAPANESE} japanese_wiki - !endif - - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" \ - "InternetShortcut" "URL" \ - "http://getpopfile.org/wiki" - - !ifndef ENGLISH_MODE - Goto pfidiagnostic - - japanese_wiki: - WriteINIStr "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\POPFile Support (Wiki).url" \ - "InternetShortcut" "URL" \ - "http://getpopfile.org/wiki/jp" - - pfidiagnostic: - !endif - IfFileExists "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" 0 pfidiag_entries SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\User Data ($G_WINUSERNAME).lnk" NORMAL --- 1215,1220 ---- *************** *** 1261,1270 **** IfFileExists "$G_ROOTDIR\pfidiag.exe" 0 msgcapture_entry Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\PFI Diagnostic utility.lnk" ! SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" NORMAL ! CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" \ ! "$G_ROOTDIR\pfidiag.exe" ! SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" NORMAL ! CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" \ ! "$G_ROOTDIR\pfidiag.exe" "/full" SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" NORMAL CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" \ --- 1225,1234 ---- IfFileExists "$G_ROOTDIR\pfidiag.exe" 0 msgcapture_entry Delete "$SMPROGRAMS\${C_PFI_PRODUCT}\PFI Diagnostic utility.lnk" ! ; SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" NORMAL ! ; CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (simple).lnk" \ ! ; "$G_ROOTDIR\pfidiag.exe" ! ; SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" NORMAL ! ; CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\PFI Diagnostic utility (full).lnk" \ ! ; "$G_ROOTDIR\pfidiag.exe" "/full" SetFileAttributes "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" NORMAL CreateShortCut "$SMPROGRAMS\${C_PFI_PRODUCT}\Support\Create 'User Data' shortcut.lnk" \ *************** *** 1309,1313 **** end_autostart_set: ! ; Create entry in the Control Panel's "Add/Remove Programs" list WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}_Data" \ --- 1273,1277 ---- end_autostart_set: ! ; Create "User Data" entry in the Control Panel's "Add/Remove Programs" list WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}_Data" \ *************** *** 1322,1325 **** --- 1286,1316 ---- "NoRepair" "1" + ; Create "POPFile" (program) entry in "Add/Remove Programs" list (if target is Vista) + + IfFileExists "$G_ROOTDIR\uninstall.exe" 0 all_done + ClearErrors + ReadRegStr ${L_TEMP} HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" CurrentVersion + IfErrors all_done + StrCpy ${L_TEMP} ${L_TEMP} 1 + StrCmp ${L_TEMP} '6' 0 all_done + + MoreInfo::GetFileVersion "$G_ROOTDIR\uninstall.exe" + Pop ${L_TEMP} + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "DisplayName" "${C_PFI_PRODUCT} ${L_TEMP}" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "UninstallString" '"$G_ROOTDIR\uninstall.exe" /UNINSTALL' + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "InstallLocation" "$G_ROOTDIR" + WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "NoModify" "0" + WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "ModifyPath" '"$G_ROOTDIR\uninstall.exe" /MODIFY' + WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "NoElevateOnModify" "1" + WriteRegDWORD HKCU "Software\Microsoft\Windows\CurrentVersion\Uninstall\${C_PFI_PRODUCT}" \ + "NoRepair" "1" + + all_done: SetDetailsPrint textonly DetailPrint "$(PFI_LANG_BE_PATIENT)" |