Working with Write Registry for HKLM.

Got a problem you cannot solve? Try here.
wxperson99
Posts: 62
Joined: Sun Jul 13, 2014 3:28 pm

Working with Write Registry for HKLM.

Postby wxperson99 » Wed Mar 16, 2022 1:36 pm

HI...

I wanted to control the "highdpiaware" compatibility settings in the registry for the local user and got it to work with the following code.

Write Registry Key HKCU\Software\Microsoft\WindowsNT\CurrentVersion\AppCompatFlags\Layers\$TARGETDIR$\obsman.exe, ~ HIGHDPIAWARE

~InstallAware Clipboard Data~
~Write Registry~
~{4C7FD145-0CC4-46C3-948D-D0414A75E839}~
~0~
~1|~
~Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers~
~C:\Program Files (x86)\pcwp\adv2022\obsman.exe~
~~ HIGHDPIAWARE~
~TRUE~
~FALSE~

Now I am trying to do the same for ALL users so I tried by writing to the HKLM registry using the following...

Write Registry Key HKLM\Software\Microsoft\WindowsNT\CurrentVersion\AppCompatFlags\Layers\$TARGETDIR$\obsman.exe, ~ HIGHDPIAWARE

~InstallAware Clipboard Data~
~Write Registry~
~{7BA08583-2C7D-4997-A12B-6B8DB0578AC0}~
~0~
~2|~
~Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers~
~$TARGETDIR$\obsman.exe~
~~ HIGHDPIAWARE~
~TRUE~
~FALSE~

THE Problem is that it does not update the "correct" location but rather updates the settings in the registry under a WOW6432Node folder.

i.e.

Computer\HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

which is NOT the correct location and does NOT affect the highdpiaware setting for the executable referenced.

BTW... if I manually change the compat setting for all users .... it does show up in the NON WOW6432Node folder.

Does anyone have any ideas on why this would occur and how I can fix it to write to the correct NON WOW6432Node location??

Thanks,

George

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Working with Write Registry for HKLM.

Postby FrancescoT » Thu Mar 17, 2022 1:02 pm

Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: Google [Bot] and 36 guests