Skip to content
⌘ NSIS Forum Archive

$root

7 posts

Kreft#

$root

how about a $ROOT variable to represent the drive that the exe is on. This would be extremely helpful.
Kreft#
not really..

$EXEDIR will be c:\goober if the installer is in c:\goomer i want it to return C:\ if the installer is in c:\goober see what i am saying?
DuaneJeffers#
Ohhhhh, I see. But what if someone installed it in lets say:

C:\Program Files\My App\1\1\0\2

I am being hypothetical, but you can't really use a $ROOT tag because then it would go to the next folder up. It would be nice to have something like $INSTDRV . You know. But for right now, you should point SetOutPath to the C:\ drive.

-DJ
DuaneJeffers#
Now, let me also say this, if you are a Developer, then you could impliment these things into the NSIS program. But it is only a thought.

-DJ
cchian#
If you just need the drive letter, colon and backslash "c:\", try assigning the value to a variable. For example, if your exe is in c:\program files\goober\myexe.exe, and you have the following line of code:

StrCpy $1 $EXEDIR 3

The value of $1 would be "c:\" (without the quotes). If you just want the drive letter, replace the 3 with a 1.

CC