1

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.

2 Answers 2

1

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.

2
  • 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.
    – Name
    Jun 28, 2021 at 13:31
  • @Name I fixed the typo. Glad you found a solution. Jun 28, 2021 at 13:52
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.