From: Brian S. <xue...@us...> - 2006-08-29 16:03:02
|
Update of /cvsroot/popfile/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15218 Modified Files: Tag: b0_22_2 pfi-library.nsh Log Message: Updated to work for the 0.22.5 release. Replaced the slow script-based installation log dump function with one which uses a much faster plugin. Index: pfi-library.nsh =================================================================== RCS file: /cvsroot/popfile/windows/pfi-library.nsh,v retrieving revision 1.53.4.3 retrieving revision 1.53.4.4 diff -C2 -d -r1.53.4.3 -r1.53.4.4 *** pfi-library.nsh 6 Feb 2006 14:48:03 -0000 1.53.4.3 --- pfi-library.nsh 29 Aug 2006 16:02:57 -0000 1.53.4.4 *************** *** 58,62 **** #-------------------------------------------------------------------------- ! !define C_PFI_LIBRARY_VERSION "0.1.12" #-------------------------------------------------------------------------- --- 58,62 ---- #-------------------------------------------------------------------------- ! !define C_PFI_LIBRARY_VERSION "0.2.0" #-------------------------------------------------------------------------- *************** *** 515,519 **** ! !ifndef ADDSSL & BACKUP #-------------------------------------------------------------------------- # Installer Function: PFI_GetParameters --- 515,519 ---- ! !ifndef BACKUP #-------------------------------------------------------------------------- # Installer Function: PFI_GetParameters *************** *** 1220,1223 **** --- 1220,1240 ---- # so NSIS scripts can use 'Call PFI_DumpLog' and 'Call un.PFI_DumpLog' without additional preparation. # + #-------------------------------------------------------------------------- + # This macro uses a plugin which is not distributed with the NSIS compiler + #-------------------------------------------------------------------------- + # This macro uses a special NSIS plugin (DumpLog) to dump the log contents into a text file. + # Originally a script-based method was used but it could take several seconds to save the log + # (the plugin saves the file almost instantly). + # + # The 'NSIS Wiki' page for the 'DumpLog' plugin (description, example and download links): + # http://nsis.sourceforge.net/DumpLog_plugin + # + # To install this plugin, copy the 'DumpLog.dll' file to the standard NSIS plugins folder + # (${NSISDIR}\Plugins\). The 'DumpLog' source and example files can be unzipped to the + # appropriate sub-folders of ${NSISDIR} if you wish, but this step is entirely optional. + # + # Tested with version 1.0 of the 'DumpLog' plugin. + #-------------------------------------------------------------------------- + # # Inputs: # (top of stack) - the full path of the file where the log will be dumped *************** *** 1237,1295 **** Function ${UN}PFI_DumpLog ! !ifndef LVM_GETITEMCOUNT ! !define LVM_GETITEMCOUNT 0x1004 ! !endif ! !ifndef LVM_GETITEMTEXT ! !define LVM_GETITEMTEXT 0x102D ! !endif ! ! Exch $5 ! Push $0 ! Push $1 ! Push $2 ! Push $3 ! Push $4 ! Push $6 ! FindWindow $0 "#32770" "" $HWNDPARENT ! GetDlgItem $0 $0 1016 ! StrCmp $0 0 error ! FileOpen $5 $5 "w" ! StrCmp $5 "" error ! SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6 ! System::Alloc ${NSIS_MAX_STRLEN} ! Pop $3 ! StrCpy $2 0 ! System::Call "*(i, i, i, i, i, i, i, i, i) i \ ! (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1" ! loop: ! StrCmp $2 $6 done ! System::Call "User32::SendMessageA(i, i, i, i) i \ ! ($0, ${LVM_GETITEMTEXT}, $2, r1)" ! System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)" ! FileWrite $5 "$4${MB_NL}" ! IntOp $2 $2 + 1 ! Goto loop ! done: ! FileClose $5 ! System::Free $1 ! System::Free $3 ! Goto exit ! error: ! MessageBox MB_OK|MB_ICONEXCLAMATION "$(PFI_LANG_MB_SAVELOG_ERROR)" ! exit: ! Pop $6 ! Pop $4 ! Pop $3 ! Pop $2 ! Pop $1 ! Pop $0 ! Pop $5 ! FunctionEnd !macroend --- 1254,1278 ---- Function ${UN}PFI_DumpLog ! !define L_LOGFILE $R9 ! !define L_RESULT $R8 ! Exch ${L_LOGFILE} ! Push ${L_RESULT} ! DumpLog::DumpLog "${L_LOGFILE}" .R8 ! StrCmp ${L_RESULT} 0 exit ! MessageBox MB_OK|MB_ICONEXCLAMATION "$(PFI_LANG_MB_SAVELOG_ERROR)\ ! ${MB_NL}${MB_NL}\ ! (${L_LOGFILE})" ! exit: ! Pop ${L_RESULT} ! Pop ${L_LOGFILE} ! !undef L_LOGFILE ! !undef L_RESULT ! FunctionEnd !macroend |