{"record":{"id":"b7efc12560a794ce","repo":"tauri-apps/tauri","slug":"app-wix-version-should-be-in-the-format-major-mino","errorCode":null,"errorMessage":"app wix version should be in the format major.minor.patch.build (build is optional)","messagePattern":"app wix version should be in the format major\\.minor\\.patch\\.build \\(build is optional\\)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/tauri-bundler/src/bundle/windows/msi/mod.rs","lineNumber":319,"sourceCode":"  cmd.env_clear();\n  let required_vars: Vec<std::ffi::OsString> =\n    vec![\"SYSTEMROOT\".into(), \"TMP\".into(), \"TEMP\".into()];\n  for (k, v) in std::env::vars_os() {\n    let k = k.to_ascii_uppercase();\n    if required_vars.contains(&k) || k.to_string_lossy().starts_with(\"TAURI\") {\n      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","sourceCodeStart":301,"sourceCodeEnd":337,"githubUrl":"https://github.com/tauri-apps/tauri/blob/460ec35447493200d64290dd7f015d5a91d0fd58/crates/tauri-bundler/src/bundle/windows/msi/mod.rs#L301-L337","documentation":"WiX MSI bundling requires the app version to be numeric and at least major.minor.patch. validate_wix_version splits version_str on dots, parses each part as u64, and bails if fewer than 3 numeric components exist. Note that non-numeric parts parse to nothing (flat_map .ok() drops them), so a version like '1.0.0-beta' can also end up with fewer than 3 components.","triggerScenarios":"The `version` field in tauri.conf.json (or package.json/Cargo.toml fallback) has fewer than three dot-separated numeric segments (e.g. \"1.0\", \"1.0.0.0.0\" is fine but \"1.0\" is not) or contains non-numeric segments (prerelease/build metadata like \"1.0.0-beta.1\") when bundling for the msi target.","commonSituations":"Developers using semver prerelease versions (\"2.1.0-rc.1\") or two-part versions in package.json; versions inherited from npm (often \"0.1.0\" is fine, but \"1.0\" is not); build metadata like \"1.0.0+abc\" reaching validate_wix_version before convert_version handles it.","solutions":["Set the app version in tauri.conf.json to numeric major.minor.patch (e.g. \"1.2.3\")","Strip prerelease/build metadata from the version (use convert_version-compatible plain numerics) before building the msi bundle","If the version comes from package.json or Cargo.toml, override it via tauri.conf.json `version` or the --config CLI override for Windows builds"],"exampleFix":"// before (tauri.conf.json)\n\"version\": \"1.0\"\n// after\n\"version\": \"1.0.0\"","handlingStrategy":"validation","validationCode":"fn msi_version_ok(v: &str) -> bool {\n  let parts: Vec<u64> = v.split('.')\n    .map(|p| p.parse::<u64>().ok())\n    .collect::<Option<_>>()\n    .unwrap_or_default();\n  parts.len() >= 3\n}","typeGuard":null,"tryCatchPattern":"match validate_version(app_version) {\n  Ok(_) => bundle_msi(),\n  Err(e) => eprintln!(\"fix tauri.conf.json version for msi: {e}\"),\n}","preventionTips":["Keep tauri.conf.json `version` as plain numeric major.minor.patch","Avoid semver pre-release/build metadata for Windows release builds","Validate the version in CI before invoking the bundler"],"tags":["tauri","wix","msi","version","windows"],"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"}