Bug 77057 - Installing/uninstalling LibreOffice messes up the KindMap in Windows 8.1
Summary: Installing/uninstalling LibreOffice messes up the KindMap in Windows 8.1
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
Version:
(earliest affected)
4.2.2.1 release
Hardware: x86-64 (AMD64) Windows (All)
: medium major
Assignee: Andras Timar
URL:
Whiteboard: target:4.4.0 target:4.3.0 target:4.2.6
Keywords: regression
: 76357 77035 78130 (view as bug list)
Depends on:
Blocks: mab4.2
  Show dependency treegraph
 
Reported: 2014-04-04 15:20 UTC by SteveB
Modified: 2014-08-17 20:19 UTC (History)
15 users (show)

See Also:
Crash report or crash signature:


Attachments
An image of the KindMap in Regedit (245.51 KB, image/jpeg)
2014-04-04 15:37 UTC, SteveB
Details
Fix corrupted KindMap (968 bytes, text/plain)
2014-07-04 08:03 UTC, Andras Timar
Details

Note You need to log in before you can comment on or make changes to this bug.
Description SteveB 2014-04-04 15:20:30 UTC
On the Microsoft forums, a number of users reported that the Photos app in Windows 8.1 no longer worked. It would show folders of photos, but it wouldn't display the actual photos - it would just say that the folders were empty.

This turned out to be related to this registry key: -

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\KindMap

Listed under that key are file extensions. Affected users noted that the keys for all image file extensions had been changed from "picture" to "document", which is what caused the bug in the Photos app. Manually changing the value of each affected key back to "picture" and then rebuilding the search index fixes the issue.

This issue affected 2 of my machines, so I posted a list of the software that's installed on both, which includes LibreOffice. Another user also reported that he had LibreOffice installed, so that started to look like the likely culprit.

So, I then uninstalled LibreOffice entirely. On doing so, ALL photo file extensions were removed from the KindMap altogether. I then reinstalled the latest version of LibreOffice and all of the photo extensions were added back into the KindMap, but they were all set to "document", which again breaks the Photos app.

It appears that the bug has 2 elements then: -

1. Installing LibreOffice changes the registry keys for image file extensions in the KindMap from "picture" to "document", breaking functionality in Windows 8.1 including Microsoft's standard Photos app.

2. Uninstalling LibreOffice remove the registry keys for image file extensions completely from the KindMap, which causes the Photos app in Windows 8.1 to fail to display thumbnails (and it may have other unwanted effects).

Thanks.
Comment 1 SteveB 2014-04-04 15:30:43 UTC
Here is the thread on the MS forums where this issue is being discussed: -

http://answers.microsoft.com/en-us/windows/forum/windows8_1-pictures/windows-81-photos-app-does-not-show-any-photos/5b1740bc-d87d-4d07-afe5-c1a60cdecd55
Comment 2 SteveB 2014-04-04 15:37:46 UTC
Created attachment 96910 [details]
An image of the KindMap in Regedit

This image shows some affected keys after installing LibreOffice. You can see that the key values for GIF, JPG and JPEG files have been changed to "document".
Comment 3 bfoman (inactive) 2014-04-07 20:39:07 UTC
*** Bug 77035 has been marked as a duplicate of this bug. ***
Comment 4 bfoman (inactive) 2014-04-07 20:39:38 UTC
*** Bug 76357 has been marked as a duplicate of this bug. ***
Comment 5 bfoman (inactive) 2014-04-07 20:40:39 UTC
NEW per duplicates.
Comment 6 bryanf 2014-04-25 00:42:40 UTC
It appears this was introduced last summer by this commit:
http://cgit.freedesktop.org/libreoffice/core/commit/?id=cd97b11a33db909318572a27a54305cb4757ba0f

That 'CONDITIONAL_REGISTER_DOC_EXTENSION( Jpg, ...' registers a KindMap value of 'document' per here: http://cgit.freedesktop.org/libreoffice/core/plain/scp2/inc/macros.inc

The installer probably shouldn't write any KindMap registry value for well-known extensions with a kind already registered there. (Both to avoid inappropriately altering the existing kind registration, and to avoid removing it on uninstall.)

