Код:
![Выделить весь код](images/misc/selectcode.png)
ShowInstDetails show
RequestExecutionLevel user
InstallColors /windows
SetFont 'Fira Code Retina' 9
ChangeUI all '${MYNSISDIREXAMPLES}\Contrib\UIs\largelog.exe'
!include LogicLib.nsh
!include Util.nsh
!define SetSystemPluginDestination `!insertmacro SetSystemPluginDestination `
!macro SetSystemPluginDestination gflag value
!define ${gflag} ${value}
!if ${value} == 's'
!else if ${value} S== 'r0'
!else if ${value} S== 'r1'
!else if ${value} S== 'r2'
!else if ${value} S== 'r3'
!else if ${value} S== 'r4'
!else if ${value} S== 'r5'
!else if ${value} S== 'r6'
!else if ${value} S== 'r7'
!else if ${value} S== 'r8'
!else if ${value} S== 'r9'
!else if ${value} S== 'R0'
!else if ${value} S== 'R1'
!else if ${value} S== 'R2'
!else if ${value} S== 'R3'
!else if ${value} S== 'R4'
!else if ${value} S== 'R5'
!else if ${value} S== 'R6'
!else if ${value} S== 'R7'
!else if ${value} S== 'R8'
!else if ${value} S== 'R9'
!else
!define /redef ${gflag} 's'
!endif
!macroend
!define ChrW `!insertmacro ChrW `
!macro ChrW result int
!ifndef CharConvertBuffer16Initialized
!define CharConvertBuffer16Initialized
Var /GLOBAL g_CharConvertBuffer16
System::Call '*(&i2)p.s'
Pop $g_CharConvertBuffer16
!endif
${SetSystemPluginDestination} ${__MACRO__}SymbolDestination ${result}
System::Call '*$g_CharConvertBuffer16(&i2 ${int})'
System::Call '*$g_CharConvertBuffer16(&w1 .${${__MACRO__}SymbolDestination})'
!if ${${__MACRO__}SymbolDestination} == 's'
Pop ${result}
!endif
!undef ${__MACRO__}SymbolDestination
!macroend
!define StrUnicodeUnescape `!insertmacro StrUnicodeUnescape `
!macro StrUnicodeUnescape result str
!if '${str}' != 's'
Push '${str}'
!endif
${CallArtificialFunction} StrUnicodeUnescape_
!if ${result} != 's'
Pop ${result}
!endif
!macroend
!macro StrUnicodeUnescape_
Exch $0 ; [in] EscapedUnicodeString / [out] UnescapedUnicodeString
Push $1 ; / EscapedUnicodeString
Push $2 ; Counter
Push $3 ; GetChar
Push $4 ; GetChar2
StrCpy $1 $0
StrCpy $0 ''
StrCpy $2 -1
${Do}
IntOp $2 $2 + 1
StrCpy $3 $1 1 $2
${IfThen} $3 == '' ${|} ${ExitDo} ${|}
${If} $3 == '\'
IntOp $4 $2 + 1
StrCpy $4 $1 1 $4
${If} $4 == 'u'
IntOp $2 $2 + 2
StrCpy $3 $1 4 $2
IntOp $2 $2 + 3
${ChrW} r3 0x$3
${EndIf}
${EndIf}
StrCpy $0 $0$3
${Loop}
Pop $4
Pop $3
Pop $2
Pop $1
Exch $0
!macroend
Section
StrCpy $1 '\u0412\u0430\u043b\u0435нт\u0438\u043d'
DetailPrint '>> [$1]'
${StrUnicodeUnescape} $0 $1
DetailPrint "<< [$0]"
Push $1
${StrUnicodeUnescape} $0 s
DetailPrint "<< [$0]"
Push $1
${StrUnicodeUnescape} s s
Pop $0
DetailPrint "<< [$0]"
SectionEnd