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.

Example:

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

I want: "MyProgram"


Just found the answer, putting it up for reference:

http://nsis.sourceforge.net/Docs/AppendixE.html

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