Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork15.2k
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:masterChoose a base branch fromGlassOnTin:fix-gui-close-service-install-complete
base:master
Could not load branches
Branch not found:{{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline, and old review comments may become outdated.
Open
Fix GUI closing when enabling service on Windows (#7010)#11915
GlassOnTin wants to merge2 commits intorustdesk:masterfromGlassOnTin:fix-gui-close-service-install-complete
Uh oh!
There was an error while loading.Please reload this page.
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
- 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.
8471167 to64cfdf6CompareNeustradamus commentedJun 17, 2025
@rustdesk: It replaces: What do you think? |
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
\\.\pipe\RustDesk\querystop_main_window_process()which sendsClosemessage to GUISolution
This PR implements a three-part fix:
1. Server-side improvements (server.rs)
RUSTDESK_SERVICE_INSTALLATIONto detect service installation2. Client-side improvements (ipc.rs)
Closemessage--no-serverflag after 2-second delay3. Increased timeouts
Testing
To test this fix:
Related Issue
Fixes#7010
Alternative Approaches Considered