- NSIS Discussion
- Installer works on XP, not on Server 2003
Archive: Installer works on XP, not on Server 2003
drmth
29th June 2010 15:03 UTC
Installer works on XP, not on Server 2003
Hi folks,
I did an installer, in which I use the variable $INSTDIR. Through a command line, I can change it (using /D=). Everything is doing well under XP.
Unfortunately, under Server 2003, the variable $INSTDIR is not set and when I print its value, it returns ${INSTDIR}.
Do somebody know why under Server 2003 the installer is going crazy?
Thanks
drmth
30th June 2010 09:14 UTC
Hi,
I checked one time again, and the problem is the same... Do anybody know what is happening to the installer?
I will try on a new Server 2003. But, i am not sure it will solve the problem.
Anders
30th June 2010 14:08 UTC
${INSTDIR} would be a define, even if $INSTDIR (a variable, not a define) was broken, it would not print ${INSTDIR} (with those braces)
drmth
30th June 2010 14:27 UTC
I completely agree with you... This thing is weird. I tried the installer on another machine this morning (still using Server 2003) but the result was the same.
After, I did some tests and $INSTDIR returns a good value when for example, in the command line i write: Installer.exe /D=C:\blablabla
Here, $INSTDIR is C:\blablabla
but if I write: $INSTDIR is C:\ , the value of $INSTDIR will be ${INSTDIR}.
In fact, it takes a good value only if I do not direct $INSTDIR to the root of the disk...
Unfortunaltely, I need to leave $INSTDIR as C:\
Anders
30th June 2010 14:43 UTC
AllowRootDirInstall
drmth
30th June 2010 14:57 UTC
it seems to be what i'm looking for....
I gonna give it a try
thx
drmth
30th June 2010 16:30 UTC
Unfortunately, the problem is still there.
it does not work on Server 2003. I am going to make another program to know if the problem comes from my program or if Server is a tricky environment.... Because it works on XP...
MSG
30th June 2010 16:58 UTC
Can you show us a minimalistic script that does the strange ${INSTDIR} thingiemajigger?
drmth
1st July 2010 10:14 UTC
Hi,
I did some change into the code and finally, I am able to set $INSTDIR.
Just to remind the way I proceed:
In the headers of the code:
AllowRootDirInstall true (thx to Anders!!)
In the function .onINIT:
SetOutPath $INSTDIR
${IF} "$INSTDIR" == ""
${ORIF} "$INSTDIR" == "${INSTDIR}"
Strcpy $INSTDIR "C:\"
${ENDIF}
This is the way I did. In you see any mistake do not hesitate to let me know.
I did a little test to know what is inside $INSTDIR, and it seems that if you do not fix it somewhere in your code, it takes some weird values...
Thank you Anders and MSG.
drmth
1st July 2010 10:15 UTC
But the mystery remains the same, why the program was running under XP and not Server 2003....
Anders
1st July 2010 15:29 UTC
You should not be calling SetOutPath $instdir in .oninit since it will create the directory, remove the SetOutPath call
drmth
2nd July 2010 13:08 UTC
Ok I remodeved it from the code...
Now, i'm having trouble to set $Instdir into the code.
It is ok using the command line, but I'd like that if I do not set $Instdir from the command line, $INSTDIR = S:\ by default
I tried to change it into the piece of code i wrote above (by changing C:\ with S:\) but the installer set it directly to C:\
Dou you have any idea?
Afrow UK
2nd July 2010 18:17 UTC
Does S:\ exist?
Stu
drmth
5th July 2010 09:11 UTC
S:\ does not exist on every machine I am going to use. But I must have $INSTDIR set to S:\ by default.
I tried to set it by using Strcpy, but then, the command line is not taken into account.