[GH-ISSUE #207] Doesn't seem to work when being run as a Windows service. #94

Open
opened 2026-05-05 22:09:14 -06:00 by gitea-mirror · 2 comments
Owner

Originally created by @20excal07 on GitHub (Sep 29, 2024).
Original GitHub issue: https://github.com/feschber/lan-mouse/issues/207

I'd like to set this up as a Windows service via srvany-ng, but it seems like the app isn't doing anything once the service is started. I can see the lan-mouse.exe process in Task Manager, but that's about it.

The command I want to run is as follows:
C:\lan-mouse-windows\lan-mouse.exe -d -c C:\lan-mouse-windows\config.toml

And following the steps through srvany-ng, these are the registry keys inside HKLM\SYSTEM\CurrentControlSet\Services\Lan-Mouse\Parameters:

Name Type Data
Application REG_SZ (String) C:\lan-mouse-windows\lan-mouse.exe
AppDirectory REG_SZ (String) C:\lan-mouse-windows\
AppParameters REG_SZ (String) -d -c C:\lan-mouse-windows\config.toml

And here are the contents of config.toml:

# configure release bind
release_bind = [ "KeyJ", "KeyK", "KeyL", "KeySemicolon" ]

# optional port (defaults to 4242)
port = 4242
# optional frontend -> defaults to gtk if available
# possible values are "cli" and "gtk" 
frontend = "Cli"

[top]
# hostname
hostname = "192.168.18.235"
# activate this client immediately when lan-mouse is started
activate_on_startup = true

And yes, I've tested running the command as-is through the CLI, it works just fine when it's run that way.

EDIT: I managed to run the app via a batch file, but still launched through the srvany-ng service, so I could get the log output, but there doesn't seem to be anything to indicate that there was an issue. Very strange...

[2024-09-29T07:40:37Z INFO  lan_mouse::config] using config: "C:\lan-mouse-windows\config.toml"
[2024-09-29T07:40:37Z INFO  lan_mouse] release bind: [KeyJ, KeyK, KeyL, KeySemicolon]
[2024-09-29T07:40:37Z INFO  lan_mouse] Press [KeyJ, KeyK, KeyL, KeySemicolon] to release the mouse
[2024-09-29T07:40:37Z INFO  lan_mouse::server] running service
[2024-09-29T07:40:37Z INFO  input_capture] using capture backend: windows
[2024-09-29T07:40:37Z INFO  lan_mouse::server::capture_task] [(0, (ClientConfig { hostname: Some("192.168.18.235"), fix_ips: [], port: 4242, pos: Top, cmd: None }, ClientState { active: true, active_addr: None, alive: false, dns_ips: [], ips: {}, pressed_keys: {}, resolving: false }))]
[2024-09-29T07:40:37Z INFO  lan_mouse::server::emulation_task] creating input emulation...
[2024-09-29T07:40:37Z INFO  input_emulation] using emulation backend: windows
[2024-09-29T07:40:37Z INFO  lan_mouse::dns] resolving (0) `192.168.18.235` ...
[2024-09-29T07:40:37Z INFO  lan_mouse::dns] 192.168.18.235: adding ip 192.168.18.235

(should probably clarify that by "not working", i mean that it doesn't swap control to the other host after moving the cursor to the edge of the screen)

Originally created by @20excal07 on GitHub (Sep 29, 2024). Original GitHub issue: https://github.com/feschber/lan-mouse/issues/207 I'd like to set this up as a Windows service via [srvany-ng](https://github.com/birkett/srvany-ng), but it seems like the app isn't doing anything once the service is started. I can see the `lan-mouse.exe` process in Task Manager, but that's about it. The command I want to run is as follows: `C:\lan-mouse-windows\lan-mouse.exe -d -c C:\lan-mouse-windows\config.toml` And following the steps through `srvany-ng`, these are the registry keys inside `HKLM\SYSTEM\CurrentControlSet\Services\Lan-Mouse\Parameters`: | Name | Type | Data | | ------ | ------ | ----- | | Application | REG_SZ (String) | C:\lan-mouse-windows\lan-mouse.exe | | AppDirectory | REG_SZ (String) | C:\lan-mouse-windows\ | | AppParameters | REG_SZ (String) | -d -c C:\lan-mouse-windows\config.toml | And here are the contents of `config.toml`: ``` # configure release bind release_bind = [ "KeyJ", "KeyK", "KeyL", "KeySemicolon" ] # optional port (defaults to 4242) port = 4242 # optional frontend -> defaults to gtk if available # possible values are "cli" and "gtk" frontend = "Cli" [top] # hostname hostname = "192.168.18.235" # activate this client immediately when lan-mouse is started activate_on_startup = true ``` And yes, I've tested running the command as-is through the CLI, it works just fine when it's run that way. EDIT: I managed to run the app via a batch file, but still launched through the `srvany-ng` service, so I could get the log output, but there doesn't seem to be anything to indicate that there was an issue. Very strange... ``` [2024-09-29T07:40:37Z INFO lan_mouse::config] using config: "C:\lan-mouse-windows\config.toml" [2024-09-29T07:40:37Z INFO lan_mouse] release bind: [KeyJ, KeyK, KeyL, KeySemicolon] [2024-09-29T07:40:37Z INFO lan_mouse] Press [KeyJ, KeyK, KeyL, KeySemicolon] to release the mouse [2024-09-29T07:40:37Z INFO lan_mouse::server] running service [2024-09-29T07:40:37Z INFO input_capture] using capture backend: windows [2024-09-29T07:40:37Z INFO lan_mouse::server::capture_task] [(0, (ClientConfig { hostname: Some("192.168.18.235"), fix_ips: [], port: 4242, pos: Top, cmd: None }, ClientState { active: true, active_addr: None, alive: false, dns_ips: [], ips: {}, pressed_keys: {}, resolving: false }))] [2024-09-29T07:40:37Z INFO lan_mouse::server::emulation_task] creating input emulation... [2024-09-29T07:40:37Z INFO input_emulation] using emulation backend: windows [2024-09-29T07:40:37Z INFO lan_mouse::dns] resolving (0) `192.168.18.235` ... [2024-09-29T07:40:37Z INFO lan_mouse::dns] 192.168.18.235: adding ip 192.168.18.235 ``` (should probably clarify that by "not working", i mean that it doesn't swap control to the other host after moving the cursor to the edge of the screen)
Author
Owner

@feschber commented on GitHub (Oct 1, 2024):

I tried that and did not get it to work either (the service seems to be running but it wont allow input capturing).

<!-- gh-comment-id:2385637630 --> @feschber commented on GitHub (Oct 1, 2024): I tried that and did not get it to work either (the service seems to be running but it wont allow input capturing).
Author
Owner

@jonstelly commented on GitHub (Feb 5, 2026):

I've got the starting point of a windows service PR up at #373 . there are some extra things needed to work with UAC elevation prompts or login screen, it's working for me in the PR branch

<!-- gh-comment-id:3854860846 --> @jonstelly commented on GitHub (Feb 5, 2026): I've got the starting point of a windows service PR up at #373 . there are some extra things needed to work with UAC elevation prompts or login screen, it's working for me in the PR branch
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/lan-mouse#94
No description provided.