${SegmentFile} ${SegmentPreExec} # # Code courtesy of Bart.S # ${registry::Read} "HKEY_CURRENT_USER\Software\Ulduzsoft\kchmviewer" "recentFileList" $R0 $R1 StrLen $1 $R0 ${If} $R1 == "REG_MULTI_SZ" ${AndIf} $1 > 3 ; Test for empty value StrCpy $2 '' ${Do} StrCpy $0 $R0 1 -$1 ; Get every ... IntOp $1 $1 - 2 ; second character. StrCpy $2 $2$0 ; Add this character to the string ${LoopUntil} $1 == 2 ; 2 = ignore the last character, another bug StrCpy $R0 $2 ${EndIf} MessageBox MB_OK 'Value=$R0' MessageBox MB_OK 'Type=$R1' ${If} $R0 != "" ${WordReplace} $R0 "%PAL:LastDrive%" "%PAL:Drive%" "E+" $R2 ${If} ${Errors} MessageBox MB_OK 'Errorlevel=$R2' ${Else} MessageBox MB_OK 'No errors' ${EndIf} ${registry::Write} "HKEY_CURRENT_USER\Software\Ulduzsoft\kchmviewer" "recentFileList" "$R0" "$R1" $R3 MessageBox MB_OK 'Value=$R0' ${EndIf} !macroend