You are here

[Bug] PAL needs to be able to disable Wow6432Node redirection

19 posts / 0 new
Last post
Bennieboj
Bennieboj's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2010-09-16 07:28
[Bug] PAL needs to be able to disable Wow6432Node redirection

Hi all,

I have a problem with the registry.
I have a game that writes into install=HKLM\SOFTWARE\makername\gamename.
The backup and restoring using PAL all works on Windows 32 bit, but on a 64 bit it goes into HKLM\SOFTWARE\Wow6432Node\makername\gamename.
The game can't find it: errors, nothing works anymore.

So I thought to use custom code to disable redirection with "SetRegView 64".
I don't know if it works, since I don't know how to do the backuping, importing and restoring in NSIS, like PAL does.

That's the problem and what I tried so far.
Any help please?
Thanks in advance.

[Escalated to a bug report as it's very important missing functionality which needs to go in PAL 3.0 - mod Chris]

Bennieboj
Bennieboj's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2010-09-16 07:28
Thanks

Thanks for the update Chris!

Yes, I set the working directory!

CODYQX4
Offline
Last seen: 4 years 3 months ago
Joined: 2010-04-23 20:39
Perhaps something like the

Perhaps something like the following would work:

[RegistryKeys]
SomeKey1=HKCU\Software\SomeKey
SomeKey2=HKLM\Software\SomeKey2

[RegistryKeys:DisableWow6432Node]
SomeKey3=HKLM\Software\SomeKey3

The first case is how we do it now, the second is an example of how we could control things.

In a 64 Bit OS, SomeKey1 would not be redirected as HKCU typically isn't subject to redirection. SomeKey2 would be redirected.

SomeKey3 would have redirection disabled by the special section.

You would want to export all keys in 32 bit mode, as 64 bit mode would add Wow6432Node to the path in the file. You would import all keys in the first INI section using 32 bit mode, and use 64 bit mode to import the second entries.

What I mean by 32 bit mode is that if you have a reg file, and it goes to HKLM\SOFTWARE\AKey (no Wow6432Node in the file), if you import it with cmd.exe *32 (running under WOW64), it will be imported to HKLM\SOFTWARE\Wow6432Node\AKey. If you used the 64 bit CMD.exe, it would not be redirected.

Bennieboj
Bennieboj's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2010-09-16 07:28
Status?

What's the status on this?
I haven't heard anything about the development of PAL 3.0 for half a year. Is it possible for a mod to give a little bit more info?
Thanks in advance Wink

Yes, I set the working directory!

John T. Haller
John T. Haller's picture
Online
Last seen: 1 min 3 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Not Sure

I know Chris is quite busy. Aluisio may have more insight.

Side Note: This bug isn't affecting any potential releases, as a game would not be permitted to require admin rights.

Sometimes, the impossible can become possible, if you're awesome!

Bennieboj
Bennieboj's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2010-09-16 07:28
OK

Thanks for the fast response, I'll wait for Aluisio's response Smile

Yes, I set the working directory!

Bennieboj
Bennieboj's picture
Offline
Last seen: 4 years 8 months ago
Joined: 2010-09-16 07:28
Status again?

So it's 2014 now almost a year after I last asked about this bug.

As this is "very important missing functionality which needs to go in PAL 3.0", according to Chris, how is the status of PAL 3.0?
Is there still someone developing PAL 3.0?

Is the source code made publically available on, e.g. Github or Sourceforge? Users making pull requests should speed up the process quite a bit.

Yes, I set the working directory!

John T. Haller
John T. Haller's picture
Online
Last seen: 1 min 3 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Source

The source has always been available from SF and is linked directly from the PA.c Launcher page.

Chris is mostly busy with life and not working on PAL at present. Presently, no work is being done on PAL 3.0.

Until it is complete, you can manually use Custom Code to accomplish manual read/write/restore to the 64-bit HKLM and HKCU hives for 64-bit apps.

Sometimes, the impossible can become possible, if you're awesome!

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 months 6 days ago
DeveloperModerator
Joined: 2008-07-24 18:46
Implementing DisableRedirect sections

For those following this bug, I'm currently implementing DisableRedirect variants of the RegistryKeys, RegistryValueBackupDelete, RegistryValueWrite and both RegistryCleanup sections.

demon.devin
demon.devin's picture
Offline
Last seen: 3 years 7 months ago
Developer
Joined: 2007-08-02 09:04
A working method can be found

A working method can be found here:
https://github.com/demondevin/portableapps.comlauncher

daemon.devin

FukenGruven
FukenGruven's picture
Offline
Last seen: 9 years 10 months ago
Joined: 2011-01-29 02:15
not a bug

NSIS is a 32bit executable..

if you want to read/write in x64 registry..
use Custom code..

takes only a few lines..

set in .OnInit

ie.

!include x64.nsh

${SegmentFile}
${Segment.OnInit}
${If} ${RunningX64}
   SetRegView 64
   ${DisableX64FSRedirection}
${EndIf}
!macroend

if you want to use the launcher..
then use ReadINIStr or ${ReadLauncherConfig}

if you really don't want to use Custom Code
then you can edit the source to have your own custom Launcher sections..
so end-users don't have to deal with Custom code.

if you don't want to edit anything at all..
then redesign PAL with NSIS 3.0 x64 ..
it's been released.

I use PortableApps on my PC..

freemp
Offline
Last seen: 9 years 10 months ago
Joined: 2007-09-08 09:41
Tried that but it's not

Tried that but it's not working. ${RunningX64} is true but SetRegView 64 seems to be ignored. Registry values still go to ...\Wow6432node\...

FukenGruven
FukenGruven's picture
Offline
Last seen: 9 years 10 months ago
Joined: 2011-01-29 02:15
it's you

Google around for PortableApps sites and blogs..
there are tons of them..

download their sources and take a look ..
i have tons of x64 applications designed w/PAF..

I use PortableApps on my PC..

freemp
Offline
Last seen: 9 years 10 months ago
Joined: 2007-09-08 09:41
no, it's not me

it's the code that you published that's not working.

anyway, already found another workaround.

FukenGruven
FukenGruven's picture
Offline
Last seen: 9 years 10 months ago
Joined: 2011-01-29 02:15
Really? Teach me

what was the workaround?

can you show us?

I use PortableApps on my PC..

John T. Haller
John T. Haller's picture
Online
Last seen: 1 min 3 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
NSIS 3 major changes

While PAL is currently using a modified version of NSIS 2 we will be switching it to NSIS 3 in the near future. As of the NSIS 3.02 release, NSIS now has support for HKCR32, HKCR64, HKCU32, HKCU64, HKLM32 and HKLM64 registry root keys and no longer supports SetRegView. We'll need to consider how we implement this going forward carefully and possibly adapt our handling of .reg files to match.

Sometimes, the impossible can become possible, if you're awesome!

Gord Caswell
Gord Caswell's picture
Offline
Last seen: 4 months 6 days ago
DeveloperModerator
Joined: 2008-07-24 18:46
Possibly minimally affected

I don't think our handling will necessarily be affected much. We'll need to do some heavy testing, to be sure, however it looks like SetRegView is still supported, what's unsupported (and rightly so) is attempting to use an incompatible registry view - i.e. SetRegView64 when on x86.

I've made changes for fixing the redirect problem, but am going to review our registry handling overall with the 3.02 changes in mind.

John T. Haller
John T. Haller's picture
Online
Last seen: 1 min 3 sec ago
AdminDeveloperModeratorTranslator
Joined: 2005-11-28 22:21
Normal to Wow32 and Back

I was thinking we could have our registry handling bits do the appropriate 32 or 64 based on what kind of app mode we're running for any of the direct read/write commands. With .reg files, I think we'll need to look into whether we need to go to/from regular and wow32 depending on whether we're running the 32bit or 64bit version of the app for dual mode apps.

Sometimes, the impossible can become possible, if you're awesome!

WindyPigeon
Offline
Last seen: 1 year 9 months ago
Joined: 2021-05-23 05:26
About Registry plug-ins and SetRegView instruction

Hi Gord. Actually this bug come from Registry plug-ins. Registry plug-ins didn't provide an approach to handle this problem. SetRegView will only affect the NSIS built-in instructions (DeleteRegKey, DeleteRegValue, EnumRegKey, EnumRegValue, ReadRegDWORD, ReadRegStr, WriteRegBin, WriteRegDWORD, WriteRegStr and WriteRegExpandStr). The latest version of Registry plug-ins (4.1) is release in 2011, and probably no new version will be released for this old stuff.

If SetRegView is to be used, then functions from Registry plug-ins had to be replaced by built-in registry instructions, and functions to Move/Copy registry keys/values needs to be rewritten.

Of course, finding other alternatives to replace the Registry plug-ins would be a better solution.

Log in or register to post comments