tauri-apps/tauri · error

app version minor number cannot be greater than 255

Error message

app version minor number cannot be greater than 255

What it means

Validation guard in validate_wix_version: the minor component of the app version being bundled into an MSI exceeds 255. WiX/MSI ProductVersion fields are bounded per segment (max 255 for major/minor), so a version like 1.300.0 would produce an invalid MSI and is rejected before the WiX build runs.

Solutions

  1. Lower the minor version component to 255 or below in tauri.conf.json
  2. Move high counters into the patch (≤65535) or build (4th, ≤65535) field instead
  3. Fix the CI/version-bump script so the minor field resets/rolls over within range

Example fix

// before (tauri.conf.json)
"version": "1.300.0"
// after
"version": "2.0.0"
Defensive patterns

Strategy: validation

Validate before calling

fn msi_minor_ok(v: &str) -> bool {
  v.split('.').nth(1)
    .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}");
}

Prevention

When it happens

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

Common situations: Auto-incrementing CI version scripts that bump minor endlessly; using large build counters in the minor slot; mechanically converted internal version schemes (e.g. "1.512.3").

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/158edf84e81088e4. Report an issue: GitHub.

Appendix: source

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

}

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)
    .map_err(Into::into)
    .context("invalid app version")?;
  if !version.build.is_empty() {

View on GitHub (pinned to 460ec35447)