cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
BingMa
Level 4

Write Values to Registry

Hi,

I am working on a basic MSI project. I created a custom property, and set its value with MsiSetProperty method in one custom action, then write the value to registry. however, what has been wrote to the registry is always the value before it is set by the MsiSetProperty method, but it get the correct values for the build in properties.

Anyone knows what could be wrong?

Thank you,

Bing
Labels (1)
0 Kudos
(5) Replies
SGorman
Level 3

Are you setting the property and writing to the registry all in the same custom action?
0 Kudos
BingMa
Level 4

Hi Susan,

Thank you for your reply.

I set the property in a custom action, for writing to registry I used the build in feature of installshield.

I created a property in the Property table in Property Manager, with a default value of "0", and in one custom action I used MsiSetProperty to set it to "1", then in Registry I created a string value registry entry, and referenced the name of the property as the value. However, what is written to registry is always "0".

Bing
0 Kudos
KathyMorey
Level 10

Is your custom property public (i.e., all caps as in "MYPROPERTY")? Where did you schedule the MsiSetProperty custom action? In the UI sequence, the Execute sequence, or both? Did you run the install with a log file to see if that can give you any clues as to what the issue is?
0 Kudos
TheTraveler
Level 8

I believe KathyMorey maybe on the right track. When you look at your MSI project, do not look at the order it shows up in the IDE. Instead, look at the sequence of execution. You might be writing the MSI Property to the registry before your custom action modifies it to what you need.

Hope this helps.
0 Kudos
BingMa
Level 4

Hi,

Thank you for all your replies.

It turns out the problem is I didn't use all capital letters for the property name, as Kathy has mentioned. Then the value set by the MsiSetPropery only takes effact locally in the same custom action, and doesn't affect other custom actions.


Bing
0 Kudos