View Single Post
Old 4th December 2015, 16:09   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,263
PHP Code:
!include LogicLib.nsh
Section SimpleHack
/*Emulate ReadIniStr:*/ StrCpy $"{26}\Winamp" ;ReadIniStr $... inidir
StrCpy 
$$0 4
${If} $== "{26}"
    
StrCpy $$"" 4
    StrCpy 
$"$AppData$0"
${EndIf}
DetailPrint $0
SectionEnd  

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

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote