View Full Version : # symbol in Registry key value causes 1406 error

02-12-2002, 04:58 PM
I have an application that uses a # symbol in the data value of a registry key: #DiademATF The value is captured by InstallShield properly but returns error 1406 when the setup package is run on a clean machine. It seems that AdminStudio is not capable of writing the # symbol to the registry as we have seen this in another application as well. Has anyone else seen this and have a resolution?
Thanks in Advance

02-13-2002, 03:04 PM
Had the same error 1406 with the # sign in registry keys. The exact value was #0 in a registry entry in a merge module that I had written. With Orca I removed the # from in front of the 0 just to see what happened. The 1406 error went away and the file that is dependant on the changed registry keys work fine. Don't know if this helps but it worked in our situation. I also looked at a previous build of the same product made with ISWI and the same keys had the 0 without the # sign. Hope this helps.

03-05-2002, 01:27 PM
We got an answer, from third level support. Heres the answer for everyone else to see...

Hello Edward,

I have heard back from the developer who was working on your issue and this is what has been found out:

When a registry key with a name that starts with # is created in the Registry_data in an ism file, it is a File key; i.e. during runtime, the MSI assumes that the key name is a file name and looks for the this file name in the File table and when found creates the key with complete path to the File Name.

In your project, at runtime, MSI tries to find that name in the File
table.. and since no file exits with that name, the error 1406 (unable to create the registry key) is generated.

*** The solution for this is to treat the "#" as a special character and enclose # in square brackets with slash.

For example: To create a key, "#test", then please add the key in the *.ism file and name it in the following format "[\#]test". This will make the # character a part of the name rather than making the registry key a File key.

More information can be found in the MSI help of the Author by searching
under "Formatted."

I believe that this answers your question. Thank you.

Hope this helps someone else..