Skip to content

fix: Restore active desktop name check in Windows daemon#8194

Merged
nbolton merged 6 commits intomasterfrom
win-client-uac-auto
Feb 19, 2025
Merged

fix: Restore active desktop name check in Windows daemon#8194
nbolton merged 6 commits intomasterfrom
win-client-uac-auto

Conversation

@nbolton
Copy link
Copy Markdown
Member

@nbolton nbolton commented Feb 13, 2025

Fixes: #8183

Blocks:

Restores some of the code deleted in fb686ed (#7827) which is needed to run the core process in secure desktops (UAC prompts, login, lock screen, etc). I thought I tested PR #7827 pretty thoroughly (#7827 (comment)) but it looks like I made a mistake and wasn't thorough enough.

This time we're using deskflow-core.exe deskflow-server.exe (temporarily until core bin ships) instead of deskflow-legacy.exe to find the active desktop name (which is not accessible to processes running in session 0).

  • Test with UAC dialog
  • Test with lock screen
  • Test with login screen
  • Test local built package
  • Test CI package

Testing

Use 'Automatic' elevation:
image

Right click any app and click 'Run as administrator' to show the UAC dialog.

Expect: Mouse should work on client

@nbolton nbolton force-pushed the win-client-uac-auto branch 2 times, most recently from 8ef6f26 to 02507a7 Compare February 18, 2025 18:15
@nbolton nbolton requested a review from sithlord48 February 18, 2025 18:21
@nbolton nbolton marked this pull request as ready for review February 18, 2025 18:21
@nbolton nbolton force-pushed the win-client-uac-auto branch from 02507a7 to 3a2c3df Compare February 18, 2025 18:22
Copy link
Copy Markdown
Member

@sithlord48 sithlord48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have not tested yet on windows.

Edit: Seams to work on windows UAC prompts work but deskflow-core was not installed (if that was intended).

@sithlord48
Copy link
Copy Markdown
Member

This can no land as is the installer has to be fixed to setup the core properly and we have to make sure that the core does work . I am ok with landing this but i am NOT ok with shipping the core by default yet. There is more work to make that work proper

@nbolton
Copy link
Copy Markdown
Member Author

nbolton commented Feb 19, 2025

This can no land as is the installer has to be fixed to setup the core properly and we have to make sure that the core does work . I am ok with landing this but i am NOT ok with shipping the core by default yet. There is more work to make that work proper

As discussed on Matrix, we agreed that we should not ship 3 binaries as this would be confusing for people to see:

  • deskflow-core
  • deskflow-server
  • deskflow-client

If running from CLI or browsing the 'Program Files' dir, they might get confused about which to use.

For this reason, I am temporarily moving the --active-desktop arg to the deskflow-server binary (which is a hack) and will move it back to deskflow-core (where it belongs) after landing this PR:

@nbolton nbolton force-pushed the win-client-uac-auto branch from 2391983 to 32b1ccb Compare February 19, 2025 13:45
@nbolton nbolton requested a review from sithlord48 February 19, 2025 13:46
@nbolton
Copy link
Copy Markdown
Member Author

nbolton commented Feb 19, 2025

@sithlord48 Tested Windows CI package on client, works great for me. How about you?

@sithlord48
Copy link
Copy Markdown
Member

does not break linux..
on windows as a client i get nothing but ipc errors on that machine.

@nbolton
Copy link
Copy Markdown
Member Author

nbolton commented Feb 19, 2025

on windows as a client i get nothing but ipc errors on that machine.

I can't repro that issue anymore. Did you try the latest CI package?

https://github.com/deskflow/deskflow/actions/runs/13414062492/artifacts/2616525149

I wonder if you're seeing IPC errors related to #7804? (progress on which is unfortunately blocked by this PR)

@nbolton nbolton marked this pull request as draft February 19, 2025 16:49
@nbolton
Copy link
Copy Markdown
Member Author

nbolton commented Feb 19, 2025

CI package works fine on dev machine, but not fresh VM :|

image

Gonna need some more work.

Edit: Repro'd it on dev machine, fixing.

- Use `PIPE_NOWAIT` to skip empty stderr output on process output reading from Windows daemon watchdog
- Use `CreateProcess` result to determine when to call `CloseHandle` in Windows daemon watchdog
- Trim output from active desktop process in Windows daemon watchdog
- Improve error logging in Windows daemon watchdog
@nbolton nbolton force-pushed the win-client-uac-auto branch from 32b1ccb to fec6570 Compare February 19, 2025 17:31
@nbolton nbolton marked this pull request as ready for review February 19, 2025 17:49
@nbolton
Copy link
Copy Markdown
Member Author

nbolton commented Feb 19, 2025

@sithlord48 Figured it out. It was a segfault that only happened on fresh install (when there was no command to run).

@nbolton

This comment was marked as outdated.

@nbolton nbolton force-pushed the win-client-uac-auto branch from fec6570 to abfe6bb Compare February 19, 2025 18:10
@nbolton
Copy link
Copy Markdown
Member Author

nbolton commented Feb 19, 2025

Package: https://github.com/deskflow/deskflow/actions/runs/13419409704/artifacts/2618354728

Tested and working on fresh Windows 11 VM.

@sithlord48 sithlord48 self-requested a review February 19, 2025 18:20
Copy link
Copy Markdown
Member

@sithlord48 sithlord48 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Worked now on windows

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Unable to control Windows client UAC dialog or login screen with auto elevate mode

2 participants