Posted by gr.ind.can in SWF Studio V3 on Mar 15 2016, 08:30 am

Having a problem with changing value of a subkey of HKEY_LOCAL_MACHINE. When I update the value with ssCore.Registry.setValue it updates the value in WOW6432Node. I found that it happens when a 32bit app tries to change registry on 64bit system. Is there a way to redirect it to actual subkey instead of WOW6432Node?


Posted by gr.ind.can in SWF Studio V3 on Mar 15 2016, 09:45 am

I have tried "regwrite.exe" of forum thread #6441, but its also not working.


Posted by northcode in SWF Studio V3 on Mar 15 2016, 01:12 pm

The regwrite.exe utility is still a 32-bit app so the writes are affected by the automatic registry redirection that Windows performs. I need to add support for some flags to the registry functions that will allow you to target either the 32-bit or 64-bit registry as described in Accessing an Alternate Registry View.


Posted by gr.ind.can in SWF Studio V3 on Mar 16 2016, 06:59 am

I have tried executing a batch file through this application, but its still updating value in Wow6432Node key. Executing batch file normally updates at correct place.

Batch command I tried:

@echo off
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "test.exe" /f
pause


Posted by northcode in SWF Studio V3 on Mar 16 2016, 12:55 pm

Did you verify that just running your BAT file manually updates the correct part of the registry?

Did you use Shell.open or Shell.execute to launch the BAT file?

If you used Shell.execute then the BAT file will be a child of the parent process so it will still be running as a 32-bit process. If you use Shell.open, the child should run as a 64-bit process on a 64-bit machine.


Posted by gr.ind.can in SWF Studio V3 on Mar 17 2016, 01:48 am

I have verified that running the bat file manually is updating at correct place in registry. And Yes, I am using Shell.execute to run this bat file. I'll update my code to use Shell.open and will let you know the result.


Posted by gr.ind.can in SWF Studio V3 on Mar 17 2016, 02:41 am

Shell.execute and Shell.open both are making registry entry in same place (Wow6432Node). But adding " /reg:64" in bat command has resolved the issue. New bat command is:

@echo off
reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v Shell /t REG_SZ /d "abcd.exe" /f  <B>/reg:64</B>
pause


After updating the command, Shell.execute and Shell.open both are making entry in correct place. I have verified it on 64-bit and 32-bit both devices.