https://bugs.documentfoundation.org/show_bug.cgi?id=32747

--- Comment #10 from [email protected] ---
I've been encountering this issue for some time as well.

The duplication in the "Open with" menu is caused by redundant entries within
the Windows Registry for the affected file extensions. Specifically, entries
for both Writer and Calc are registered for the same file type (like .txt).

Interestingly, even the Calc entry results in the file opening in Writer,
proving the duplication is undesirable

For reference, here is a PowerShell script that detects and removes the
duplicates for the affected extensions:

$classesRoot = "HKLM:\SOFTWARE\Classes"

# Note: This operation is slow
Get-ChildItem -Path $classesRoot | Where-Object { $_.Name -match "\\\." } |
ForEach-Object {
    $ext = Split-Path $_.Name -Leaf
    $regPath = "$classesRoot\$ext\OpenWithProgIDs"

    if (Test-Path $regPath) {
        $values = Get-ItemProperty -Path $regPath
        $props = $values.PSObject.Properties.Name

        $writerKey = if ($ext -eq ".rtf") { "LibreOffice.Rtf" } else {
"soffice.StarWriterDocument.6" }

        if ($props -contains $writerKey -and $props -contains
"soffice.StarCalcDocument.6") {
            Write-Host "Duplicate detected for extension $ext"
            Remove-ItemProperty -Path $regPath -Name
"soffice.StarCalcDocument.6"
        }
    }
}

I have detected these five impacted extensions: .txt .htm .html .rtf .xml

(Notice that the Writer key is different for .rtf files.)

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to