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
- :
- Need help to permanently set a registry key value (no uninstall)
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
‎Feb 29, 2008
11:29 AM
Need help to permanently set a registry key value (no uninstall)
Hi everyone,
I'm new to this forum, and fairly new to IS. I have a special requirement where I want to set a registry at install time permanently - it should never be removed at install time. The value I'm setting (ie. not creating, it's already created I'm just setting it to a desired value) is the Start key value for a windows system service (msdtc.exe). The install works fine, the system service is set to the correct start mode (Automatic), but when we uninstall the application the Start value is deleted from the registry Key. This makes the service itself appear to have been uninstalled and no longer appears in Services.msc. I would like to prevent this uninstall behavior.
I've tried two approaches:
1) Use the Registry View to set the registry key value in question. I have tried to Install Only(+) option, but the menu item is always grayed out for me (all other options, such as uninstall entire key, Install if absent, Uninstall if Present and Automatic are all enabled). So for what ever reason, I can't use this approach.
2) I added some install script to call RegDBSetKeyValueEx() which works fine for the install, but again removes the key value at uninstall time.
There must be a way to set a registry key and forget about it, no?
I'm using InstallShield 2008 and it's an InstallScript MSI project. Any suggestions would be greatly appreciated.
I'm new to this forum, and fairly new to IS. I have a special requirement where I want to set a registry at install time permanently - it should never be removed at install time. The value I'm setting (ie. not creating, it's already created I'm just setting it to a desired value) is the Start key value for a windows system service (msdtc.exe). The install works fine, the system service is set to the correct start mode (Automatic), but when we uninstall the application the Start value is deleted from the registry Key. This makes the service itself appear to have been uninstalled and no longer appears in Services.msc. I would like to prevent this uninstall behavior.
I've tried two approaches:
1) Use the Registry View to set the registry key value in question. I have tried to Install Only(+) option, but the menu item is always grayed out for me (all other options, such as uninstall entire key, Install if absent, Uninstall if Present and Automatic are all enabled). So for what ever reason, I can't use this approach.
2) I added some install script to call RegDBSetKeyValueEx() which works fine for the install, but again removes the key value at uninstall time.
There must be a way to set a registry key and forget about it, no?
I'm using InstallShield 2008 and it's an InstallScript MSI project. Any suggestions would be greatly appreciated.
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2008
04:30 AM
maby someone from the installshield support team can help us??????????????????????????
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 02, 2008
10:03 PM
If you disable logging, InstallShield doesn't keep track of what you're doing so it won't undo it during an uninstallation.
Do...
I used this to modify a system's PATH statement. Like you, everything worked fine during the installation, but during the un-install, the entire path statement would disappear.
But, I'd also like to hear if there's a 'correct' way to do this.
Leigh
Do...
Disable(LOGGING);
RegDBSetKeyValueEx(....);
Enable(LOGGING);
I used this to modify a system's PATH statement. Like you, everything worked fine during the installation, but during the un-install, the entire path statement would disappear.
But, I'd also like to hear if there's a 'correct' way to do this.
Leigh
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 03, 2008
09:40 AM
Another way to do this is to create a seperate component specifically for your registry entry (use setup design view) create the registry key under the component, and set the component's permanent flag to 'Yes'.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 03, 2008
10:36 AM
Okay, thanks guys, I'll give that a shot right away!
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 03, 2008
01:22 PM
Ok, got it working. The way I fixed it, I created a new component with the Permanent attribute set. That corrected it. Simple. Now why didn't I think of that?!?
Well, thanks again for the help.
Well, thanks again for the help.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 04, 2008
02:00 AM
or how can i decide if to remove these reg key when uninstaling...by user choice?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Mar 11, 2008
09:38 AM
You can ask the user the question when the finish dialog appears. If they select the delete option then use a modification of Leigh's code:
Cheers,
ME
if( bvOpt1 ) then
Disable( LOGGING );
RegDBSetDefaultRoot( HKEY_LOCAL_MACHINE );
nResult = RegDBGetKeyValueEx( ... );
if( nResult = 0 ) then
RegDBDeleteValue( .... );
endif;
Enable( LOGGING );
endif;
Cheers,
ME