Old 30th May 2006, 11:29   #1
shaunb
Member
 
Join Date: May 2006
Location: Devon, UK
Posts: 65
Outfile and capitals

odd one, When I specify a variable to be used for an Outfile name, it doesnt preserve the caps.

example,

I have a var called $blech which contains BLECH

if I do

Outfile "Setup $blech.exe"

I get, as a resulting filename:

"Setup blech.exe"

and not

"Setup BLECH.exe"

of course, this works fine

Outfile "Setup BLECH.exe"

returns

"Setup BLECH.exe"



am I being stupid? its just I need the company brand to be in capitals. of course hardcoding it myself works, but that negates the whole point of the variable substitution.

thanks!
shaunb is offline   Reply With Quote
Old 30th May 2006, 11:42   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Yes you're being stupid lol.
OutFile is a compile-time instruction - it writes the setup file onto your computer. Variables such as $blech are for run time use... i.e. when the setup is run on the users' computer.
Naturally you can't use a run time variable at compile time - this is impossible!

Why is it coming out as blech.exe? Well it's taking the $blech variable and trimming the $ from the front (invalid path character) and using that as the file name.

-Stu
Afrow UK is offline   Reply With Quote
Old 30th May 2006, 11:45   #3
shaunb
Member
 
Join Date: May 2006
Location: Devon, UK
Posts: 65
ah.. : )

"Why is it coming out as blech.exe? Well it's taking the $blech variable and trimming the $ from the front (invalid path character) and using that as the file name."


I dont think so, this was merely an example and I have no $blech variable with BLECH contained, so it can't be just chopping the dollar off.

Its a define actually, and not a variable if that makes any difference.
shaunb is offline   Reply With Quote
Old 30th May 2006, 11:52   #4
shaunb
Member
 
Join Date: May 2006
Location: Devon, UK
Posts: 65
??? I've changed nothing but now it works.

cool.

*looks around to see where the fairy went*

*puzzled look*
shaunb is offline   Reply With Quote
Old 30th May 2006, 11:54   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You should have said it wasn't a variable.
!defines use curly braces -> ${blech}

-Stu
Afrow UK is offline   Reply With Quote
Old 30th May 2006, 11:56   #6
shaunb
Member
 
Join Date: May 2006
Location: Devon, UK
Posts: 65
yeah sorry about that, only noticed after, yeah it does use braces, definately a define.

I can't explain how it just switched from not being uppercase, to being uppercase though. I havent changed it myself.

its the same code as when I posted this thread.

world. .. ignore me

shaunb is offline   Reply With Quote
Old 30th May 2006, 11:58   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
Never mind then lol

$ isn't an invalid path character either

-Stu
Afrow UK is offline   Reply With Quote
Old 30th May 2006, 12:05   #8
shaunb
Member
 
Join Date: May 2006
Location: Devon, UK
Posts: 65
true, I'm lost now, hah

anyway whats important is that it works.

you're saying its just chopping the dollar off right?

so if its a define, where do the curly braces go?

I'm pretty sure its not just dumping the define name or dropping the $ or whatever.

ah well
shaunb is offline   Reply With Quote
Old 30th May 2006, 12:07   #9
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
No it isn't.
I'm not sure what was wrong really with the details that you gave (mind you they were more unhelpful really!)

!define MyDefine "blah"
OutFile "${MyDefine}.exe"

-Stu
Afrow UK is offline   Reply With Quote
Old 30th May 2006, 12:12   #10
shaunb
Member
 
Join Date: May 2006
Location: Devon, UK
Posts: 65
yes, my example was .. ... -=useless=-

sorry about that hah

The example you show there, thats the code I had before, when I made this thread,.. I changed it so it was hardcoded, obviously it worked then, but wasnt suitable, so I added the define again, and now its working with caps. weird.

anyway, now I've made myself appear a complete lemon to everyone I'd better continue with my project.. .. lol

shaunb is offline   Reply With Quote
Old 30th May 2006, 22:02   #11
JasonFriday13
Major Dude
 
JasonFriday13's Avatar
 
Join Date: May 2005
Location: New Zealand
Posts: 916
shaunb: Since you had a dollar chopped off, here is another one.
$1.00
Go buy a chocolate blah.

"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me)
NSIS 3 POSIX Ninja
Wiki Profile
JasonFriday13 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