Go Back   Winamp Forums > Developer Center > NSIS Discussion

Reply
Thread Tools Search this Thread Display Modes
Old 8th February 2002, 10:48   #1
plaztic
Junior Member
 
Join Date: Jun 2001
Location: Sweden
Posts: 10
Unhappy Cant figure out variables

Hi,

I've been trying to figure out how to use variables with no luck.
I want to use a variable to display my program name in dialog boxes etc.

Name "My New app"

Function .onInit
MessageBox MB_YESNO "Do you want to install $R9?" IDYES NoAbort
MessageBox MB_OK "Installation canceled by user."
Abort
NoAbort:
FunctionEnd

I tried;

Section InstAppName
StrLen $R9 "My New App"
SectionEnd

The docs make no sense to me is there an NSIS for Dummies?

\plaz
plaztic is offline   Reply With Quote
Old 8th February 2002, 12:42   #2
petersa
Senior Member
 
petersa's Avatar
 
Join Date: Apr 2001
Location: Melbourne, Australia
Posts: 207
Try changing StrLen to StrCpy. Everything should work then!

Of course, you could do it this way, too. Put this line at the start of your script.
code:
!Define APPNAME 'My New App'
Then when you want to refer to it, use ${APPNAME}.
code:
MessageBox MB_YESNO 'Would you like to install ${APPNANE}?' IDYES NoAbort
You don't have to use APPNAME. Choose anything.

No NSIS for Dummies! Just post any problems of yours here and someone will be glad to help.
petersa is offline   Reply With Quote
Old 8th February 2002, 16:00   #3
plaztic
Junior Member
 
Join Date: Jun 2001
Location: Sweden
Posts: 10
Thanks for the tip!

I'll this asap.

\plaz
plaztic is offline   Reply With Quote
Old 11th February 2002, 07:02   #4
plaztic
Junior Member
 
Join Date: Jun 2001
Location: Sweden
Posts: 10
Thumbs up

Thanks Petersa,

Solved my problems. Did try this once before, but then I used NSIS 1.44 and that didn't work.

\Plaz
plaztic is offline   Reply With Quote
Old 11th February 2002, 08:07   #5
Tresni
Junior Member
 
Tresni's Avatar
 
Join Date: Oct 2001
Location: Boise, ID
Posts: 18
Send a message via ICQ to Tresni Send a message via AIM to Tresni Send a message via Yahoo to Tresni
The only problem with your original script was you were using StrLen (which would return the length of a string) when you should have been using StrCpy (which copies on string into another). But I would suggest taht you keep your variables from something that is well, variable. If it's going to stay the same use a !define.. 8) Anyway.. Have fun!
Tresni is offline   Reply With Quote
Old 4th June 2002, 01:32   #6
glenncarr
Junior Member
 
Join Date: Feb 2002
Location: Tulsa, OK, US
Posts: 26
Send a message via AIM to glenncarr Send a message via Yahoo to glenncarr
Unhappy trying to define string - 'Name expects 1 parameters, got 7'

So, what am I doing wrong here...?

!Define APPNAME 'GoogleSpell Add-on for Daves Quick Search Deskbar'

Here's the script error I get...

Processing script file: "C:\glenn\dev\dqsd\addons\googlespell\googlespell.nsi"
!define: "APPNAME"="GoogleSpell Add-on for Daves Quick Search Deskbar"
Name expects 1 parameters, got 7.
Usage: Name installer_name
Error in script "C:\glenn\dev\dqsd\addons\googlespell\googlespell.nsi" on line 8 -- aborting creation process

Using v1.98
glenncarr is offline   Reply With Quote
Old 4th June 2002, 02:06   #7
0mar
Registered User
 
Join Date: Jan 2002
Posts: 30
wild wild guess, but try this:

Name "${APPNAME}"

I'm thinking right now you have:

Name ${APPNAME}

Although I'm really not sure...
0mar is offline   Reply With Quote
Old 4th June 2002, 04:12   #8
glenncarr
Junior Member
 
Join Date: Feb 2002
Location: Tulsa, OK, US
Posts: 26
Send a message via AIM to glenncarr Send a message via Yahoo to glenncarr
Doh!

You're right. Thanks.
glenncarr is offline   Reply With Quote
Old 4th June 2002, 04:27   #9
0mar
Registered User
 
Join Date: Jan 2002
Posts: 30
Glad I could help.
0mar 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