From: Brian S. <xue...@us...> - 2006-08-29 15:52:19
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11371 Modified Files: Tag: b0_22_2 adduser-EmailConfig.nsh Log Message: Updated to work with the NSIS 2.19 compiler (for the 0.22.5 release). If no reconfigurable clients are detected the wizard no longer attempts to find Outlook Express accounts (oops!). If an Outlook Express account which uses SMTP Authentication is to be reconfigured and it re-uses the POP3 username (the default setting) then a separate SMTP username is created (to avoid login failures when SMTP Authentication tries to use the POPFile-enabled POP3 username). Index: adduser-EmailConfig.nsh =================================================================== RCS file: /cvsroot/popfile/windows/adduser-EmailConfig.nsh,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** adduser-EmailConfig.nsh 6 Feb 2006 16:26:03 -0000 1.1.2.4 --- adduser-EmailConfig.nsh 29 Aug 2006 15:52:09 -0000 1.1.2.5 *************** *** 69,72 **** --- 69,73 ---- # # This function is used to introduce the reconfiguration of email clients + # (at present only a few clients can be reconfigured automatically) #-------------------------------------------------------------------------- *************** *** 77,82 **** !define L_CLIENT_NAME $R7 !define L_CLIENT_TYPE $R6 ; used to indicate if client can be reconfigured by installer ! !define L_SEPARATOR $R5 ! !define L_TEMP $R4 Push ${L_CLIENT_INDEX} --- 78,84 ---- !define L_CLIENT_NAME $R7 !define L_CLIENT_TYPE $R6 ; used to indicate if client can be reconfigured by installer ! !define L_RECONFIGURABLE $R5 ; 0 = no reconfigurable clients found ! !define L_SEPARATOR $R4 ! !define L_TEMP $R3 Push ${L_CLIENT_INDEX} *************** *** 84,90 **** --- 86,97 ---- Push ${L_CLIENT_NAME} Push ${L_CLIENT_TYPE} + Push ${L_RECONFIGURABLE} Push ${L_SEPARATOR} Push ${L_TEMP} + ; Assume no suitable clients are found + + StrCpy ${L_RECONFIGURABLE} "0" + ; On older systems with several email clients, the email client scan can take a few seconds ; during which time the user may be tempted to click the 'Next' button which would result in *************** *** 116,120 **** --- 123,131 ---- Pop ${L_CLIENT_TYPE} StrCmp ${L_CLIENT_TYPE} "" add_to_list + + ; A reconfigurable client has been found (NB Some Outlook accounts cannot be reconfigured) + StrCpy ${L_CLIENT_TYPE} " (*)" + StrCpy ${L_RECONFIGURABLE} "1" ReadRegStr ${L_TEMP} HKLM "Software\Clients\Mail\${L_CLIENT_NAME}\shell\open\command" "" *************** *** 145,154 **** !insertmacro MUI_INSTALLOPTIONS_SHOW_RETURN Pop ${L_TEMP} ! StrCmp ${L_TEMP} "back" 0 exit !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "ClientEXE" "ConfigStatus" "SkipAll" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioF.ini" "Settings" "NumFields" "1" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioF.ini" "Settings" "BackEnabled" "0" !insertmacro PFI_IO_TEXT "ioF.ini" "1" "$(PFI_LANG_MAILCFG_IO_CANCEL)" !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioF.ini" --- 156,175 ---- !insertmacro MUI_INSTALLOPTIONS_SHOW_RETURN Pop ${L_TEMP} ! StrCmp ${L_TEMP} "back" skip_email_pages ! StrCmp ${L_RECONFIGURABLE} "1" exit ! ! skip_email_pages: !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "ClientEXE" "ConfigStatus" "SkipAll" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioF.ini" "Settings" "NumFields" "1" !insertmacro MUI_INSTALLOPTIONS_WRITE "ioF.ini" "Settings" "BackEnabled" "0" + StrCmp ${L_TEMP} "back" cancelled_by_user + !insertmacro PFI_IO_TEXT "ioF.ini" "1" "$(PFI_LANG_MAILCFG_IO_NOMATCHES)" + goto show_skip_page + + cancelled_by_user: !insertmacro PFI_IO_TEXT "ioF.ini" "1" "$(PFI_LANG_MAILCFG_IO_CANCEL)" + + show_skip_page: !insertmacro MUI_INSTALLOPTIONS_DISPLAY "ioF.ini" *************** *** 156,159 **** --- 177,181 ---- Pop ${L_TEMP} Pop ${L_SEPARATOR} + Pop ${L_RECONFIGURABLE} Pop ${L_CLIENT_TYPE} Pop ${L_CLIENT_NAME} *************** *** 165,168 **** --- 187,191 ---- !undef L_CLIENT_NAME !undef L_CLIENT_TYPE + !undef L_RECONFIGURABLE !undef L_SEPARATOR !undef L_TEMP *************** *** 233,252 **** ; etc ! !define L_ACCOUNT $R9 ; path to the data for the current OE account (less the HKCU part) ! !define L_ACCT_INDEX $R8 ; used to loop through OE accounts for the current OE Identity ! !define L_CFG $R7 ; file handle ! !define L_GUID $R6 ; GUID of the current entry in HKCU\Identities list ! !define L_GUID_INDEX $R5 ; used to loop through the list of OE Identities ! !define L_IDENTITY $R4 ; plain text form of OE Identity name ! !define L_OEDATA $R3 ; some data (it varies) for current OE account ! !define L_OEPATH $R2 ; holds part of the path used to access OE account data ! !define L_ORDINALS $R1 ; "Identity Ordinals" flag (1 = found, 0 = not found) ! !define L_PORT $R0 ; POP3 Port used for an OE Account ! !define L_STATUS $9 ; keeps track of the status of the account we are checking ! !define L_TEMP $8 !define L_POP3SERVER $7 !define L_EMAILADDRESS $6 !define L_USERNAME $5 Push ${L_ACCOUNT} --- 256,280 ---- ; etc ! !define L_ACCOUNT $R9 ; path to data for the current OE account (less the HKCU part) ! !define L_ACCT_INDEX $R8 ; used to loop through OE accounts for the current OE Identity ! !define L_CFG $R7 ; file handle ! !define L_GUID $R6 ; GUID of the current entry in HKCU\Identities list ! !define L_GUID_INDEX $R5 ; used to loop through the list of OE Identities ! !define L_IDENTITY $R4 ; plain text form of OE Identity name ! !define L_OEDATA $R3 ; some data (it varies) for current OE account ! !define L_OEPATH $R2 ; holds part of the path used to access OE account data ! !define L_ORDINALS $R1 ; "Identity Ordinals" flag (1 = found, 0 = not found) ! !define L_PORT $R0 ; POP3 Port used for an OE Account ! !define L_STATUS $9 ; keeps track of the status of the account we are checking ! !define L_TEMP $8 !define L_POP3SERVER $7 !define L_EMAILADDRESS $6 !define L_USERNAME $5 + !define L_SMTPAUTH $4 ; 'SMTP Use Sicily' setting from this account's registry entry + ; 0 (or an empty string) = SMTP Authentication is not used, + ; 2 = SMTP Authentication uses the POP3 username and password, + ; 3 = SMTP Authentication uses the 'SMTP User Name' username + !define L_SMTPUSERNAME $3 ; user name to be used when SMTP Authentication is employed Push ${L_ACCOUNT} *************** *** 266,269 **** --- 294,299 ---- Push ${L_EMAILADDRESS} Push ${L_USERNAME} + Push ${L_SMTPAUTH} + Push ${L_SMTPUSERNAME} !insertmacro MUI_HEADER_TEXT "$(PFI_LANG_EXPCFG_TITLE)" "$(PFI_LANG_EXPCFG_SUBTITLE)" *************** *** 480,483 **** --- 510,520 ---- ReadRegStr ${L_OEDATA} HKCU ${L_ACCOUNT} "Account Name" + ; If this account uses SMTP Authentication and SMTP currently uses the POP3 username + ; then we will need to change the SMTP settings if this account is configured to work + ; with POPFile (all we need to do is set up a new SMTP username) + + ReadRegDWORD ${L_SMTPAUTH} HKCU ${L_ACCOUNT} "SMTP Use Sicily" + ReadRegStr ${L_SMTPUSERNAME} HKCU ${L_ACCOUNT} "SMTP User Name" + !insertmacro MUI_INSTALLOPTIONS_READ ${L_STATUS} "ioB.ini" "Field 8" "State" StrCpy ${L_TEMP} "" *************** *** 502,505 **** --- 539,544 ---- !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "Account $G_OOELIST_INDEX" "POP3username" "${L_USERNAME}" !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "Account $G_OOELIST_INDEX" "POP3port" "${L_PORT}" + !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "Account $G_OOELIST_INDEX" "SMTPauth" "${L_SMTPAUTH}" + !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "Account $G_OOELIST_INDEX" "SMTPusername" "${L_SMTPUSERNAME}" !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "Account $G_OOELIST_INDEX" "RegistryKey" "${L_ACCOUNT}" *************** *** 531,537 **** !endif ! ; In 'GetDlgItem', use (1200 + Field number - 1) to refer to the field to be changed ! GetDlgItem $G_DLGITEM $G_HWND 1200 ; Field 1 = IDENTITY label (above the box) CreateFont $G_FONT "MS Shell Dlg" 8 700 ; use a 'bolder' version of the font in use SendMessage $G_DLGITEM ${WM_SETFONT} $G_FONT 0 --- 570,576 ---- !endif ! ; Field 1 = IDENTITY label (above the box) ! !insertmacro MUI_INSTALLOPTIONS_READ $G_DLGITEM "ioB.ini" "Field 1" "HWND" CreateFont $G_FONT "MS Shell Dlg" 8 700 ; use a 'bolder' version of the font in use SendMessage $G_DLGITEM ${WM_SETFONT} $G_FONT 0 *************** *** 573,579 **** !endif ! ; In 'GetDlgItem', use (1200 + Field number - 1) to refer to the field to be changed ! GetDlgItem $G_DLGITEM $G_HWND 1200 ; Field 1 = IDENTITY label (above the box) CreateFont $G_FONT "MS Shell Dlg" 8 700 ; use a 'bolder' version of the font in use SendMessage $G_DLGITEM ${WM_SETFONT} $G_FONT 0 --- 612,618 ---- !endif ! ; Field 1 = IDENTITY label (above the box) ! !insertmacro MUI_INSTALLOPTIONS_READ $G_DLGITEM "ioB.ini" "Field 1" "HWND" CreateFont $G_FONT "MS Shell Dlg" 8 700 ; use a 'bolder' version of the font in use SendMessage $G_DLGITEM ${WM_SETFONT} $G_FONT 0 *************** *** 615,618 **** --- 654,659 ---- exit: + Pop ${L_SMTPUSERNAME} + Pop ${L_SMTPAUTH} Pop ${L_USERNAME} Pop ${L_EMAILADDRESS} *************** *** 648,651 **** --- 689,694 ---- !undef L_EMAILADDRESS !undef L_USERNAME + !undef L_SMTPAUTH + !undef L_SMTPUSERNAME FunctionEnd *************** *** 853,856 **** --- 896,901 ---- !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "Account ${L_TEXT_INDEX}" "POP3username" "" !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "Account ${L_TEXT_INDEX}" "POP3port" "" + !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "Account ${L_TEXT_INDEX}" "SMTPauth" "" + !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "Account ${L_TEXT_INDEX}" "SMTPusername" "" !insertmacro MUI_INSTALLOPTIONS_WRITE "pfi-cfg.ini" "Account ${L_TEXT_INDEX}" "RegistryKey" "" IntOp ${L_TEXT_INDEX} ${L_TEXT_INDEX} + 1 *************** *** 888,891 **** --- 933,942 ---- !define L_POP3PORT $5 + !define L_SMTPAUTH $4 ; 'SMTP Use Sicily' setting from this account's registry entry + ; 0 (or an empty string) = SMTP Authentication is not used, + ; 2 = SMTP Authentication uses the POP3 username and password, + ; 3 = SMTP Authentication uses the 'SMTP User Name' username + !define L_SMTPUSERNAME $3 ; user name to be used when SMTP Authentication is employed + Push ${L_CBOX_INDEX} Push ${L_CBOX_STATE} *************** *** 902,905 **** --- 953,958 ---- Push ${L_POP3USERNAME} Push ${L_POP3PORT} + Push ${L_SMTPAUTH} + Push ${L_SMTPUSERNAME} ; If user has cancelled the reconfiguration, there is nothing to do here *************** *** 930,935 **** --- 983,996 ---- !insertmacro MUI_INSTALLOPTIONS_READ ${L_POP3USERNAME} "pfi-cfg.ini" "Account ${L_DATA_INDEX}" "POP3username" !insertmacro MUI_INSTALLOPTIONS_READ ${L_POP3PORT} "pfi-cfg.ini" "Account ${L_DATA_INDEX}" "POP3port" + !insertmacro MUI_INSTALLOPTIONS_READ ${L_SMTPAUTH} "pfi-cfg.ini" "Account ${L_DATA_INDEX}" "SMTPauth" + !insertmacro MUI_INSTALLOPTIONS_READ ${L_SMTPUSERNAME} "pfi-cfg.ini" "Account ${L_DATA_INDEX}" "SMTPusername" !insertmacro MUI_INSTALLOPTIONS_READ ${L_REGKEY} "pfi-cfg.ini" "Account ${L_DATA_INDEX}" "RegistryKey" + StrCpy $G_PLS_FIELD_1 "${MB_NL}" + StrCmp ${L_SMTPAUTH} "2" 0 get_permission + StrCpy $G_PLS_FIELD_2 "${L_POP3USERNAME}" + StrCpy $G_PLS_FIELD_1 "$(PFI_LANG_OOECFG_MBSMTPLOGIN)${MB_NL}${MB_NL}${MB_NL}" + + get_permission: MessageBox MB_YESNO \ "$(PFI_LANG_EXPCFG_MBIDENTITY) ${L_IDENTITY}\ *************** *** 947,951 **** $(PFI_LANG_OOECFG_MBOEPORT) $G_POP3 \ ($(PFI_LANG_OOECFG_MBOLDVALUE) '${L_POP3PORT}')\ ! ${MB_NL}${MB_NL}${MB_NL}\ $(PFI_LANG_OOECFG_MBQUESTION)\ " IDNO ignore_tick --- 1008,1013 ---- $(PFI_LANG_OOECFG_MBOEPORT) $G_POP3 \ ($(PFI_LANG_OOECFG_MBOLDVALUE) '${L_POP3PORT}')\ ! ${MB_NL}${MB_NL}\ ! $G_PLS_FIELD_1\ $(PFI_LANG_OOECFG_MBQUESTION)\ " IDNO ignore_tick *************** *** 969,973 **** WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "History" "User-${L_UNDO}" "$G_WINUSERNAME" WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "History" "Type-${L_UNDO}" "$G_WINUSERTYPE" ! WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "History" "IniV-${L_UNDO}" "3" WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "Undo-${L_UNDO}" "Restored" "No" --- 1031,1035 ---- WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "History" "User-${L_UNDO}" "$G_WINUSERNAME" WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "History" "Type-${L_UNDO}" "$G_WINUSERTYPE" ! WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "History" "IniV-${L_UNDO}" "4" WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "Undo-${L_UNDO}" "Restored" "No" *************** *** 976,979 **** --- 1038,1043 ---- WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "Undo-${L_UNDO}" "POP3Server" "${L_POP3SERVER}" WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "Undo-${L_UNDO}" "POP3Port" "${L_POP3PORT}" + WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "Undo-${L_UNDO}" "SMTPUseSicily" "${L_SMTPAUTH}" + WriteINIStr "$G_USERDIR\pfi-outexpress.ini" "Undo-${L_UNDO}" "SMTPUserName" "${L_SMTPUSERNAME}" ; Reconfigure the Outlook Express account *************** *** 982,986 **** --- 1046,1054 ---- WriteRegStr HKCU ${L_REGKEY} "POP3 Server" "127.0.0.1" WriteRegDWORD HKCU ${L_REGKEY} "POP3 Port" $G_POP3 + StrCmp ${L_SMTPAUTH} "2" 0 update_log + WriteRegDWORD HKCU ${L_REGKEY} "SMTP Use Sicily" 3 + WriteRegStr HKCU ${L_REGKEY} "SMTP User Name" "${L_POP3USERNAME}" + update_log: !insertmacro PFI_OOECONFIG_CHANGES_LOG "${L_IDENTITY}" 20 !insertmacro PFI_OOECONFIG_CHANGES_LOG "${L_ACCOUNTNAME}" 20 *************** *** 1000,1003 **** --- 1068,1073 ---- exit: + Pop ${L_SMTPUSERNAME} + Pop ${L_SMTPAUTH} Pop ${L_POP3PORT} Pop ${L_POP3USERNAME} *************** *** 1029,1032 **** --- 1099,1104 ---- !undef L_POP3USERNAME !undef L_POP3PORT + !undef L_SMTPAUTH + !undef L_SMTPUSERNAME FunctionEnd *************** *** 1352,1358 **** !endif ! ; In 'GetDlgItem', use (1200 + Field number - 1) to refer to the field to be changed ! GetDlgItem $G_DLGITEM $G_HWND 1200 ; Field 1 = IDENTITY label (above the box) CreateFont $G_FONT "MS Shell Dlg" 8 700 ; use a 'bolder' version of the font in use SendMessage $G_DLGITEM ${WM_SETFONT} $G_FONT 0 --- 1424,1430 ---- !endif ! ; Field 1 = IDENTITY label (above the box) ! !insertmacro MUI_INSTALLOPTIONS_READ $G_DLGITEM "ioB.ini" "Field 1" "HWND" CreateFont $G_FONT "MS Shell Dlg" 8 700 ; use a 'bolder' version of the font in use SendMessage $G_DLGITEM ${WM_SETFONT} $G_FONT 0 *************** *** 1394,1400 **** !endif ! ; In 'GetDlgItem', use (1200 + Field number - 1) to refer to the field to be changed ! GetDlgItem $G_DLGITEM $G_HWND 1200 ; Field 1 = IDENTITY label (above the box) CreateFont $G_FONT "MS Shell Dlg" 8 700 ; use a 'bolder' version of the font in use SendMessage $G_DLGITEM ${WM_SETFONT} $G_FONT 0 --- 1466,1472 ---- !endif ! ; Field 1 = IDENTITY label (above the box) ! !insertmacro MUI_INSTALLOPTIONS_READ $G_DLGITEM "ioB.ini" "Field 1" "HWND" CreateFont $G_FONT "MS Shell Dlg" 8 700 ; use a 'bolder' version of the font in use SendMessage $G_DLGITEM ${WM_SETFONT} $G_FONT 0 *************** *** 1900,1906 **** !endif ! ; In 'GetDlgItem', use (1200 + Field number - 1) to refer to the field to be changed ! GetDlgItem $G_DLGITEM $G_HWND 1203 ; Field 4 = PERSONA (text in groupbox frame) CreateFont $G_FONT "MS Shell Dlg" 8 700 ; use a 'bolder' version of the font in use SendMessage $G_DLGITEM ${WM_SETFONT} $G_FONT 0 --- 1972,1978 ---- !endif ! ; Field 4 = PERSONA (text in groupbox frame) ! !insertmacro MUI_INSTALLOPTIONS_READ $G_DLGITEM "ioE.ini" "Field 4" "HWND" CreateFont $G_FONT "MS Shell Dlg" 8 700 ; use a 'bolder' version of the font in use SendMessage $G_DLGITEM ${WM_SETFONT} $G_FONT 0 |