tomkpunkt
tomkpunkt

Reputation: 1403

How escape a "{" and a "}" in Inno Setup

How can I escape the characters { and } in Inno Setup, the characters are used in the [Registry] section?

{, "{" do not compile.

%7d, "%7d", {%7d} all compile, but do not work, they result in the wrong values in the registry.

Best regards.

Upvotes: 6

Views: 5093

Answers (2)

RijS
RijS

Reputation: 21

I wanted to escape a quotation mark ("). Doubling it does not escape this,

I was able to force the hex-code by using {%|%22}.

On http://www.jrsoftware.org/ishelp/index.php?topic=consts this escaping is show as {%NAME|DefaultValue}. Leaving NAME empty makes it use the hex code.

Upvotes: 2

Deanna
Deanna

Reputation: 24283

You can escape the { by doubling it. There is no need to escape the } as it is only used if inside a constant.

From the help file:

A "{" character is treated as the start of the constant. If you want to use that actual character in a place where constants are supported, you must use two consecutive "{" characters. (You do not need to double "}" characters.)

Upvotes: 10

Related Questions