Bug 122266 - LibreOffice/Windows does not install MIME type for MS Word =>2007 documents
Summary: LibreOffice/Windows does not install MIME type for MS Word =>2007 documents
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
6.1.4.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:6.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-21 15:07 UTC by Mike Moratz-Coppins
Modified: 2018-12-22 05:17 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
A test DOCX without an extension, but with correct content type (11.57 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2018-12-21 21:04 UTC, Mike Kaganski
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mike Moratz-Coppins 2018-12-21 15:07:24 UTC
Description:
I found this in a round-about way because of a website that was inadvertently offering files to download but in Firefox the files came without the .docx file extension, causing Windows (tested on 10 x64, 7 x64, XP x86) to ask the user what they want to do with a file with no extension and no suggested app to open it with.  Firefox described the file being of type:
application/vnd.openxmlformats-officedocument.wordprocessingml.document

However, with Word 2007 installed, Firefox would suggest Word to open the file with and described it as a "Microsoft Word Document", or with Word installed but LO set as the default app to open Word 2007 Documents in Windows, it would suggest LibreOffice Writer.

After a bit of research, I added the following registry keys when Word was not installed:

HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/vnd.openxmlformats-officedocument.wordprocessingml.document

application/vnd.openxmlformats-officedocument.wordprocessingml.document\Extension (string): ".docx"

Which fixes the problem.  I think the other ones (Excel, PowerPoint) are missing too, but I haven't tested those to the same degree.

On Linux x64 LO 6.0.x works fine in this regard.

Here's the contents of the .reg file I made that fixes the problem:
Windows Registry Editor Version 5.00

[HKEY_CLASSES_ROOT\MIME\Database\Content Type\application/vnd.openxmlformats-officedocument.wordprocessingml.document]
"Extension"=".docx"



Steps to Reproduce:
1.  Download with Firefox a Word 2007 document from a website which lacks the .docx extension.


Actual Results:
Windows asks what to do with file of type 'application/vnd.openxmlformats-officedocument.wordprocessingml.document' with no suggested apps.


Expected Results:
LibreOffice Writer should have been the suggested app to open the file.


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Roman Kuznetsov 2018-12-21 20:49:04 UTC
Mike, please look at this. Can it be problem of LO installer?
Comment 2 Mike Kaganski 2018-12-21 20:56:20 UTC
(In reply to Mike Moratz-Coppins from comment #0)

Thanks for your proposal, and almost complete recipe for fixing.
Just one thing here:

> ...
> Steps to Reproduce:
> 1.  Download with Firefox a Word 2007 document from a website which lacks
> the .docx extension.

Could you please provide a link for such a document so that we could test?
As I cannot test the said behavior at the moment, you could help here in e.g. this way: attach a sample docx file without an extension, but with correct content type, to this issue, and check that downloading it actually reproduces the problem on your system. That way we would be sure to have steps to reproduce. Thanks!
Comment 3 Mike Moratz-Coppins 2018-12-21 20:58:55 UTC
https://dar98a.wixsite.com/yorkshiresommeliers/teams

Any of the blue links except 'Bingley'.
Comment 4 Mike Moratz-Coppins 2018-12-21 21:00:37 UTC
Re: which component - I would have marked it as an installer issue but I would have thought that when Windows's "Default Programs" UI is used to make LO as having all the defaults that perhaps that would be another point when a setting like this might be checked, but I have no idea of the inner workings of either Windows in this respect or LO.
Comment 5 Mike Kaganski 2018-12-21 21:00:53 UTC
(In reply to Mike Moratz-Coppins from comment #3)

Heh, both Google Chrome and Free Download Manager download them with .docx extension; and the links seem to have the extension there?
Comment 6 Mike Moratz-Coppins 2018-12-21 21:03:10 UTC
- edit - 

"Default Programs" is *also* used...

Re: Chrome and others - yeah, I have no idea what's going on there and why only FF is apparently affected by the filename truncation.
Comment 7 Mike Kaganski 2018-12-21 21:04:26 UTC
Created attachment 147769 [details]
A test DOCX without an extension, but with correct content type

Mike: could you please test if this reproduces the problem for you?
Comment 8 Mike Moratz-Coppins 2018-12-21 21:53:15 UTC
That test DOCX without an extension works fine, but then so do the documents from the website I mentioned and yet I removed the registry entries I made and rebooted the VM I've been using for testing this issue.

I thought that the issue might have been fixed pending a reboot that hadn't been done yet when I installed the latest 'fresh' release version (6.1.4) rather than the stable branch I normally use (6.0.7 for example), so I removed the latest version, rebooted, installed 6.0.7 and yet the files on both sites are working.
Comment 9 Mike Kaganski 2018-12-21 22:45:57 UTC
https://gerrit.libreoffice.org/65563
Comment 10 Commit Notification 2018-12-22 05:17:51 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/39b39f124a2bd6abe62e30bacac5d1326495d862%5E%21

tdf#122266: Register default extensions for OOXML content types

It will be available in 6.3.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.