Repairing Registry Settings

One of the most common things you'll find yourself doing with a Windows Installer-based application's registry settings is repairing them. The most common scenario is when a user's settings are so out of whack that the only choice is to restore them to their original values. This goes for computer settings, too. After the helpdesk call has exceeded a reasonable amount of time, the technician can put a quick end to the call by repairing the application. The most straightforward ways to repair a Windows Installer-based application are in the user interface:

  • On the application's Help menu, click Detect And Repair.

  • In Add Or Remove Programs, select the application you want to repair, click Change, and then follow the directions you see on the screen.

Some applications don't provide a user interface for repairing them, so you must use the command line. The syntax of the command you use to repair an application follows this paragraph. The variable package is the path and name of the package file from which you installed the application. To repair user settings, type msiexec /fu package. To repair computer settings, type msiexec /fm package. The command msiexec /fmu package gets them both at the same time. These commands work rather well, which you can witness for yourself. Install Office XP. Remove its settings from the registry, which are in HKCU \Software\Microsoft\Office, and then repair user settings. Windows Installer rebuilds the missing settings.

 msiexec /f[p|o|e|d|c|a|u|m|v|s] package 

p

Reinstall missing files but don't check version

o

Reinstall missing files or files that are from an earlier version

e

Reinstall missing files or files that are from the same or earlier version

d

Reinstall missing files or files that aren't from the same version

c

Reinstall missing files or files that are corrupt. This option repairs only files that have a checksum in the package file.

a

Reinstall all files regardless of their versions or checksums

u

Rewrite the essential registry values described in the package file. This includes values in the per-user branches HKU and HKCU.

m

Rewrite essential registry values described in the package file. This includes values in the per-computer branches HKLM and HKCR.

s

Reinstall all shortcuts and overwrite existing icons.

v

Recache the source package locally.

Note 

Repairing an application using Windows Installer is a bit extreme considering that you have System Restore at your disposal. Chapter 3, "Backing Up the Registry," describes how to use this awesome feature to protect configurations. If users' settings get out of whack, going back to an earlier restore point will likely fix the problem. IT professionals can easily script this operation, too, which enables the helpdesk to automatically go back to the most recent restore point.



Microsoft Windows XP Registry Guide
Microsoft Windows XP Registry Guide (Bpg-Other)
ISBN: 0735617880
EAN: 2147483647
Year: 2005
Pages: 185

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net