tauri-apps/tauri · error
app wix version should be in the format…
Error message
app wix version should be in the format major.minor.patch.build (build is optional)
What it means
WiX MSI bundling requires the app version to be numeric and at least major.minor.patch. validate_wix_version splits version_str on dots, parses each part as u64, and bails if fewer than 3 numeric components exist. Note that non-numeric parts parse to nothing (flat_map .ok() drops them), so a version like '1.0.0-beta' can also end up with fewer than 3 components.
Solutions
- Set the app version in tauri.conf.json to numeric major.minor.patch (e.g. "1.2.3")
- Strip prerelease/build metadata from the version (use convert_version-compatible plain numerics) before building the msi bundle
- If the version comes from package.json or Cargo.toml, override it via tauri.conf.json `version` or the --config CLI override for Windows builds
Example fix
// before (tauri.conf.json) "version": "1.0" // after "version": "1.0.0"
Defensive patterns
Strategy: validation
Validate before calling
fn msi_version_ok(v: &str) -> bool {
let parts: Vec<u64> = v.split('.')
.map(|p| p.parse::<u64>().ok())
.collect::<Option<_>>()
.unwrap_or_default();
parts.len() >= 3
} Try / catch
match validate_version(app_version) {
Ok(_) => bundle_msi(),
Err(e) => eprintln!("fix tauri.conf.json version for msi: {e}"),
} Prevention
- Keep tauri.conf.json `version` as plain numeric major.minor.patch
- Avoid semver pre-release/build metadata for Windows release builds
- Validate the version in CI before invoking the bundler
When it happens
Trigger: The `version` field in tauri.conf.json (or package.json/Cargo.toml fallback) has fewer than three dot-separated numeric segments (e.g. "1.0", "1.0.0.0.0" is fine but "1.0" is not) or contains non-numeric segments (prerelease/build metadata like "1.0.0-beta.1") when bundling for the msi target.
Common situations: Developers using semver prerelease versions ("2.1.0-rc.1") or two-part versions in package.json; versions inherited from npm (often "0.1.0" is fine, but "1.0" is not); build metadata like "1.0.0+abc" reaching validate_wix_version before convert_version handles it.
Understand the failure class
Background: "Invalid ... format", "must be in format X", "does not look like a ..." — invalid argument format errors across CLI tools and libraries — this error's family across 17 libraries.
Related errors
- app version build number cannot be greater than 65535
- app version major number cannot be greater than 255
- app version minor number cannot be greater than 255
- app version patch number cannot be greater than 65535
- optional build metadata in app version must be numeric-only…
AI-assisted analysis of tauri-apps/tauri@460ec35447 (2026-09-18).
Data as JSON: /api/errors/b7efc12560a794ce.
Report an issue: GitHub.
Appendix: source
Thrown at crates/tauri-bundler/src/bundle/windows/msi/mod.rs:319
cmd.env_clear();
let required_vars: Vec<std::ffi::OsString> =
vec!["SYSTEMROOT".into(), "TMP".into(), "TEMP".into()];
for (k, v) in std::env::vars_os() {
let k = k.to_ascii_uppercase();
if required_vars.contains(&k) || k.to_string_lossy().starts_with("TAURI") {
cmd.env(k, v);
}
}
}
fn validate_wix_version(version_str: &str) -> crate::Result<()> {
let components = version_str
.split('.')
.flat_map(|c| c.parse::<u64>().ok())
.collect::<Vec<_>>();
if components.len() < 3 {
crate::error::bail!(
"app wix version should be in the format major.minor.patch.build (build is optional)"
);
}
if components[0] > 255 {
crate::error::bail!("app version major number cannot be greater than 255");
}
if components[1] > 255 {
crate::error::bail!("app version minor number cannot be greater than 255");
}
if components[2] > 65535 {
crate::error::bail!("app version patch number cannot be greater than 65535");
}
if components.len() == 4 && components[3] > 65535 {
crate::error::bail!("app version build number cannot be greater than 65535");
}
View on GitHub (pinned to 460ec35447)