diff --git a/rust/windows-client/src-tauri/src/client.rs b/rust/windows-client/src-tauri/src/client.rs index 5597ea2e0..b37e6bc4b 100644 --- a/rust/windows-client/src-tauri/src/client.rs +++ b/rust/windows-client/src-tauri/src/client.rs @@ -2,6 +2,7 @@ use anyhow::Result; use clap::{Args, Parser}; use std::{os::windows::process::CommandExt, process::Command}; +mod about; mod auth; mod crash_handling; mod debug_commands; @@ -35,7 +36,7 @@ pub const BUNDLE_ID: &str = "dev.firezone.client"; /// * `g` doesn't mean anything /// * `ed5437c88` is the Git commit hash /// * `-modified` is present if the working dir has any changes from that commit number -const GIT_VERSION: &str = +pub const GIT_VERSION: &str = git_version::git_version!(args = ["--always", "--dirty=-modified", "--tags"]); /// GuiParams prevents a problem where changing the args to `gui::run` breaks static analysis on non-Windows targets, where the gui is stubbed out diff --git a/rust/windows-client/src-tauri/src/client/about.rs b/rust/windows-client/src-tauri/src/client/about.rs new file mode 100644 index 000000000..e7c1cce9a --- /dev/null +++ b/rust/windows-client/src-tauri/src/client/about.rs @@ -0,0 +1,12 @@ +//! Everything related to the About window +use crate::client::GIT_VERSION; + +#[tauri::command] +pub(crate) fn get_cargo_version() -> String { + env!("CARGO_PKG_VERSION").to_string() +} + +#[tauri::command] +pub(crate) fn get_git_version() -> String { + GIT_VERSION.to_string() +} diff --git a/rust/windows-client/src-tauri/src/client/gui.rs b/rust/windows-client/src-tauri/src/client/gui.rs index 2109b90b9..78bf1b301 100644 --- a/rust/windows-client/src-tauri/src/client/gui.rs +++ b/rust/windows-client/src-tauri/src/client/gui.rs @@ -7,7 +7,7 @@ use crate::client::{self, deep_link, network_changes, AppLocalDataDir, BUNDLE_ID use anyhow::{anyhow, bail, Context, Result}; use arc_swap::ArcSwap; use client::{ - logging, + about, logging, settings::{self, AdvancedSettings}, }; use connlib_client_shared::{file_logger, ResourceDescription}; @@ -137,6 +137,8 @@ pub(crate) fn run(params: client::GuiParams) -> Result<()> { } }) .invoke_handler(tauri::generate_handler![ + about::get_cargo_version, + about::get_git_version, logging::clear_logs, logging::count_logs, logging::export_logs, diff --git a/rust/windows-client/src/about.html b/rust/windows-client/src/about.html index 1610e7ac6..595b99099 100644 --- a/rust/windows-client/src/about.html +++ b/rust/windows-client/src/about.html @@ -5,32 +5,18 @@