This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Registry key name based on a property value?
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 14, 2008
02:08 PM
Registry key name based on a property value?
Is it possible to have a registry key's name be based on a property? I know it's possible to have registry values us properties, but the obvious idea of doing [PropertyName] as the registry key name does not work.
I tried getting cute and writing a custom action to change the entry in the Registry table, but Session.Database returns a read-only database that you can't modify. As it stands now, I am stumped. How do you create a registry key who's name is based on something programmatic? Particularly user input.
This is all Basic MSI, we do not (and will not) use InstallScript. We want our installations to be pure Windows Installer.
I tried getting cute and writing a custom action to change the entry in the Registry table, but Session.Database returns a read-only database that you can't modify. As it stands now, I am stumped. How do you create a registry key who's name is based on something programmatic? Particularly user input.
This is all Basic MSI, we do not (and will not) use InstallScript. We want our installations to be pure Windows Installer.
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 14, 2008
02:39 PM
Hmmmmmm, let me try again. Maybe it did work and I am out of my mind.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 14, 2008
03:17 PM
Ahh, I know what the issue is. The property replacement seems to happen at build time, not runtime...so if I change that property at runtime, the registry entry doesn't reflect this. I change the property at runtime.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 14, 2008
03:33 PM
Ah ha, got it. Custom properties seem to be reset to their default values when the UI sequence ends and the Execution sequence begins. Having the custom action that sets the properties after CostFinalize of both sequences fixed the problem.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jan 14, 2008
03:42 PM
Or using a public property---one with an all-caps name---should do it: CUSTOMPROP instead of CustomProp. You might look into SecureCustomProperties to ensure the value makes it from UI to Execute, but first things first.