3

I created a custom keyboard layout with the Microsoft Keyboard Layouter Creator (MSKLC) tool and generated a "build package" which allows an easy installation. The installation of the keyboard layout requires administratior priviliges. It copies basically the generated .DLL file (which is part of the build result) to C:\windows\system32 and register it in the Windows Registry.

In my case I want to use the same keyboard layout on a system where I have limited priviliges. However I'm able to modify the Windows Registry.

So I tried the following (on a pc where I have administrator priviliges):

  1. Copy custom.dll to C:\custom.dll
  2. Change the path from an existing (already registered) keyboard layout to ..\..\custom.dll; for example: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Keyboard Layouts\0000100c; Layout File = ..\..\custom.dll
  3. Select the keyboard layout in the system settings for which the file path to his related DLL was modified (in this case the "Swiss French" layout).

It works! It didn't work. (at first I had the impression that it worked, but I must have mixed something up.). It seems the files must be located within C:\windows\system32 and can't be referenced with a relative path.

Basically I want to use the custom keyboard layout (DLL) but I cant use the generated deployment package since I have no priviliges to write files to C:\windows\system32. But I could modify the Windows Registry. Is there a way for me to still load this layout?

My OS: Windows 10 x64

1
  • I'm not sure to comprehend. If you could successfully copy it and install it in C:\custom\custom.dll - why not use this path? You wish to distribute this package, like to the public? That's a risky thing (you can brick systems) and I guess drivers/keyboard packages have strict guidelines for installation, including signature, etc.
    – Sylvain
    Feb 20, 2023 at 23:59

1 Answer 1

2

Microsoft already released an update for older Windows versions in 2012 that verifies that the keyboard layouts are contained in %Windir%\System32 and are not located somewhere else and referenced by relative paths.

See "MS12-034: Description of the security update for CVE-2012-0181 in Windows XP and Windows Server 2003: May 8, 2012"

How does this update work?

This update enumerates all the keyboard layout files that are registered on your computer, and then it verifies that they are all in the %Windir%\System32 folder.

Microsoft wants to make sure the keyboard layout files are in the right directory. If it's otherwise possible, it would be security bug. I can't find anything specific about this for Windows 10, but it can be assumed that the same logic applies here.

To answer my original question: It is not possible to register the keyboard layout without being able to copy the DLL file to %Windir%\System32.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .