|
|
#1 |
|
Junior Member
Join Date: Feb 2003
Posts: 10
|
any way too do a '!if ${FOO} == 1'?
I am using NSIS to write an installer for the upcoming release of The Ur-Quan Masters
http://sc2.sf.net And I'm pretty much done. However, I'd like the installer to be very easy to configure, and as such would really like to be able to do something like: code: I realize that for 2 options, I could do: code: (Note that I need to define FOO, since I use it later in the installer) Which works (and is how I'm doinng it now), but is somewhat confusing for the users, and doesn't allow for more than 2 options Is there any more elegant way to do what I need? (We are usiing 2.0b1) (BTW: Thank you for NSIS! It is a wonderful project) |
|
|
|
|
|
#2 |
|
Junior Member
Join Date: Feb 2003
Posts: 10
|
I should also mention that I've tried using IntCmp in a .onInit, but that requires thatI set the variable as $0-$9 (or $R0-$R9), or push it onto the stack, neither of which is really a viable option, since I have lots of variabbles I need to do this for.
|
|
|
|
|
|
#3 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,898
|
well, your using the same "BAR" to define diferent strings...
.... try use the other "cmp" like StrCmp... for example: code: Hope this help you!
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4. |
|
|
|
|
|
#4 |
|
Major Dude
Join Date: Sep 2002
Location: At [4C69:6E6B]
Posts: 561
|
I think that many people would like it to see !elseif added to NSIS. And it would take NSIS again one step closer to a 'real' scriptiong or programming language.
- Claudia Pelsmaeker |
|
|
|
|
|
#5 |
|
Junior Member
Join Date: Feb 2003
Posts: 10
|
Using StrCmp doesn't buy me anything over an IntCmp in this case, and isn't very conveneient since this check is done in several places (this indicates that I'd need to do the compare in a function call, which I thought about, but it seems kinda silly to do a compare in the installer, when the actual string can be defined at compile-time instead).
Anyhow, I have a workable solution for now, and I really do appreciate all the nifty features in NSIS. Thanks! |
|
|
|
|
|
#6 | |
|
NSIS MUI Dev
Join Date: Nov 2001
Posts: 3,717
|
Quote:
|
|
|
|
|
|
|
#7 | |
|
Junior Member
Join Date: Feb 2003
Posts: 10
|
Quote:
!if !elif !endif Which is what I'd like to see (and I imagine what virtlink was talking about) |
|
|
|
|
|
|
#8 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,338
|
!if something = somethingelse is not supported. You'll have to do with !ifdef, !else ifdef, and !endif for now. Instead of giving a value for your define make use of two different define names.
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#9 |
|
NSIS Dev
Join Date: Sep 2001
Location: Leicester, UK
Posts: 193
|
This just occured to me but I've not tried it...
code: hth! Dave. |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Feb 2003
Posts: 10
|
Very cool! i just tried this, and it works great. (of course you shouldn't have the '${' and '}' on the !ifdef lines (I screwed up the original proto code too)), so it looks more like:
code: But it does exactly what I need! Thanks! |
|
|
|
|
|
#11 |
|
NSIS Dev
Join Date: Sep 2001
Location: Leicester, UK
Posts: 193
|
Ar yes you're right. Like I said, I hadn't tried it
Glad I could help. |
|
|
|
|
|
#12 |
|
M.I.A.
[NSIS Dev, Mod] Join Date: Oct 2001
Location: Israel
Posts: 11,338
|
Good idea eccles!
NSIS FAQ | NSIS Home Page | Donate $ "I hear and I forget. I see and I remember. I do and I understand." -- Confucius |
|
|
|
|
|
#13 |
|
Debian user
(Forum King) Join Date: Jan 2003
Location: Arch land
Posts: 4,898
|
works for me too
* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux w/ xfce4. * Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Debian unstable w/ xfce4. |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|