cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
tom_dinh
Level 3

Create Registry Key name in a backet [123]

Hi Everyone,

How do i write a registry key in a bracket in Installshield?
For example this is my registry key

MyRegistryKey (TEST [123])

and i want to write it to the following registry key

HKEY_LOCAL_MACHINE\SOFTWARE\MyCompany\


I was able to put this key in the registry in the registry area under System Configuration but when it writes to the registry, i only see the following

MyCompany\MyRegistryKey (test)

i guess Installshield interpreted [123] as a property and it is empty so i do not see [123].

Is there anyway i can write this key? I tried using Installshield script as a custom action but it failed writing the registry key.

Thank you in advance
Labels (1)
0 Kudos
(5) Replies
DLee65
Level 13

Have you tried using an escape character '\' before the brackets? I am not sure if this works or not but that is the common escape character in InstallShield.
0 Kudos
MarkusLatz
Level 8

Enable REGDB_OPTION_DISABLETEXTSUBS at REGDB_OPTIONS.

regards

Markus
0 Kudos
tom_dinh
Level 3

Thank you both for replying but they did not work.
The "\" cuts the registry key and the REGDB_OPTIONS does not seem to do anything, I am still getting the RegDBCreateKeyEx write error.
0 Kudos
Cary_R
Level 11

If you're using an MSI based project, check this out:

https://msdn.microsoft.com/en-us/library/windows/desktop/aa370109%28v=vs.85%29.aspx

If a substring of the form "[\c]" is found, it is replaced by the character without any further processing. Only the first character after the backslash is kept; everything else is removed.



So, try something like:

[\[]123[\]]

0 Kudos
mduiker
Level 3

Have you tried coding like:

[ for left square bracket [

] for right square bracket ]
0 Kudos