Skip to content

Commit

Permalink
apparently i forgot to push the code that actually makes the updater …
Browse files Browse the repository at this point in the history
…work + Update README.md
  • Loading branch information
RubberDuckShobe committed Apr 30, 2024
1 parent ae8e228 commit 06f3933
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ This enables Audiosurf to connect to [the public testing instance of Wavebreaker
It *should* be able to connect to the official server as well, but that is *not* its primary intended use and keeping compatibility with the original server is not explicitly a goal of this project.

## Features
- Includes an automatic updater, so users don't have to re-run the installer every time.
- Forces HTTPS for every request.
- If present, the [MusicBrainz ID](https://musicbrainz.org/doc/MusicBrainz_Identifier) of the [recording](https://musicbrainz.org/doc/Recording) is sent to the server, if it's present in a song file's metadata.
- Can optionally force HTTP (without the S) to aid in custom server development.
Expand Down
1 change: 1 addition & 0 deletions wavebreaker_client/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ rfd = "0.14.1"
octocrab = "0.38.0"
semver = "1.0.22"
tokio = { version = "1.37.0", features = ["full"] }
open = "5.1.2"

[build-dependencies]
bindgen = "0.69.4"
7 changes: 7 additions & 0 deletions wavebreaker_client/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod state;

use std::{
ffi::{c_void, CString},
path::Path,
thread,
};

Expand Down Expand Up @@ -72,8 +73,14 @@ async unsafe fn main() -> anyhow::Result<()> {
"Current version {}, latest is tag_version {}",
current_version, tag_version
);
if Path::exists(Path::new("./wavebreaker_up.exenew")) {
std::fs::rename("wavebreaker_up.exenew", "wavebreaker_up.exe")
.context("Failed to replace old updater with new one")?;
}

if tag_version > current_version {
info!("New version {} available!", tag_version);
open::that_detached("./wavebreaker_up.exe").context("Failed to open updater")?;
std::process::exit(0); //just kill the game
}
}
Expand Down

0 comments on commit 06f3933

Please sign in to comment.