[DUG] registry caching?
Ross Levis
ross at stationplaylist.com
Thu Aug 27 22:31:03 NZST 2009
I hope someone can help.
I have an app where the installer sets an XP compatibility mode registry
entry during installation. Don't ask why but it is generally required.
As the app loads after installation, it checks some hardware requirements to
see if XP compatibility mode needs to be switched off. If so, the registry
entry is deleted and the program then needs to be restarted, which I want to
do automatically.
I have a helper app which I load just before terminating the main app. The
helper app then reloads the main app after a 2 second sleep.
However, the result is that the program is still loading in compatibility
mode even though the registry entry is deleted well before it loads.
I have LazyWrite disabled on the registry change, so it is instantly
updated. I tried a massive 15 second sleep in the helper app, so the main
app is closed for 15 seconds before reloading, yet it still loads as if the
registry entry is still there.
If I terminate the app and load it manually, then it's always correct! I
don't understand this. Why would loading the app manually be any different
to loading it from another app?
I'm using CreateProcess with CREATE_NEW_PROCESS_GROUP to load the helper app
and to load the main app again. I tried ShellExecute with no difference.
Is there some way to make this work automatically?
The only method I can adopt at this stage is to popup a message to ask the
user to load the program manually, which is not user friendly.
Many thanks,
Ross.
More information about the Delphi
mailing list