Archive: Parsing a Registry String


Parsing a Registry String
So heres my issue; maybe someone knows a little better than I do.

Im pulling a string value from my registry to find the location of an install so that I can use it later for copying files.

The only key that exists is a long one that has too much stuff in it

i.e. F:\accuwin\la\sdfsd\sdfsdf C:\sdf\sdf\sdf

Out of that string all I need is the "\accuwin\la\"

How do I go about parsing it so that the string gets stored with these values, or is that impossible. Is PCRE the possible solution, or is there an easier way?


Thanks in advance


Ok here was the solution I came up with in case someone else was running into the same issues;

Push $0
ReadRegStr $0 HKEY_LOCAL_MACHINE \
"Software\Microsoft\Windows\CurrentVersion \Uninstall\AccuAuto for Windows" "UninstallString"
StrCpy $0 $0 -37 ;string parse
StrLen $1 $0
IntOp $1 $1 - 0
StrCpy $0 $0 "" -$1 ;remove " from start
StrCpy $accuinstall $0

Since the registry string is the same, your all good.