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 Branch Defined in Code
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
‎Jul 25, 2015
09:10 AM
Is there a way to set registry branches programmatically? I've created separate components for essentially the same set of registry entries. The only difference is that the branch uses a different version number. Can I just use one component to handle all versions and set that version in my script? Thanks.
(1) Solution
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 27, 2015
08:25 AM
If you're using a Basic MSI project, registry keys, value names, and value data can embed property references to determine the resulting, ah, value. So perhaps it as simple as creating a single set of keys that includes [MYVERSION], and setting the property MYVERSION to the correct version.
If you're using an InstallScript project, I forget if there's a good way to do it in the registry view, but this can definitely be done with script code.
If you're using an InstallScript project, I forget if there's a good way to do it in the registry view, but this can definitely be done with script code.
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 27, 2015
08:25 AM
If you're using a Basic MSI project, registry keys, value names, and value data can embed property references to determine the resulting, ah, value. So perhaps it as simple as creating a single set of keys that includes [MYVERSION], and setting the property MYVERSION to the correct version.
If you're using an InstallScript project, I forget if there's a good way to do it in the registry view, but this can definitely be done with script code.
If you're using an InstallScript project, I forget if there's a good way to do it in the registry view, but this can definitely be done with script code.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 27, 2015
08:34 AM
Thank you for your response. It's good to know that it's possible programmatically, so I have one option that way. The challenge I've had in the past with setting things in code is that it doesn't always run when I release an update, so I'm forced to require the user to uninstall and reinstall which is not so friendly. Maybe I'm missing how to have code run whether it's a new install or update.
Regardless, it'd be great if there could be a way to just set it through the Registry view. As you suspected, I simply need a new version branch for each version and I'm currently "forced" to create a new Registry component for each version which becomes a bigger and bigger problem to keep in snyc over time. Any suggestions for that would be greatly appreciated. Thanks.
Regardless, it'd be great if there could be a way to just set it through the Registry view. As you suspected, I simply need a new version branch for each version and I'm currently "forced" to create a new Registry component for each version which becomes a bigger and bigger problem to keep in snyc over time. Any suggestions for that would be greatly appreciated. Thanks.
MichaelU wrote:
If you're using a Basic MSI project, registry keys, value names, and value data can embed property references to determine the resulting, ah, value. So perhaps it as simple as creating a single set of keys that includes [MYVERSION], and setting the property MYVERSION to the correct version.
If you're using an InstallScript project, I forget if there's a good way to do it in the registry view, but this can definitely be done with script code.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 27, 2015
08:44 AM
Oh, I think I took the wrong picture of the use case. I was thinking something like InstallShield has, where each version of InstallShield installs a single registry branch with a version number in it. Or maybe a slight variant of that where it's a slightly different version number depending on something else, but only one at a time.
Is your case instead that you need to install several similar branches from one installation, and the number of such branches continually increases over time? I don't have a great answer for that, and totally understand that script seems like an attractive approach. Just bear in mind that component rules are pretty picky about this sort of modification, so, if you stick with the view and need to support minor upgrades, be careful to create new components as appropriate.
Is your case instead that you need to install several similar branches from one installation, and the number of such branches continually increases over time? I don't have a great answer for that, and totally understand that script seems like an attractive approach. Just bear in mind that component rules are pretty picky about this sort of modification, so, if you stick with the view and need to support minor upgrades, be careful to create new components as appropriate.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jul 27, 2015
08:55 AM
Sorry for not being clear. Within one ISM file, I have multiple releases. Each release is for a different version and has its own flags.
Currently, I've created a different component for each version's registry. Within it, it uses variable values to put into the registry.
The only difference between the registry components is the version number for its branch. I'd like to avoid having to create a different registry component for each version and just have one. If I could set the branch as a variable, that would solve my problem.
Currently, I've created a different component for each version's registry. Within it, it uses variable values to put into the registry.
The only difference between the registry components is the version number for its branch. I'd like to avoid having to create a different registry component for each version and just have one. If I could set the branch as a variable, that would solve my problem.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 16, 2022
03:09 PM
What I've since discovered with this solution is that the registry branch (key) defined with a variable doesn't get removed when the program is uninstalled. It is set to uninstall the entire key.
Any reason why it would be different as a variable versus hardcoded value?