2020Support

This commit is contained in:
PrintedScript 2023-10-15 18:13:13 +08:00
parent 966252d99f
commit 35b9172a6a
3 changed files with 9 additions and 2 deletions

2
Cargo.lock generated
View File

@ -1261,7 +1261,7 @@ dependencies = [
[[package]]
name = "syntax_bootstrapper"
version = "1.1.3"
version = "1.2.0"
dependencies = [
"chrono",
"colored",

View File

@ -1,6 +1,6 @@
[package]
name = "syntax_bootstrapper"
version = "1.1.3"
version = "1.2.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

View File

@ -305,6 +305,7 @@ async fn main() {
let ShadersZip : PathBuf = download_file_prefix(&http_client, format!("{}shaders.zip", VersionURLPrefix).as_str(), &temp_downloads_directory).await;
let Client2018Zip : PathBuf = download_file_prefix(&http_client, format!("{}2018client.zip", VersionURLPrefix).as_str(), &temp_downloads_directory).await;
let Client2020Zip : PathBuf = download_file_prefix(&http_client, format!("{}2020client.zip", VersionURLPrefix).as_str(), &temp_downloads_directory).await;
info("Download finished, extracting files.");
fn extract_to_dir( zip_file : &PathBuf, target_dir : &PathBuf ) {
@ -364,6 +365,10 @@ async fn main() {
create_folder_if_not_exists(&client_2018_directory).await;
extract_to_dir(&Client2018Zip, &client_2018_directory);
let client_2020_directory = current_version_directory.join("Client2020");
create_folder_if_not_exists(&client_2020_directory).await;
extract_to_dir(&Client2020Zip, &client_2020_directory);
info("Finished extracting files, cleaning up.");
std::fs::remove_dir_all(&temp_downloads_directory).unwrap();
@ -509,6 +514,8 @@ x-scheme-handler/syntax-player=syntax-player.desktop
debug(&client_year.to_string());
if client_year == "2018" {
client_executable_path = current_version_directory.join("Client2018").join("SyntaxPlayerBeta.exe");
} else if client_year == "2020" {
client_executable_path = current_version_directory.join("Client2020").join("SyntaxPlayerBeta.exe");
} else {
client_executable_path = current_version_directory.join("SyntaxPlayerBeta.exe");
}