Hi,
This may happens if Windows Installer uses a function like
RegCloseKey to close a key after it was changed, in this case registry changes are flushed to disk when the registry uses its lazy flusher. Lazy flushing occurs automatically and regularly after a system-specified time interval.
"The
RegCloseKey function does not necessarily write information to the registry before returning; it can take as much as several seconds for the cache to be flushed to the hard disk. If an application must explicitly write registry information to the hard disk, it can use the
RegFlushKey function.
RegFlushKey , however, uses many system resources and should be called only when necessary.
RegFlushKey should only be called explicitly when an application must guarantee that registry changes are persisted to disk immediately after modification."
In your scenario
WriteRegistryValues standard action, writes registry values into registry and from there it's lazy flusher work to flush this on hard disk, while your installation arrives to your custom action. A solution for this problem is to flush explicitly the registry key before trying to open it.
You can do this by using
in your custom action where
hKey is a opened key or any of the following predefined key:
Code: Select all
HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, HKEY_LOCAL_MACHINE, HKEY_USERS
If there is anything else I can help you with, please let me know.
Best regards,
Dan
FOLLOW US
Get the latest news in Application Packaging