{"record":{"id":"dbd3ea6c80944198","repo":"tonhowtf/omniget","slug":"uninstallstring-sem-guid","errorCode":null,"errorMessage":"UninstallString sem GUID: {}","messagePattern":"UninstallString sem GUID: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src-tauri/omniget-core/src/core/tools/uninstall.rs","lineNumber":664,"sourceCode":"                );\n                run(\"osascript\", &[\"-e\", &script])\n                    .await\n                    .map(|_| \"movido para a Lixeira\".into())\n                    .map_err(|_| anyhow!(\"{}\", e))\n            }\n        }\n    } else if cfg!(target_os = \"windows\") {\n        let cmd = app.key.trim();\n        let lower = cmd.to_ascii_lowercase();\n        if lower.contains(\"msiexec\") {\n            // MsiExec.exe /I{GUID} → /X{GUID} silencioso\n            let guid = cmd\n                .split(['{', '}'])\n                .nth(1)\n                .map(|g| format!(\"{{{}}}\", g))\n                .unwrap_or_default();\n            if guid.is_empty() {\n                Err(anyhow!(\"UninstallString sem GUID: {}\", cmd))\n            } else {\n                run(\"msiexec\", &[\"/x\", &guid, \"/passive\", \"/norestart\"])\n                    .await\n                    .map(|_| \"desinstalado\".into())\n            }\n        } else {\n            run(\"cmd\", &[\"/C\", cmd])\n                .await\n                .map(|_| \"desinstalador executado\".into())\n        }\n    } else {\n        match app.kind.as_str() {\n            \"flatpak\" => run(\n                \"flatpak\",\n                &[\n                    \"uninstall\",\n                    \"-y\",\n                    \"--delete-data\",","sourceCodeStart":646,"sourceCodeEnd":682,"githubUrl":"https://github.com/tonhowtf/omniget/blob/8600b91f4246848bac346874daa9e61c1fc5677a/src-tauri/omniget-core/src/core/tools/uninstall.rs#L646-L682","documentation":"On Windows, when an app's UninstallString is an msiexec invocation, uninstall() extracts the MSI product GUID by splitting on braces. If no GUID can be extracted (empty result), it throws 'UninstallString sem GUID' with the raw command string. This guards against running msiexec /x with an invalid product code.","triggerScenarios":"The Windows registry UninstallString contains 'msiexec' but splitting the command on '{' and '}' yields no second segment — e.g. 'MsiExec.exe /X{ malformed', a non-GUID product code, or a custom msiexec command line.","commonSituations":"Vendor-installed registry entries with custom uninstall strings; MSI product codes written without braces; quiet-mode flags interleaved in the string the simple brace-split cannot parse.","solutions":["Inspect the registry key (HKLM\\...\\Uninstall) to verify the UninstallString and note the actual product code","Extract the GUID with a proper regex like \\{[0-9A-Fa-f-]{36}\\} instead of brace splitting","Uninstall manually with the real product code: `msiexec /x <GUID> /passive /norestart`","If the app is not actually MSI-based, treat it as a generic command-line uninstall instead of forcing the msiexec path"],"exampleFix":"// before\nlet guid = cmd.split(['{','}']).nth(1).map(|g| format!(\"{{{}}}\", g)).unwrap_or_default();\n// after\nlet guid = cmd.split(['{','}']).nth(1).map(|g| format!(\"{{{}}}\", g)).unwrap_or_default();\nlet guid = regex::Regex::new(r\"\\{[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\\}\")\n    .ok().and_then(|re| re.find(cmd)).map(|m| m.as_str().to_string()).unwrap_or(guid);","handlingStrategy":"validation","validationCode":"fn extract_msi_guid(cmd: &str) -> Option<String> {\n    let re = regex::Regex::new(r\"\\{[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}\\}\").ok()?;\n    re.find(cmd).map(|m| m.as_str().to_string())\n}","typeGuard":"fn is_msi_with_guid(uninstall_string: &str) -> bool {\n    uninstall_string.to_ascii_lowercase().contains(\"msiexec\")\n        && uninstall_string.contains('{')\n        && uninstall_string.contains('}')\n}","tryCatchPattern":"match uninstall::uninstall(&app).await {\n    Err(e) if e.to_string().starts_with(\"UninstallString sem GUID\") => {\n        // fall back to generic command-line uninstall\n        run_custom_uninstall(&app);\n    }\n    other => other,\n}","preventionTips":["Inspect UninstallString in the registry before choosing the msiexec path","Use a GUID regex instead of brace splitting","Provide a generic uninstaller fallback for non-standard MSI strings"],"tags":["windows","msi","registry","uninstall","rust"],"backgroundTag":"invalid-argument-format","analyzedSha":"8600b91f4246848bac346874daa9e61c1fc5677a","analyzedAt":"2026-09-12T14:29:19.317Z","contentChangedAt":"2026-09-12T14:29:19.317Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}