Winamp & Shoutcast Forums

Winamp & Shoutcast Forums (http://forums.winamp.com/index.php)
-   NSIS Discussion (http://forums.winamp.com/forumdisplay.php?f=65)
-   -   probs with GetParent (http://forums.winamp.com/showthread.php?t=229791)

rubella 31st October 2005 07:56

probs with GetParent
 
hey all!

when i'm using the function GetParent i have something like that:

original: C:\tools\totalcmd
after calling function: C:\tools\totalcmd or C:\tools\totalcmd-9

the function:
Function GetParent

Exch $R0
Push $R1
Push $R2
Push $R3

StrCpy $R1 0
StrLen $R2 $R0

loop:
IntOp $R1 $R1 + 1
IntCmp $R1 $R2 get 0 get
StrCpy $R3 $R0 1 -$R1
StrCmp $R3 "\" get
Goto loop

get:
StrCpy $R0 $R0 -$R1

Pop $R3
Pop $R2
Pop $R1
Exch $R0

FunctionEnd

i call function like that:

Push "$EXEDIR\"
Call GetParent
Pop $R0

FileWrite $0 "Editor=$R0"

(it's an entry in a configfile)

someone an idea? thx!

rubella 31st October 2005 08:41

replace Push "$EXEDIR\" by Push "$EXEDIR" and it will work fine!

Instructor 31st October 2005 09:00

Or:
code:
Name "Output"
OutFile "Output.exe"

!include "FileFunc.nsh"
!insertmacro GetParent

Section
${GetParent} "$EXEDIR\" $R0

MessageBox MB_OK "$R0"
SectionEnd



All times are GMT. The time now is 05:12.

Copyright © 1999 - 2010 Nullsoft. All Rights Reserved.