{"record":{"id":"3e217a572750f48b","repo":"tauri-apps/tauri","slug":"app-version-major-number-cannot-be-greater-than-25","errorCode":null,"errorMessage":"app version major number cannot be greater than 255","messagePattern":"app version major number cannot be greater than 255","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/windows/msi/mod.rs","lineNumber":325,"sourceCode":"      cmd.env(k, v);\n    }\n  }\n}\n\nfn validate_wix_version(version_str: &str) -> crate::Result<()> {\n  let components = version_str\n    .split('.')\n    .flat_map(|c| c.parse::<u64>().ok())\n    .collect::<Vec<_>>();\n\n  if components.len() < 3 {\n    crate::error::bail!(\n      \"app wix version should be in the format major.minor.patch.build (build is optional)\"\n    );\n  }\n\n  if components[0] > 255 {\n    crate::error::bail!(\"app version major number cannot be greater than 255\");\n  }\n  if components[1] > 255 {\n    crate::error::bail!(\"app version minor number cannot be greater than 255\");\n  }\n  if components[2] > 65535 {\n    crate::error::bail!(\"app version patch number cannot be greater than 65535\");\n  }\n\n  if components.len() == 4 && components[3] > 65535 {\n    crate::error::bail!(\"app version build number cannot be greater than 65535\");\n  }\n\n  Ok(())\n}\n\n// WiX requires versions to be numeric only in a `major.minor.patch.build` format\nfn convert_version(version_str: &str) -> crate::Result<String> {\n  let version = semver::Version::parse(version_str)","sourceCodeStart":307,"sourceCodeEnd":343,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-bundler/src/bundle/windows/msi/mod.rs#L307-L343","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Lower the major version component to 255 or below in tauri.conf.json","Move large numbers (e.g. years) into the minor/patch fields or into product metadata instead of the version major","Adopt a semver-compatible scheme (major ≤ 255, minor ≤ 255, patch ≤ 65535)"],"exampleFix":"// before (tauri.conf.json)\n\"version\": \"2024.1.0\"\n// after\n\"version\": \"24.1.0\"","handlingStrategy":"validation","validationCode":"fn msi_major_ok(v: &str) -> bool {\n  v.split('.').next()\n    .and_then(|p| p.parse::<u64>().ok())\n    .map(|m| m <= 255)\n    .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = bundle_msi(cfg) {\n  eprintln!(\"msi version invalid: {e}\"); // adjust conf and retry\n}","preventionTips":["Never use years or epoch numbers as the major version","Keep the version scheme within WiX limits: major ≤ 255, minor ≤ 255","Assert version ranges in CI for Windows targets"],"tags":["tauri","wix","msi","version","windows"],"backgroundTag":"value-out-of-range","analyzedSha":"460ec35447493200d64290dd7f015d5a91d0fd58","analyzedAt":"2026-09-18T23:55:51.277Z","contentChangedAt":"2026-09-18T23:55:51.277Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}