Assigning to the reviewer/tester/committer of that change, as the author's email isn't resolving in Bugzilla. (Apologies if this isn't standard practice for this project.)
Comment 7 bryanf 2014-04-25 17:13:36 UTC
If feasible, it would be ideal if upgrading from an affected version of LibreOffice to a version with the fix could repair the bad state. (Still ensuring that any corrected kind values aren't removed on uninstall.) Thanks.
Comment 8 bfoman (inactive) 2014-05-01 22:22:04 UTC
*** Bug 78130 has been marked as a duplicate of this bug. ***
Comment 9 Maxime THEPAULT 2014-06-24 20:42:36 UTC
Hi,

I tried with the new LibreOffice 4.2.5.2 and the bug is still here...

With LibreOffice installed, Windows 8.1 Photo App is unusable.

Please, can you fix that problem and stop changing KindMap registry keys ?

Thank you
Comment 10 bfoman (inactive) 2014-06-25 20:32:28 UTC
Please do not change the Version field as it indicates the earliest version where bug is reproducible. Back to initial value.
Comment 11 Michael Stahl (allotropia) 2014-07-03 11:06:31 UTC
setting regression keyword as per comment #6 which blames commit cd97b11a33db909318572a27a54305cb4757ba0f
Comment 12 Commit Notification 2014-07-03 11:35:27 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=57bf88d21cacb025e7bea40da78616bb4d165215

fdo#77057 quick fix: do not touch KindMap for alien file types



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 13 Andras Timar 2014-07-03 11:44:02 UTC
The fix above solves the problem, but leaves questions open. After this patch we'll register only LibreOffice's native file types in KindMap. 

For a better solution I need to find out, whether registry entries can be refcounted, so we don't remove items from KindMap with uninstall of LibreOffice, when other viewers are existing for that file extension. 

Probably it makes little sense to register jpeg, png and other common formats, which are already there by default. Also, image file formats should be registered as "picture" not as "document".
Comment 14 Commit Notification 2014-07-03 16:55:50 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "libreoffice-4-3":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=82d685e72fb1c656d3977fa2a16f2bea256cc2be&h=libreoffice-4-3

fdo#77057 quick fix: do not touch KindMap for alien file types


It will be available in LibreOffice 4.3.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 15 Commit Notification 2014-07-03 16:57:41 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "libreoffice-4-2":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=cb2eb7194f4f2c0ab6c8e1ba0b360e021c71f1ed&h=libreoffice-4-2

fdo#77057 quick fix: do not touch KindMap for alien file types


It will be available in LibreOffice 4.2.6.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 16 Andras Timar 2014-07-04 08:03:24 UTC
Created attachment 102253 [details]
Fix corrupted KindMap

This .reg file fixes corrupted KindMap, i.e. it restores the values that LibreOffice 4.2.0 - 4.2.5 wrongly changed.
Comment 17 Commit Notification 2014-07-04 09:02:13 UTC
Andras Timar committed a patch related to this issue.
It has been pushed to "libreoffice-4-3-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=84a834f865ee91876396daf7a516488fddab6dc2&h=libreoffice-4-3-0

fdo#77057 quick fix: do not touch KindMap for alien file types


It will be available already in LibreOffice 4.3.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 18 SteveB 2014-07-31 01:23:52 UTC
This has NOT been fixed in the latest version. Updating to the latest version removes all of the affected file extensions from the KindMap altogether.
Comment 19 V Stuart Foote 2014-07-31 03:00:32 UTC
(In reply to comment #18)
> This has NOT been fixed in the latest version. Updating to the latest
> version removes all of the affected file extensions from the KindMap
> altogether.

When making that type of statement, very helpful to identify the build of LibreOffice you are referring to.  Easily found from the Help --> About LibreOffice.  For example the current 4.3.0 Release is:
Version: 4.3.0.4
Build ID: 62ad5818884a2fc2e5780dd45466868d41009ec0

or are you reporting it for a nightly build of Master?
Comment 20 SteveB 2014-07-31 03:35:10 UTC
I'm referring to version: 4.3.0.4, the latest release that's offered on the main download page on the LibreOffice website.

I didn't uninstall the previous version, as I'd already fixed the KindMap issue manually, so I assumed that as this issue was supposedly fixed in 4.3.0.4 that I could just run the 4.3.0.4 installer and update to the latest version. Unfortunately, after doing that, all of the file extensions affected by this bug were removed from the KindMap entirely, so once again I had to repair the registry and rebuild the search index in Windows to fix the problem.
Comment 21 Andras Timar 2014-08-17 20:19:59 UTC
(In reply to comment #20)

> I didn't uninstall the previous version, as I'd already fixed the KindMap
> issue manually, so I assumed that as this issue was supposedly fixed in
> 4.3.0.4 that I could just run the 4.3.0.4 installer and update to the latest
> version.

update = uninstall of previous version + install new version
Uninstallation of a buggy version corrupts KindMap, that's expected. The fix affects only versions that are released after.