Archive: What does SetRegView do on a 32-bit system?


What does SetRegView do on a 32-bit system?
I know what SetRegView does on a 64-bit system - it is well documented: http://nsis.sourceforge.net/Docs/Chapter4.html#4.9.7

But what does it do on a 32-bit system? Is it a NOOP?

or does it produce unpredictable results and mandates a clause like

${If} ${RunningX64}   
SetRegView 32
${EndIf}


Also, does SetRegView affect any (or all) of the functions in the Registry plug-in? http://nsis.sourceforge.net/Registry_plug-in

Thanks.

I hav used setregview for 64 bit compatible installer.....
n dere is no need for using SetRegView 32 on 32 bit system.......it is only applicable for 64 bit systems.
setregview 32 directs ur registry entries to 32 bit registry(i.e wow6432node...(not sure of the exact word.)) on a 64 bit system while setregview 64 directs ur entries to 64 bit registries.... as u might be aware dat dere are 2 branches of registries on 64 bit system...one for 64 bit and one for 32 bit....

${If} ${RunningX64}
SetRegView 32 -------------->change this to setregview 64 if u r making an installer for
64 bit
${EndIf}


It won't do anything on a 32-bit system.

Stu


Originally posted by manasi1128
there is no need for using SetRegView 32 on 32 bit system...
I know that, but I am writing a single script for both 32-bit and 64-bit systems and I would like to consult the gurus whether an '${If} ${RunningX64}' is necessary.

Originally posted by Afrow UK
It won't do anything on a 32-bit system.
Thanks, so I understand this is by design (just like a macro that evaluates to whitespace when a condition is not met). Do I understand correctly?

Also, do you happen to know whether it affects any of the functions in Registry plug-in? http://nsis.sourceforge.net/Registry_plug-in

Empirically, I know what it does on my system but it's good to get the formal intended behavior by the developers/gurus (and could be helpful for others visiting the forum).

Cheers. :)

SetRegView simply adds or removes the KEY_WOW64_64KEY flag to the desired SAM access to be used when NSIS calls the RegCreateKeyEx, RegOpenKeyEx etc API's. As this flag was added on XP x64 it will simply be ignored on older OS's or 32-bit OS's. For NSIS plug-ins, the extra_parameters->g_exec_flags->alter_reg_view field will be set to KEY_WOW64_64KEY if the calling script used SetRegView 64. The plug-in would need to use this field accordingly. I do not know if the Registry plug-in does this, but if not it needs to be modified to do so.

Stu


Originally posted by Afrow UK
SetRegView simply adds or removes the KEY_WOW64_64KEY flag to the desired SAM access to be used when NSIS calls the RegCreateKeyEx, RegOpenKeyEx etc API's. As this flag was added on XP x64 it will simply be ignored on older OS's or 32-bit OS's. For NSIS plug-ins, the extra_parameters->g_exec_flags->alter_reg_view field will be set to KEY_WOW64_64KEY if the calling script used SetRegView 64. The plug-in would need to use this field accordingly. I do not know if the Registry plug-in does this, but if not it needs to be modified to do so.
This is incredible information. Thanks so much!

I happened to be enhancing the Registry plug-in back then, so I can tell you that it doesn't access extra_parameters->g_exec_flags->alter_reg_view in any way. Still, for some reason, the Registry plug-in seems to be working fine for me on both 64-bit and 32-bit systems (without any modification).

It will work, sure, but I'm pretty sure registry access will always be redirected from e.g. HKEY_LOCAL_MACHINE\SOFTWARE to HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node unless KEY_WOW64_64KEY is used.

Stu