tauri-apps/tauri · error

app version major number cannot be greater than 255

Error message

app version major number cannot be greater than 255

What it means

WiX/MSI stores the major version in an 8-bit field, so validate_wix_version rejects versions whose major component exceeds 255. The check runs after confirming the version has at least three numeric components.

Solutions

  1. Lower the major version component to 255 or below in tauri.conf.json
  2. Move large numbers (e.g. years) into the minor/patch fields or into product metadata instead of the version major
  3. Adopt a semver-compatible scheme (major ≤ 255, minor ≤ 255, patch ≤ 65535)

Example fix

// before (tauri.conf.json)
"version": "2024.1.0"
// after
"version": "24.1.0"
Defensive patterns

Strategy: validation

Validate before calling

fn msi_major_ok(v: &str) -> bool {
  v.split('.').next()
    .and_then(|p| p.parse::<u64>().ok())
    .map(|m| m <= 255)
    .unwrap_or(false)
}

Try / catch

if let Err(e) = bundle_msi(cfg) {
  eprintln!("msi version invalid: {e}"); // adjust conf and retry
}

Prevention

When it happens

Trigger: Bundling an msi whose app version major number is 256 or greater — e.g. version "300.0.0" in tauri.conf.json — during build_wix_app_installer.

Common situations: Using an epoch-style or internal versioning scheme with a large major number (e.g. calendar "2024.1.0"); repurposing the major field for a year value in Windows builds.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


AI-assisted analysis of tauri-apps/tauri@460ec35447 (2026-09-18). Data as JSON: /api/errors/3e217a572750f48b. Report an issue: GitHub.

Appendix: source

Thrown at crates/tauri-bundler/src/bundle/windows/msi/mod.rs:325

      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");
  }

  Ok(())
}

// WiX requires versions to be numeric only in a `major.minor.patch.build` format
fn convert_version(version_str: &str) -> crate::Result<String> {
  let version = semver::Version::parse(version_str)

View on GitHub (pinned to 460ec35447)