Score:1

How to force Wine to open a png file by the default image viewer of my Linux system?

cn flag

How to change the default program which opens a file type (for example a .png file) within Wine?

When I try to open a png file within Wine by an email client (installed under Wine), the default Wine program which is supposed to open png files is used (instead of the default image viewer of my Linux System).

I would rather prefer to open a .png file with the default program of my Linux system which handles .png files.

My Linux system open png files by GPicView. When I click on a png file, GPicView opens them without problem. When working by Wine programs, I would prefer to open png files by GPicView as well.

To reproduce the problem: For example when I execute the Windows version of Alpine Email Client using Wine (see http://alpine.x10host.com/) when I try to open a .png email attachment, Alpine try to open it with Wine Internet Explorer which fails (no image can be seen when Internet Explorer opens).

To be precise, I use Lubuntu 18.04, Wine version is 3.0

Other observation: When I try to open a pdf attachment by Alpine, the default pdf viewer of my system (which is Document Viewer (Evince Authors)). This shows that the problem comes from Wine and not my Email Client. It seems that as Wine on my system seems to lack support for opening pdf files, it opens it by the default program of my system.

Score:1
ru flag

First create a .reg file for example png.reg and type the following in it:

[HKEY_CLASSES_ROOT\.png]
@="PNGfile"
"Content Type"="image/png"
[HKEY_CLASSES_ROOT\PNGfile\Shell\Open\command]
@="/bin/sh run_linux_program gpicview \"%1\"" 

Then import the .reg file into the registry using

regedit [Address to your file]/png.reg 

for more information take a look at this. Please note that wine isn't installed on my machine so I haven't tested it.

cn flag
Thank you. There was a typo in your code: pgicview --> gpicview, After correcting the typo, I used your solution but it didn't work. But your idea of using registry gave me the opportunity to find another solution.
AvSaba avatar
ru flag
@Name I fixed the typo. Glad you found a solution.
Score:0
cn flag

Run regedit from Terminal.

Find all occurrences of

"C:\Program Files (x86)\Internet Explorer\iexplore.exe" -nohome

and replace them with

"C:\windows\system32\winebrowser.exe" -nohome

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.