Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 930
tomkpunkt Avatar asked Oct 09 '12 12:10

tomkpunkt


People also ask

How do escape characters work?

In computing and telecommunication, an escape character is a character that invokes an alternative interpretation on the following characters in a character sequence. An escape character is a particular case of metacharacters.

Which symbol is correct in using an escape character?

Escape character syntax An escape sequence contains a backslash (\) symbol followed by one of the escape sequence characters or an octal or hexadecimal number.


1 Answers

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.)

like image 184
Deanna Avatar answered Sep 30 '22 08:09

Deanna