lee.wilmott
Posts: 9
Joined: Tue Aug 30, 2005 11:29 am

Service Parameters are deleted on Upgrade

I hope you can help me.

I have a Windows Service (let's call it MyService for the sake of argument) that when started for the very first time it creates some default registry entries within the following registry key...

HKLM\SystemCurrentControlSet\Services\MyService\Parameters

For example...

HKLM\SystemCurrentControlSet\Services\MyService\Parameters\LogLevel : REG_DWORD : 0x3

The System Administrator is then able to see all the available settings and then change them at will.

I've written an Advanced Installer for MyService which installs the service perfectly.

The problem is, is that when I upgrade MyService the registry key "HKLM\SystemCurrentControlSet\Services\MyService" is deleted (as is "HKLM\SystemCurrentControlSet\Services\MyService\Parameters"). So if anyone modifies the default registry values then these are lost after the upgrade of MyService.

How do I go about retaining the above registry key (and their values) on an Upgrade - but delete them when MyService has been uninstalled?

Many thanks,

Lee
Daniel
Posts: 8283
Joined: Mon Apr 02, 2012 1:11 pm
Contact: Website

Re: Service Parameters are deleted on Upgrade

Hello Lee,

In order to achieve what you want you can take a look on our "How do I prevent a file or registry entry from being uninstalled or repaired?" article.

Let us know if this helps, otherwise please give us more details about your scenario.

All the best,
Daniel
Daniel Radu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”