Skip to content
⌘ NSIS Forum Archive

${NSISDIR} problem

14 posts

aemik#

${NSISDIR} problem

Hello,

I have installed NSIS on D:\Program Files\NSIS but when I use ${NSISDIR} it is C:\Program Files\NSIS.

Is ${NSISDIR} saved in the registry?
aemik#


Now I have installed NSIS on a new labtop (OS: XP Prof. English).
I have choosen the directory D:\Program Files\NSIS. You can see it on the picture.

Afterwarths I have started a small program to check the ${NSISDIR} variable

Name "NSISDIR Test"
OutFile "NSISDIR Test.exe"
Section
MessageBox MB_ICONINFORMATION|MB_OK "NSIS Verzeichnis Variable: ${NSISDIR}"
Sectionend 
On the pciture you can see that the NSISDIR variable is wrong.

I had this problem on two pcs now. Please help me...
Afrow UK#
You do realise ${NSISDIR} is not a variable. It's a constant. The {} denote that. Variable names do not have {}.

${NSISDIR} is set to the NSIS directory path on compile time. If you build your installer under C:\Programme\NSIS then NSISDIR will always be that no matter where you run the installer from. Hence why it's called a constant.

Stu
aemik#
ok, it is a constant.
But that is not the main problem.

the NSIS directory path on compile time is already wrong.
aemik#
yes, for sure...

my colleague told me that problem, so I have installed NSIS on my new labtop on D:\ and there was the same.

Did you try to reproduce this failure?
kichik#
${NSISDIR} is not taken from the registry and it's not a real constant either. It's taken from wherever you ran makensis.exe. If it runs from C:\Program Files\NSIS, it'll set ${NSISDIR} to C:\Program Files\NSIS.
aemik#
Aha okay...

when i compile the nsi file with C:\Program Files\NSIS\makensis.exe the ${NSISDIR} constant in my installer is always "C:\Program Files\NSIS\".

How can I get the right NSISDIR of each PC when somebody starts the installer? Can I read the RegStr???
Red Wine#
As Stu mentioned above the value is stored in registry,
use ReadRegStr $0 HKLM "Software\NSIS" ""