Command line
Perch is a normal desktop app and does not need any of this to work. The flags exist for scripting an install, verifying a machine, and getting a useful answer out of a broken one.
Everything on this page is Windows. The macOS build parses no command-line arguments at all — not these, not any — so a script that passes one to it is passing it to something that will ignore it. The paths below are Windows paths for the same reason.
Flags#
| Flag | What it does |
|---|---|
| (none) | Starts normally |
--uninstall | Removes Perch, with a confirmation |
--uninstall --silent | Removes Perch with no window; writes a result file |
--selftest-mirror | Drives the whole capture path and writes a report |
The installer takes one of its own:
| Flag | What it does |
|---|---|
--silent | Installs with no window |
Uninstalling from a script#
"%LOCALAPPDATA%\Programs\Perch\Perch.exe" --uninstall --silentThis returns as soon as it has started, because the last step — deleting the folder the program is running from — is handed to a detached process that waits for Perch to exit first.
So do not read the exit code. Poll for the result file instead:
%TEMP%\perch-uninstall-done.txtIt appears only when the removal has finished and contains a line-by-line log of what was removed, including anything that could not be. That file is the difference between "it failed" and "it failed because".
The self-test#
"%LOCALAPPDATA%\Programs\Perch\Perch.exe" --selftest-mirrorLaunches a browser, opens a page that animates itself, captures it visible, covered and minimised, and forwards a scroll through the mirror to confirm input reaches the real page. The report lands in:
%LOCALAPPDATA%\Perch\selftest.txt
C:\Windows\Temp\perch-selftest.txtBoth are written; the second is there so a scheduled task running as another user can still find it.
It does not return when it finishes
Perch is a GUI-subsystem binary, so a shell does not wait for it. A script that runs the self-test and immediately reads the report will read the previous run's, or none at all. Poll for the file.
Exit codes#
0 on success, 1 on a bad command line. Everything meaningful is in the report files rather than in the exit code, because the operations that matter outlive the process that started them.