运行 Windows 可执行文件时找不到解释器

Tim*_*Tim 7 wine

我卸载了我的wine,通过编译源码安装了更高版本的wine。

但是,当我运行 exe 可执行文件(其路径在 中$PATH)时,它无法像以前那样工作:

$  PDFXCview.exe   

run-detectors: unable to find an interpreter for /home/tim/program_files/document/pdfxchange_portable/PDFXCview.exe
Run Code Online (Sandbox Code Playgroud)

我不知道为什么在卸载旧酒并安装新酒之前我能够直接运行这个可执行文件。我$ PDFXCview.exe现在怎样才能工作?

笔记:

$ wine /home/tim/program_files/document/pdfxchange_portable/PDFXCview.exe
Run Code Online (Sandbox Code Playgroud)

将工作。

$ wine PDFXCview.exe 

wine: cannot find L"C:\\windows\\system32\\PDFXCview.exe"
Run Code Online (Sandbox Code Playgroud)

不起作用。注意路径PDFXCview.exe还在$PATH

谢谢。

Neo*_*x0r 8

> I uninstalled my wine, and installed a higher version of wine by
> compiling source. However when I run an exe executable (whose path is
> in $PATH), it doesn't work as it used to.
Run Code Online (Sandbox Code Playgroud)

正如您显然看到的,以下工作正常

$ wine file.exe


但以下不

for a file in the current directory               `
$ ./file.exe              

for a file that is included your path             
$ file.exe
Run Code Online (Sandbox Code Playgroud)

我的 wine 版本是来自 debian/jessie-backports 的 v1.8.3 和
应该至少可以回溯到 v1.6.2(这是 debian/jessie 中的默认设置)。

您必须执行以下操作:

$ sudo apt-get install wine-binfmt $ sudo update-binfmts --import /usr/share/binfmts/wine

现在您应该能够执行如上所示的二进制文件,
而不必使用 wine 调用它。


Gil*_*il' 7

Linux 有一种机制,允许注册插件,以便内核在指令执行文件时调用解释器程序:binfmt_misc。请参阅chroot 如何将 qemu 用于交叉编译环境?以获得更详细的概述。

您的 Wine 包注册/usr/bin/wine为 Windows 可执行文件的解释器,作为其安装脚本的一部分或通过包中包含的启动脚本。您可以为自己的自制wine. 一些发行版有一种机制,包可以注册解释器,然后在引导时将其注册到内核中,例如update-binfmts在 Debian 和衍生产品上。或者,解释器可以在启动期间通过写入/proc/sys/fs/binfmt_misc/register. 我建议您查看您曾经拥有的软件包并调整以前有效的方法。


Tyl*_*nis -1

好吧,仔细听。这是你做的。

将其放入 /usr/bin/pdfxcview.exe

#!/bin/bash
# Call up a command;
wine /home/tim/program_files/document/pdfxchange_portable/PDFXCview.exe
Run Code Online (Sandbox Code Playgroud)

然后,从终端调用:

$ chmod +x /usr/bin/pdfxcview.exe
Run Code Online (Sandbox Code Playgroud)

^ 将可执行位设置为打开。

$ pdfxcview.exe
Run Code Online (Sandbox Code Playgroud)

源代码差异

软件自由不是很好吗?好像有关于路径的评论。如果您通过键入“env”打印您的环境,您可能会看到您的 Program Files 目录。

Launchpad Librarian 是 Ubuntu 开发人员保存有关其工作文档的地方,使您的系统保持最新且安全。

  • 谢谢。我明白你的方法。但当我还有老酒的时候,我没有按照你的建议去做。我做了 `chmod a+x /home/tim/program_files/document/pdfxchange_portable/PDFXCview.exe`,并将 `/home/tim/program_files/document/pdfxchange_portable/` 添加到 ~/.bashrc 中的 `$PATH` 中。然后 `$ pdfxcview.exe` 就起作用了。 (3认同)