Bug: Problem with trying to open an attachment with a wine-programme (wine-Excel, wine-Notepad ect.)
Status: UNCONFIRMED
Priority: --
Created: 2024-06-05 19:05:11+00:00
Resolved: 2024-06-06 14:40:19+00:00

User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0

Steps to reproduce:

My system: 
– MX-Liux 23.3 Xfce (Debian 12 based)
– Xfce with Thunar as file-manager.
– Wine: I have installed Wine and in my Wine-Prefix I have installed MS Office 2010 inclusive Excel 2010.

Problem in short:
Thunderbird: I wanted to open a *.xls-file attachment in Thunderbird with Wine-Excel. But it does not open the xls-file.

Workaround: 
Thunar: Thunar also offers the possibility to open files by right click. 
I have now found this workaround: 
When I set Wine-Excel as the default App. in Thunar for double click, then it also works after in Thunderbird.

How to reproduce (step for step):
1. install Wine
2. create a Wine-prefix and install MS Office 2010 

------------------------------------------------------------
insertion:
You now have to configure wine, so that it works together with Thunderbird. Thunderbird-attachments are stored in the following folder in Linux:
/tmp/

So you must therefore ensure, that Wine has access to this folder:
You have to configure your prefix with winecfg. Please be sure, that you do really configure the prefix and not the default wine.

– open the wine-configuration window
– go to the tab "drives". There press the "expand-button".
– Add any drive letter. As path choose "/tmp/". Typ "automatically". Device should be empty. Apply and press the OK button.
(Have a look at the picture in this bug-report)

-> Wine and MS Office should now have access to /tmp/.
----------------------------------------------------------------------

3. open Thunar
4. right click on a xls-file
5. select "open with"
6. select "set default"
7. select something other than MS Excel. I have selected "FreeOffice 2021 PlanMaker". I guess you can also select "LibreOffice".
-> "FreeOffice 2021 PlanMaker" opens now automatically
8.  Close it
9. right click again on the file and control, if "FreeOffice 2021 PlanMaker" is the default now.
10. open Thunderbird
11. settings -> general -> files & attachments
12. look for the entry "(Microsoft Excel sheet: application/vnd.ms-excel)"
13. in the column "action" select "other app"
14. look for the right *.desktop wine-extension file. On my system its name is "wine-extension-xls.desktop". On my system it is in the path ~/.local/share/applications/
15. select/open it
16. In "action" I have now exactly the entry "wine-extension-xls.desktop" which is already a hint, that it will not work. – (Actually it should show under "action" the name that is in the line, that starts with "Name=" in the content of the "wine-extension-xls.desktop"-file which is normally different from the name of the file itself.
17. close in Thunderbird the settings-tab
18. go in Thunderbird to a mail, that has an xls-attachment.
19. Click on it.
-> Nothing happens


Now the workaround comes:
– Go back to Thunar and change the default from "FreeOffice 2021 PlanMaker" to "Wine-Excel".
– Excel opens and shows the file. Close it.
– Go back to Thunderbird
– In Thunderbird settings -> general -> files & attachments open the list in "action".
Now you not only find there the entry "wine-extension-xls.desktop", which is the file name, but you also find in the list the entry, that is in the line that begins with "Name=" in the file "wine-extension-xls.desktop". To find out this name open the file "wine-extension-xls.desktop" and have a look at the line.
– select the entry in "action" with this name
– close the settings-tab in Thunderbird
– change to the mail in Thunar with the xls-attachment
– click on it
-> Wine-Excel opens and shows the content of the attachment.

appendix:
The content of my "wine-extension-xls.desktop" looks like this:
´´´[Desktop Entry]
Type=Application
Name=xls Microsoft Excel
MimeType=application/vnd.ms-excel;
Exec=env WINEPREFIX="/home/user/.local/share/wineprefixes/Microsoft_2010_Office_Visio/" "/home/user/.local/share/lutris/runners/wine/lutris-5.2-x86_64/bin/wine" start /ProgIDOpen Excel.Sheet.8 %f
NoDisplay=true
StartupNotify=true
Icon=A888_EXCEL.0´´´


Actual results:

When I click on the xls-attachment in Thunderbird it only opens the file with wine-Excel, if wine-Excel is also the default app for this file-typ in thunar.


Expected results:

The excel attachment should open in Thunderbird with wine-Excel regardless of what is the default app in thunar.

Please note this is a bug report for Wine MS Office and *.xls-attachments.
It should be the same issue with ...
– Wine MS Office and *.xlsx-attachments
– Wine MS Office and *.doc-attachments
– Wine MS Office and *.docx-attachments