Archive: accessing registry under Vista


accessing registry under Vista
Howdy

I'm writing an updater to download data files in background while my game is running. Updater is working as admin using:

RequestExecutionLevel admin

Updater first runs game exe with:

Exec '"$INSTDIR\${GAME_EXEC_DIR}\${GAME_EXEC}" "${GAME_RUN_PARAM}"'

then starts downloads and during download it writes to HKLM registry information about finished files, something like that:

!define REGKEY_VER_PROGRESS "Software\${COMPANY}\${PRODUCT_NAME}\.Progress"

WriteRegStr HKLM "${REGKEY_VER_PROGRESS}" $fileGameID "1"

To my surprise, my game can't see or read registry strings created by Updater. I can see them in regedit, but my game can not? Worse if for test purpose my game writes/creates string with existing but invisible name, in regedit i can see that there are two values with the same name? What is going on? I'm sure that has something to do with Vista, but how to combat this?
That's what I want in short:
run updater as an admin to may change files in "Program Files" and at the same time create string visible from my game running with user privileges.
What should I do?

Greets
Rafał


Do both the installer and the game have a Vista manifest? It sounds like you get redirected to another hive, though I can't remember any compatibility tweak that'd do this for HKLM. Make sure both the game and the installer run with the same "vista tweak mode" by giving them both manifests.


You might find more suprises with Vista and the registry and also files in certain folders like "Program Files". Vista has introduced symbolic links on both the file system and registry. If a particular user updates an installed program only that user can see the updates.

It may be that if your user is not an admin and the updater runs as an admin, the game (running under the user account) won't be able to see the registry (and maybe file) edits that were made by an admin.

Try running the game as admin, then running your update process and see if the game can see the registry edits then. If so you know it's vista's new symbolic link/account permission feature that is preventing the user account from seeing the admin edits.


Thanks for answers.
I'm using old Visual C++ 6.0 and as far as I know it's not supplied with any manifest tools. Someone maybe knows where can I get one?
I'm quite confused (and tired) with unpredictable(at least for me) Vista behaviours. But unfortunately need my app working under Vista too.
I was wondering about using some *.ini to keep informations about updates. That's because my game has free read access to files in "Program Files" even these written by Updater. I will investigate this idea further but looks like one worth a try.

Thanks again, I must say that I like convenience and simplicity of NSIS very much, too bad that it's still not quite "Vista ready". Actually I think that fault is rather on Microsoft's side and plain stupid idea of common registry file - a thing visibly not prepared for real multiuser system.

Greets Rafał