Old 27th July 2007, 13:56   #1
aemik
Member
 
Join Date: Jun 2007
Location: Böblingen
Posts: 94
${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 is offline   Reply With Quote
Old 27th July 2007, 15:30   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
If you use the NSIS installer it will be set correctly. My NSISDIR is set to D:\...

Stu
Afrow UK is offline   Reply With Quote
Old 30th July 2007, 09:36   #3
aemik
Member
 
Join Date: Jun 2007
Location: Böblingen
Posts: 94
http://www.aemik.de/bilder/nsisbug.JPG

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

PHP Code:
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...
aemik is offline   Reply With Quote
Old 30th July 2007, 10:56   #4
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 30th July 2007, 11:44   #5
aemik
Member
 
Join Date: Jun 2007
Location: Böblingen
Posts: 94
ok, it is a constant.
But that is not the main problem.

the NSIS directory path on compile time is already wrong.
aemik is offline   Reply With Quote
Old 30th July 2007, 12:48   #6
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
What is the value stored in
HKLM "Software\NSIS" ""

Stu
Afrow UK is offline   Reply With Quote
Old 30th July 2007, 13:17   #7
aemik
Member
 
Join Date: Jun 2007
Location: Böblingen
Posts: 94
D:\Program Files\NSIS

${NSISDIR} = C:\Programme\NSIS
aemik is offline   Reply With Quote
Old 30th July 2007, 13:58   #8
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
And you definitely recompiled that installer on the same machine?

Stu
Afrow UK is offline   Reply With Quote
Old 30th July 2007, 14:49   #9
aemik
Member
 
Join Date: Jun 2007
Location: Böblingen
Posts: 94
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?
aemik is offline   Reply With Quote
Old 30th July 2007, 14:56   #10
kichik
M.I.A.
[NSIS Dev, Mod]
 
kichik's Avatar
 
Join Date: Oct 2001
Location: Israel
Posts: 11,343
${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.

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 30th July 2007, 16:43   #11
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
My bad

Stu
Afrow UK is offline   Reply With Quote
Old 31st July 2007, 10:41   #12
aemik
Member
 
Join Date: Jun 2007
Location: Böblingen
Posts: 94
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???
aemik is offline   Reply With Quote
Old 31st July 2007, 12:09   #13
Red Wine
Forum King
 
Red Wine's Avatar
 
Join Date: Mar 2006
Location: Ath. GR
Posts: 2,078
As Stu mentioned above the value is stored in registry,
use ReadRegStr $0 HKLM "Software\NSIS" ""

Quick AVI Creator - Quick and easy convert from DVD/MPEG/AVI/MKV to AVI/MP4/MKV
Quick AVI Creator entirely edited with NSIS and entirely upgraded to Unicode NSIS
Red Wine is offline   Reply With Quote
Old 31st July 2007, 12:45   #14
aemik
Member
 
Join Date: Jun 2007
Location: Böblingen
Posts: 94
Ok, I think I have it. Thank you very much...
aemik 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