Skip to content

feat(launcher): ✨ Support copying session file from other installations #2828

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zmerp
Copy link
Member

@zmerp zmerp commented May 16, 2025

This feature is Windows-only, because on Linux the session file is written globally on ~/config.
It finds the installations with a session file and shows them in a dropdown when installing a new version. For the edge case where a session file gets deleted during the lifetime of the launcher and the corresponding version is selected, it will gracefully show an error. I don't believe we need to handle this edge case more.

This PR contains also some minor refactoring.

@zmerp zmerp force-pushed the session-sharing branch from b138156 to 1321f69 Compare May 18, 2025 13:35
@@ -264,6 +280,31 @@ async fn install_server(
tar::Archive::new(&mut GzDecoder::new(&mut buffer)).unpack(&installation_dir)?;
}

if let Some(session_version) = session_version {
assert!(cfg!(windows));
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm not a particularly big fan of this assert just floating about without context

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah, first I put a comment but then I though of all the comments we left behind that are now obsolete, so I thought to have an assert sort of explain what i wanted to say with words. But yeah probably both comment and assert is best.

is_apk_downloaded: bool,
has_session_json: bool, // Only relevent on Windows
Copy link
Collaborator

Choose a reason for hiding this comment

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

*relevant

Comment on lines +286 to +287
let installations = get_installations();
for inst in installations {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't be a separate variable

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah. This time it wasn't even ChatGPT slop.

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.

2 participants