Archive: Understanding SetRegView


Understanding SetRegView
Hi,

just to verify that I understood it correctly:

Since i use 32Bit NSIS, i got an 32BIT installer, which by default works in 32Bit "area".

#Windows 32Bit:
ReadRegStr HKLM Software\JavaSoft (e.g. for Java 32 Bit)

#Windows 64Bit:
ReadRegStr HKLM Software\JavaSoft (e.g. for Java 32 Bit)
#Got redirected -> thus the key is actually taken from:
#HKLM SOFTWARE\Wow6432Node\JavaSoft (e.g. for Java 32 Bit)


Is the following the same as above? (Should be :)
#Windows 32Bit:
SetRegView 32
ReadRegStr HKLM Software\JavaSoft (e.g. for Java 32 Bit)

#Windows 64Bit:
SetRegView 32
ReadRegStr HKLM Software\JavaSoft (e.g. for Java 32 Bit)


If i now want to check the 64 bit "area":
#Windows 64Bit:
SetRegView 64
ReadRegStr HKLM SOFTWARE\JavaSoft (e.g. for Java 64Bit)
#No rederection -> thus the key is taken from:
#HKLM SOFTWARE\JavaSoft (e.g. for Java 64 Bit)

Yes, all of the above is correct.

(Remember to reset regview to 32 after you're done with x64 registry.)


Highly appreciated your confirmation.

One last thing, I have read that:

SetRegView 64 


on a 32Bit system sometimes causes problems. Thus it has to be wrapped with

${If} ${RunningX64}
SetRegView 64
${EndIf}


But there shouldn't be a problem calling plain
SetRegView 32

on a 32Bit system, right?

Sure, but I find it highly unlikely that setregview 64 would cause problems on an x86 system.


Who said it would cause problems? It just sets an extra flag on the registry API call which older operating systems (i.e. non 64-bit) will just ignore (because they are not aware the flag exists). There is no need to wrap it in an ${If}.

Stu


I didn't say "impossible" because there could always be a very stupid bug in NSIS... But yeah, I doubt that very much.


Originally posted by MSG
I didn't say "impossible" because there could always be a very stupid bug in NSIS... But yeah, I doubt that very much.
It was in response to TeeWeTee rather than your post (I should have quoted) - I'm curious as to where he read that it can cause problems.

Stu

I was referring to the following post:

SetRegView and DeleteRegKey

You should only use SetRegView 64 on XP x64. Not all 32-bit versions of Windows support this flag and some might cause registry operations to fail, just like in your case.
But maybe I over interpreted it ;)

That's interesting and news to me. I've used SetRegView 64 on 32-bit XP for years with no issues so perhaps Microsoft fixed the issue with a service pack at some point.

Edit: Further research suggests that having the flag set will cause registry operations to fail on Windows 2000 - so now I would suggest wrapping it in an ${If} for the sake of compatibility with XP and 2000.

Stu