{"record":{"id":"844d034f4b50250e","repo":"DioxusLabs/dioxus","slug":"invalid-version-for-msi-expected-format-ma","errorCode":null,"errorMessage":"Invalid version for MSI: '{}'. Expected format: major.minor.patch[.build]","messagePattern":"Invalid version for MSI: '(.+?)'\\. Expected format: major\\.minor\\.patch\\[\\.build\\]","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"packages/cli/src/bundler/windows.rs","lineNumber":937,"sourceCode":"    let safe_template = template.replace(\"\\\\{{\", &replacement);\n    let mut hbs = Handlebars::new();\n    hbs.set_strict_mode(false);\n    hbs.register_escape_fn(|s: &str| s.to_string());\n    hbs.register_template_string(\"template\", &safe_template)\n        .context(\"Failed to parse template\")?;\n    let rendered = hbs\n        .render(\"template\", data)\n        .context(\"Failed to render template\")?;\n    Ok(rendered.replace(BACKSLASH_PLACEHOLDER, \"\\\\\"))\n}\n\n/// Convert a semver version string to a WiX-compatible version.\nfn wix_version(version: &str) -> Result<String> {\n    let version = version.split('-').next().unwrap_or(version);\n    let parts: Vec<&str> = version.split('.').collect();\n\n    if parts.len() < 2 || parts.len() > 4 {\n        bail!(\n            \"Invalid version for MSI: '{}'. Expected format: major.minor.patch[.build]\",\n            version\n        );\n    }\n\n    for (i, part) in parts.iter().enumerate() {\n        let num: u64 = part\n            .parse()\n            .with_context(|| format!(\"Invalid version component: '{part}'\"))?;\n        match i {\n            0 | 1 if num > 255 => {\n                bail!(\"Version component {part} exceeds maximum value of 255\");\n            }\n            2 | 3 if num > 65535 => {\n                bail!(\"Version component {part} exceeds maximum value of 65535\");\n            }\n            _ => {}\n        }","sourceCodeStart":919,"sourceCodeEnd":955,"githubUrl":"https://github.com/DioxusLabs/dioxus/blob/24f6a829df0dfa203961a98ea4cae21c2ff27e28/packages/cli/src/bundler/windows.rs#L919-L955","documentation":"Validation guard in wix_version (called from bundle_windows_msi): after stripping any pre-release segment from the crate's version string, splitting on '.' produced fewer than 2 or more than 4 components, which does not match the numeric major.minor[.patch][.build] layout WiX requires. The input at fault is the project's semver version string, whose dotted shape cannot be mapped onto an MSI ProductVersion.","triggerScenarios":"Thrown at packages/cli/src/bundler/windows.rs:937 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Use a numeric MSI version in the format major.minor.patch[.build] in Dioxus.toml."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"24f6a829df0dfa203961a98ea4cae21c2ff27e28","analyzedAt":"2026-08-23T07:10:14.078Z","contentChangedAt":"2026-08-23T07:10:14.078Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}