Hi there,
I am getting my installdir from the uninstallpath in the registry.
InstallDirRegKey HKLM Software\Microsoft\Windows\CurrentVersion\Uninstall\TobWen "UninstallString"
Returning is "C:\progs\bla bla\runme"
How can I go back to "C:\progs\bla bla" and set it as $INSTDIR ?
Another question is:
SetOutPath $PROGRAMFILES\TobWen
CreateDirectory "bla bla"
SetOutPath "bla bla"
File ....
Where is the error?
It copies the files anywhere ... but not into this directory.
Thanks
Tobias
Installdir from Registrypath ... but how to go to ..\ - 2 Questions
3 posts
To get the parent dir, use the GetParent function that is in
functions.htm. i.e.:
-Justin
functions.htm. i.e.:
As for the second question, what are you doing wrong, do this:
Function GetParent
Exch $0 ; old $0 is on top of stack
Push $1
Push $2
StrCpy $1 -1
loop:
StrCpy $2 $0 1 $1
StrCmp $2 "" exit
StrCmp $2 "\" exit
IntOp $1 $1 - 1
Goto loop
exit:
StrCpy $0 $0 $1
Pop $2
Pop $1
Exch $0 ; put $0 on top of stack, restore $0 to original value
FunctionEnd
...
and in your first section, something like:
Push $INSTDIR
Call GetParent
Pop $INSTDIR
or, if you want to do it more quickly, use:
SetOutPath $PROGRAMFILES\TobWen
...
SetOutPath "$OUTDIR\bla bla"
File..
note that setOutPath creates the directory as well.
SetOutPath "$PROGRAMFILES\TobWen\bla blah"
-Justin
Thanks
Thanks a lot 🙂
Thanks a lot 🙂