Add a macOS/Linux installer, and manual install steps

install.ps1 could never have worked outside Windows: it reads
%APPDATA% for the resource path, guards on Get-Process, and needs
PowerShell installed. install.sh mirrors it exactly -- same actions,
same key table, same idempotent rewrite and backup -- differing only
in resource-path discovery and --real-control, which exists because
modifier bit 8 means Ctrl on Windows but Command on macOS.

Also document installing by hand from the action list, for anyone who
would rather not run either script.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
2026-08-14 22:14:33 +02:00
co-authored by Claude Opus 5
parent b256bbdead
commit 2fe9fa75b2
3 changed files with 286 additions and 13 deletions
+13 -5
View File
@@ -14,8 +14,10 @@ when behaviour changes.
```
lua test_lib.lua # run the tests
powershell -ExecutionPolicy Bypass -File install.ps1 # install (REAPER must be CLOSED)
powershell -ExecutionPolicy Bypass -File install.ps1 # install on Windows (REAPER must be CLOSED)
powershell -ExecutionPolicy Bypass -File install.ps1 -Uninstall
./install.sh # install on macOS/Linux
./install.sh --uninstall
```
There is no build, no lint, no package manager, no test framework. `test_lib.lua`
@@ -67,11 +69,17 @@ and friends), not raw ticks, so edits stay correct across tempo changes.
## Installation model
`install.ps1` edits `reaper-kb.ini` directly and is idempotent (it strips all
`RSmidigrid` lines first, and backs up to `reaper-kb.ini.midigrid-backup`).
REAPER rewrites that file on exit, so it must be closed or changes are lost.
`install.ps1` (Windows) and `install.sh` (macOS/Linux) edit `reaper-kb.ini`
directly and are idempotent (they strip all `RSmidigrid` lines first, and back
up to `reaper-kb.ini.midigrid-backup`). REAPER rewrites that file on exit, so
it must be closed or changes are lost. The two scripts are deliberate mirrors:
same action list, same key table, same output. **Any change to one must be made
to the other.** They differ only in resource-path discovery
(`%APPDATA%\REAPER` vs `~/Library/Application Support/REAPER`) and in
`install.sh --real-control`, which exists because modifier bit 8 means Ctrl on
Windows but Command on macOS (physical Control is bit 32).
Adding a new action means adding a row to **both** tables in `install.ps1`: the
Adding a new action means adding a row to **both** tables in each installer: the
`$actions` table (`SCR 4 <section> <id> "<description>" <path>`) and, if it needs
a key, `$keys` (flags: 1 base, +4 Shift, +8 Ctrl, +16 Alt; section 0 = Main,
32060 = MIDI Editor). `KEY` lines must reference the named command — the SCR id