Old 24th October 2011, 16:33   #1
raoulvolfoni
Junior Member
 
Join Date: Oct 2011
Posts: 2
Question SetRegView 32 doesn't seem to do what it's supposed to

Hi

I'm making an installer for a 32bit app installable on Windows XP 32bit and Seven 32 or 64bit.

Under a 64bit Windows Seven, this app needs to be run in "Windows XP SP3 compatibility mode" due to a third party lib problem.
Also, I run the installer in "admin" exec level (RequestExecutionLevel admin) because I write in the HKLM path.

So in my nsis script I added the following lines:
code:
SetRegView 32
WriteRegStr HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" $INSTDIR\MyApp.exe WINXPSP3
SetRegView 64


Which should avoid the Wow6432Node reflection and write directly into this specific key.
But in Windows Seven x64 it doesn't: it still writes in HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers.

Normally it shouldn't be a problem because, if I understand correctly, Windows should take care of the reflection. However, after installation, the compatibility mode for Windows XP SP3 isn't checked in MyApp.exe's properties.

What am I doing wrong ?
raoulvolfoni is offline   Reply With Quote
Old 24th October 2011, 16:44   #2
Afrow UK
Moderator
 
Afrow UK's Avatar
 
Join Date: Nov 2002
Location: Surrey, England
Posts: 8,434
You've got it the wrong way around. SetRegView 64 will ensure NSIS writes to the 64-bit registry (i.e. NOT Wow6432Node).

Stu
Afrow UK is offline   Reply With Quote
Old 25th October 2011, 06:35   #3
MSG
Major Dude
 
Join Date: Oct 2006
Posts: 1,892
To clarify: 32 bits applications should write to the Wow6432Node, NOT to native x64 registry. If you app is 64 bits however, then you can use setregview 64.


Also: "requestexecutionlevel admin" is not sufficient to enforce admin access. You also need to use the userinfo plugin to verify admin access in .onInit. (Reason being: requestexecutionlevel does nothing on WinXP, and also does nothing on win7 if UAC is turned off.)
MSG is offline   Reply With Quote
Old 25th October 2011, 08:50   #4
raoulvolfoni
Junior Member
 
Join Date: Oct 2011
Posts: 2
Thumbs up

Quote:
Originally Posted by Afrow UK View Post
You've got it the wrong way around. SetRegView 64 will ensure NSIS writes to the 64-bit registry (i.e. NOT Wow6432Node).

Stu
You're right, now it works as intended. I hadn't understood the principle of SetRegView.

Quote:
Originally Posted by MSG View Post
To clarify: 32 bits applications should write to the Wow6432Node, NOT to native x64 registry. If you app is 64 bits however, then you can use setregview 64.
The problem is that, although it's a 32bit app, when I set this value in the Wow6432Node it isn't taken into account and my app's compatibility isn't set to Windows XP SP3.

Quote:
Originally Posted by MSG View Post
Also: "requestexecutionlevel admin" is not sufficient to enforce admin access. You also need to use the userinfo plugin to verify admin access in .onInit. (Reason being: requestexecutionlevel does nothing on WinXP, and also does nothing on win7 if UAC is turned off.)
I'll be doing that.

Thanks a lot for your help !
raoulvolfoni 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