0
$ echo $PATH
/home/t/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin

$ which PDFXCview.exe
/home/t/bin//PDFXCview.exe

$ ls /home/t/bin/PDFXCview.exe  -l
lrwxrwxrwx 1 t t 97 Mar 18 09:20 /home/t/bin/PDFXCview.exe -> ../program_files/document/formats/pdf/TrackerSoftware/pdfxcview/pdfxchange_portable/PDFXCview.exe

Now,

$ wine /home/t/bin/PDFXCview.exe   &
[1] 23220

But even though PDFXCview.exe is searcheable in $PATH,

$ wine PDFXCview.exe
wine: cannot find L"C:\\windows\\system32\\PDFXCview.exe"

Is the failure because that PDFXCview.exe does not appear as a command name in wine PDFXCview.exe, so it is not searched in $PATH?

Is there some way to make PDFXCview.exe in wine PDFXCview.exe searched in $PATH?

Thanks.

Tim
  • 101,790

1 Answers1

5

There are two ways to make Wine programs available from a path.

  1. You can make the Windows program executable, and add its containing directory to your PATH; see Transparently run wine programs and How is Mono magical? for details. You’d then run

    PDFXCview.exe
    

    to start the program.

  2. You can add the Wine directory containing the executable to the Wine path. To do this, run wine regedit, find the HKEY_CURRENT_USER/Environment entry, and edit the Path value (using ; to separate directories). You can use winepath to convert Linux paths to Wine paths. You’d then run

    wine PDFXCview
    

    to start the program.

Stephen Kitt
  • 434,908
  • Thanks. Is it a good idea to put alias PDFXCview="wine /home/t/bin/PDFXCview.exe" in ~/.profile? – Tim Mar 20 '18 at 13:33
  • Yes, that works too (in .bashrc or .zshrc rather than .profile though). The difference is that you need one alias per program, instead of one path entry per directory containing programs you want to run. – Stephen Kitt Mar 20 '18 at 14:18
  • Thanks. (1) Why define environment variables in ~/.profile or ~/.bash_profile, and alias and functions in ~/.bashrc? https://unix.stackexchange.com/q/431832/674 (2) https://unix.stackexchange.com/a/76641/674 suggests to write a shell script for each .exe file, so it is still done per program, just as alias is, isn't it? – Tim Mar 21 '18 at 19:43