Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix GUI closing when enabling service on Windows (#7010)#11915

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
GlassOnTin wants to merge2 commits intorustdesk:master
base:master
Choose a base branch
Loading
fromGlassOnTin:fix-gui-close-service-install-complete

Conversation

@GlassOnTin
Copy link

Summary

This PR fixes the issue where the RustDesk GUI closes immediately (~500ms) when attempting to enable the service on Windows.

Problem

When enabling the service, the GUI would close immediately due to:

  1. GUI process has IPC server on\\.\pipe\RustDesk\query
  2. Service process tries to create IPC server on the same pipe
  3. Service gets "Access is denied" error
  4. Service callsstop_main_window_process() which sendsClose message to GUI
  5. GUI exits without restarting (unlike Linux/macOS)

Solution

This PR implements a three-part fix:

1. Server-side improvements (server.rs)

  • Added retry logic with exponential backoff (up to 10 attempts)
  • Added environment variable checkRUSTDESK_SERVICE_INSTALLATION to detect service installation
  • Prevents killing GUI process during service installation scenario

2. Client-side improvements (ipc.rs)

  • Added Windows support to restart GUI after receivingClose message
  • GUI restarts with--no-server flag after 2-second delay
  • Matches the behavior on Linux/macOS where GUI restarts during service installation

3. Increased timeouts

  • More generous retry attempts and wait times to allow proper IPC handover

Testing

To test this fix:

  1. Build RustDesk with these changes
  2. Start RustDesk GUI on Windows
  3. Go to Settings and enable the service
  4. The GUI should briefly close and restart instead of closing permanently

Related Issue

Fixes#7010

Alternative Approaches Considered

  • Having GUI close its IPC server before starting service (more complex)
  • Using different pipe names for GUI vs service (would break compatibility)
  • This approach is minimally invasive and maintains backward compatibility

- Add retry logic with up to 10 attempts for IPC connection- Detect service installation/startup state to prevent premature closure- Implement exponential backoff for connection retries- Check installing_service() flag for accurate service state detectionThis fixes the issue where the GUI would close within ~500ms whenenabling the service due to 'Access is denied' IPC errors.Fixesrustdesk#7010
This fixes issuerustdesk#7010 where the RustDesk GUI closes immediately when enabling the service.The problem was:1. GUI has IPC server on \\.\\pipe\\RustDesk\\query2. Service tries to start and create IPC server on same pipe3. Service gets 'Access is denied' error4. Service calls stop_main_window_process() which sends Close message to GUI5. GUI exits immediatelyThe fix:1. Added retry logic with exponential backoff (up to 10 attempts) in server.rs2. Added environment variable check to avoid killing GUI during service installation3. Added Windows support in ipc.rs to restart GUI after receiving Close message4. Increased wait times to allow proper handover of IPC server from GUI to serviceThis allows the GUI to gracefully restart while the service takes over the IPC server.
@Neustradamus
Copy link

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@GlassOnTin@Neustradamus

[8]ページ先頭

©2009-2025 Movatter.jp