Marin
Marin

Reputation: 1331

MSI prevent registry key repair

I created an MSI setup via Visual Studio 2008 for my application, and added a registry key to windows\run for automatic startup, but also implemented a function in my application to disable automatic startup. However, when the application is restarted, the key is automatically repaired.

How to prevent MSI from repairing the key??

Thank you!

Upvotes: 3

Views: 839

Answers (1)

Cosmin
Cosmin

Reputation: 21436

The registry key is repaired because it was installed by your package and Windows Installer knows that it should be present. Some possible solutions are:

  1. Move the entry in a separate component which doesn't have a Component ID. This way the component is not registered with Windows Installer.
  2. Use a custom action to create the registry entry during install.

Upvotes: 2

Related Questions