wine 使用点滴


Excel 单个文件单独应用程序窗口打开

Excel 2010 打开两个或两个以上的表格时,都是在同一个应用窗口中显示。当同时编辑多个文件时非常不方便,尤其使用 wine 时,多个文件切换也存在问题,将 Excel 设置为独立文件独立进程窗口打开即可解决这类问题。

通过注册表来实现:

  1. 定位到 [HKEY_CLASSES_ROOT\Excel.Sheet.12\shell\Open] 下
    • 删除 ddeexec 键
    • 选中 commond 键
      • 将默认值和 command 值中的 /dde 全部改为 “%1”
  2. 定位到 [HKEY_CLASSES_ROOT\Excel.Sheet.8\shell\Open] 下,重复上述操作

  3. 关闭注册表,完成操作

.docx/.xlxs/.pptx 文件无法打开

使用 crossover 安装 office 2010 后,在某些发布版本上(mint 19.1)上打不开 .docx/.xlxs/.pptx 文件,使用命令行提示文件魔数错误:

invalid file (bad magic number): Exec format error

其原因是 Java 的 binfmt 组件将 .docx/.xlxs/.pptx 文件传递给 jexec,而 jexec 因认为这些文件不是可执行文件而拒绝运行。

解决方法是删除关联,执行 update-binfmts 命令(mint 19.1 具体环境命令如下)

sudo update-binfmts –remove jar /usr/bin/jexec –package openjdk-11

执行后,文件可以正常打开。

KDE 环境下鼠标点击软件单元格或滚动屏幕出现闪动

KDE Plasma 5 环境安装 office,鼠标点击 office 软件的内容(如在 excel 中点击单元格),或者鼠标滚动查看 office 软件的内容,会出现屏幕闪烁的情况。

针对这种情况,有三种方式解决:

  • Option 1:进入 System Setting — > Hardware — > Display and Monitor — > Compositor,将 tearing prevention 选项改为 "Full screen repaints"

  • Option 2:与 Option 1 同样的菜单,将 compositor — > tearing prevention 改为 XRender

  • Option 3:在 /etc/profile.d 中编写一个脚本文件,如命名为 kwin.sh(以 .sh 作为文件后缀即可)。 文件中加入 export KWIN_TRIPLE_BUFFER=1

安装企业微信无法身份验证二维码

安装 deepin-wine 的企业微信后,出现身份验证二维码图片刷不出来的情况。

查看日志,会显示错误信息

0009:err:wincodecs:JpegDecoder_CreateInstance Failed reading JPEG because unable to find libjpeg.so.62
0009:err:wincodecs:JpegDecoder_CreateInstance Failed reading JPEG because unable to find libjpeg.so.62
0009:err:wincodecs:JpegDecoder_CreateInstance Failed reading JPEG because unable to find libjpeg.so.62

安装 libjpeg 库

sudo apt-get install libjpeg62-dev
## deepin 使用的是 32 位的库
sudo apt-get install libjpeg62-dev:i386

企业微信无法启动

新版企业微信安装后需要修复的相关问题,#277 and #205.

In summary we need to install some packages.

$ sudo apt install libjpeg62:i386 fonts-wqy-zenhei xfonts-wqy  

And modify /opt/apps/com.qq.weixin.work.deepin/files/run.sh to comment 2 lines as below.

#export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64
#export WINEPREDLL="$ARCHIVE_FILE_DIR/dlls"

调整 deepin 程序(weixin/weixin.work)的字体大小

  • Option 1:使用注册表

    通过注册表调整 deepin 程序的分辨率

    WINEPREFIX=$HOME/.deepinwine/XXXX deepin-wineX-stable winecfg
    
  • Option 2:使用 DEEPIN_WINE_SCALE 环境变量

    启动 deepin 应用脚本时,设置 DEEPIN_WINE_SCALE 环境变量,

    [Desktop Entry]
    Encoding=UTF-8
    Type=Application
    X-Created-By=Deepin WINE Team
    Categories=chat;
    Icon=com.qq.weixin.deepin
    Exec=env DEEPIN_WINE_SCALE=2 "/opt/apps/com.qq.weixin.deepin/files/run.sh" -u %u
    Name=WeChat
    Name[zh_CN]=微信
    Comment=Tencent WeChat Client on Deepin Wine
    StartupWMClass=WeChat.exe
    MimeType=
    

每次启动后运行 desktop 重置容器

某些发行版上,使用 deepin-wine 的应用程序每次启动时,都会重置容器,导致设置的参数重新初始化。

以微信为例,

修改 dpi 为 192:

env WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat" /opt/deepin-wine6-stable/bin/wine winecfg

然后运行微信,会重新生成微信容器,导致上面修改的 dpi 失效。
但不止 dpi 失效,是所有注册表文件都重置了。

默认生成 desktop 文件中使用的启动脚本如下,

/opt/apps/com.qq.weixin.deepin/files/run.sh

使用下面的命令才能正常使用自定义过的容器:

env WINEPREFIX="$HOME/.deepinwine/Deepin-WeChat" /opt/deepin-wine6-stable/bin/wine $HOME/.deepinwine/Deepin-WeChat/drive_c/Program\ Files/Tencent/WeChat/WeChat.exe

长期使用的解决方案:

复制一个微信的 desktop 文件放在 $HOME/.local/applications 中,将 Exec 命令修改为 /opt/deepin-wine6-stable/bin/wine $HOME/.deepinwine/Deepin-WeChat/drive_c/Program\ Files/Tencent/WeChat/WeChat.exe 即可。

有些发行版可能无法识别 desktop 中的环境变量 $HOME,需要修改为 /home/ 用户名。

deepin 本身的 wine 是放在 $HOME/.deepinwine 目录中的,使用此库的 deb 却放在了对用户只读的 /opt 目录中。

完全可以不用使用此库的 deb ,只需要将 deepin-wine6-stable 放在 $HOME/.deepinwine 中,以后所有的 exe 程序都用类似上面的命令启动。

程序出现 GLXBadFBConfig 错误

运行 wine 程序时,出现如下错误

X Error of failed request:  GLXBadFBConfig
  Major opcode of failed request:  153 (GLX)
  Minor opcode of failed request:  0 ()
  Serial number of failed request:  1602
  Current serial number in output stream:  1602

需在运行脚本中加入如下环境变量设置

MESA_GL_VERSION_OVERRIDE=4.5

reference:

  1. https://jingyan.baidu.com/article/77b8dc7fb963336174eab63d.html
  2. https://www.codeweavers.com/support/wiki/linux/faq/cxofficejavaassociation
  3. https://www.codeweavers.com/support/forums/general?t=26;forumcurPos=850;msg=107987
  4. Flickering in KDE Plasma 5.4
  5. https://forum.winehq.org/viewtopic.php?t=34889
  6. https://github.com/zq1997/deepin-wine/issues/291
  7. https://github.com/zq1997/deepin-wine/issues/217

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注