fix(launcher): wait for injection thread before exit#4
Open
f1rep0wr wants to merge 1 commit into
Open
Conversation
…ded files The InjectionThread runs launch_and_restore(), which moves DLLs from data/ into the game's bin/, sleeps 45s for the game to load them, then moves them back. Closing the launcher mid-sleep killed the thread before the move-back ran, leaving non-required injected files (e.g. exosuit_weapons.json) stranded in bin/ with no recovery path. ensure_required_files_in_data() only knows about REQUIRED_BIN_FILENAMES, so anything outside that list never came home. Block closeEvent on injection_thread for up to 50s so the existing move-back logic completes naturally. Distributors should still warn users not to close mid-injection — this is a safety net, not a graceful cancel. Also drops the redundant unconditional self.rpc_manager.stop() that ran after the hasattr-guarded block.
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
Sign up for free
to 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.
If user closes the launcher during 'time.sleep(45)', InjectionThreads will be killed before data/ directory files are moved back from bin/ to data/.
closeEventalready callsensure_required_files_in_data()as a safety net, but that only recovers the three files inREQUIRED_BIN_FILENAMES(discord_game_sdk.dll,mounts.json,msvcp140.dll). Anything else that gets injected (e.g.exosuit_weapons.json) had no recovery path and stayed orphaned inbin/forever.Proposed fix:
closeEvent, wait up to 50 seconds forinjection_threadto finish before tearing the app down. The existing move-back logic completes naturally.self.rpc_manager.stop()that ran after thehasattr-guarded block.Would still recommend CGW-Launcher warns users to not close the application mid-injection after PR merge.