Can't open a file with default wine application by double clicking

Hello all. I am using manjaro latest version with KDE plasma DE. I am trying to open a pdf file with pdfxchange editor application installed on wine. When double click on a pdf file (pdfxchange is selected as the default application) the the pdfxchange open without opening the pdf file itself. So I cannot open the pdf file in pdfxchange by double clicking on it. I have to go to open the pdfxchange application first. The go to files menu and then browse the pdf file and open it in this manner, or I can also drag the pdf file to the open pdfxchange editor application. I tried many things, with no success. I tried wine with playonlinux. I tried just wine without anything else. I tried with winetricks app. I also uninstalled and reinstalled wine and other dependencies several times but all without any success.
It would be strange that the default configuration of wine doesn’t permit this basic functionality of wine to open a file in its default wine application…Any help will be appreciated.

Extension?

find ~/.local/share/applications/ -name "*wine-extension*"

(PS - supposedly some tools like playonlinux have settings for enabling pdf extension)

Open up the System Settings and navigate to… :arrow_down:

Personalization → Applications → File Associations

Click on “+application” in the left pane. Scroll down until you see .pdf. Now in the right hand box, select your pdfexchange application and click the Edit button.

A dialog will pop up. Click on the Application tab. In the field for the application’s command, add %U behind the name of the executable, e.g. like so… :arrow_down:

wine pdfexchange %U

Click OK. Then click OK again in the parent window.

1 Like

Aragon, Thank you for detailed explanation. Sorry, but I can’t understand where exactly I have to add %U. On the Application tab, on the field for application name it is written “PDF-XChange Editor” I added %U after that and nothing has happened. When I double click a pdf, an empty PDF-Xchange editor window is opened.

No, you should not add it after the name of the application, but after the name of the command, as in the screenshot below ─ note: I don’t have wine installed, so the screenshot is of another application’s settings. :arrow_down:

Oh OK. Thank you. I understand it better. I tried that. But unfortunately, nothing has changed. I still cant open a pdf file with a double click.

Have you tried logging out and logging back in after making the change?

Yes. I did logout and in. Also restarted. But no help.
I wonder if some previous installations of wine have ruined something. I just tried this:

rm -rf $HOME/.wine
rm -f $HOME/.config/menus/applications-merged/*wine*
rm -rf $HOME/.local/share/applications/wine
rm -f $HOME/.local/share/desktop-directories/*wine*
rm -f $HOME/.local/share/icons/*wine*

(source: askubuntu[dot]com/questions/15551/how-to-remove-wine-completely)
I dont know why the forum does not let me add links and images to my post
Now trying to reinstall wine

Hi @amdg,

Please see [HowTo] post screenshots and links

1 Like

@Mirdarthos, thank you for the link. I guess I have to wait with patience to become trustworthy

@Aragorn, I tried reinstalling. But nothing got better. Its only worse now since I lost all the icons (because I guess I cleaned too much the previous installation)


**thanks to whoever made me trustworthy so quickly :slight_smile:

Or, y’know, use another method mentioned there…

Updates:

  1. The icons are all back now. May be because I changed the theme. I don’t know.
  2. If I try to open a file with a wine application with terminal, it works. I tried wine PDFXEdit somefile.pdf and it opens the file perfectly in the wine application. But I can’t get it to open with the GUI(by double clicking on the file)

Finally I had it working.

I just added Z:%U at the end of the executable.
So in my case it is:

env WINEPREFIX="/home/pc/.wine" wine C:\\windows\\command\\start.exe /Unix /home/pc/.wine/dosdevices/c:/users/pc/AppData/Roaming/Microsoft/Windows/Start\ Menu/Programs/Tracker\ Software/PDF-XChange\ Editor.lnk Z:%U

Reference:

  1. https://askubuntu.com/questions/123092/open-file-using-custom-command-how-to-specify-the-file-in-cmd-line
  2. see posts above, especially: Can't open a file with default wine application by double clicking - #3 by Aragorn

Thanks also @Aragorn for getting me started in the right track.

I have one more question:
Is this something a problem that can be resolved by the ones who maintain wine or by manjaro? I would like to report this problem to the right people who can resolve it so that one will not have to struggle and do a patch like I did.

1 Like

It’s a package that’s directly imported from Arch. The packager is Felix Yan, an Arch package maintainer.

:man_shrugging:

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.