Skip to content

Commit 7960ae9

Browse files
committed
v1.0.14
- Added metadata to help improve trust - Updated file version handling to keep version information synced
1 parent 50d656b commit 7960ae9

File tree

5 files changed

+42
-24
lines changed

5 files changed

+42
-24
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,6 @@
1818
Thumbs.db
1919
Desktop.ini
2020
.DS_Store
21+
22+
# Local release workflow helper
23+
workflow.cmd

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
[package]
22
name = "claude-code-usage-monitor"
3-
version = "0.1.0"
3+
version = "1.0.14"
44
edition = "2021"
55
license = "MIT"
6+
description = "Windows taskbar widget for monitoring Claude Code usage and rate limits"
7+
homepage = "https://codezeno.com.au"
8+
repository = "https://github.com/CodeZeno/Claude-Code-Usage-Monitor"
9+
10+
[package.metadata.winres]
11+
CompanyName = "Code Zeno Pty Ltd"
12+
ProductName = "Claude Code Usage Monitor"
13+
FileDescription = "Windows taskbar widget for monitoring Claude Code usage and rate limits"
14+
OriginalFilename = "claude-code-usage-monitor.exe"
15+
InternalName = "ClaudeCodeUsageMonitor"
16+
Comments = "https://codezeno.com.au"
17+
LegalCopyright = "Copyright (C) 2026 Code Zeno Pty Ltd"
618

719
[dependencies]
820
ureq = { version = "2", default-features = false, features = ["native-tls", "json"] }

build.rs

Lines changed: 24 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,30 @@
1+
use winres::{VersionInfo, WindowsResource};
2+
13
fn main() {
2-
// Derive version from the latest Git tag (e.g. "v1.0.7" → "1.0.7").
3-
let version = std::process::Command::new("git")
4-
.args(["describe", "--tags", "--abbrev=0"])
5-
.output()
6-
.ok()
7-
.and_then(|o| {
8-
if o.status.success() {
9-
String::from_utf8(o.stdout).ok()
10-
} else {
11-
None
12-
}
13-
})
14-
.unwrap_or_else(|| String::from("0.0.0"));
4+
let version = env!("CARGO_PKG_VERSION");
155

16-
let version = version.trim().trim_start_matches('v');
17-
println!("cargo:rustc-env=APP_VERSION={version}");
6+
// Embed the icon and richer PE version metadata into the executable.
7+
let mut res = WindowsResource::new();
8+
let numeric_version = pack_version(version);
189

19-
// Re-run build script whenever HEAD or tags change so the version stays current.
20-
println!("cargo:rerun-if-changed=.git/HEAD");
21-
println!("cargo:rerun-if-changed=.git/refs/tags");
10+
res.set_icon("src/icons/icon.ico")
11+
.set("FileVersion", version)
12+
.set("ProductVersion", version)
13+
.set_version_info(VersionInfo::FILEVERSION, numeric_version)
14+
.set_version_info(VersionInfo::PRODUCTVERSION, numeric_version);
2215

23-
// Embed the application icon into the executable.
24-
let mut res = winres::WindowsResource::new();
25-
res.set_icon("src/icons/icon.ico");
2616
res.compile().expect("Failed to compile Windows resources");
2717
}
18+
19+
fn pack_version(version: &str) -> u64 {
20+
let core = version.split('-').next().unwrap_or(version);
21+
let mut parts = core
22+
.split('.')
23+
.map(|part| part.parse::<u64>().unwrap_or(0));
24+
25+
let major = parts.next().unwrap_or(0).min(u16::MAX as u64);
26+
let minor = parts.next().unwrap_or(0).min(u16::MAX as u64);
27+
let patch = parts.next().unwrap_or(0).min(u16::MAX as u64);
28+
29+
(major << 48) | (minor << 32) | (patch << 16)
30+
}

src/window.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1286,7 +1286,7 @@ fn show_context_menu(hwnd: HWND) {
12861286

12871287
let _ = AppendMenuW(settings_menu, MF_SEPARATOR, 0, PCWSTR::null());
12881288

1289-
let version_str = native_interop::wide_str(&format!("v{}", env!("APP_VERSION")));
1289+
let version_str = native_interop::wide_str(&format!("v{}", env!("CARGO_PKG_VERSION")));
12901290
let _ = AppendMenuW(
12911291
settings_menu,
12921292
MF_GRAYED,

0 commit comments

Comments
 (0)