upgrade deps, fix dotnet8 detection, preperations for skins tab

This commit is contained in:
2025-09-08 20:14:20 +02:00
parent ff00b27330
commit adf40b70cb
11 changed files with 365 additions and 617 deletions

173
src-tauri/Cargo.lock generated
View File

@@ -504,7 +504,7 @@ dependencies = [
"iana-time-zone",
"num-traits",
"serde",
"windows-link",
"windows-link 0.1.3",
]
[[package]]
@@ -777,19 +777,21 @@ dependencies = [
"libc",
"option-ext",
"redox_users",
"windows-sys 0.60.2",
"windows-sys 0.61.0",
]
[[package]]
name = "discord-rich-presence"
version = "0.2.5"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a75db747ecd252c01bfecaf709b07fcb4c634adf0edb5fed47bc9c3052e7076b"
checksum = "ead3c5edc7e048c317c6fc4a7e24aff0c7e4c136918e2ba38106a385b2cc53a5"
dependencies = [
"log",
"serde",
"serde_derive",
"serde_json",
"serde_repr",
"thiserror 2.0.12",
"uuid 0.8.2",
]
@@ -833,9 +835,9 @@ dependencies = [
[[package]]
name = "dlopen2"
version = "0.7.0"
version = "0.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9e1297103d2bbaea85724fcee6294c2d50b1081f9ad47d0f6f6f61eda65315a6"
checksum = "b54f373ccf864bf587a89e880fb7610f8d73f3045f13580948ccbcaff26febff"
dependencies = [
"dlopen2_derive",
"libc",
@@ -1010,7 +1012,7 @@ dependencies = [
[[package]]
name = "ezpplauncher"
version = "3.0.4"
version = "3.0.5"
dependencies = [
"base64 0.22.1",
"discord-rich-presence",
@@ -1033,7 +1035,7 @@ dependencies = [
"tokio",
"widestring",
"winapi",
"windows-sys 0.60.2",
"windows-sys 0.61.0",
"winreg 0.55.0",
]
@@ -2552,6 +2554,16 @@ dependencies = [
"objc2-core-foundation",
]
[[package]]
name = "objc2-javascript-core"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9052cb1bb50a4c161d934befcf879526fb87ae9a68858f241e693ca46225cf5a"
dependencies = [
"objc2 0.6.1",
"objc2-core-foundation",
]
[[package]]
name = "objc2-metal"
version = "0.2.2"
@@ -2588,6 +2600,17 @@ dependencies = [
"objc2-foundation 0.3.1",
]
[[package]]
name = "objc2-security"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e1f8e0ef3ab66b08c42644dcb34dba6ec0a574bbd8adbb8bdbdc7a2779731a44"
dependencies = [
"bitflags 2.9.1",
"objc2 0.6.1",
"objc2-core-foundation",
]
[[package]]
name = "objc2-ui-kit"
version = "0.3.1"
@@ -2612,6 +2635,8 @@ dependencies = [
"objc2-app-kit",
"objc2-core-foundation",
"objc2-foundation 0.3.1",
"objc2-javascript-core",
"objc2-security",
]
[[package]]
@@ -3368,9 +3393,9 @@ checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c"
[[package]]
name = "reqwest"
version = "0.12.22"
version = "0.12.23"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "cbc931937e6ca3a06e3b6c0aa7841849b160a90351d6ab467a8b9b9959767531"
checksum = "d429f34c8092b2d42c7c93cec323bb4adeb7c67698f70839adec842ec10c7ceb"
dependencies = [
"base64 0.22.1",
"bytes",
@@ -3710,9 +3735,9 @@ dependencies = [
[[package]]
name = "serde_json"
version = "1.0.141"
version = "1.0.143"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "30b9eff21ebe718216c6ec64e1d9ac57087aad11efc64e32002bce4a0d4c03d3"
checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a"
dependencies = [
"itoa",
"memchr",
@@ -3795,9 +3820,9 @@ dependencies = [
[[package]]
name = "serialize-to-javascript"
version = "0.1.1"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c9823f2d3b6a81d98228151fdeaf848206a7855a7a042bbf9bf870449a66cafb"
checksum = "04f3666a07a197cdb77cdf306c32be9b7f598d7060d50cfd4d5aa04bfd92f6c5"
dependencies = [
"serde",
"serde_json",
@@ -3806,13 +3831,13 @@ dependencies = [
[[package]]
name = "serialize-to-javascript-impl"
version = "0.1.1"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "74064874e9f6a15f04c1f3cb627902d0e6b410abbf36668afa873c61889f1763"
checksum = "772ee033c0916d670af7860b6e1ef7d658a4629a6d0b4c8c3e67f09b3765b75d"
dependencies = [
"proc-macro2",
"quote",
"syn 1.0.109",
"syn 2.0.104",
]
[[package]]
@@ -4085,9 +4110,9 @@ dependencies = [
[[package]]
name = "sysinfo"
version = "0.36.1"
version = "0.37.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "252800745060e7b9ffb7b2badbd8b31cfa4aa2e61af879d0a3bf2a317c20217d"
checksum = "07cec4dc2d2e357ca1e610cfb07de2fa7a10fc3e9fe89f72545f3d244ea87753"
dependencies = [
"libc",
"memchr",
@@ -4133,11 +4158,12 @@ dependencies = [
[[package]]
name = "tao"
version = "0.34.0"
version = "0.34.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "49c380ca75a231b87b6c9dd86948f035012e7171d1a7c40a9c2890489a7ffd8a"
checksum = "959469667dbcea91e5485fc48ba7dd6023face91bb0f1a14681a70f99847c3f7"
dependencies = [
"bitflags 2.9.1",
"block2 0.6.1",
"core-foundation 0.10.1",
"core-graphics",
"crossbeam-channel",
@@ -4189,12 +4215,13 @@ checksum = "61c41af27dd6d1e27b1b16b489db798443478cef1f06a660c96db617ba5de3b1"
[[package]]
name = "tauri"
version = "2.7.0"
version = "2.8.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "352a4bc7bf6c25f5624227e3641adf475a6535707451b09bb83271df8b7a6ac7"
checksum = "d4d1d3b3dc4c101ac989fd7db77e045cc6d91a25349cd410455cb5c57d510c1c"
dependencies = [
"anyhow",
"bytes",
"cookie",
"dirs",
"dunce",
"embed_plist",
@@ -4212,6 +4239,7 @@ dependencies = [
"objc2-app-kit",
"objc2-foundation 0.3.1",
"objc2-ui-kit",
"objc2-web-kit",
"percent-encoding",
"plist",
"raw-window-handle",
@@ -4239,9 +4267,9 @@ dependencies = [
[[package]]
name = "tauri-build"
version = "2.3.1"
version = "2.4.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "182d688496c06bf08ea896459bf483eb29cdff35c1c4c115fb14053514303064"
checksum = "9c432ccc9ff661803dab74c6cd78de11026a578a9307610bbc39d3c55be7943f"
dependencies = [
"anyhow",
"cargo_toml",
@@ -4255,15 +4283,15 @@ dependencies = [
"serde_json",
"tauri-utils",
"tauri-winres",
"toml 0.8.23",
"toml 0.9.4",
"walkdir",
]
[[package]]
name = "tauri-codegen"
version = "2.3.1"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b54a99a6cd8e01abcfa61508177e6096a4fe2681efecee9214e962f2f073ae4a"
checksum = "1ab3a62cf2e6253936a8b267c2e95839674e7439f104fa96ad0025e149d54d8a"
dependencies = [
"base64 0.22.1",
"brotli",
@@ -4288,9 +4316,9 @@ dependencies = [
[[package]]
name = "tauri-macros"
version = "2.3.2"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7945b14dc45e23532f2ded6e120170bbdd4af5ceaa45784a6b33d250fbce3f9e"
checksum = "4368ea8094e7045217edb690f493b55b30caf9f3e61f79b4c24b6db91f07995e"
dependencies = [
"heck 0.5.0",
"proc-macro2",
@@ -4302,9 +4330,9 @@ dependencies = [
[[package]]
name = "tauri-plugin"
version = "2.3.1"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5bd5c1e56990c70a906ef67a9851bbdba9136d26075ee9a2b19c8b46986b3e02"
checksum = "9946a3cede302eac0c6eb6c6070ac47b1768e326092d32efbb91f21ed58d978f"
dependencies = [
"anyhow",
"glob",
@@ -4313,7 +4341,7 @@ dependencies = [
"serde",
"serde_json",
"tauri-utils",
"toml 0.8.23",
"toml 0.9.4",
"walkdir",
]
@@ -4337,9 +4365,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-dialog"
version = "2.3.2"
version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "37e5858cc7b455a73ab4ea2ebc08b5be33682c00ff1bf4cad5537d4fb62499d9"
checksum = "0beee42a4002bc695550599b011728d9dfabf82f767f134754ed6655e434824e"
dependencies = [
"log",
"raw-window-handle",
@@ -4355,9 +4383,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-fs"
version = "2.4.1"
version = "2.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8c6ef84ee2f2094ce093e55106d90d763ba343fad57566992962e8f76d113f99"
checksum = "315784ec4be45e90a987687bae7235e6be3d6e9e350d2b75c16b8a4bf22c1db7"
dependencies = [
"anyhow",
"dunce",
@@ -4371,15 +4399,15 @@ dependencies = [
"tauri-plugin",
"tauri-utils",
"thiserror 2.0.12",
"toml 0.8.23",
"toml 0.9.4",
"url",
]
[[package]]
name = "tauri-plugin-shell"
version = "2.3.0"
version = "2.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b9ffadec5c3523f11e8273465cacb3d86ea7652a28e6e2a2e9b5c182f791d25"
checksum = "54777d0c0d8add34eea3ced84378619ef5b97996bd967d3038c668feefd21071"
dependencies = [
"encoding_rs",
"log",
@@ -4398,9 +4426,9 @@ dependencies = [
[[package]]
name = "tauri-plugin-single-instance"
version = "2.3.2"
version = "2.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "50a0e5a4ce43cb3a733c3aef85e8478bc769dac743c615e26639cbf5d953faf7"
checksum = "fb9cac815bf11c4a80fb498666bcdad66d65b89e3ae24669e47806febb76389c"
dependencies = [
"serde",
"serde_json",
@@ -4413,9 +4441,9 @@ dependencies = [
[[package]]
name = "tauri-runtime"
version = "2.7.1"
version = "2.8.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b1cc885be806ea15ff7b0eb47098a7b16323d9228876afda329e34e2d6c4676"
checksum = "d4cfc9ad45b487d3fded5a4731a567872a4812e9552e3964161b08edabf93846"
dependencies = [
"cookie",
"dpi",
@@ -4424,20 +4452,23 @@ dependencies = [
"jni",
"objc2 0.6.1",
"objc2-ui-kit",
"objc2-web-kit",
"raw-window-handle",
"serde",
"serde_json",
"tauri-utils",
"thiserror 2.0.12",
"url",
"webkit2gtk",
"webview2-com",
"windows",
]
[[package]]
name = "tauri-runtime-wry"
version = "2.7.2"
version = "2.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fe653a2fbbef19fe898efc774bc52c8742576342a33d3d028c189b57eb1d2439"
checksum = "c1fe9d48bd122ff002064e88cfcd7027090d789c4302714e68fcccba0f4b7807"
dependencies = [
"gtk",
"http",
@@ -4462,9 +4493,9 @@ dependencies = [
[[package]]
name = "tauri-utils"
version = "2.6.0"
version = "2.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9330c15cabfe1d9f213478c9e8ec2b0c76dab26bb6f314b8ad1c8a568c1d186e"
checksum = "41a3852fdf9a4f8fbeaa63dc3e9a85284dd6ef7200751f0bd66ceee30c93f212"
dependencies = [
"anyhow",
"brotli",
@@ -4491,7 +4522,7 @@ dependencies = [
"serde_with",
"swift-rs",
"thiserror 2.0.12",
"toml 0.8.23",
"toml 0.9.4",
"url",
"urlpattern",
"uuid 1.17.0",
@@ -4631,9 +4662,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
[[package]]
name = "tokio"
version = "1.47.0"
version = "1.47.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "43864ed400b6043a4757a25c7a64a8efde741aed79a056a2fb348a406701bb35"
checksum = "89e49afdadebb872d3145a5638b59eb0691ea23e46ca484037cfab3b76b95038"
dependencies = [
"backtrace",
"bytes",
@@ -5431,7 +5462,7 @@ dependencies = [
"windows-collections",
"windows-core",
"windows-future",
"windows-link",
"windows-link 0.1.3",
"windows-numerics",
]
@@ -5452,7 +5483,7 @@ checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3"
dependencies = [
"windows-implement",
"windows-interface",
"windows-link",
"windows-link 0.1.3",
"windows-result",
"windows-strings",
]
@@ -5464,7 +5495,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e"
dependencies = [
"windows-core",
"windows-link",
"windows-link 0.1.3",
"windows-threading",
]
@@ -5496,6 +5527,12 @@ version = "0.1.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a"
[[package]]
name = "windows-link"
version = "0.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "45e46c0661abb7180e7b9c281db115305d49ca1709ab8242adf09666d2173c65"
[[package]]
name = "windows-numerics"
version = "0.2.0"
@@ -5503,7 +5540,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1"
dependencies = [
"windows-core",
"windows-link",
"windows-link 0.1.3",
]
[[package]]
@@ -5512,7 +5549,7 @@ version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5b8a9ed28765efc97bbc954883f4e6796c33a06546ebafacbabee9696967499e"
dependencies = [
"windows-link",
"windows-link 0.1.3",
"windows-result",
"windows-strings",
]
@@ -5523,7 +5560,7 @@ version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6"
dependencies = [
"windows-link",
"windows-link 0.1.3",
]
[[package]]
@@ -5532,7 +5569,7 @@ version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57"
dependencies = [
"windows-link",
"windows-link 0.1.3",
]
[[package]]
@@ -5571,6 +5608,15 @@ dependencies = [
"windows-targets 0.53.3",
]
[[package]]
name = "windows-sys"
version = "0.61.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e201184e40b2ede64bc2ea34968b28e33622acdbbf37104f0e4a33f7abe657aa"
dependencies = [
"windows-link 0.2.0",
]
[[package]]
name = "windows-targets"
version = "0.42.2"
@@ -5608,7 +5654,7 @@ version = "0.53.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d5fe6031c4041849d7c496a8ded650796e7b6ecc19df1a431c1a363342e5dc91"
dependencies = [
"windows-link",
"windows-link 0.1.3",
"windows_aarch64_gnullvm 0.53.0",
"windows_aarch64_msvc 0.53.0",
"windows_i686_gnu 0.53.0",
@@ -5625,7 +5671,7 @@ version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6"
dependencies = [
"windows-link",
"windows-link 0.1.3",
]
[[package]]
@@ -5634,7 +5680,7 @@ version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e04a5c6627e310a23ad2358483286c7df260c964eb2d003d8efd6d0f4e79265c"
dependencies = [
"windows-link",
"windows-link 0.1.3",
]
[[package]]
@@ -5829,14 +5875,15 @@ checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb"
[[package]]
name = "wry"
version = "0.52.1"
version = "0.53.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "12a714d9ba7075aae04a6e50229d6109e3d584774b99a6a8c60de1698ca111b9"
checksum = "31f0e9642a0d061f6236c54ccae64c2722a7879ad4ec7dff59bd376d446d8e90"
dependencies = [
"base64 0.22.1",
"block2 0.6.1",
"cookie",
"crossbeam-channel",
"dirs",
"dpi",
"dunce",
"gdkx11",

View File

@@ -1,6 +1,6 @@
[package]
name = "ezpplauncher"
version = "3.0.4"
version = "3.0.5"
description = "EZPPLauncher redefined."
authors = ["HorizonCode"]
edition = "2024"
@@ -15,25 +15,25 @@ name = "ezpplauncher_lib"
crate-type = ["staticlib", "cdylib", "rlib"]
[build-dependencies]
tauri-build = { version = "2.3.1", features = [] }
tauri-build = { version = "2.4.1", features = [] }
[dependencies]
tauri = { version = "2.7.0", features = [] }
tauri-plugin-shell = "2.3.0"
tauri = { version = "2.8.5", features = [] }
tauri-plugin-shell = "2.3.1"
serde = { version = "1.0.219", features = ["derive"] }
serde_json = "1.0.141"
serde_json = "1.0.143"
serde_repr = "0.1.20"
tauri-plugin-dialog = "2.3.2"
tauri-plugin-fs = "2.4.1"
tauri-plugin-dialog = "2.4.0"
tauri-plugin-fs = "2.4.2"
hardware-id = "0.3.0"
tauri-plugin-cors-fetch = "4.1.0"
sysinfo = "0.36.1"
reqwest = { version = "0.12.22", features = ["json", "stream"] }
sysinfo = "0.37.0"
reqwest = { version = "0.12.23", features = ["json", "stream"] }
md5 = "0.8.0"
tokio = { version = "1.47.0", features = ["full"] }
tokio = { version = "1.47.1", features = ["full"] }
open = "5.3.2"
windows-sys = "0.60.2"
discord-rich-presence = "0.2.5"
windows-sys = "0.61.0"
discord-rich-presence = "1.0.0"
once_cell = "1.21.3"
[target.'cfg(windows)'.dependencies]
@@ -43,5 +43,5 @@ base64 = "0.22.1"
widestring = "1.0"
[target.'cfg(not(any(target_os = "android", target_os = "ios")))'.dependencies]
tauri-plugin-single-instance = "2.3.2"
tauri-plugin-single-instance = "2.3.4"

BIN
src-tauri/icons/64x64.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.9 KiB

View File

@@ -1,343 +0,0 @@
; A set of NSIS macros to check whether a dotnet core runtime is installed and, if not, offer to
; download and install it. Supports dotnet versions 3.1 and newer - latest tested version is 7.0.
;
; Inspired by & initially based on NsisDotNetChecker, which does the same thing for .NET framework
; https://github.com/alex-sitnikov/NsisDotNetChecker
!include "WordFunc.nsh"
!include "TextFunc.nsh"
!include "X64.nsh"
!ifndef DOTNETCORE_INCLUDED
!define DOTNETCORE_INCLUDED
; Check that a specific version of the dotnet core runtime is installed and, if not, attempts to
; install it
;
; \param Version The desired dotnet core runtime version as a 2 digit version. e.g. 3.1, 6.0, 7.0
!macro CheckDotNetCore Version
; Save registers
Push $R0
Push $R1
Push $R2
; Push and pop parameters so we don't have conflicts if parameters are $R#
Push ${Version}
Pop $R0 ; Version
!define ID ${__LINE__}
; Check current installed version
!insertmacro DotNetCoreGetInstalledVersion $R0 $R1
; If $R1 is blank then there is no version installed, otherwise it is installed
; todo in future we might want to support "must be at least 6.0.7", for now we only deal with "yes/no" for a major version (e.g. 6.0)
StrCmp $R1 "" notinstalled_${ID}
DetailPrint "dotnet version $R1 already installed"
Goto end_${ID}
notinstalled_${ID}:
DetailPrint "dotnet $R0 is not installed"
!insertmacro DotNetCoreGetLatestVersion $R0 $R1
DetailPrint "Latest Version of $R0 is $R1"
; Get number of input digits
; ${WordFind} $R1 "." "#" $R2
; DetailPrint "version parts count is $R2"
; ${WordFind} $R1 "." "+1" $R2
; DetailPrint "version part 1 is $R2"
; ${WordFind} $R1 "." "+2" $R2
; DetailPrint "version part 2 is $R2"
; ${WordFind} $R1 "." "+3" $R2
; DetailPrint "version part 3 is $R2"
!insertmacro DotNetCoreInstallVersion $R1
end_${ID}:
!undef ID
; Restore registers
Pop $R2
Pop $R1
Pop $R0
!macroend
; Gets the latest version of the runtime for a specified dotnet version. This uses the same endpoint
; as the dotnet-install scripts to determine the latest full version of a dotnet version
;
; \param[in] Version The desired dotnet core runtime version as a 2 digit version. e.g. 3.1, 6.0, 7.0
; \param[out] Result The full version number of the latest version - e.g. 6.0.7
!macro DotNetCoreGetLatestVersion Version Result
; Save registers
Push $R0
Push $R1
Push $R2
; Push and pop parameters so we don't have conflicts if parameters are $R#
Push ${Version}
Pop $R0 ; Version
StrCpy $R1 https://dotnetcli.azureedge.net/dotnet/WindowsDesktop/$R0/latest.version
DetailPrint "Querying latest version of dotnet $R0 from $R1"
; Fetch latest version of the desired dotnet version
; todo error handling in the PS script? so we can check for errors here
StrCpy $R2 "Write-Host (Invoke-WebRequest -UseBasicParsing -URI $\"$R1$\").Content;"
!insertmacro DotNetCorePSExec $R2 $R2
; $R2 contains latest version, e.g. 6.0.7
; todo error handling here
; Push the result onto the stack
${TrimNewLines} $R2 $R2
Push $R2
; Restore registers
Exch
Pop $R2
Exch
Pop $R1
Exch
Pop $R0
; Set result
Pop ${Result}
!macroend
!macro DotNetCoreGetInstalledVersion Version Result
!define DNC_INS_ID ${__LINE__}
; Save registers
Push $R0
Push $R1
Push $R2
; Push and pop parameters so we don't have conflicts if parameters are $R#
Push ${Version}
Pop $R0 ; Version
DetailPrint "Checking installed version of dotnet $R0"
StrCpy $R1 "dotnet --list-runtimes | % { if($$_ -match $\".*WindowsDesktop.*($R0.\d+).*$\") { $$matches[1] } } | Sort-Object {[int]($$_ -replace '\d.\d.(\d+)', '$$1')} -Descending | Select-Object -first 1"
!insertmacro DotNetCorePSExec $R1 $R1
; $R1 contains highest installed version, e.g. 6.0.7
${TrimNewLines} $R1 $R1
; If there is an installed version it should start with the same two "words" as the input version,
; otherwise assume we got an error response
; todo improve this simple test which checks there are at least 3 "words" separated by periods
${WordFind} $R1 "." "E#" $R2
IfErrors error_${DNC_INS_ID}
; $R2 contains number of version parts in R1 (dot separated words = version parts)
; If less than 3 parts, or more than 4 parts, error
IntCmp $R2 3 0 error_${DNC_INS_ID}
IntCmp $R2 4 0 0 error_${DNC_INS_ID}
; todo more error handling here / validation
; Seems to be OK, skip the "set to blank string" error handler
Goto end_${DNC_INS_ID}
error_${DNC_INS_ID}:
StrCpy $R1 "" ; Set result to blank string if any error occurs (means not installed)
end_${DNC_INS_ID}:
!undef DNC_INS_ID
; Push the result onto the stack
Push $R1
; Restore registers
Exch
Pop $R2
Exch
Pop $R1
Exch
Pop $R0
; Set result
Pop ${Result}
!macroend
!macro DotNetCoreInstallVersion Version
; Save registers
Push $R0
Push $R1
Push $R2
Push $R3
; Push and pop parameters so we don't have conflicts if parameters are $R#
Push ${Version}
Pop $R0 ; Version
${If} ${IsNativeAMD64}
StrCpy $R3 "x64"
${ElseIf} ${IsNativeARM64}
StrCpy $R3 "arm64"
${ElseIf} ${IsNativeIA32}
StrCpy $R3 "x86"
${Else}
StrCpy $R3 "unknown"
${EndIf}
; todo can download as a .zip, which is smaller, then we'd need to unzip it before running it...
StrCpy $R1 https://dotnetcli.azureedge.net/dotnet/WindowsDesktop/$R0/windowsdesktop-runtime-$R0-win-$R3.exe
; For dotnet versions less than 5 the WindowsDesktop runtime has a different path
${WordFind} $R0 "." "+1" $R2
IntCmp $R2 5 +2 0 +2
StrCpy $R1 https://dotnetcli.azureedge.net/dotnet/Runtime/$R0/windowsdesktop-runtime-$R0-win-$R3.exe
DetailPrint "Downloading dotnet $R0 from $R1"
; Create destination file
GetTempFileName $R2
nsExec::Exec 'cmd.exe /c rename "$R2" "$R2.exe"' ; Not using Rename to avoid spam in details log
Pop $R3 ; Pop exit code
StrCpy $R2 "$R2.exe"
; Fetch runtime installer
; todo error handling in the PS script? so we can check for errors here
StrCpy $R1 "Invoke-WebRequest -UseBasicParsing -URI $\"$R1$\" -OutFile $\"$R2$\""
!insertmacro DotNetCorePSExec $R1 $R1
; $R1 contains powershell script result
${WordFind} $R1 "BlobNotFound" "E+1{" $R3
ifErrors +3 0
DetailPrint "Dotnet installer $R0 not found."
Goto +10
; todo error handling for PS result, verify download result
IfFileExists $R2 +3, 0
DetailPrint "Dotnet installer did not download."
Goto +7
DetailPrint "Download complete"
DetailPrint "Installing dotnet $R0"
ExecWait "$\"$R2$\" /install /quiet /norestart" $R1
DetailPrint "Installer completed (Result: $R1)"
nsExec::Exec 'cmd.exe /c del "$R2"' ; Not using Delete to avoid spam in details log
Pop $R3 ; Pop exit code
; Error checking? Verify install result?
; Restore registers
Pop $R3
Pop $R2
Pop $R1
Pop $R0
!macroend
; below is adapted from https://nsis.sourceforge.io/PowerShell_support but avoids using the plugin
; directory in favour of a temp file and providing a return variable rather than returning on the
; stack. Methods renamed to avoid conflicting with use of the original macros
; DotNetCorePSExec
; Executes a powershell script
;
; \param[in] PSCommand The powershell command or script to execute
; \param[out] Result The output from the powershell script
!macro DotNetCorePSExec PSCommand Result
Push ${PSCommand}
Call DotNetCorePSExecFn
Pop ${Result}
!macroend
; DotNetCorePSExecFile
; Executes a powershell file
;
; \param[in] FilePath The path to the powershell script file to execute
; \param[out] Result The output from the powershell script
!macro DotNetCorePSExecFile FilePath Result
Push ${FilePath}
Call DotNetCorePSExecFileFn
Pop ${Result}
!macroend
Function DotNetCorePSExecFn
; Read parameters and save registers
Exch $R0 ; Script
Push $R1
Push $R2
; Write the command into a temp file
; Note: Using GetTempFileName to get a temp file name, but since we need to have a .ps1 extension
; on the end we rename it with an extra file extension
GetTempFileName $R1
nsExec::Exec 'cmd.exe /c rename "$R1" "$R1.ps1"' ; Not using Rename to avoid spam in details log
Pop $R2 ; Pop exit code
StrCpy $R1 "$R1.ps1"
FileOpen $R2 $R1 w
FileWrite $R2 $R0
FileClose $R2
; Execute the powershell script and delete the temp file
Push $R1
Call DotNetCorePSExecFileFn
nsExec::Exec 'cmd.exe /c del "$R1"' ; Not using Delete to avoid spam in details log
Pop $R0 ; Pop exit code
; Restore registers
Exch
Pop $R2
Exch
Pop $R1
Exch
Pop $R0
; Stack contains script output only, which we leave as the function result
FunctionEnd
Function DotNetCorePSExecFileFn
; Read parameters and save registers
Exch $R0 ; FilePath
Push $R1
nsExec::ExecToStack 'powershell -inputformat none -ExecutionPolicy RemoteSigned -File "$R0" '
; Stack contain exitCode, scriptOutput, registers
; Pop exit code & validate
Pop $R1
IntCmp $R1 0 +2
SetErrorLevel 2
; Restore registers
Exch
Pop $R1
Exch
Pop $R0
; Stack contains script output only, which we leave as the function result
FunctionEnd
!endif

View File

@@ -1,9 +1,3 @@
!incluide "dotnet.nsh"
!macro NSIS_HOOK_PREINSTALL
!insertmacro CheckDotNetCore 8.0
!macroend
!macro NSIS_HOOK_POSTINSTALL
${If} $PassiveMode = 1
${OrIf} ${Silent}

View File

@@ -1,12 +1,12 @@
use discord_rich_presence::{
activity::{Activity, Assets, Button, Timestamps},
DiscordIpc, DiscordIpcClient,
activity::{Activity, Assets, Button, Timestamps},
};
use once_cell::sync::Lazy;
use std::sync::Mutex as StdMutex;
use std::time::{SystemTime, UNIX_EPOCH};
use tokio::sync::{mpsc, oneshot};
use tokio::time::{interval, Duration};
use tokio::time::{Duration, interval};
#[derive(Clone, Debug)]
pub struct PresenceData {
@@ -92,14 +92,10 @@ impl PresenceActor {
}
println!("Actor: Connecting to Discord...");
match DiscordIpcClient::new("1032772293220384808").map_err(|e| e.to_string()) {
Ok(mut new_client) => {
if let Err(e) = new_client.connect().map_err(|e| e.to_string()) {
eprintln!("Failed to connect to Discord: {:?}", e);
let _ = responder.send(false);
return;
}
self.client = Some(new_client);
let mut dc_client = DiscordIpcClient::new("1032772293220384808");
match dc_client.connect() {
Ok(()) => {
self.client = Some(dc_client);
println!("Actor: Connected successfully.");
self.handle_update().await;
let _ = responder.send(true);
@@ -186,7 +182,11 @@ pub async fn connect() -> bool {
pub async fn disconnect() {
let (tx, rx) = oneshot::channel();
if PRESENCE_TX.send(PresenceCommand::Disconnect(tx)).await.is_ok() {
if PRESENCE_TX
.send(PresenceCommand::Disconnect(tx))
.await
.is_ok()
{
let _ = rx.await;
} else {
println!("Could not send disconnect command; actor may not be running.");
@@ -195,7 +195,11 @@ pub async fn disconnect() {
pub async fn has_presence() -> bool {
let (tx, rx) = oneshot::channel();
if PRESENCE_TX.send(PresenceCommand::IsConnected(tx)).await.is_ok() {
if PRESENCE_TX
.send(PresenceCommand::IsConnected(tx))
.await
.is_ok()
{
return rx.await.unwrap_or(false);
}
false

View File

@@ -1,13 +1,13 @@
{
"$schema": "https://schema.tauri.app/config/2",
"productName": "EZPPLauncher",
"version": "3.0.4",
"version": "3.0.5",
"identifier": "farm.EZPPFarm.Launcher",
"mainBinaryName": "ezpplauncher",
"build": {
"beforeDevCommand": "bun run vite:dev",
"devUrl": "http://localhost:1420",
"beforeBuildCommand": "bun run vite:build",
"beforeBuildCommand": "",
"frontendDist": "../build"
},
"app": {