The easiest way to install Programmer Dvorak on a Windows 11 installation is by using WinGet. This document will describe the process of installing the keyboard layout this way.

1. Launch an administrative PowerShell command-line

  1. Press and release the Windows button to activate the Start menu.
  2. Type "PowerShell" into the search bar.
  3. Ensure that the search actually found the program called Windows PowerShell and that it is now the selected one; otherwise use the Down arrow key until you have selected that one.
  4. Press Shift-F10 to activate the context menu.
  5. Select "Run as administrator" from the context menu and press Enter
  6. Acknowledge that the program can make changes to you computer by pressing the button labeled Yes

2. Remove previous versions

Versions 1.2.8 or older of the layout must be removed from the computer before a version newer than this is installed. The new installer is not capable of upgrading versions older than this, so if they are not removed, you'll end up with two (slightly different) versions of the layout.

If you are sure that you don't have any old versions installed, this step may be skipped. Otherwise, paste the following script into the PowerShell command terminal that was opened in the previous step:

$keyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\kbddvp"
if (Test-Path -Path $keyPath) {
  $key = Get-Item -Path $keyPath
  $uninst = $key.GetValue("UninstallString")
  if ($uninst) {
    Start-Process -Verb RunAs -FilePath ${env:SystemRoot}\System32\cmd.exe `
      -ArgumentList "/c", $uninst
  }
}

3. Ensure that WinGet is at the newest version

Before installation get begin, the WinGet program must be up to date. If you have used WinGet recently, this step can be skipped, otherwise run the commands below:

Install-Module Microsoft.WinGet.Client -Scope AllUsers -Force
Repair-WinGetPackageManager -AllUsers -Latest

4. Install the keyboard layout system-wide

Enter the following commands into the terminal window to install the layout on the system. Please note that the first command saves the current timestamp in an environment variable that can be used in the same terminal window later for troubleshooting.

$tstamp = Get-Date -Format "yyyy-MM-dd-HH-mm"
Install-WinGetPackage -Id KaufmannNO.ProgrammerDvorak -Scope System -Source WinGet

5. Activate the layout for the current user

A keyboard layout is inherently installed in a system scope and made available to all users on Windows, but it must be activated individually for each user afterwards.

You may use the script below to activate the keyboard layout for the current user. In constrast to the other commands here, these does not have to be entered in an administrative shell, but can be submitted to a regular PowerShell terminal.

$cult = Get-Culture
$keyb = "19360409"
$list = Get-WinUserLanguageList
$item = $list | Where-Object { $cult.Name -match $_.LanguageTag }
$item.InputMethodTips.Clear()
$item.InputMethodTips.Add(("{0:X4}:{1:S}" -f $cult.LCID, $keyb))
Set-WinUserLanguageList $list -Force

A. Troubleshooting

WinGet keeps its log-files in a directory underneath the user profile. Use the commands below to locate this directory and print its content from the around when the installer was started.

$diagDir = Join-Path (Get-WinGetSetting | `
  Select-Object -ExpandProperty userSettingsFile | `
  Split-Path -Parent) "DiagOutputDir"
Get-ChildItem -Path $diagDir -Filter "*${tstamp}*"

B. Deactivating the layout

To deactivate the layout and restore the default keyboard for your current language, follow the procedure in the activation section, except replace the line:

$keyb = "19360409"

with:

$keyb = "0000{0:X4}" -f $cult.LCID

instead.

C. Uninstall the layout

To completely remove the layout from your system, use the command below. Note that you should make another keyboard layout active before removing the current one, or your keyboard will be unusable until you have selected another.

Uninstall-WinGetPackage -Id KaufmannNO.ProgrammerDvorak