|
|
#1 |
|
Junior Member
Join Date: Jun 2010
Posts: 9
|
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 |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Jun 2010
Posts: 9
|
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. |
|
|
|
|
|
#3 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
|
${INSTDIR} would be a define, even if $INSTDIR (a variable, not a define) was broken, it would not print ${INSTDIR} (with those braces)
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#4 |
|
Junior Member
Join Date: Jun 2010
Posts: 9
|
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:\ |
|
|
|
|
|
#5 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
|
AllowRootDirInstall
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Jun 2010
Posts: 9
|
it seems to be what i'm looking for....
I gonna give it a try thx |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Jun 2010
Posts: 9
|
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... |
|
|
|
|
|
#8 |
|
Major Dude
Join Date: Oct 2006
Posts: 1,840
|
Can you show us a minimalistic script that does the strange ${INSTDIR} thingiemajigger?
|
|
|
|
|
|
#9 |
|
Junior Member
Join Date: Jun 2010
Posts: 9
|
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. |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Jun 2010
Posts: 9
|
But the mystery remains the same, why the program was running under XP and not Server 2003....
|
|
|
|
|
|
#11 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
|
You should not be calling SetOutPath $instdir in .oninit since it will create the directory, remove the SetOutPath call
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#12 |
|
Junior Member
Join Date: Jun 2010
Posts: 9
|
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? |
|
|
|
|
|
#13 |
|
Moderator
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
|
Does S:\ exist?
Stu Need an installer? http://www.afrowsoft.co.uk |
|
|
|
|
|
#14 |
|
Junior Member
Join Date: Jun 2010
Posts: 9
|
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. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|