How to open files with a wine application from mc?Xorg ignoring wine applicationInstall winetricks...

Acceleration in Circular motion

Why is my line not appearing smooth?

Do space suits measure "methane" levels or other biological gases?

How can I get edges to bend to avoid crossing?

What's the easiest way for a whole party to be able to communicate with a creature that doesn't know Common?

Does anyone know what these symbols mean?

Details of video memory access arbitration in Space Invaders

Why do I need two parameters in an HTTP parameter pollution attack?

Meaning of もてり and use of が

Are these intended activities legal to do in the USA under the VWP?

How to fix a dry solder pin in BGA package?

Did Wakanda officially get the stuff out of Bucky's head?

Can Access Fault Exceptions of the MC68040 caused by internal access faults occur in normal situations?

Is there a way for presidents to legally extend their terms beyond the maximum of four years?

The Confused Alien

If two black hole event horizons overlap (touch) can they ever separate again?

When are digital copies of Switch games made available to play?

Is there a nice way to assign std::minmax(a, b) to std::tie(a, b)?

Why won't the ground take my seed?

Convergenge or divergence of series with e

Word for the ability to deliver clever replies?

Can a Federation colony become a member world?

What is the highest number of sneak attacks that a Pure/High Level Rogue (Level 17+) can make in one round?

How to expand abbrevs without hitting another extra key?



How to open files with a wine application from mc?


Xorg ignoring wine applicationInstall winetricks application to ~/.wine prefixhow to delete wine temp files for an applicationInstalling an application to run using wineCompiling wine application, how do i link to windows.hRunning a Wine application from other user in openSUSEHow to create a custom command in Linux for a wine pdf application?Prevent Wine application from checking for DirectXThe window of a Window's program running under Wine is not in the front by defaultWine application launch error






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty{ margin-bottom:0;
}







2















I want to use PDF-XChange Editor to open pdf files from within mc. I tryed setting



Open=wine ~/PDFXEdit6_Portable/PDFXEdit.exe %f


in mc.ext, but it opens only the application, not the file.





[edit]



It seems to me the syntax of this field is close to that of exec in .desktop files, so I tried to adapt some of the solutions proposed on How to pass file as argument in .desktop file for wine application, but without success yet.










