15 Commits

Author SHA1 Message Date
0378f19a75 set matrix target 2023-09-25 18:57:51 +02:00
64f4ae6429 v0.5.2 2023-09-25 18:52:35 +02:00
b2cc21aed0 Merge branch 'main' of github.com:mxve/alterware-launcher 2023-09-25 18:51:54 +02:00
dc5957ea41 build i686 target 2023-09-25 18:51:43 +02:00
54abce4d30 Merge pull request #34 from mxve/dependabot/cargo/semver-1.0.19
Bump semver from 1.0.18 to 1.0.19
2023-09-25 17:51:50 +02:00
6ae33cdcb3 self-replace 1.3.7 2023-09-25 17:51:21 +02:00
c9d30fa95a Bump semver from 1.0.18 to 1.0.19
Bumps [semver](https://github.com/dtolnay/semver) from 1.0.18 to 1.0.19.
- [Release notes](https://github.com/dtolnay/semver/releases)
- [Commits](https://github.com/dtolnay/semver/compare/1.0.18...1.0.19)

---
updated-dependencies:
- dependency-name: semver
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-25 15:28:54 +00:00
dc81430f6b don't ask if --bonus set 2023-09-23 01:29:04 +02:00
9c122506ce Merge pull request #31 from mxve/dependabot/cargo/http_req-0.9.3
Bump http_req from 0.9.2 to 0.9.3
2023-09-18 20:12:38 +02:00
f2ba92c31d Merge pull request #32 from mxve/dependabot/cargo/serde_json-1.0.107
Bump serde_json from 1.0.106 to 1.0.107
2023-09-18 20:12:30 +02:00
c92fb88e83 Bump serde_json from 1.0.106 to 1.0.107
Bumps [serde_json](https://github.com/serde-rs/json) from 1.0.106 to 1.0.107.
- [Release notes](https://github.com/serde-rs/json/releases)
- [Commits](https://github.com/serde-rs/json/compare/v1.0.106...v1.0.107)

---
updated-dependencies:
- dependency-name: serde_json
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 15:05:36 +00:00
1e0e0090f5 Bump http_req from 0.9.2 to 0.9.3
Bumps [http_req](https://github.com/jayjamesjay/http_req) from 0.9.2 to 0.9.3.
- [Release notes](https://github.com/jayjamesjay/http_req/releases)
- [Commits](https://github.com/jayjamesjay/http_req/compare/v0.9.2...v0.9.3)

---
updated-dependencies:
- dependency-name: http_req
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2023-09-18 15:05:29 +00:00
48f6a96a01 pwettify comfig file :3 2023-09-18 16:29:37 +02:00
f4fe1c6699 v0.5.1 2023-09-18 12:27:01 +02:00
59f1b09337 set current_dir when launching 2023-09-18 12:26:47 +02:00
6 changed files with 36 additions and 25 deletions

View File

@ -18,14 +18,21 @@ jobs:
upload-assets: upload-assets:
strategy: strategy:
matrix: matrix:
os: include:
- ubuntu-20.04 - target: x86_64-unknown-linux-gnu
- windows-latest os: ubuntu-20.04
- target: i686-unknown-linux-gnu
os: ubuntu-20.04
- target: x86_64-pc-windows-msvc
os: windows-latest
- target: i686-pc-windows-msvc
os: windows-latest
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
steps: steps:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- uses: taiki-e/upload-rust-binary-action@v1 - uses: taiki-e/upload-rust-binary-action@v1
with: with:
target: ${{ matrix.target }}
bin: alterware-launcher bin: alterware-launcher
tar: unix tar: unix
zip: windows zip: windows

19
Cargo.lock generated
View File

@ -30,7 +30,7 @@ dependencies = [
[[package]] [[package]]
name = "alterware-launcher" name = "alterware-launcher"
version = "0.5.0" version = "0.5.2"
dependencies = [ dependencies = [
"colored", "colored",
"http_req", "http_req",
@ -42,7 +42,6 @@ dependencies = [
"serde_json", "serde_json",
"sha1_smol", "sha1_smol",
"steamlocate", "steamlocate",
"windows-sys",
"winres", "winres",
"zip", "zip",
] ]
@ -313,9 +312,9 @@ dependencies = [
[[package]] [[package]]
name = "http_req" name = "http_req"
version = "0.9.2" version = "0.9.3"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9f680177f2ebe4aabd573d07b322d15a5e0fbc97cd739fd627b08043c89041f8" checksum = "42ce34c74ec562d68f2c23a532c62c1332ff1d1b6147fd118bd1938e090137d0"
dependencies = [ dependencies = [
"rustls", "rustls",
"unicase", "unicase",
@ -707,9 +706,9 @@ dependencies = [
[[package]] [[package]]
name = "self-replace" name = "self-replace"
version = "1.3.6" version = "1.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c56335359191626938ef6fdeb478f9f6a7c6020254d7f4641c7d810369fa0ec1" checksum = "525db198616b2bcd0f245daf7bfd8130222f7ee6af9ff9984c19a61bf1160c55"
dependencies = [ dependencies = [
"fastrand 1.9.0", "fastrand 1.9.0",
"tempfile", "tempfile",
@ -718,9 +717,9 @@ dependencies = [
[[package]] [[package]]
name = "semver" name = "semver"
version = "1.0.18" version = "1.0.19"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" checksum = "ad977052201c6de01a8ef2aa3378c4bd23217a056337d1d6da40468d267a4fb0"
[[package]] [[package]]
name = "serde" name = "serde"
@ -744,9 +743,9 @@ dependencies = [
[[package]] [[package]]
name = "serde_json" name = "serde_json"
version = "1.0.106" version = "1.0.107"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2cc66a619ed80bf7a0f6b17dd063a84b88f6dea1813737cf469aef1d081142c2" checksum = "6b420ce6e3d8bd882e9b243c6eed35dbc9a6110c9769e74b584e0d68d1f20c65"
dependencies = [ dependencies = [
"itoa", "itoa",
"ryu", "ryu",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "alterware-launcher" name = "alterware-launcher"
version = "0.5.0" version = "0.5.2"
edition = "2021" edition = "2021"
build = "res/build.rs" build = "res/build.rs"
@ -15,25 +15,21 @@ panic = "abort"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
http_req = { version = "0.9.2", default-features = false, features = [ http_req = { version = "0.9.3", default-features = false, features = [
"rust-tls", "rust-tls",
] } ] }
sha1_smol = "1.0.0" sha1_smol = "1.0.0"
serde = { version = "1.0.188", features = ["derive"] } serde = { version = "1.0.188", features = ["derive"] }
serde_json = "1.0.106" serde_json = "1.0.107"
rand = "0.8.5" rand = "0.8.5"
semver = "1.0.18" semver = "1.0.19"
zip = "0.6.6" zip = "0.6.6"
colored = "2.0.4" colored = "2.0.4"
[target.'cfg(windows)'.dependencies] [target.'cfg(windows)'.dependencies]
steamlocate = "2.0.0-alpha.0" steamlocate = "2.0.0-alpha.0"
mslnk = "0.1.8" mslnk = "0.1.8"
# https://github.com/mitsuhiko/self-replace/pull/16/ self-replace = "1.3.7"
windows-sys = { version = "0.48", features = [
"Win32_Security",
] }
self-replace = "1.3.6"
[build-dependencies] [build-dependencies]
winres = "0.1.12" winres = "0.1.12"

View File

@ -13,7 +13,7 @@ pub fn load(config_path: PathBuf) -> Config {
} }
pub fn save(config_path: PathBuf, config: Config) { pub fn save(config_path: PathBuf, config: Config) {
fs::write(config_path, serde_json::to_string(&config).unwrap()).unwrap(); fs::write(config_path, serde_json::to_string_pretty(&config).unwrap()).unwrap();
} }
pub fn save_value(config_path: PathBuf, key: &str, value: bool) { pub fn save_value(config_path: PathBuf, key: &str, value: bool) {

View File

@ -267,6 +267,7 @@ fn launch(file_path: &PathBuf, args: &str) {
println!("Launching {} {}", file_path.display(), args); println!("Launching {} {}", file_path.display(), args);
std::process::Command::new(file_path) std::process::Command::new(file_path)
.args(args.trim().split(' ')) .args(args.trim().split(' '))
.current_dir(file_path.parent().unwrap())
.spawn() .spawn()
.expect("Failed to launch the game") .expect("Failed to launch the game")
.wait() .wait()
@ -372,6 +373,7 @@ fn main() {
if arg_bool(&args, "--bonus") { if arg_bool(&args, "--bonus") {
cfg.download_bonus_content = true; cfg.download_bonus_content = true;
cfg.ask_bonus_content = false;
arg_remove(&mut args, "--bonus"); arg_remove(&mut args, "--bonus");
} }

View File

@ -60,10 +60,17 @@ pub fn run(update_only: bool) {
fs::remove_file(&update_binary).unwrap(); fs::remove_file(&update_binary).unwrap();
} }
let launcher_name = if cfg!(target_arch = "x86") {
"alterware-launcher-x86.exe"
} else {
"alterware-launcher.exe"
};
println!("{}", launcher_name);
http::download_file( http::download_file(
&format!( &format!(
"{}/download/alterware-launcher.exe", "{}/download/{}",
github::latest_release_url(GH_OWNER, GH_REPO) github::latest_release_url(GH_OWNER, GH_REPO),
launcher_name
), ),
&file_path, &file_path,
); );