PHP Code:
!include LogicLib.nsh
Section SimpleHack
/*Emulate ReadIniStr:*/ StrCpy $0 "{26}\Winamp" ;ReadIniStr $0 ... inidir
StrCpy $1 $0 4
${If} $1 == "{26}"
StrCpy $0 $0 "" 4
StrCpy $0 "$AppData$0"
${EndIf}
DetailPrint $0
SectionEnd
Section Proper
/*Emulate ReadIniStr:*/ StrCpy $0 "{26}\Winamp" ;ReadIniStr $0 ... inidir
StrCpy $1 $0 1
${If} $1 == "{"
StrCpy $1 0
loop:
IntOp $1 $1 + 1
StrCpy $2 $0 1 $1
StrCmp $2 "" notspecial ; Reached end of string without finding }
StrCmp $2 "}" 0 loop
IntOp $1 $1 - 1
StrCmp $1 0 notspecial ; Ignore "{}"
StrCpy $2 $0 $1 1
System::Call 'SHELL32::SHGetFolderPath(i0, ir2, i0, i0, t.r2)' ; Win2000+, more operations required for 95/98/NT4
IntOp $1 $1 + 2
StrCpy $1 $0 "" $1
StrCpy $0 "$2$1"
notspecial:
${EndIf}
DetailPrint $0
SectionEnd