Skip to content
⌘ NSIS Forum Archive

Using & in !define

4 posts

jkeller@opentext#

Using & in !define

I have a define that creates a string with an '&' in it....

!define IHUB_PRODUCT_NAME "OpenText Magellan BI & Reporting System Console 16.6"

but when I use this define it removes the '&' (see attachments).

OpenText Magellan BI Reporting System Console 16.6"

Why is this? and how can I get this to work?
JasonFriday13#
If you have nsis 3, try this:

!define IHUB_PRODUCT_NAME "OpenText Magellan BI & Reporting System Console 16.6"
!define IHUB_PRODUCT_NAME_DA "OpenText Magellan BI && Reporting System Console 16.6"

Name "${IHUB_PRODUCT_NAME}" "${IHUB_PRODUCT_NAME_DA}"

Name has an optional parameter for using doubled ampersands.

Also, you can use defines within defines:

!define IHUB_PRODUCT_VERSION "16.6"
!define IHUB_PRODUCT_NAME "OpenText Magellan BI & Reporting System Console ${IHUB_PRODUCT_VERSION}"
!define IHUB_PRODUCT_NAME_DA "OpenText Magellan BI && Reporting System Console ${IHUB_PRODUCT_VERSION}"
Anders#
Originally Posted by jkeller@opentext View Post
Unfortunatly we are using MakeNSIS v2.46.5-Unicode
Why?


Anyway, the 2 parameter version of Name exists in NSIS 2.4x as well IIRC.