share|improve this question































    2















    I want to use PDF-XChange Editor to open pdf files from within mc. I tryed setting



    Open=wine ~/PDFXEdit6_Portable/PDFXEdit.exe %f


    in mc.ext, but it opens only the application, not the file.





    [edit]



    It seems to me the syntax of this field is close to that of exec in .desktop files, so I tried to adapt some of the solutions proposed on How to pass file as argument in .desktop file for wine application, but without success yet.










    share|improve this question



























      2












      2








      2








      I want to use PDF-XChange Editor to open pdf files from within mc. I tryed setting



      Open=wine ~/PDFXEdit6_Portable/PDFXEdit.exe %f


      in mc.ext, but it opens only the application, not the file.





      [edit]



      It seems to me the syntax of this field is close to that of exec in .desktop files, so I tried to adapt some of the solutions proposed on How to pass file as argument in .desktop file for wine application, but without success yet.










      share|improve this question
















      I want to use PDF-XChange Editor to open pdf files from within mc. I tryed setting



      Open=wine ~/PDFXEdit6_Portable/PDFXEdit.exe %f


      in mc.ext, but it opens only the application, not the file.





      [edit]



      It seems to me the syntax of this field is close to that of exec in .desktop files, so I tried to adapt some of the solutions proposed on How to pass file as argument in .desktop file for wine application, but without success yet.







      pdf wine mc






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Dec 29 '16 at 19:45







      Arch Stanton

















      asked Dec 20 '16 at 21:43









      Arch StantonArch Stanton

      1652 silver badges14 bronze badges




      1652 silver badges14 bronze badges






















          2 Answers
          2






          active

          oldest

          votes


















          1














          Short answer.



          You are using %f, but the filename You want to pass is stored in ${MC_EXT_FILENAME} variable.



          Long answer.



          How to open / view PDF files using Midnight Commander + wine + PDF-XChange Viewer / Editor Portable



          note: I assume that windows portable apps are stored in "~/MyApps/*"




          • open Midnight Commander extension file for editing: F9
            -> Command -> Edit extension file

          • navigate to the section of the file where PDF configuration is written:
            type /pdfEnter

          • comment out the following lines (just for a backup):




          # PDF
          #type/^PDF
          # Open=/usr/lib/mc/ext.d/doc.sh open pdf
          # View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view pdf



          • add / replace with the following lines:




          # PDF
          type/^PDF
          Open=~/MyApps/start-pdf-mc.sh
          View=%view{ascii} ~/MyApps/start-pdf-mc.sh



          • exit and save the changes: :wq

          • create the ~/MyApps/start-pdf-mc.sh file with the following content:




          #!/bin/bash
          Filename="z:"${MC_EXT_FILENAME////\}
          App=`eval wine "~/MyApps/PDF-XChange_Viewer/PDFXCview.exe" "'$Filename'" > /dev/null 2>&1 &`
          $App


          note: You might want to create it in /usr/lib/mc/ext.d/*.sh (instead of ~/MyApps/ as I did)




          • make sure start-pdf-mc.sh file is executable (use chmod)


          explanation of the start-pdf-mc.sh file




          • the filename we are trying to open is stored in ${MC_EXT_FILENAME}
            variable


          • when using wine, use drive letter z:


          • convert Linux-style file path (/) to Windows-style () with the
            following: ${MC_EXT_FILENAME////\} to pass it as an argument to
            PDF-XChange Viewer later


          • > /dev/null 2>&1 and & are required to discard program output and to run it as a background process, otherwise (if you omit this), You've won't be able to use Midnight Commander till You close PDF-XChange Viewer which is obviously not desirable



          tested with the following software




          • Linux Debian 32-bit


          • GNU Midnight Commander 4.8.13


          • wine-1.6.2


          • PDF-XChange Viewer v2.5.316.1



          AND




          • Linux Debian 32-bit


          • GNU Midnight Commander 4.8.13


          • wine-1.6.2


          • PDF-XChange Editor v6.0.321.0



          update according to Your comment



          It seems that there is still some error in the filepath... Let's try to correct it.



          1.




          • Open problematic pdf file with PDFXChange Editor (as you usually do, NOT with the Midnight Commander)


          • File -> Copy Full File Name


          • Paste it in any text file (just for later reference)


          • Close PDFXChange Editor


          • Open the same file with Midnight Commander + PDFXChange Editor (which shows your error message)


          • Compare if the file paths are identical (the one that You've just
            pasted for reference and the one in Your error message)


          • If the paths are NOT identical - correct the path accordingly in .sh file OR paste them here for me to help (just replace your username in the path with <username> for security)



          2.



          Also, this is not so likely, BUT if the paths ARE identical there might be an issue with permissions that are set on the file you are trying to open. Thus verify your file permissions are at least:



          sudo chmod 644 your-file-name-here.pdf


          update 2



          It is possible to have access to all files from all drives including those that are NOT located in the ~/* (home user directory) or even stored on other HDDs just by using Z: (not using H: and other drive letters at all).



          Check Your drive mapping in wine:





          • run in terminal



            $ winecfg



          • open the Drives tab



          • the following records have to be there by default



            Letter | Drive Mapping
            C: | ../drive_c
            Z: | /



          As far as I know, any path starts with / (for any file on any HDD accessed in Linux) and thus can be accessed using the Z:, because of the mapping described above.



          For example, the above config allows me to access a pdf file




          • from /home/<username>/*.pdf (~/*.pdf), if it's located in home
            user directory

          • from /media/<drive-label>/*.pdf OR /mnt/<drive-label>/*.pdf, if it's located on some external drive or HDD, that I've mounted; (in windows the same drive might be accessed using the H:, for example)


          Drive mappings, however, would be another question, specific to Your setup. :-)



          BTW, one more thing to check. Is your user home directory ~/* mapped to wine's My Documents folder?




          • in terminal: $ wine explorer

          • double click on My Documents folder

          • You should see the contents of your Linux ~/* home directory






          share|improve this answer


























          • Thanks for helping. I get an error, though: PDFXChange Editor says An error occurred while opening the document from the file: z:home...file.pdf Error [operating system]: path not found.

            – Arch Stanton
            Apr 22 '17 at 9:29













          • Answer updated. Please, check it and report the results.

            – Dmytro Dzyubak
            Apr 22 '17 at 15:35











          • I think the problem is that the ${MC_EXT_FILENAME} is an absolute path while the "full file name" is relative to my home. The full file name is H:Downloadsfile.pdf, the Downloads folder is in /home/me/Downloads.

            – Arch Stanton
            Apr 23 '17 at 8:31













          • How have you managed to get to the H: drive letter from MC? Anyway, check out update 2.

            – Dmytro Dzyubak
            Apr 23 '17 at 18:48











          • My Documents is not mapped to ~/ and I don't want it so. Anyway, I didn't have Z: mapped to /. I added it and now it works. Thank you :-)

            – Arch Stanton
            Apr 23 '17 at 19:28



















          0














          For me, the solution was to add, at the end of command line
          Open=wine ~/PDFXEdit6_Portable/PDFXEdit.exe z:%f



          I tested with PDF X-Change Editor, in the shortcut, and it worked too:



          env WINEPREFIX="/home/jim/.wine" wine-stable C:windowscommandstart.exe /Unix /home/jim/.wine/dosdevices/c:/users/jim/Start Menu/Programs/Tracker Software/PDF-XChange Editor.lnk z:%f






          share|improve this answer








          New contributor



          James Erdrick Hawk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






















            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "106"
            };
            initTagRenderer("".split(" "), "".split(" "), channelOptions);

            StackExchange.using("externalEditor", function() {
            // Have to fire editor after snippets, if snippets enabled
            if (StackExchange.settings.snippets.snippetsEnabled) {
            StackExchange.using("snippets", function() {
            createEditor();
            });
            }
            else {
            createEditor();
            }
            });

            function createEditor() {
            StackExchange.prepareEditor({
            heartbeatType: 'answer',
            autoActivateHeartbeat: false,
            convertImagesToLinks: false,
            noModals: true,
            showLowRepImageUploadWarning: true,
            reputationToPostImages: null,
            bindNavPrevention: true,
            postfix: "",
            imageUploader: {
            brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
            contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
            allowUrls: true
            },
            onDemand: true,
            discardSelector: ".discard-answer"
            ,immediatelyShowMarkdownHelp:true
            });


            }
            });














            draft saved

            draft discarded


















            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f331763%2fhow-to-open-files-with-a-wine-application-from-mc%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            2 Answers
            2






            active

            oldest

            votes








            2 Answers
            2






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            1














            Short answer.



            You are using %f, but the filename You want to pass is stored in ${MC_EXT_FILENAME} variable.



            Long answer.



            How to open / view PDF files using Midnight Commander + wine + PDF-XChange Viewer / Editor Portable



            note: I assume that windows portable apps are stored in "~/MyApps/*"




            • open Midnight Commander extension file for editing: F9
              -> Command -> Edit extension file

            • navigate to the section of the file where PDF configuration is written:
              type /pdfEnter

            • comment out the following lines (just for a backup):




            # PDF
            #type/^PDF
            # Open=/usr/lib/mc/ext.d/doc.sh open pdf
            # View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view pdf



            • add / replace with the following lines:




            # PDF
            type/^PDF
            Open=~/MyApps/start-pdf-mc.sh
            View=%view{ascii} ~/MyApps/start-pdf-mc.sh



            • exit and save the changes: :wq

            • create the ~/MyApps/start-pdf-mc.sh file with the following content:




            #!/bin/bash
            Filename="z:"${MC_EXT_FILENAME////\}
            App=`eval wine "~/MyApps/PDF-XChange_Viewer/PDFXCview.exe" "'$Filename'" > /dev/null 2>&1 &`
            $App


            note: You might want to create it in /usr/lib/mc/ext.d/*.sh (instead of ~/MyApps/ as I did)




            • make sure start-pdf-mc.sh file is executable (use chmod)


            explanation of the start-pdf-mc.sh file




            • the filename we are trying to open is stored in ${MC_EXT_FILENAME}
              variable


            • when using wine, use drive letter z:


            • convert Linux-style file path (/) to Windows-style () with the
              following: ${MC_EXT_FILENAME////\} to pass it as an argument to
              PDF-XChange Viewer later


            • > /dev/null 2>&1 and & are required to discard program output and to run it as a background process, otherwise (if you omit this), You've won't be able to use Midnight Commander till You close PDF-XChange Viewer which is obviously not desirable



            tested with the following software




            • Linux Debian 32-bit


            • GNU Midnight Commander 4.8.13


            • wine-1.6.2


            • PDF-XChange Viewer v2.5.316.1



            AND




            • Linux Debian 32-bit


            • GNU Midnight Commander 4.8.13


            • wine-1.6.2


            • PDF-XChange Editor v6.0.321.0



            update according to Your comment



            It seems that there is still some error in the filepath... Let's try to correct it.



            1.




            • Open problematic pdf file with PDFXChange Editor (as you usually do, NOT with the Midnight Commander)


            • File -> Copy Full File Name


            • Paste it in any text file (just for later reference)


            • Close PDFXChange Editor


            • Open the same file with Midnight Commander + PDFXChange Editor (which shows your error message)


            • Compare if the file paths are identical (the one that You've just
              pasted for reference and the one in Your error message)


            • If the paths are NOT identical - correct the path accordingly in .sh file OR paste them here for me to help (just replace your username in the path with <username> for security)



            2.



            Also, this is not so likely, BUT if the paths ARE identical there might be an issue with permissions that are set on the file you are trying to open. Thus verify your file permissions are at least:



            sudo chmod 644 your-file-name-here.pdf


            update 2



            It is possible to have access to all files from all drives including those that are NOT located in the ~/* (home user directory) or even stored on other HDDs just by using Z: (not using H: and other drive letters at all).



            Check Your drive mapping in wine:





            • run in terminal



              $ winecfg



            • open the Drives tab



            • the following records have to be there by default



              Letter | Drive Mapping
              C: | ../drive_c
              Z: | /



            As far as I know, any path starts with / (for any file on any HDD accessed in Linux) and thus can be accessed using the Z:, because of the mapping described above.



            For example, the above config allows me to access a pdf file




            • from /home/<username>/*.pdf (~/*.pdf), if it's located in home
              user directory

            • from /media/<drive-label>/*.pdf OR /mnt/<drive-label>/*.pdf, if it's located on some external drive or HDD, that I've mounted; (in windows the same drive might be accessed using the H:, for example)


            Drive mappings, however, would be another question, specific to Your setup. :-)



            BTW, one more thing to check. Is your user home directory ~/* mapped to wine's My Documents folder?




            • in terminal: $ wine explorer

            • double click on My Documents folder

            • You should see the contents of your Linux ~/* home directory






            share|improve this answer


























            • Thanks for helping. I get an error, though: PDFXChange Editor says An error occurred while opening the document from the file: z:home...file.pdf Error [operating system]: path not found.

              – Arch Stanton
              Apr 22 '17 at 9:29













            • Answer updated. Please, check it and report the results.

              – Dmytro Dzyubak
              Apr 22 '17 at 15:35











            • I think the problem is that the ${MC_EXT_FILENAME} is an absolute path while the "full file name" is relative to my home. The full file name is H:Downloadsfile.pdf, the Downloads folder is in /home/me/Downloads.

              – Arch Stanton
              Apr 23 '17 at 8:31













            • How have you managed to get to the H: drive letter from MC? Anyway, check out update 2.

              – Dmytro Dzyubak
              Apr 23 '17 at 18:48











            • My Documents is not mapped to ~/ and I don't want it so. Anyway, I didn't have Z: mapped to /. I added it and now it works. Thank you :-)

              – Arch Stanton
              Apr 23 '17 at 19:28
















            1














            Short answer.



            You are using %f, but the filename You want to pass is stored in ${MC_EXT_FILENAME} variable.



            Long answer.



            How to open / view PDF files using Midnight Commander + wine + PDF-XChange Viewer / Editor Portable



            note: I assume that windows portable apps are stored in "~/MyApps/*"




            • open Midnight Commander extension file for editing: F9
              -> Command -> Edit extension file

            • navigate to the section of the file where PDF configuration is written:
              type /pdfEnter

            • comment out the following lines (just for a backup):




            # PDF
            #type/^PDF
            # Open=/usr/lib/mc/ext.d/doc.sh open pdf
            # View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view pdf



            • add / replace with the following lines:




            # PDF
            type/^PDF
            Open=~/MyApps/start-pdf-mc.sh
            View=%view{ascii} ~/MyApps/start-pdf-mc.sh



            • exit and save the changes: :wq

            • create the ~/MyApps/start-pdf-mc.sh file with the following content:




            #!/bin/bash
            Filename="z:"${MC_EXT_FILENAME////\}
            App=`eval wine "~/MyApps/PDF-XChange_Viewer/PDFXCview.exe" "'$Filename'" > /dev/null 2>&1 &`
            $App


            note: You might want to create it in /usr/lib/mc/ext.d/*.sh (instead of ~/MyApps/ as I did)




            • make sure start-pdf-mc.sh file is executable (use chmod)


            explanation of the start-pdf-mc.sh file




            • the filename we are trying to open is stored in ${MC_EXT_FILENAME}
              variable


            • when using wine, use drive letter z:


            • convert Linux-style file path (/) to Windows-style () with the
              following: ${MC_EXT_FILENAME////\} to pass it as an argument to
              PDF-XChange Viewer later


            • > /dev/null 2>&1 and & are required to discard program output and to run it as a background process, otherwise (if you omit this), You've won't be able to use Midnight Commander till You close PDF-XChange Viewer which is obviously not desirable



            tested with the following software




            • Linux Debian 32-bit


            • GNU Midnight Commander 4.8.13


            • wine-1.6.2


            • PDF-XChange Viewer v2.5.316.1



            AND




            • Linux Debian 32-bit


            • GNU Midnight Commander 4.8.13


            • wine-1.6.2


            • PDF-XChange Editor v6.0.321.0



            update according to Your comment



            It seems that there is still some error in the filepath... Let's try to correct it.



            1.




            • Open problematic pdf file with PDFXChange Editor (as you usually do, NOT with the Midnight Commander)


            • File -> Copy Full File Name


            • Paste it in any text file (just for later reference)


            • Close PDFXChange Editor


            • Open the same file with Midnight Commander + PDFXChange Editor (which shows your error message)


            • Compare if the file paths are identical (the one that You've just
              pasted for reference and the one in Your error message)


            • If the paths are NOT identical - correct the path accordingly in .sh file OR paste them here for me to help (just replace your username in the path with <username> for security)



            2.



            Also, this is not so likely, BUT if the paths ARE identical there might be an issue with permissions that are set on the file you are trying to open. Thus verify your file permissions are at least:



            sudo chmod 644 your-file-name-here.pdf


            update 2



            It is possible to have access to all files from all drives including those that are NOT located in the ~/* (home user directory) or even stored on other HDDs just by using Z: (not using H: and other drive letters at all).



            Check Your drive mapping in wine:





            • run in terminal



              $ winecfg



            • open the Drives tab



            • the following records have to be there by default



              Letter | Drive Mapping
              C: | ../drive_c
              Z: | /



            As far as I know, any path starts with / (for any file on any HDD accessed in Linux) and thus can be accessed using the Z:, because of the mapping described above.



            For example, the above config allows me to access a pdf file




            • from /home/<username>/*.pdf (~/*.pdf), if it's located in home
              user directory

            • from /media/<drive-label>/*.pdf OR /mnt/<drive-label>/*.pdf, if it's located on some external drive or HDD, that I've mounted; (in windows the same drive might be accessed using the H:, for example)


            Drive mappings, however, would be another question, specific to Your setup. :-)



            BTW, one more thing to check. Is your user home directory ~/* mapped to wine's My Documents folder?




            • in terminal: $ wine explorer

            • double click on My Documents folder

            • You should see the contents of your Linux ~/* home directory






            share|improve this answer


























            • Thanks for helping. I get an error, though: PDFXChange Editor says An error occurred while opening the document from the file: z:home...file.pdf Error [operating system]: path not found.

              – Arch Stanton
              Apr 22 '17 at 9:29













            • Answer updated. Please, check it and report the results.

              – Dmytro Dzyubak
              Apr 22 '17 at 15:35











            • I think the problem is that the ${MC_EXT_FILENAME} is an absolute path while the "full file name" is relative to my home. The full file name is H:Downloadsfile.pdf, the Downloads folder is in /home/me/Downloads.

              – Arch Stanton
              Apr 23 '17 at 8:31













            • How have you managed to get to the H: drive letter from MC? Anyway, check out update 2.

              – Dmytro Dzyubak
              Apr 23 '17 at 18:48











            • My Documents is not mapped to ~/ and I don't want it so. Anyway, I didn't have Z: mapped to /. I added it and now it works. Thank you :-)

              – Arch Stanton
              Apr 23 '17 at 19:28














            1












            1








            1







            Short answer.



            You are using %f, but the filename You want to pass is stored in ${MC_EXT_FILENAME} variable.



            Long answer.



            How to open / view PDF files using Midnight Commander + wine + PDF-XChange Viewer / Editor Portable



            note: I assume that windows portable apps are stored in "~/MyApps/*"




            • open Midnight Commander extension file for editing: F9
              -> Command -> Edit extension file

            • navigate to the section of the file where PDF configuration is written:
              type /pdfEnter

            • comment out the following lines (just for a backup):




            # PDF
            #type/^PDF
            # Open=/usr/lib/mc/ext.d/doc.sh open pdf
            # View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view pdf



            • add / replace with the following lines:




            # PDF
            type/^PDF
            Open=~/MyApps/start-pdf-mc.sh
            View=%view{ascii} ~/MyApps/start-pdf-mc.sh



            • exit and save the changes: :wq

            • create the ~/MyApps/start-pdf-mc.sh file with the following content:




            #!/bin/bash
            Filename="z:"${MC_EXT_FILENAME////\}
            App=`eval wine "~/MyApps/PDF-XChange_Viewer/PDFXCview.exe" "'$Filename'" > /dev/null 2>&1 &`
            $App


            note: You might want to create it in /usr/lib/mc/ext.d/*.sh (instead of ~/MyApps/ as I did)




            • make sure start-pdf-mc.sh file is executable (use chmod)


            explanation of the start-pdf-mc.sh file




            • the filename we are trying to open is stored in ${MC_EXT_FILENAME}
              variable


            • when using wine, use drive letter z:


            • convert Linux-style file path (/) to Windows-style () with the
              following: ${MC_EXT_FILENAME////\} to pass it as an argument to
              PDF-XChange Viewer later


            • > /dev/null 2>&1 and & are required to discard program output and to run it as a background process, otherwise (if you omit this), You've won't be able to use Midnight Commander till You close PDF-XChange Viewer which is obviously not desirable



            tested with the following software




            • Linux Debian 32-bit


            • GNU Midnight Commander 4.8.13


            • wine-1.6.2


            • PDF-XChange Viewer v2.5.316.1



            AND




            • Linux Debian 32-bit


            • GNU Midnight Commander 4.8.13


            • wine-1.6.2


            • PDF-XChange Editor v6.0.321.0



            update according to Your comment



            It seems that there is still some error in the filepath... Let's try to correct it.



            1.




            • Open problematic pdf file with PDFXChange Editor (as you usually do, NOT with the Midnight Commander)


            • File -> Copy Full File Name


            • Paste it in any text file (just for later reference)


            • Close PDFXChange Editor


            • Open the same file with Midnight Commander + PDFXChange Editor (which shows your error message)


            • Compare if the file paths are identical (the one that You've just
              pasted for reference and the one in Your error message)


            • If the paths are NOT identical - correct the path accordingly in .sh file OR paste them here for me to help (just replace your username in the path with <username> for security)



            2.



            Also, this is not so likely, BUT if the paths ARE identical there might be an issue with permissions that are set on the file you are trying to open. Thus verify your file permissions are at least:



            sudo chmod 644 your-file-name-here.pdf


            update 2



            It is possible to have access to all files from all drives including those that are NOT located in the ~/* (home user directory) or even stored on other HDDs just by using Z: (not using H: and other drive letters at all).



            Check Your drive mapping in wine:





            • run in terminal



              $ winecfg



            • open the Drives tab



            • the following records have to be there by default



              Letter | Drive Mapping
              C: | ../drive_c
              Z: | /



            As far as I know, any path starts with / (for any file on any HDD accessed in Linux) and thus can be accessed using the Z:, because of the mapping described above.



            For example, the above config allows me to access a pdf file




            • from /home/<username>/*.pdf (~/*.pdf), if it's located in home
              user directory

            • from /media/<drive-label>/*.pdf OR /mnt/<drive-label>/*.pdf, if it's located on some external drive or HDD, that I've mounted; (in windows the same drive might be accessed using the H:, for example)


            Drive mappings, however, would be another question, specific to Your setup. :-)



            BTW, one more thing to check. Is your user home directory ~/* mapped to wine's My Documents folder?




            • in terminal: $ wine explorer

            • double click on My Documents folder

            • You should see the contents of your Linux ~/* home directory






            share|improve this answer















            Short answer.



            You are using %f, but the filename You want to pass is stored in ${MC_EXT_FILENAME} variable.



            Long answer.



            How to open / view PDF files using Midnight Commander + wine + PDF-XChange Viewer / Editor Portable



            note: I assume that windows portable apps are stored in "~/MyApps/*"




            • open Midnight Commander extension file for editing: F9
              -> Command -> Edit extension file

            • navigate to the section of the file where PDF configuration is written:
              type /pdfEnter

            • comment out the following lines (just for a backup):




            # PDF
            #type/^PDF
            # Open=/usr/lib/mc/ext.d/doc.sh open pdf
            # View=%view{ascii} /usr/lib/mc/ext.d/doc.sh view pdf



            • add / replace with the following lines:




            # PDF
            type/^PDF
            Open=~/MyApps/start-pdf-mc.sh
            View=%view{ascii} ~/MyApps/start-pdf-mc.sh



            • exit and save the changes: :wq

            • create the ~/MyApps/start-pdf-mc.sh file with the following content:




            #!/bin/bash
            Filename="z:"${MC_EXT_FILENAME////\}
            App=`eval wine "~/MyApps/PDF-XChange_Viewer/PDFXCview.exe" "'$Filename'" > /dev/null 2>&1 &`
            $App


            note: You might want to create it in /usr/lib/mc/ext.d/*.sh (instead of ~/MyApps/ as I did)




            • make sure start-pdf-mc.sh file is executable (use chmod)


            explanation of the start-pdf-mc.sh file




            • the filename we are trying to open is stored in ${MC_EXT_FILENAME}
              variable


            • when using wine, use drive letter z:


            • convert Linux-style file path (/) to Windows-style () with the
              following: ${MC_EXT_FILENAME////\} to pass it as an argument to
              PDF-XChange Viewer later


            • > /dev/null 2>&1 and & are required to discard program output and to run it as a background process, otherwise (if you omit this), You've won't be able to use Midnight Commander till You close PDF-XChange Viewer which is obviously not desirable



            tested with the following software




            • Linux Debian 32-bit


            • GNU Midnight Commander 4.8.13


            • wine-1.6.2


            • PDF-XChange Viewer v2.5.316.1



            AND




            • Linux Debian 32-bit


            • GNU Midnight Commander 4.8.13


            • wine-1.6.2


            • PDF-XChange Editor v6.0.321.0



            update according to Your comment



            It seems that there is still some error in the filepath... Let's try to correct it.



            1.




            • Open problematic pdf file with PDFXChange Editor (as you usually do, NOT with the Midnight Commander)


            • File -> Copy Full File Name


            • Paste it in any text file (just for later reference)


            • Close PDFXChange Editor


            • Open the same file with Midnight Commander + PDFXChange Editor (which shows your error message)


            • Compare if the file paths are identical (the one that You've just
              pasted for reference and the one in Your error message)


            • If the paths are NOT identical - correct the path accordingly in .sh file OR paste them here for me to help (just replace your username in the path with <username> for security)



            2.



            Also, this is not so likely, BUT if the paths ARE identical there might be an issue with permissions that are set on the file you are trying to open. Thus verify your file permissions are at least:



            sudo chmod 644 your-file-name-here.pdf


            update 2



            It is possible to have access to all files from all drives including those that are NOT located in the ~/* (home user directory) or even stored on other HDDs just by using Z: (not using H: and other drive letters at all).



            Check Your drive mapping in wine:





            • run in terminal



              $ winecfg



            • open the Drives tab



            • the following records have to be there by default



              Letter | Drive Mapping
              C: | ../drive_c
              Z: | /



            As far as I know, any path starts with / (for any file on any HDD accessed in Linux) and thus can be accessed using the Z:, because of the mapping described above.



            For example, the above config allows me to access a pdf file




            • from /home/<username>/*.pdf (~/*.pdf), if it's located in home
              user directory

            • from /media/<drive-label>/*.pdf OR /mnt/<drive-label>/*.pdf, if it's located on some external drive or HDD, that I've mounted; (in windows the same drive might be accessed using the H:, for example)


            Drive mappings, however, would be another question, specific to Your setup. :-)



            BTW, one more thing to check. Is your user home directory ~/* mapped to wine's My Documents folder?




            • in terminal: $ wine explorer

            • double click on My Documents folder

            • You should see the contents of your Linux ~/* home directory







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Apr 23 '17 at 18:52

























            answered Apr 21 '17 at 2:02









            Dmytro DzyubakDmytro Dzyubak

            2181 gold badge3 silver badges8 bronze badges




            2181 gold badge3 silver badges8 bronze badges













            • Thanks for helping. I get an error, though: PDFXChange Editor says An error occurred while opening the document from the file: z:home...file.pdf Error [operating system]: path not found.

              – Arch Stanton
              Apr 22 '17 at 9:29













            • Answer updated. Please, check it and report the results.

              – Dmytro Dzyubak
              Apr 22 '17 at 15:35











            • I think the problem is that the ${MC_EXT_FILENAME} is an absolute path while the "full file name" is relative to my home. The full file name is H:Downloadsfile.pdf, the Downloads folder is in /home/me/Downloads.

              – Arch Stanton
              Apr 23 '17 at 8:31













            • How have you managed to get to the H: drive letter from MC? Anyway, check out update 2.

              – Dmytro Dzyubak
              Apr 23 '17 at 18:48











            • My Documents is not mapped to ~/ and I don't want it so. Anyway, I didn't have Z: mapped to /. I added it and now it works. Thank you :-)

              – Arch Stanton
              Apr 23 '17 at 19:28



















            • Thanks for helping. I get an error, though: PDFXChange Editor says An error occurred while opening the document from the file: z:home...file.pdf Error [operating system]: path not found.

              – Arch Stanton
              Apr 22 '17 at 9:29













            • Answer updated. Please, check it and report the results.

              – Dmytro Dzyubak
              Apr 22 '17 at 15:35











            • I think the problem is that the ${MC_EXT_FILENAME} is an absolute path while the "full file name" is relative to my home. The full file name is H:Downloadsfile.pdf, the Downloads folder is in /home/me/Downloads.

              – Arch Stanton
              Apr 23 '17 at 8:31













            • How have you managed to get to the H: drive letter from MC? Anyway, check out update 2.

              – Dmytro Dzyubak
              Apr 23 '17 at 18:48











            • My Documents is not mapped to ~/ and I don't want it so. Anyway, I didn't have Z: mapped to /. I added it and now it works. Thank you :-)

              – Arch Stanton
              Apr 23 '17 at 19:28

















            Thanks for helping. I get an error, though: PDFXChange Editor says An error occurred while opening the document from the file: z:home...file.pdf Error [operating system]: path not found.

            – Arch Stanton
            Apr 22 '17 at 9:29







            Thanks for helping. I get an error, though: PDFXChange Editor says An error occurred while opening the document from the file: z:home...file.pdf Error [operating system]: path not found.

            – Arch Stanton
            Apr 22 '17 at 9:29















            Answer updated. Please, check it and report the results.

            – Dmytro Dzyubak
            Apr 22 '17 at 15:35





            Answer updated. Please, check it and report the results.

            – Dmytro Dzyubak
            Apr 22 '17 at 15:35













            I think the problem is that the ${MC_EXT_FILENAME} is an absolute path while the "full file name" is relative to my home. The full file name is H:Downloadsfile.pdf, the Downloads folder is in /home/me/Downloads.

            – Arch Stanton
            Apr 23 '17 at 8:31







            I think the problem is that the ${MC_EXT_FILENAME} is an absolute path while the "full file name" is relative to my home. The full file name is H:Downloadsfile.pdf, the Downloads folder is in /home/me/Downloads.

            – Arch Stanton
            Apr 23 '17 at 8:31















            How have you managed to get to the H: drive letter from MC? Anyway, check out update 2.

            – Dmytro Dzyubak
            Apr 23 '17 at 18:48





            How have you managed to get to the H: drive letter from MC? Anyway, check out update 2.

            – Dmytro Dzyubak
            Apr 23 '17 at 18:48













            My Documents is not mapped to ~/ and I don't want it so. Anyway, I didn't have Z: mapped to /. I added it and now it works. Thank you :-)

            – Arch Stanton
            Apr 23 '17 at 19:28





            My Documents is not mapped to ~/ and I don't want it so. Anyway, I didn't have Z: mapped to /. I added it and now it works. Thank you :-)

            – Arch Stanton
            Apr 23 '17 at 19:28













            0














            For me, the solution was to add, at the end of command line
            Open=wine ~/PDFXEdit6_Portable/PDFXEdit.exe z:%f



            I tested with PDF X-Change Editor, in the shortcut, and it worked too:



            env WINEPREFIX="/home/jim/.wine" wine-stable C:windowscommandstart.exe /Unix /home/jim/.wine/dosdevices/c:/users/jim/Start Menu/Programs/Tracker Software/PDF-XChange Editor.lnk z:%f






            share|improve this answer








            New contributor



            James Erdrick Hawk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
            Check out our Code of Conduct.
























              0














              For me, the solution was to add, at the end of command line
              Open=wine ~/PDFXEdit6_Portable/PDFXEdit.exe z:%f



              I tested with PDF X-Change Editor, in the shortcut, and it worked too:



              env WINEPREFIX="/home/jim/.wine" wine-stable C:windowscommandstart.exe /Unix /home/jim/.wine/dosdevices/c:/users/jim/Start Menu/Programs/Tracker Software/PDF-XChange Editor.lnk z:%f






              share|improve this answer








              New contributor



              James Erdrick Hawk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
              Check out our Code of Conduct.






















                0












                0








                0







                For me, the solution was to add, at the end of command line
                Open=wine ~/PDFXEdit6_Portable/PDFXEdit.exe z:%f



                I tested with PDF X-Change Editor, in the shortcut, and it worked too:



                env WINEPREFIX="/home/jim/.wine" wine-stable C:windowscommandstart.exe /Unix /home/jim/.wine/dosdevices/c:/users/jim/Start Menu/Programs/Tracker Software/PDF-XChange Editor.lnk z:%f






                share|improve this answer








                New contributor



                James Erdrick Hawk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.









                For me, the solution was to add, at the end of command line
                Open=wine ~/PDFXEdit6_Portable/PDFXEdit.exe z:%f



                I tested with PDF X-Change Editor, in the shortcut, and it worked too:



                env WINEPREFIX="/home/jim/.wine" wine-stable C:windowscommandstart.exe /Unix /home/jim/.wine/dosdevices/c:/users/jim/Start Menu/Programs/Tracker Software/PDF-XChange Editor.lnk z:%f







                share|improve this answer








                New contributor



                James Erdrick Hawk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.








                share|improve this answer



                share|improve this answer






                New contributor



                James Erdrick Hawk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.








                answered 1 hour ago









                James Erdrick HawkJames Erdrick Hawk

                1




                1




                New contributor



                James Erdrick Hawk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.




                New contributor




                James Erdrick Hawk is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
                Check out our Code of Conduct.
































                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Unix & Linux Stack Exchange!


                    • Please be sure to answer the question. Provide details and share your research!

                    But avoid



                    • Asking for help, clarification, or responding to other answers.

                    • Making statements based on opinion; back them up with references or personal experience.


                    To learn more, see our tips on writing great answers.




                    draft saved


                    draft discarded














                    StackExchange.ready(
                    function () {
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f331763%2fhow-to-open-files-with-a-wine-application-from-mc%23new-answer', 'question_page');
                    }
                    );

                    Post as a guest















                    Required, but never shown





















































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown

































                    Required, but never shown














                    Required, but never shown












                    Required, but never shown







                    Required, but never shown







                    Popular posts from this blog

                    Taj Mahal Inhaltsverzeichnis Aufbau | Geschichte | 350-Jahr-Feier | Heutige Bedeutung | Siehe auch |...

                    Baia Sprie Cuprins Etimologie | Istorie | Demografie | Politică și administrație | Arii naturale...

                    Ciclooctatetraenă Vezi și | Bibliografie | Meniu de navigare637866text4148569-500570979m