{"record":{"id":"d893ce4db296a139","repo":"tauri-apps/tauri","slug":"app-version-patch-number-cannot-be-greater-than-65","errorCode":null,"errorMessage":"app version patch number cannot be greater than 65535","messagePattern":"app version patch number cannot be greater than 65535","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/windows/msi/mod.rs","lineNumber":331,"sourceCode":"  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)\n    .map_err(Into::into)\n    .context(\"invalid app version\")?;\n  if !version.build.is_empty() {\n    let build = version.build.parse::<u64>();\n    if build.map(|b| b <= 65535).unwrap_or_default() {\n      return Ok(format!(","sourceCodeStart":313,"sourceCodeEnd":349,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-bundler/src/bundle/windows/msi/mod.rs#L313-L349","documentation":"Validation guard in validate_wix_version: the patch component of the app version exceeds 65535, which would overflow the MSI ProductVersion patch field during the WiX build. The version string is rejected before the installer is generated.","triggerScenarios":"Bundling an msi whose app version patch number is 65536 or greater — e.g. version \"1.0.70000\" in tauri.conf.json — during build_wix_app_installer.","commonSituations":"CI pipelines that use a global commit/build counter as the patch number (e.g. \"1.0.{build_number}\") once the counter passes 65535.","solutions":["Lower the patch version component to 65535 or below in tauri.conf.json","Change the CI versioning scheme to mod/rotate the build counter, or place large counters in the 4th build field only if ≤65535 too","Use the msi upgrade-code strategy for increments instead of ever-growing patch numbers"],"exampleFix":"// before (tauri.conf.json)\n\"version\": \"1.0.70000\"\n// after\n\"version\": \"1.0.65535\"","handlingStrategy":"validation","validationCode":"fn msi_patch_ok(v: &str) -> bool {\n  v.split('.').nth(2)\n    .and_then(|p| p.parse::<u64>().ok())\n    .map(|p| p <= 65535)\n    .unwrap_or(false)\n}","typeGuard":null,"tryCatchPattern":"if let Err(e) = bundle_msi(cfg) {\n  eprintln!(\"msi version invalid: {e}\");\n}","preventionTips":["If patch = CI build number, wrap it: build_number % 65536","Set an alert before the build counter hits 65535","Verify version limits whenever changing the versioning scheme"],"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"}