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

Patch unexpectedly resets registry values


6 replies to this topic

ColSnell

ColSnell
  • Members
  • 11 posts

Posted 06 July 2004 - 15:24

I've created a patch for our product and when applied it resets a number of registry string values that were created using [INSTALLDIR]\path as the value.

These are correctly populated with the path the software is installed to on installation.

When a patch is applied, these are reset to the default value of INSTALLDIR, regardless of where the product was originally installed.

The registry keys are not part of the patch.
eg Initial installation to D:\MyProduct, registry key HKLM\Software\MyProd\ExePath = D:\MyProduct\Exe

After patching the key value is :
C:\Program Files\MyProduct\Exe

Is this a Windows Installer problem, a problem with the way INSTALLDIR is used or a problem with our installer / patch?

Any help appreciated.


Colin Snelling

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 06 July 2004 - 15:32

I believe this happens if you use a minor upgrade, and this is a "by design" feature of windows installer (always reset the value for registry values written by components). I think the advice usually given is to separate the components that write registry keys into a separate feature. This feature is then excluded from the REINSTALL property during a minor upgrade. This will prevent the feature from being reinstalled, and hence the registry keys are not reset.

If you already have setups out with customers, this does not help you. I don't know of any elegant solutions. Maybe you can rename the registry key to a temporary value, delete the value the upgrade inserts and then change the name back to the real name for the backup registry key. Stefan probably has a nicer solution. Finally, it is also possible to call regedit.exe with the /e command line and export the registry section to a *.reg file and then import it again at the end of the install. I posted a description of how to do this on this board some time ago, please do a search for it if you want to try it (if regedit.exe is not available this method will obviously fail).

Edited by Glytzhkof, 06 July 2004 - 15:34.

Regards
-Stein Åsmul

ColSnell

ColSnell
  • Members
  • 11 posts

Posted 06 July 2004 - 15:38

Thank you (especially for such a prompt response).

I think it's something to consider for the future and the next major upgrade. It's only a problem if the product is installed to a non default location.

I may well use the regedit solution as a work around though.
Colin Snelling

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 06 July 2004 - 15:47

Are you using a minor upgrade or a major upgrade? If you use a major upgrade this shouldn't happen as far as I can tell. At least if you specify to uninstall the existing installation after having installed the new version.
Regards
-Stein Åsmul

ColSnell

ColSnell
  • Members
  • 11 posts

Posted 06 July 2004 - 15:48

You were correct in your original assumption, this is a minor upgrade using a patch file.
Colin Snelling

Zweitze

Zweitze
  • Full Members
  • 522 posts

Posted 07 July 2004 - 08:50

Note that a somewhat related problem occurs in major upgrades: the INSTALLDIR of the older installation is not persisted. The result will be that the user has to set the installdir again.
To initialize INSTALLDIR properly, you'll need a CA that tries to read INSTALLDIR (and other directories, if that is the case) from the previous install.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 07 July 2004 - 09:22

True, and reading the previous installation dir is particularly important if you use major upgrade patches. I do think Installshield 8 and upwards persists the INSTALLDIR somewhere in the registry (think it is in the ARP settings), but I generally just write the installation directory to HKLM to have easy access to it. Remember to read the value in both the user interface and execute sequence to ensure proper operation in silent installation mode.
Regards
-Stein Åsmul