lan-mouse icon indicating copy to clipboard operation
lan-mouse copied to clipboard

Doesn't seem to work when being run as a Windows service.

Open 20excal07 opened this issue 1 year ago • 1 comments

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)

20excal07 avatar Sep 29 '24 05:09 20excal07

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

feschber avatar Oct 01 '24 12:10 feschber