Old 19th October 2007, 10:36   #1
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
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!
jiake is offline   Reply With Quote
Old 19th October 2007, 11:49   #2
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
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.

NSIS FAQ | NSIS Home Page | Donate $
"I hear and I forget. I see and I remember. I do and I understand." -- Confucius
kichik is offline   Reply With Quote
Old 19th October 2007, 18:06   #3
jiake
Senior Member
 
jiake's Avatar
 
Join Date: Oct 2007
Location: Shanghai, China
Posts: 207
Thank u very much!!!
jiake is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump