Updated documentation and file functions for Unicode support

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6119 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
wizou 2010-07-09 15:12:21 +00:00
parent 954c0abe6c
commit 73501896d4
6 changed files with 179 additions and 4 deletions

View file

@ -262,6 +262,57 @@ Here is the function:
written by KiCHiK
Here's the function to generate a Unicode file if you're building a \R{intro-unicode}{Unicode installer}.
\c !define LVM_GETITEMCOUNT 0x1004
\c !define LVM_GETITEMTEXT 0x1073
\c
\c Function DumpLog
\c Exch $5
\c Push $0
\c Push $1
\c Push $2
\c Push $3
\c Push $4
\c Push $6
\c
\c FindWindow $0 "#32770" "" $HWNDPARENT
\c GetDlgItem $0 $0 1016
\c StrCmp $0 0 error
\c FileOpen $5 $5 "w"
\c FileWriteWord $5 0xfeff ; Write the BOM
\c StrCmp $5 0 error
\c SendMessage $0 ${LVM_GETITEMCOUNT} 0 0 $6
\c System::StrAlloc ${NSIS_MAX_STRLEN}
\c Pop $3
\c StrCpy $2 0
\c System::Call "*(i, i, i, i, i, i, i, i, i) i \
\c (0, 0, 0, 0, 0, r3, ${NSIS_MAX_STRLEN}) .r1"
\c loop: StrCmp $2 $6 done
\c System::Call "User32::SendMessageW(i, i, i, i) i \
\c ($0, ${LVM_GETITEMTEXT}, $2, r1)"
\c System::Call "*$3(&t${NSIS_MAX_STRLEN} .r4)"
\c FileWriteUTF16LE $5 "$4$\r$\n"
\c IntOp $2 $2 + 1
\c Goto loop
\c done:
\c FileClose $5
\c System::Free $1
\c System::Free $3
\c Goto exit
\c error:
\c MessageBox MB_OK error
\c exit:
\c Pop $6
\c Pop $4
\c Pop $3
\c Pop $2
\c Pop $1
\c Pop $0
\c Exch $5
\c FunctionEnd
Modified by Jim Park.
\H{readreg_multi_sz} How to Read REG_MULTI_SZ Values
@ -383,3 +434,7 @@ I wrote this script to help rpetges in \W{http://forums.winamp.com/showthread.ph
\c SectionEnd
written by KiCHiK
\H{unicode_defines}Predefined Macros for Unicode support
There are two macros that can help you write scripts that work for both Unicode and ANSI installers. To figure out if the script is being compiled to generate a Unicode installer, use !ifdef check for $\{NSIS_UNICODE\}. To see what the size of the default character is, use $\{NSIS_CHAR_SIZE\}. It will be 1 for ANSI and 2 for Unicode installers.