mirror of
https://github.com/armbian/imager.git
synced 2026-01-06 12:31:28 -08:00
Implement comprehensive settings modal with: - Theme switching (light/dark/auto) with system preference detection - Language selection for 17 languages with native name sorting - Developer mode with detailed logging and log viewer - About section with app info and external links - Update notification improvements with reduced log spam Technical improvements: - Added ThemeContext with persistent state management - Implemented memory-safe log file reading (5MB limit) - Fixed all ESLint, TypeScript, and Clippy warnings - Added JSDoc documentation for public APIs - Updated README.md and DEVELOPMENT.md with new features
40 lines
1.4 KiB
Rust
40 lines
1.4 KiB
Rust
fn main() {
|
|
// Extract Tauri version from Cargo.toml and expose it as a compile-time env var
|
|
println!("cargo:rustc-env=TAURI_VERSION={}", tauri_version());
|
|
|
|
// On Windows, embed the manifest to request admin privileges at startup
|
|
#[cfg(windows)]
|
|
{
|
|
let mut windows = tauri_build::WindowsAttributes::new();
|
|
windows = windows.app_manifest(include_str!("app.manifest"));
|
|
tauri_build::try_build(tauri_build::Attributes::new().windows_attributes(windows))
|
|
.expect("failed to run build script");
|
|
}
|
|
|
|
#[cfg(not(windows))]
|
|
tauri_build::build();
|
|
}
|
|
|
|
/// Extract Tauri version from Cargo.toml dependencies
|
|
fn tauri_version() -> String {
|
|
let cargo_toml = std::path::PathBuf::from("Cargo.toml");
|
|
|
|
if let Ok(content) = std::fs::read_to_string(&cargo_toml) {
|
|
// Look for tauri dependency version
|
|
for line in content.lines() {
|
|
if line.contains("tauri =") || line.contains("tauri =") {
|
|
// Extract version from line like: tauri = { version = "2.x", ... }
|
|
if let Some(start) = line.find("version = \"") {
|
|
let after_version = &line[start + 11..];
|
|
if let Some(end) = after_version.find('"') {
|
|
return after_version[..end].to_string();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
// Fallback to unknown if parsing fails
|
|
"unknown".to_string()
|
|
}
|