John P.
8th August 2005 18:18 UTC
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. :)
John P.
8th August 2005 20:47 UTC
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)?
Yathosho
8th August 2005 21:01 UTC
it works when using ReadRegStr
John P.
8th August 2005 21:12 UTC
[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?
Yathosho
8th August 2005 21:42 UTC
you can always check with a messagebox
MessageBox MB_OK "$INSTDIR"
John P.
8th August 2005 21:53 UTC
OK, thanks for helping me out; I'll try that. :)