{"record":{"id":"dfe1ee4a82279f2b","repo":"tauri-apps/tauri","slug":"optional-build-metadata-in-app-version-must-be-num","errorCode":null,"errorMessage":"optional build metadata in app version must be numeric-only and cannot be greater than 65535 for msi target","messagePattern":"optional build metadata in app version must be numeric-only and cannot be greater than 65535 for msi target","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/windows/msi/mod.rs","lineNumber":354,"sourceCode":"  }\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!(\n        \"{}.{}.{}.{}\",\n        version.major, version.minor, version.patch, version.build\n      ));\n    } else {\n      crate::error::bail!(\n        \"optional build metadata in app version must be numeric-only and cannot be greater than 65535 for msi target\"\n      );\n    }\n  }\n\n  if !version.pre.is_empty() {\n    let pre = version.pre.parse::<u64>();\n    if pre.is_ok() && pre.unwrap() <= 65535 {\n      return Ok(format!(\n        \"{}.{}.{}.{}\",\n        version.major, version.minor, version.patch, version.pre\n      ));\n    } else {\n      crate::error::bail!(\n        \"optional pre-release identifier in app version must be numeric-only and cannot be greater than 65535 for msi target\"\n      );\n    }\n  }","sourceCodeStart":336,"sourceCodeEnd":372,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-bundler/src/bundle/windows/msi/mod.rs#L336-L372","documentation":"convert_version in the WiX MSI bundler converts the semver app version to a numeric-only MSI version. If the version has no numeric 4th field but does carry build metadata (the part after '+'), it can only be used if it parses as a number ≤ 65535; otherwise the bundler bails. MSI versions must be purely numeric, so non-numeric or oversized build metadata is rejected.","triggerScenarios":"Bundling an msi with a semver version containing build metadata that is non-numeric or greater than 65535 — e.g. \"1.2.3+abc\" or \"1.2.3+70000\" — via build_wix_app_installer.","commonSituations":"Versions like \"1.2.3+build.42\" produced by release tooling; CI injecting a commit hash or timestamp as build metadata; Cargo/semver versions with '+' metadata carried into Windows bundling.","solutions":["Remove the build metadata (the '+' part) from the app version when targeting msi","Use numeric-only build metadata ≤ 65535, e.g. \"1.2.3+42\"","Strip/normalize the version in CI before invoking tauri build for Windows"],"exampleFix":"// before (tauri.conf.json)\n\"version\": \"1.2.3+build.42\"\n// after\n\"version\": \"1.2.3\"","handlingStrategy":"validation","validationCode":"fn msi_build_meta_ok(v: &str) -> bool {\n  match v.split_once('+') {\n    None => true,\n    Some((_, meta)) => meta.parse::<u64>().map(|n| n <= 65535).unwrap_or(false),\n  }\n}","typeGuard":null,"tryCatchPattern":"match bundle_msi(cfg) {\n  Err(e) if e.to_string().contains(\"build metadata\") => eprintln!(\"strip '+' metadata from version\"),\n  Err(e) => eprintln!(\"bundling failed: {e}\"),\n  Ok(_) => {},\n}","preventionTips":["Strip '+' build metadata from versions in Windows CI jobs","If metadata is required, keep it numeric and ≤ 65535","Keep release-tooling semver features disabled for msi targets"],"tags":["tauri","wix","msi","semver","version"],"backgroundTag":"invalid-argument-format","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"}