Archive: Strip Path


Strip Path
Hi all!

I remember seeing this recently, but when searching for Path in the forums, I couldn't find it in the 125 odd posts.

What I want to do is strip the path/to from path/to/filename.whatever

so say:

$0 = C:\Program Files\My_App_Folder\My_App.exe

do something like (I know its not this simple):

$0 = C:\Program Files\My_App_Folder\My_App.exe
strip $1 $0
$1 = My_App.exe

Can anyone kindly point me to the thread if you know it, or perhaps suggest how I could achieve the above?

Thanks for the help!


Use a script like GetParent and modify it.

See attachment.

-Hendri.


Thanks!
Thanks Hendri!!

That did exactly what I want....Smiling2you :)

Although this is a slight variation of the GetParent function, it should be published as a function on its own...its very useful! Maybe call it StripPath?!?

Nice one!


Thanks. But the script is not a major new function, only a modification. But you can keep it as StripPath on your harddisk if you like that. Justin decides about implementing this in NSIS 2.0 (functions.htm) and I think he will not include it since it is not something really new.

Thanks for the nice words though :D

Greetz,
-Hendri.