Old 20th September 2010, 00:55   #1
nsnb
Senior Member
 
Join Date: Jul 2008
Posts: 157
Question 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
code:
${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.
nsnb is offline   Reply With Quote
Old 20th September 2010, 07:29   #2
manasi1128
Junior Member
 
Join Date: Sep 2010
Posts: 19
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}
manasi1128 is offline   Reply With Quote
Old 20th September 2010, 08:23   #3
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
It won't do anything on a 32-bit system.

Stu
Afrow UK is offline   Reply With Quote
Old 20th September 2010, 15:44   #4
nsnb
Senior Member
 
Join Date: Jul 2008
Posts: 157
Question

Quote:
Originally Posted by manasi1128 View Post
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.

Quote:
Originally Posted by Afrow UK View Post
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.
nsnb is offline   Reply With Quote
Old 20th September 2010, 16:58   #5
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Old 20th September 2010, 17:49   #6
nsnb
Senior Member
 
Join Date: Jul 2008
Posts: 157
Lightbulb

Quote:
Originally Posted by Afrow UK View Post
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).
nsnb is offline   Reply With Quote
Old 20th September 2010, 18:18   #7
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
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
Afrow UK is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump