Archive: How to get the parent directory


How to get the parent directory
For example the script:

!include "MUI.nsh"
SetCompressor /SOLID lzma
InstallDir "$PROGRAMFILES\MYPROGRM"
......
Section Client
${GetParent} $INSTDIR $R0
......
SetOutDir "$R0\TEST"
......

When compiling,it said:

Invalid command: ${GetParent}

How to use the function "${GetParent}"?Help me!

The help give the follow code:

Section
${GetParent} "C:\Program Files\Winamp\uninstwa.exe" $R0
;$R0="C:\Program Files\Winamp"
SectionEnd

But I test it,it can't be compiled!


You must declare you'll be using this function before actually using it by adding !insertmacro GetParent at the top as explained in the introduction.


Thank u very much!!!