如何在不启动应用程序的情况下更新 WINEPREFIX

如何在不启动应用程序的情况下更新 WINEPREFIX

当系统上的 wine 软件包更新时,大多数WINEPREFIX'es(除非配置为使用特定版本的 wine)也需要更新。据大家所知,当应用程序根据前缀启动时,更新会自动处理。所以类似的东西WINEPREFIX='/path/to/prefix' winecfg就足够了。

不过,我正在寻找一种无需用户输入即可批量更新多个前缀的方法。并且最好不要运行 X。有什么建议如何去做吗?

答案1

您只需要运行非图形 wine/windows 命令并且$DISPLAY根本不需要设置。

这是一个例子:

$ unset DISPLAY
$ wine ping
000b:fixme:winediag:start_process Wine Staging 3.21 is a testing version containing experimental patches.
000b:fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org.
000b:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
000b:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0027:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
0027:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0027:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0027:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
002b:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
002b:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
0027:err:ole:apartment_createwindowifneeded CreateWindow failed with error -536870654
002d:err:winediag:nodrv_CreateWindow Application tried to create a window, but no driver could be loaded.
002d:err:winediag:nodrv_CreateWindow Make sure that your X server is running and that $DISPLAY is set correctly.
Could not load wine-gecko. HTML rendering will be disabled.
0027:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0027:err:ole:apartment_createwindowifneeded CreateWindow failed with error -536870654
0027:err:ole:apartment_createwindowifneeded CreateWindow failed with error 0
0027:err:ole:apartment_createwindowifneeded CreateWindow failed with error -536870654
wine: configuration in '/home/test/.wine' has been updated.
Usage: ping [-n count] [-w timeout] [-l buffer_length] target_name

Options:
    -n  Number of echo requests to send.
    -w  Timeout in milliseconds to wait for each reply.
    -l  Length of send buffer.

通常会有弹出窗口要求下载 mono 和 wine-gecko。这些部件失败了(如果需要,可以提前提供它们),但无论如何都进行了升级,如您所见:

wine: configuration in '/home/test/.wine' has been updated.

(并且 ping 命令抱怨语法:它实际上运行了)。

当然,不能保证这种行为会保持不变。所以你应该做测试和备份。

编辑:按照要求,对于更中立的命令和输出:

unset DISPLAY
export WINEDEBUG=-all
wine net help >/dev/null

将仅产生两行(或可能仅最后一行)标准错误并给出退出代码 0:

Could not load wine-gecko. HTML rendering will be disabled.
wine: configuration in '/home/test/.wine' has been updated.

答案2

完全自动,更新过程中不会提出任何问题:

for I in */wine*
do
    WINEDLLOVERRIDES="winemenubuilder.exe=d;mscoree=d;" WINEPREFIX="$PWD/$I" wineboot --update
done

描述:

  • for I in */wine*- 枚举所有的 wineprefixes
  • WINEDLLOVERRIDES="winemenubuilder.exe=d;mscoree=d;"- 不更新桌面快捷方式,也从不要求更新单声道
  • wineboot --update- 前缀更新

相关内容