3

I've recently created an application for my brother to use, it has several entries stored in the registry that it uses. I created a Setup Application in VS2010 so he can install the application to his PC with ease and set the entries to some default values for him, which he has changed. e.g.

I have a entry called "SummaryFolder" and the value of "Successfully Installed" - so when it was installed it would have the default value. He will have changed this by now to an actual folder on his PC.

Now I've just made a change to the program and added a couple more registry entries, modified the setup application and added in the new entries for installing. I've changed the build number of the setup app, so when he installs the app, it actually UPDATES his existing version. The problem I'm having is that the existing registry entries he has from the initial installation has been overwritten with the default "Successfully Installed" values, hence removing the folder he set.

So my question is: How can I specify for the setup program to only add the registry entries if they DON'T already exist ??? I want to have the installer to be as simple as possible for him.

Many thanks for any help.

Harag
  • 1,532
  • 4
  • 19
  • 31

1 Answers1

3

You can try this approach:

  • select your setup project in Solution Explorer
  • click Launch Conditions editor button at the top of Solution Explorer
  • add a new registry search and configure it to search for your registry entry
  • set the search property to something meaningful, for example SUMMARY_FOLDER_REG (only uppercase letters so its a public property)
  • in the Registry Editor select your registry value
  • in its Properties pane set the Condition field to the negated search property:

    NOT SUMMARY_FOLDER_REG

This way the registry entry is installed only if the search doesn't find anything.

Cosmin
  • 21,216
  • 5
  • 45
  • 60
  • Thanks, the "SummaryFolder" reg entry is in: HKCU\Software\[Manufacturer]\[ProductName] - What do I set the RegKey and the value to in the Launch Conditions properties window? – Harag Sep 13 '11 at 17:23
  • Ignore the above comment, I've had a play around and it seems to work - I put "Software\[Manufacturer]\[ProductName]" in the regkey and the "SummaryFolder" into the value property. – Harag Sep 13 '11 at 18:16