diff --git a/.cargo/config.toml b/.cargo/config.toml index 630c55231..3d438521b 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -6,3 +6,13 @@ rustflags = ["-C", "target-feature=-crt-static", "-C", "target-cpu=x86-64"] [target.x86_64-unknown-linux-gnu] rustflags = ["-C", "target-feature=-crt-static", "-C", "target-cpu=x86-64"] + +[target.x86_64-pc-windows-gnu] +linker = "x86_64-w64-mingw32-gcc-posix" +ar = "x86_64-w64-mingw32-ar" + +[env] +CC_x86_64_pc_windows_gnu = "x86_64-w64-mingw32-gcc-posix" +CXX_x86_64_pc_windows_gnu = "x86_64-w64-mingw32-g++-posix" +AR_x86_64_pc_windows_gnu = "x86_64-w64-mingw32-ar" +CFLAGS_x86_64_pc_windows_gnu = "-O2" diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cd296c688..5d40e103c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -3,8 +3,8 @@ name: Release Dash Evo Tool on: push: tags: - - 'v*' - - 'v*-dev.*' + - "v*" + - "v*-dev.*" release: types: - published @@ -12,7 +12,7 @@ on: inputs: tag: description: "Version (i.e. v0.1.0)" - required: true + required: false permissions: id-token: write @@ -93,7 +93,7 @@ jobs: - name: Install essentials if: ${{ runner.os == 'Linux' }} - run: sudo apt-get update && sudo apt-get install -y build-essential pkg-config clang cmake unzip libsqlite3-dev gcc-mingw-w64 mingw-w64 libsqlite3-dev mingw-w64-x86-64-dev gcc-aarch64-linux-gnu zip && uname -a && cargo clean + run: sudo apt-get update && sudo apt-get install -y build-essential pkg-config clang cmake unzip libsqlite3-dev gcc-mingw-w64 mingw-w64 libsqlite3-dev mingw-w64-x86-64-dev binutils-mingw-w64-x86-64 gcc-aarch64-linux-gnu zip && uname -a && cargo clean - name: Install protoc (ARM) if: ${{ matrix.platform == 'linux-arm64' }} @@ -121,10 +121,6 @@ jobs: run: | cargo build --release --target ${{ matrix.target }} mv target/${{ matrix.target }}/release/dash-evo-tool${{ matrix.ext }} dash-evo-tool/dash-evo-tool${{ matrix.ext }} - env: - CC_x86_64_pc_windows_gnu: x86_64-w64-mingw32-gcc - AR_x86_64_pc_windows_gnu: x86_64-w64-mingw32-ar - CFLAGS_x86_64_pc_windows_gnu: "-O2" - name: Package release run: | @@ -133,7 +129,7 @@ jobs: - name: Attest uses: actions/attest-build-provenance@v1 with: - subject-path: 'dash-evo-tool-${{ matrix.platform }}.zip' + subject-path: "dash-evo-tool-${{ matrix.platform }}.zip" - name: Upload build artifact uses: actions/upload-artifact@v4 @@ -158,20 +154,20 @@ jobs: run: | echo "Disk usage before initial cleanup:" df -h - + # Clean up homebrew cache brew cleanup --prune=all || true - + # Remove Xcode caches sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/dyld 2>/dev/null || true sudo rm -rf ~/Library/Developer/Xcode/DerivedData 2>/dev/null || true sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode 2>/dev/null || true - + # Clean system caches sudo rm -rf /Library/Caches/* 2>/dev/null || true sudo rm -rf /System/Library/Caches/* 2>/dev/null || true sudo rm -rf /private/var/folders/* 2>/dev/null || true - + echo "Disk usage after initial cleanup:" df -h @@ -194,7 +190,7 @@ jobs: rm -rf target/aarch64-apple-darwin/release/.fingerprint rm -rf target/aarch64-apple-darwin/debug rm -rf target/debug - + # Remove the actual binary from target since we copied it rm -f target/aarch64-apple-darwin/release/dash-evo-tool @@ -300,37 +296,37 @@ jobs: echo "Disk usage before cleanup:" df -h du -sh ~/* 2>/dev/null | sort -rh | head -20 - + # Remove the ENTIRE target directory since we already copied the binary rm -rf target - + # Remove the entire Cargo directory rm -rf ~/.cargo - + # Clean up homebrew completely brew cleanup --prune=all rm -rf $(brew --cache) - + # Remove any unnecessary Xcode simulators and caches sudo rm -rf ~/Library/Developer/CoreSimulator 2>/dev/null || true sudo rm -rf ~/Library/Developer/Xcode 2>/dev/null || true sudo rm -rf ~/Library/Caches 2>/dev/null || true - + # Remove temporary icon files after creating the app bundle rm -rf AppIcon.iconset 2>/dev/null || true - + # Clean system caches more aggressively sudo rm -rf /Library/Caches/* 2>/dev/null || true sudo rm -rf /System/Library/Caches/* 2>/dev/null || true sudo rm -rf /private/var/folders/* 2>/dev/null || true sudo rm -rf /Users/runner/Library/Caches/* 2>/dev/null || true - + # Remove any iOS simulators and SDKs we don't need sudo rm -rf /Library/Developer/CoreSimulator 2>/dev/null || true sudo rm -rf /Applications/Xcode*.app/Contents/Developer/Platforms/iPhoneOS.platform 2>/dev/null || true sudo rm -rf /Applications/Xcode*.app/Contents/Developer/Platforms/AppleTVOS.platform 2>/dev/null || true sudo rm -rf /Applications/Xcode*.app/Contents/Developer/Platforms/WatchOS.platform 2>/dev/null || true - + echo "Disk usage after cleanup:" df -h du -sh ~/* 2>/dev/null | sort -rh | head -20 @@ -340,14 +336,14 @@ jobs: # Get app size for sparse image APP_SIZE=$(du -sm "build/Dash Evo Tool.app" | cut -f1) DMG_SIZE=$((APP_SIZE + 50)) # Add 50MB padding - + # Create a sparse image instead of using srcfolder # Sparse images only use disk space as needed hdiutil create -size ${DMG_SIZE}m -type SPARSE -fs HFS+ -volname "Dash Evo Tool" temp.sparseimage - + # Mount the sparse image hdiutil mount temp.sparseimage -mountpoint /Volumes/"Dash Evo Tool" - + # Copy app to mounted volume cp -r "build/Dash Evo Tool.app" /Volumes/"Dash Evo Tool"/ ln -s /Applications /Volumes/"Dash Evo Tool"/Applications @@ -356,13 +352,13 @@ jobs: rm -rf /Volumes/"Dash Evo Tool"/.fseventsd rm -rf /Volumes/"Dash Evo Tool"/.Spotlight-V100 rm -f /Volumes/"Dash Evo Tool"/.DS_Store - + # Unmount hdiutil detach /Volumes/"Dash Evo Tool" - + # Convert sparse image to compressed DMG hdiutil convert temp.sparseimage -format UDZO -o dash-evo-tool-macos-arm64.dmg - + # Clean up sparse image rm -f temp.sparseimage @@ -400,7 +396,7 @@ jobs: - name: Attest uses: actions/attest-build-provenance@v1 with: - subject-path: 'dash-evo-tool-macos-arm64.dmg' + subject-path: "dash-evo-tool-macos-arm64.dmg" - name: Upload build artifact uses: actions/upload-artifact@v4 @@ -425,20 +421,20 @@ jobs: run: | echo "Disk usage before initial cleanup:" df -h - + # Clean up homebrew cache brew cleanup --prune=all || true - + # Remove Xcode caches sudo rm -rf ~/Library/Developer/CoreSimulator/Caches/dyld 2>/dev/null || true sudo rm -rf ~/Library/Developer/Xcode/DerivedData 2>/dev/null || true sudo rm -rf ~/Library/Caches/com.apple.dt.Xcode 2>/dev/null || true - + # Clean system caches sudo rm -rf /Library/Caches/* 2>/dev/null || true sudo rm -rf /System/Library/Caches/* 2>/dev/null || true sudo rm -rf /private/var/folders/* 2>/dev/null || true - + echo "Disk usage after initial cleanup:" df -h @@ -461,7 +457,7 @@ jobs: rm -rf target/x86_64-apple-darwin/release/.fingerprint rm -rf target/x86_64-apple-darwin/debug rm -rf target/debug - + # Remove the actual binary from target since we copied it rm -f target/x86_64-apple-darwin/release/dash-evo-tool @@ -567,37 +563,37 @@ jobs: echo "Disk usage before cleanup:" df -h du -sh ~/* 2>/dev/null | sort -rh | head -20 - + # Remove the ENTIRE target directory since we already copied the binary rm -rf target - + # Remove the entire Cargo directory rm -rf ~/.cargo - + # Clean up homebrew completely brew cleanup --prune=all rm -rf $(brew --cache) - + # Remove any unnecessary Xcode simulators and caches sudo rm -rf ~/Library/Developer/CoreSimulator 2>/dev/null || true sudo rm -rf ~/Library/Developer/Xcode 2>/dev/null || true sudo rm -rf ~/Library/Caches 2>/dev/null || true - + # Remove temporary icon files after creating the app bundle rm -rf AppIcon.iconset 2>/dev/null || true - + # Clean system caches more aggressively sudo rm -rf /Library/Caches/* 2>/dev/null || true sudo rm -rf /System/Library/Caches/* 2>/dev/null || true sudo rm -rf /private/var/folders/* 2>/dev/null || true sudo rm -rf /Users/runner/Library/Caches/* 2>/dev/null || true - + # Remove any iOS simulators and SDKs we don't need sudo rm -rf /Library/Developer/CoreSimulator 2>/dev/null || true sudo rm -rf /Applications/Xcode*.app/Contents/Developer/Platforms/iPhoneOS.platform 2>/dev/null || true sudo rm -rf /Applications/Xcode*.app/Contents/Developer/Platforms/AppleTVOS.platform 2>/dev/null || true sudo rm -rf /Applications/Xcode*.app/Contents/Developer/Platforms/WatchOS.platform 2>/dev/null || true - + echo "Disk usage after cleanup:" df -h du -sh ~/* 2>/dev/null | sort -rh | head -20 @@ -607,24 +603,24 @@ jobs: # Get app size for sparse image APP_SIZE=$(du -sm "build/Dash Evo Tool.app" | cut -f1) DMG_SIZE=$((APP_SIZE + 50)) # Add 50MB padding - + # Create a sparse image instead of using srcfolder # Sparse images only use disk space as needed hdiutil create -size ${DMG_SIZE}m -type SPARSE -fs HFS+ -volname "Dash Evo Tool" temp.sparseimage - + # Mount the sparse image hdiutil mount temp.sparseimage -mountpoint /Volumes/"Dash Evo Tool" - + # Copy app to mounted volume cp -r "build/Dash Evo Tool.app" /Volumes/"Dash Evo Tool"/ ln -s /Applications /Volumes/"Dash Evo Tool"/Applications - + # Unmount hdiutil detach /Volumes/"Dash Evo Tool" - + # Convert sparse image to compressed DMG hdiutil convert temp.sparseimage -format UDZO -o dash-evo-tool-macos-x86_64.dmg - + # Clean up sparse image rm -f temp.sparseimage @@ -662,7 +658,7 @@ jobs: - name: Attest uses: actions/attest-build-provenance@v1 with: - subject-path: 'dash-evo-tool-macos-x86_64.dmg' + subject-path: "dash-evo-tool-macos-x86_64.dmg" - name: Upload build artifact uses: actions/upload-artifact@v4 @@ -700,6 +696,7 @@ jobs: uses: softprops/action-gh-release@v1 env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + if: ${{ github.event.inputs.tag != '' }} with: tag_name: ${{ github.event.inputs.tag }} files: | diff --git a/Cargo.lock b/Cargo.lock index fe7c0b67d..938872ea0 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -849,24 +849,6 @@ dependencies = [ "which 4.4.2", ] -[[package]] -name = "bindgen" -version = "0.72.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "993776b509cfb49c750f11b8f07a46fa23e0a1386ffc01fb1e7d343efc387895" -dependencies = [ - "bitflags 2.10.0", - "cexpr", - "clang-sys", - "itertools 0.13.0", - "proc-macro2", - "quote", - "regex", - "rustc-hash 2.1.1", - "shlex", - "syn 2.0.114", -] - [[package]] name = "bip37-bloom-filter" version = "0.1.0" @@ -1159,16 +1141,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bzip2-sys" -version = "0.1.13+1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225bff33b2141874fe80d71e07d6eec4f85c5c216453dd96388240f96e1acc14" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "calloop" version = "0.13.0" @@ -1452,15 +1424,6 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b05b61dc5112cbb17e4b6cd61790d9845d13888356391624cbe7e41efeac1e75" -[[package]] -name = "colored" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "combine" version = "4.6.7" @@ -2355,7 +2318,7 @@ dependencies = [ "serde_json", "serde_repr", "sha2", - "strum 0.26.3", + "strum", "thiserror 2.0.18", "tracing", ] @@ -3490,18 +3453,13 @@ dependencies = [ "grovedb-element", "grovedb-merk", "grovedb-path", - "grovedb-storage", "grovedb-version", - "grovedb-visualize", "hex", "hex-literal", "indexmap 2.13.0", "integer-encoding", - "intmap", - "itertools 0.14.0", "reqwest", "sha2", - "tempfile", "thiserror 2.0.18", ] @@ -3524,7 +3482,6 @@ dependencies = [ "bincode_derive", "grovedb-path", "grovedb-version", - "grovedb-visualize", "hex", "integer-encoding", "thiserror 2.0.18", @@ -3551,19 +3508,15 @@ dependencies = [ "bincode_derive", "blake3", "byteorder", - "colored", "ed", "grovedb-costs", "grovedb-element", "grovedb-path", - "grovedb-storage", "grovedb-version", "grovedb-visualize", "hex", "indexmap 2.13.0", "integer-encoding", - "num_cpus", - "rand 0.8.5", "thiserror 2.0.18", ] @@ -3575,25 +3528,6 @@ dependencies = [ "hex", ] -[[package]] -name = "grovedb-storage" -version = "4.0.0" -source = "git+https://github.com/dashpay/grovedb?rev=33dfd48a1718160cb333fa95424be491785f1897#33dfd48a1718160cb333fa95424be491785f1897" -dependencies = [ - "blake3", - "grovedb-costs", - "grovedb-path", - "grovedb-visualize", - "hex", - "integer-encoding", - "lazy_static", - "num_cpus", - "rocksdb", - "strum 0.27.2", - "tempfile", - "thiserror 2.0.18", -] - [[package]] name = "grovedb-version" version = "4.0.0" @@ -3615,7 +3549,7 @@ dependencies = [ [[package]] name = "grovestark" version = "0.1.0" -source = "git+https://www.github.com/dashpay/grovestark?rev=a70bdb1adac080d4f1dc10f2f4480d9dacd0f0da#a70bdb1adac080d4f1dc10f2f4480d9dacd0f0da" +source = "git+https://www.github.com/dashpay/grovestark?rev=5b9e289cca54c79b1305d5f4f40bf1148f1eb0e3#5b9e289cca54c79b1305d5f4f40bf1148f1eb0e3" dependencies = [ "ark-ff", "base64 0.22.1", @@ -4541,20 +4475,6 @@ dependencies = [ "redox_syscall 0.7.0", ] -[[package]] -name = "librocksdb-sys" -version = "0.18.0+10.7.5" -source = "git+https://github.com/QuantumExplorer/rust-rocksdb.git?rev=52772eea7bcd214d1d07d80aa538b1d24e5015b7#52772eea7bcd214d1d07d80aa538b1d24e5015b7" -dependencies = [ - "bindgen 0.72.1", - "bzip2-sys", - "cc", - "libc", - "libz-sys", - "lz4-sys", - "zstd-sys", -] - [[package]] name = "libsqlite3-sys" version = "0.35.0" @@ -4566,17 +4486,6 @@ dependencies = [ "vcpkg", ] -[[package]] -name = "libz-sys" -version = "1.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15d118bbf3771060e7311cc7bb0545b01d08a8b4a7de949198dec1fa0ca1c0f7" -dependencies = [ - "cc", - "pkg-config", - "vcpkg", -] - [[package]] name = "linux-raw-sys" version = "0.4.15" @@ -4628,16 +4537,6 @@ dependencies = [ "hashbrown 0.16.1", ] -[[package]] -name = "lz4-sys" -version = "1.11.1+lz4-1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bd8c0d6c6ed0cd30b3652886bb8711dc4bb01d637a68105a3d5158039b418e6" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "malloc_buf" version = "0.0.6" @@ -4836,7 +4735,7 @@ dependencies = [ "once_cell", "rustc-hash 1.1.0", "spirv", - "strum 0.26.3", + "strum", "thiserror 2.0.18", "unicode-ident", ] @@ -6352,15 +6251,6 @@ dependencies = [ "windows-sys 0.52.0", ] -[[package]] -name = "rocksdb" -version = "0.24.0" -source = "git+https://github.com/QuantumExplorer/rust-rocksdb.git?rev=52772eea7bcd214d1d07d80aa538b1d24e5015b7#52772eea7bcd214d1d07d80aa538b1d24e5015b7" -dependencies = [ - "libc", - "librocksdb-sys", -] - [[package]] name = "ron" version = "0.10.1" @@ -6412,7 +6302,7 @@ version = "0.1.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94ea852806513d6f5fd7750423300375bc8481a18ed033756c1a836257893a30" dependencies = [ - "bindgen 0.65.1", + "bindgen", "cc", "libc", ] @@ -7122,16 +7012,7 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros 0.26.4", -] - -[[package]] -name = "strum" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af23d6f6c1a224baef9d3f61e287d2761385a5b88fdab4eb4c6f11aeb54c4bcf" -dependencies = [ - "strum_macros 0.27.2", + "strum_macros", ] [[package]] @@ -7147,18 +7028,6 @@ dependencies = [ "syn 2.0.114", ] -[[package]] -name = "strum_macros" -version = "0.27.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7695ce3845ea4b33927c055a39dc438a45b059f7c1b3d91d38d10355fb8cbca7" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.114", -] - [[package]] name = "subtle" version = "2.6.1" @@ -9920,16 +9789,6 @@ dependencies = [ "simd-adler32", ] -[[package]] -name = "zstd-sys" -version = "2.0.16+zstd.1.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91e19ebc2adc8f83e43039e79776e3fda8ca919132d68a1fed6a5faca2683748" -dependencies = [ - "cc", - "pkg-config", -] - [[package]] name = "zune-core" version = "0.4.12" diff --git a/Cargo.toml b/Cargo.toml index f535fb180..e94de8b28 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ dash-sdk = { git = "https://github.com/dashpay/platform", rev = "98a0ebeca4e6a9a "core_rpc_client", "core_spv", ] } -grovestark = { git = "https://www.github.com/dashpay/grovestark", rev = "a70bdb1adac080d4f1dc10f2f4480d9dacd0f0da" } +grovestark = { git = "https://www.github.com/dashpay/grovestark", rev = "5b9e289cca54c79b1305d5f4f40bf1148f1eb0e3" } rayon = "1.8" thiserror = "2.0.12" serde = "1.0.219" diff --git a/README.md b/README.md index 84cc820e5..0c9cd47ce 100644 --- a/README.md +++ b/README.md @@ -14,6 +14,7 @@ The tool supports both Mainnet and Testnet networks. Check out the [documentatio - [Prerequisites](#prerequisites) - [Rust Installation](#rust-installation) - [Dependencies](#dependencies) + - [Windows Runtime Dependencies](#windows-runtime-dependencies) - [Dash Core Wallet Setup](#dash-core-wallet-setup) - [Installation](#installation) - [Getting Started](#getting-started) @@ -67,6 +68,14 @@ system, unzip, and install: sudo unzip protoc-*-linux-x86_64.zip -d /usr/local ``` +### Windows Runtime Dependencies + +If you use the prebuilt Windows binary, make sure the target machine has: + +- Microsoft Visual C++ Redistributable (vc_redist x64): https://aka.ms/vc14/vc_redist.x64.exe +- OpenGL 2.0 support. If OpenGL 2.0 is not available (or the app fails to start with OpenGL-related errors), install the OpenCL, OpenGL, and Vulkan Compatibility Pack: + https://apps.microsoft.com/detail/9nqpsl29bfff?ocid=webpdpshare + ### Dash Core Wallet Setup - **Dash Core Wallet**: Download and install from [dash.org/wallets](https://www.dash.org/wallets/). diff --git a/assets/DET_LOGO.ico b/assets/DET_LOGO.ico new file mode 100644 index 000000000..54200221b Binary files /dev/null and b/assets/DET_LOGO.ico differ diff --git a/build.rs b/build.rs index 4e6bfb5c6..d5c18016c 100644 --- a/build.rs +++ b/build.rs @@ -1,8 +1,11 @@ use std::env; use std::path::Path; +use std::process::Command; fn main() { println!("cargo:rerun-if-changed=assets/DET_LOGO.ico"); + println!("cargo:rerun-if-changed=assets/DET_LOGO.png"); + println!("cargo:rerun-if-env-changed=WINDRES"); let target = env::var("TARGET").unwrap_or_default(); if !target.contains("windows") { @@ -24,6 +27,22 @@ fn main() { .expect("icon path must be valid UTF-8 for the resource compiler"); res.set_icon(icon_str); + let windres_cmd = resolve_windres(); + if let Some(cmd) = windres_cmd { + res.set_windres_path(&cmd); + let ar_cmd = resolve_ar(&target).unwrap_or_else(|| { + panic!( + "Required tool not found: ar. Set AR_{} or AR, or install x86_64-w64-mingw32-ar.", + target.replace('-', "_") + ) + }); + res.set_ar_path(&ar_cmd); + } else { + panic!( + "Required tool not found: windres. Set WINDRES or install x86_64-w64-mingw32-windres." + ); + } + if let Ok(version) = env::var("CARGO_PKG_VERSION") { res.set("FileVersion", &version); res.set("ProductVersion", &version); @@ -37,3 +56,46 @@ fn main() { panic!("Failed to embed Windows resources: {err}"); } } + +fn resolve_windres() -> Option { + resolve_tool( + &[String::from("WINDRES")], + &["x86_64-w64-mingw32-windres", "windres"], + ) +} + +fn resolve_ar(target: &str) -> Option { + let ar_target_key = format!("AR_{}", target.replace('-', "_")); + resolve_tool( + &[ar_target_key, String::from("AR")], + &["x86_64-w64-mingw32-ar", "ar"], + ) +} + +fn resolve_tool(env_keys: &[String], candidates: &[&str]) -> Option { + for key in env_keys { + if let Ok(cmd) = env::var(key) + && is_available(&cmd) + { + return Some(cmd); + } + } + + for &cmd in candidates { + if is_available(cmd) { + return Some(cmd.to_string()); + } + } + + None +} + +fn is_available(cmd: &str) -> bool { + Command::new(cmd) + .arg("--version") + .stdout(std::process::Stdio::null()) + .stderr(std::process::Stdio::null()) + .status() + .map(|status| status.success()) + .unwrap_or(false) +} diff --git a/src/backend_task/core/start_dash_qt.rs b/src/backend_task/core/start_dash_qt.rs index 08d54f8f9..b8b4fc825 100644 --- a/src/backend_task/core/start_dash_qt.rs +++ b/src/backend_task/core/start_dash_qt.rs @@ -133,7 +133,7 @@ fn signal_term(child: &Child) -> Result<(), String> { } #[cfg(windows)] -fn signal_term(child: &Child) -> Result<(), String> { +fn signal_term(_child: &Child) -> Result<(), String> { // TODO: Implement graceful termination for Dash-Qt on Windows. tracing::warn!( "SIGTERM signal is not supported on Windows. Dash-Qt process will not be gracefully terminated." diff --git a/src/main.rs b/src/main.rs index b26319f3f..0dae520d3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,5 @@ +#![cfg_attr(target_os = "windows", windows_subsystem = "windows")] + use dash_evo_tool::*; use crate::app_dir::{app_user_data_dir_path, create_app_user_data_directory_if_not_exists}; @@ -30,6 +32,8 @@ fn load_icon() -> egui::IconData { let image = image::load_from_memory(icon_bytes) .expect("Failed to load icon") .to_rgba8(); + // Windows can ignore overly large icons; keep a reasonable size. + let image = image::imageops::resize(&image, 64, 64, image::imageops::FilterType::Lanczos3); let (width, height) = image.dimensions(); egui::IconData { rgba: image.into_raw(),