Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 29th June 2010, 14:03   #1
drmth
Junior Member
 
Join Date: Jun 2010
Posts: 9
Cool 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 is offline   Reply With Quote
Old 30th June 2010, 08:14   #2
drmth
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.
drmth is offline   Reply With Quote
Old 30th June 2010, 13:08   #3
Anders
Moderator
 
Anders's Avatar
 
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
Anders is offline   Reply With Quote
Old 30th June 2010, 13:27   #4
drmth
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:\
drmth is offline   Reply With Quote
Old 30th June 2010, 13:43   #5
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 2,776
AllowRootDirInstall

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 30th June 2010, 13:57   #6
drmth
Junior Member
 
Join Date: Jun 2010
Posts: 9
it seems to be what i'm looking for....

I gonna give it a try

thx
drmth is offline   Reply With Quote
Old 30th June 2010, 15:30   #7
drmth
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...
drmth is offline   Reply With Quote
Old 30th June 2010, 15:58   #8
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,840
Can you show us a minimalistic script that does the strange ${INSTDIR} thingiemajigger?
MSG is offline   Reply With Quote
Old 1st July 2010, 09:14   #9
drmth
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.
drmth is offline   Reply With Quote
Old 1st July 2010, 09:15   #10
drmth
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....
drmth is offline   Reply With Quote
Old 1st July 2010, 14:29   #11
Anders
Moderator
 
Anders's Avatar
 
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
Anders is offline   Reply With Quote
Old 2nd July 2010, 12:08   #12
drmth
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?
drmth is offline   Reply With Quote
Old 2nd July 2010, 17:17   #13
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Birmingham, England
Posts: 8,202
Does S:\ exist?

Stu

Need an installer? http://www.afrowsoft.co.uk
Afrow UK is offline   Reply With Quote
Old 5th July 2010, 08:11   #14
drmth
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.
drmth is offline   Reply With Quote
Reply
Go Back   Winamp 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