cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
scottd72
Level 7

Installshield registry bug found - Properties show up as literals in registry

Sorry if this isn't the correct place to post this.

I have found an annoying bug pertaining to registry values in IS. I'm working with a basic msi project and I've had this bug happen twice so far.

I have two features (Feat1, Feat2) with registry entries in each. I want to copy a particular registry key from Feat1 to Feat2, so I right-click on the key and select "export selected branch..", then paste it to the registry in Feat2. Feat2's registry had existing keys with properties as values prior to the copy, ie: [INSTALLDIR], [REGUSER]. When I build the install, run it and look at the computer's registry, the key's values from Feat2 are going to have the property's string literals instead of the value.

To solve this issue I open the project, delete the values of each key this is happening to, save the project, then manually type in the properties.
Labels (1)
0 Kudos
(9) Replies
BrHartmann
Level 7

I also ran into this problem with my basic MSI and Installscript-MSI projects when I imported .reg files with properties.

I found that looking at the registry values in the Direct Editor (Registry table), all the "[" and "]" characters from those imported keys had some kind of escape characters added in front of them (I forget the exact characters now). Deleting those characters fixes the registry keys (without needing to completely re-enter the rest of the value contents).
0 Kudos
scottd72
Level 7

The first time this happened to me I looked in the direct editor at the registry entries and they had double brackets on each of the properties, [[property]]. So, removing the extra brackets solved it for me that time. However, the second time it happened to me everything looked fine in the direct editor, so I had to remove them all and manually add them again.
0 Kudos
BrHartmann
Level 7

Here's an example of the value I would get after importing a key:

[\[]CommonAppDataFolder[\]]TheRestOfMyPath

This is with an IS-MSI project, using 2011 Premier Edition. Maybe the bug is different in other IS product editions?

Anyway, just to clarify for anyone else facing this, I needed to remove the \[] at the beginning of the property and the [\] at the end of the property.
0 Kudos
scottd72
Level 7

Yeah, that looks familiar. That's exactly what I had gotten the first time.
0 Kudos
Stefan_Krueger
Level 9

[\[]CommonAppDataFolder[\]]TheRestOfMyPath
This is with an IS-MSI project, using 2011 Premier Edition. Maybe the bug is different in other IS product editions?

Not sure I would call this a bug. .reg files know nothing about properties. So if you import a .reg file that has a string in it like [something] , InstallShield thinks you want to write that extact string to the registry, inlcuding the square brackets.
To do this - and to make sure the string with square brackets is interreted as a property by Windows Installer - it has to escape the brackets. Windows Installer's escape scheme is: Precede the special character with a backslash and then enclose the wholöe thing in square brackets. So if you want to escape # it would look like: [\#]. In case of a [ it becomes [\[] and for ] it becomes [\]]
Stefan Krueger
InstallSite.org
0 Kudos
MichaelU
Level 12 Flexeran
Level 12 Flexeran

I believe Hotfix A includes a fix for this; please check for updates if you haven't already. The round trip is the best argument (the number of you who used this behavior was similarly important) I've seen for why this is a bug instead of a debate about what .reg files should or should not know about, although the .reg argument Stefan mentions was why the change was attempted.
0 Kudos
Stefan_Krueger
Level 9

Yes, round trip is indeed a very good point.
Stefan Krueger
InstallSite.org
0 Kudos
DBrewer
Level 3

Maybe a silly question but I have the opposite problem of I need this value in the registy [Common] Prod (SaaS) and it completly strips out the [Common] and leaves the rest.

What do I need to place around the brackets so when the app installs the brackets are in the registry?

Thank you!
0 Kudos
DBrewer
Level 3

Sorry I answered my own question by doing this: [\[]Common[\]]Prod (SaaS)
0 Kudos