Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

How do I prevent registry keys being overwritten


3 replies to this topic

vincent.magallona

vincent.magallona
  • Members
  • 3 posts

Posted 27 May 2003 - 15:58

I'm a newbie at this and I'm currently using Installshield Developer 8.0.

Perhaps I'm not using the developer or the technologies as intended but as far as I can ascertain a minor upgrade or a patch to an installation will reinstall or reinitialise my registry keys back to their default values.

In the case of the installers I am working on, registry keys are installed by the setup.exe but their values are set post installation by a configuration program. We've used this technique to ensure that all registry keys are removed upon uninstallation...which is fair.

However, when performing a minor upgrade or applying a patch the registry keys that were set by the configuration program are overwritten and set back to default thus breaking the system.

Is there a way of not wiping the registry like this when performing minor upgrades or applying patches?

Thanks in advance for any help

GuySmiley

GuySmiley
  • Members
  • 14 posts

Posted 27 May 2003 - 20:20

Hi Vincent.. I think you can accomplish it by using a combination of the AppSearch, RegLocator, and Property tables.

First of all, don't write the values explicitly in the Registry table, instead write a property value. eg: set Value="[TESTPROPERTY]" .. this syntax will replace the string with the value of that property at runtime.

Next insert your default value for TESTPROPERTY into the Property table.

Finally, add a RegLocator entry for that registry value and use the AppSearch table to associate it with TESTPROPERTY.

properties are initialized in the following order 1) command-line value, 2) Property table value 3) AppSearch value
so now when you run it, assuming the user doesn't initialize TESTPROPERTY from the command-line, the installer will initialize it to the default value you gave it in the Property table. Then when the AppSearch action is executed the installer will look in the registry for the value.. if it exists it will overwrite the value of TESTPROPERTY, otherwise TESTPROPERTY will not be changed. Then when WriteRegistryValues is executed, the registry value will be set at the default value if the registry entry was missing, and otherwise will preserve its previous value.

Note that you may have to create some custom actions to initialize TESTPROPERTY to some execution-dependant value. These actions should be conditioned with TESTPROPERTY=""

Also note that you can remove registry settings on uninstallation that weren't installed by the installer by using the RemoveRegistry table.

Hope this helps..
gs

kranzf

kranzf
  • Members
  • 1 posts

Posted 27 August 2003 - 11:01

This looks like a lot of work if you have a lot of user settings to prevent being rewritten during an upgrade! Does anyone know if MSI3.0 will have some function to (maybe a reinstallmode switch?) not overwrite settings if they exist but different to the upgrade. MSI3.0 patches look like they will only action the specific things authored into them (instead of triggering reinstall as under 2.0) but will this extend to upgrade MSIs only actioning the things that have changed in the upgrade?

vincent.magallona

vincent.magallona
  • Members
  • 3 posts

Posted 27 August 2003 - 11:08

Hey,

I ended up writing a script to copy an entire key and then restore it once installshield had finished reinstalling the files and after it had rewritten the registry.