Old 23rd July 2012, 09:40   #1
xbarns
Senior Member
 
xbarns's Avatar
 
Join Date: Aug 2007
Location: Frankfurt, Germany
Posts: 187
Prevent Resolution of Variable

Hi all,

i am using

FileWrite $0 "LangString CheckDBName {LANG_ENGLISH} $\"Please check DB Name$\""

to create a set of translation files (comes out of a database we use for tracking translations).

In the file the string will look like this:

LangString CheckDBName 1033 "Please check DB Name"

is there a way to prevent the resolution of ${LANG_ENGLISH} to 1033 ?

Thanks a lot
xBarns
xbarns is offline   Reply With Quote
Old 23rd July 2012, 12:01   #2
Anders
Moderator
 
Anders's Avatar
 
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,442
You mean define?

You can use this hack:
Quote:
!define dollar $
Foo ${dollar}{LANG_ENGLISH}

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Old 23rd July 2012, 12:06   #3
xbarns
Senior Member
 
xbarns's Avatar
 
Join Date: Aug 2007
Location: Frankfurt, Germany
Posts: 187
Thumbs up

That does the trick

Thanks a lot!
xbarns is offline   Reply With Quote
Old 23rd July 2012, 13:12   #4
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
Quote:
Originally Posted by Anders View Post
You can use this hack:
what's wrong with $${LANG_ENGLISH}?
Yathosho is offline   Reply With Quote
Old 23rd July 2012, 13:18   #5
xbarns
Senior Member
 
xbarns's Avatar
 
Join Date: Aug 2007
Location: Frankfurt, Germany
Posts: 187
Quote:
Originally Posted by Yathosho View Post
what's wrong with $${LANG_ENGLISH}?
I tried that first but it did not work
xbarns is offline   Reply With Quote
Old 24th July 2012, 05:17   #6
T.Slappy
Major Dude
 
T.Slappy's Avatar
 
Join Date: Jan 2006
Location: Slovakia
Posts: 562
Send a message via ICQ to T.Slappy
Quote:
Originally Posted by Anders View Post
You mean define?

You can use this hack:
Heh, nice trick

Cool looking installers with custom design: www.graphical-installer.com
Create Setup Pages easily: www.install-designer.com
Build installers in Visual Studio 2005-2022: www.visual-installer.com
or RAD Studio 2009 - 11 Alexandria: www.rad-installer.com
T.Slappy is offline   Reply With Quote
Old 23rd July 2012, 14:03   #7
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
Only works to escape a variable, I think.
MSG is offline   Reply With Quote
Old 23rd July 2012, 21:12   #8
Yathosho
Forum King
 
Yathosho's Avatar
 
Join Date: Jan 2002
Location: AT-DE
Posts: 3,366
Quote:
Originally Posted by MSG View Post
Only works to escape a variable, I think.
i'm pretty sure i got it working with a definition in a script of mine - otherwise my entire installer wouldn't work, but it does
Yathosho is offline   Reply With Quote
Old 24th July 2012, 04:31   #9
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
!define foo bar
detailprint "$${foo}"

Compiler: unknown variable/constant "bar" detected, ignoring (D:\Projects\MB\Installer\test.nsi:22)
Installer: $bar

detailprint "$$${foo}"
Compiler: no warnings
Installer: $bar

So no, doesn't work.
MSG 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