Skip to content

Commit

Permalink
Developer Install docs update
Browse files Browse the repository at this point in the history
  • Loading branch information
Psychlist1972 committed Feb 28, 2025
1 parent bd78807 commit 7f663d4
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 20 deletions.
Binary file added docs/developer-how-to/developer-prep-settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 66 additions & 20 deletions docs/developer-how-to/how-to-install-development-builds.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,43 +13,81 @@ Windows MIDI Services has been designed from the start to be expandible with new

If you are a regular musician, we generally recommend you stick with what is installed in-box in Windows. If, however, you are technically astute, and safe in your computer practices, you can unlock Windows MIDI Services to enable in-development service plugins to be installed, and service settings to be changed.

> Note: The steps in this file will eventually be replaced by developer-mode settings in the MIDI Settings app.
## Required: Uninstall any previous developer packages

## Enable developer mode
In Settings > Apps > Installed Apps uninstall any previously installed developer packages for Windows MIDI Services.

In Windows Settings, you must enable developer mode. System > For Developers >
## Required: Turn on Developer Mode in Windows

## Install PowerShell 7
Normally, the service will checked for signed binaries before loading them. If you install the service and then run an application, you will not see any endpoints because no transports have been loaded.

The scripts require PowerShell 7 or newer. You can install PowerShell [following these instructions](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows).
If Developer Mode is turned on in settings, the service skips the check for signing and loads the binaries.

After installing PowerShell, you need to enable script execution in the Windows Settings app: Settings > System > For Developers > PowerShell.
Settings > System > For developers > Developer Mode

![Enable PowerShell Scripts in Settings](.\enable-powershell-scripts.png)
![Developer Mode](.\settings-developer-mode.png)

# Easiest Way: Use the MIDI Settings App

The easiest way to set up your PC to use developer builds is to use the MIDI Settings app. This is a new feature added on February 28, 2025 and is in testing.

## Install the SDK Runtime and Tools

First, install the SDK and Tools installer, without installing the service installer. This will install the MIDI Settings app.

## Run the MIDI Settings app as Administrator

Next, run the MIDI Settings app **as Administrator**. Depending upon what is already on your system, it may tell you there's no service present. That is fine.

Because you previously enabled developer mode, you will see a **For Developers** page in the app. You will also see "Developer Mode Enabled".

Because you have run this as Administrator, you will see "Administrator" in the title bar, and the buttons under "Install Developer Preview Releases" will be enabled.

![Developer Prep Settings](.\developer-prep-settings.png)

## Prepare for Developer install

Click the button that says "Prepare for Developer Install"

## Run the Service and components installer

## Take Ownership of the Registry Keys
When that succeeds, you may run the installer for the Service and components.

When Windows MIDI Services is included with the in-box install of Windows, the registry keys for the transport plugins and other MIDI Services settings are all protected, and owned by Trusted Installer. This helps prevent malicious apps from adding entries and loading any arbitrary code into the service.
## Replace wdmaud2

Developers and those using preview versions of plugins, however, need to be able to write to those keys to add new transports, or change developer settings.
After the Service and components installer completes, unzip the `wdmaud2` zip file for your processor architecture (Arm64 or x64) to a known location on your PC.

Each developer release comes with a zip file with two PowerShell scripts and two .cmd files which launch them. The first lists the registry entries for for all the COM components used by the service, as well as the service itself. The second, when run as administrator, will take ownership of the relevant keys allowing the values to be replaced with development versions of components. We recommend this be done only by developers and other more technical users.
Then click the "Replace wdmaud2.drv ... " button on the developer page.

Run the two .cmd files from a normal developer command prompt (cmd, not PowerShell), as Administator as follows.
## Reboot

### List Registry State
After the wdmaud2.drv replacement has completed, reboot your PC.


# Command-line Way: Use PowerShell Scripts

## Required: Install PowerShell 7+

The scripts require PowerShell 7 or newer. You can install PowerShell [following these instructions](https://learn.microsoft.com/powershell/scripting/install/installing-powershell-on-windows).

After installing PowerShell, you need to enable script execution in the Windows Settings app: Settings > System > For Developers > PowerShell.

![Enable PowerShell Scripts in Settings](.\enable-powershell-scripts.png)


## Optional: List Registry State

First, run `list-reg.cmd` to see the current registry values. In-box services and components are all installed in `\Windows\System32`. The pre-release versions of those components are installed in `\Program Files\Windows MIDI Services`

```
c:\foo\bar> list-reg.cmd
c:\path\to\utilities\in\zip> list-reg.cmd
```

![Before](.\list-reg-before.png)

You can see in this that we have the stock plugins listed as running from `System32`, and no entry for the Network MIDI 2.0 plugin. This is expected for the time when I wrote this article, as Network MIDI 2.0 is/was an in-development preview plugin, not an in-box plugin.

### Prepare for a Developer Install
## Required: Prepare for a Developer Install

After validating your current state is the in-box state (this is reverted to this state with each Windows Upgrade, including Insider Builds, as well as with any Windows MIDI Services update), you'll next want to take ownership of the keys.

Expand All @@ -59,11 +97,11 @@ Run the `dev-prep.cmd` file from an Administrator command prompt (again, a regul

If you see any errors in the output, stop at this point and investigate. Otherwise, the installers will appear to run fine, but if they do not have permissions to write to the correct registry keys, you won't be using the components you just installed.

## Install the Developer Packages
## Required: Install the Developer Packages

Now you may install all of the developer packages via their installers.
Now you may install all of the developer packages from the release via their installers.

## Verify the Installation
## Recommended: Verify the Installation

Finally, run the `list-reg.cmd` file again to verify that everything is installed in the new locations.

Expand All @@ -77,6 +115,14 @@ In some cases, you may want to leave the existing service, but install only a pr
## wdmaud2.drv the WinMM bridge to Windows MIDI Services

The WinMM compatibility component, `wdmaud2.drv`, is a system-protected file under Windows 11 Resource Protection (WRP). It is possible to take ownership of it using the `takeown` command, but if you replace it, WRP will kick in and put the official version back in place. The mechanisms used to bypass Windows File Protection (WFP) with older versions of Windows do not necessarily apply here.
Current releases include separate Arm64 and x64 wdmaudi2.drv zip files, with the driver itself as well as a PowerShell script to replace the existing in-box version.

Installing this requires that you are running a Windows Insider Canary build that includes wdmaud2.drv already, and that you are a local Administrator on the PC. You can go through this process at any point, but it's typically run *after* you have already installed the rest of the packages for the release.

1. Unzip the wdmaud2 zip file for your architecture. Then open an Administrator command prompt in the directory which includes the `wdmaud2.drv` file from the zip.
2. Run `dev-replace-wdmaud2.cmd` from that command prompt
3. Reboot, and then WinMM support will be in place

## When to do these steps

[Learn more about Windows Resource Protection](https://learn.microsoft.com/windows/win32/wfp/about-windows-file-protection)
Each time you have an OS upgrade (not update, but upgrade) from one version of Canary to another, you will need to repeat the above steps.
Binary file added docs/developer-how-to/settings-developer-mode.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7f663d4

Please sign in to comment.