Archive: Using something similar like "StrRight"


Using something similar like "StrRight"
Okay, I've used NSIS before to create a real installer, but now I'm trying to create something that does a couple of actions. I already have one problem. :/

See, first it gets the installation directory of Winamp from the registry. So far, so good.

Now, I want to check if a trailing backslash at the end exists and then remove it. Like this:

"C:\Winamp\" -> "C:\Winamp"

Unfortunatly, I didn't find anything about a StringRight in the documentation. I'm sure it's possible tho.

Help would be greatly appreciated,

Edit= also, how can I get the value that I just collected to be filled in as the default path?


StrCpy $R0 $R0 -1

Edit:
StrCpy $R1 $R0 1 -1
StrCmp $R1 "\" 0 +2
StrCpy $R0 $R0 -1

-Stu


Thanks :)