Archive: Change InstallDirRegKey?


Change InstallDirRegKey?
At the beginning of my script, I state what the InstallDirRegKey is.

I then can use that as $INSTDIR for most of the script(since the install dir can be different for each user).

But towards the middle of my script, I need to change the InstallDirRegKey to something else.

The reason is that it has to correspond to the location the user has already installed a certain program(game), and the user can have installed the game pretty much anywhere he wanted. The first InstallDirRegKey I state corresponds to one game install, but then I need to change it for the other game install.

How do I change the InstallDirRegKey "in the midddle of" the script?

Thanks. :)


Come to think of it, and maybe easier to understand, is that i need to change the value of $INSTDIR to another, specific registry key.

Something like:

StrCpy $INSTDIR HKLM "SOFTWARE\GameDeveloper\GameName\" "PC ROOT"


Would that work(with some adjustments probably)?


it works when using ReadRegStr


[edited] OK - sorry, I think I got it now.

All I have to do is:

ReadRegStr $INSTDIR HKLM ""SOFTWARE\GameDeveloper\GameName" "PC_ROOT"

Inside the Section, and it will work?

I have tried that now, and didn't get any errors when compiling. But does that mean that $INSTDIR is succefully changed to the new registry path?


you can always check with a messagebox

MessageBox MB_OK "$INSTDIR"


OK, thanks for helping me out; I'll try that. :)