Archive: Get INSTDIR folder name

Get INSTDIR folder name
I'm trying to somehow get just the folder name for the chosen install directory. I know that $INSTDIR contains the full path to the install directory but I would like just the folder name for that.


$INSTDIR = "C:\Program Files\MyProgram"

I want: "MyProgram"

Just found the answer, putting it up for reference:

!include "FileFunc.nsh"
${GetBaseName} "[FileString]" $var