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

Updating the Registry from a dialog

Hi,

I need to update a Registry key to a value unknown during the build of the installation, because the person installing the software should supply that value while installing it. I have a dialog that asks for the information, but I don't know how to cause the installation program to write it. What do I need to do?

Thanks
Labels (1)
0 Kudos
(8) Replies
Jeff2008
Level 6

For a basic MSI, you need first to link a property to the control you use (click on your control in the dialog editor and fill the property "property"). The property name needs to be in ALL CAPS. Then, in a component, add the registry key and for the value, write the property name in square bracket, ie "[PROPERTY_NAME]". When installing, this will be replaced by whatever is the value of the property at this time.
0 Kudos
z_efrati
Level 4

Basic MSI Project
0 Kudos
Jeff2008
Level 6

Sorry, see my edited post 😉
0 Kudos
z_efrati
Level 4

Thank you, I'll do that
0 Kudos
speedy
Level 3

Can I apply this technique to create a new key aswell?

Eg. The user enters two values (properties) in a dialog and I want to create a key with the first property as name (1). Then I want a value created from the second property in the key created from the first property.
(1) Software\MyCompany\MyProduct\TheNewKeyFromProp1
(2) Software\MyCompany\MyProduct\TheNewKeyFromProp1\ANewValue = TheNewValueFromProperty2

I tried to do it but the following error occurred (translated to english from swedish): "Was unable to write the value TheNewValueFromProperty2 on the key \Software\MyCompay\MyProduct\. Confirm that you have valid access to the key or contact your support.
0 Kudos
speedy
Level 3

speedy wrote:
Can I apply this technique to create a new key aswell?

Eg. The user enters two values (properties) in a dialog and I want to create a key with the first property as name (1). Then I want a value created from the second property in the key created from the first property.
(1) Software\MyCompany\MyProduct\TheNewKeyFromProp1
(2) Software\MyCompany\MyProduct\TheNewKeyFromProp1\ANewValue = TheNewValueFromProperty2

I tried to do it but the following error occurred (translated to english from swedish): "Was unable to write the value TheNewValueFromProperty2 on the key \Software\MyCompay\MyProduct\. Confirm that you have valid access to the key or contact your support.


BTW, I'm using the project type Basic MSI Project
0 Kudos
speedy
Level 3

Never mind. I got it working. The variable [ ] can be used to create a key. I followed the advice at url:
http://www.acresso.com/webdocuments/PDF/is_vista.pdf?link_id=downloads
0 Kudos
Jeff2008
Level 6

Not sure what you did wrong, it works fine for me. In short, you can use a property in the columns "Key", "Name" and "Value" of the table "Registry". Maybe it's your property that contain invalid character?
0 Kudos