[未完成] Wine游戏助手安装脚本编写教程

@Ta 2022-01-30发布,2022-05-02修改 3320点击

安装脚本中文手册已经发布了:https://gitee.com/winegame/lutris/blob/master/docs/installers.rst


安装脚本是一个YAML文件,它记录了安装游戏时所需下载的文件、安装时的具体步骤,以及启动游戏时采用的设置。

安装脚本示例:https://winegame.net/games/install/132/view

下面是聊天记录摘录,待整理:

files: (要下载的文件)
- cache-updater: (文件标识符) https://file.winegame.net/games/overwatch/state-cache-update.sh (下载地址)
- setup: (文件标识符)
    filename: Battle.net-Setup-CN.exe (文件名)
    url: https://www.battlenet.com.cn/download/getInstaller?os=win&installer=Battle.net-Setup-CN.exe (下载地址。因为下载地址格式特殊,不能自动分离出文件名,所以单独指定文件名)
- dxdlls: https://file.winegame.net/games/battlenet/dxdlls.tar.xz
- wineinit: https://file.winegame.net/games/common/wineinit.sh

files段用于指定安装脚本接下来要使用的文件。通常是脚本或者游戏安装包。

files:
- cache-updater: https://file.winegame.net/games/overwatch/state-cache-update.sh
- setup: N/A:选择战网客户端安装程序(Battle.net-Setup.exe)

N/A:开头可以让用户选择文件


使用文件标识符:
单独使用文件标识符不需要加$,比如

executable: setup

引用了文件setup(战网安装包)。
如果要结合其他内容使用,前面就要加$
比如

- execute:
    command: cd "$GAMEDIR/drive_c" && tar -Jvxf "$dxdlls"
    description: 解压 DX DLL

引用dxdlls的时候加了$

注意:带连字符的标识符不能这样引用:$cache-updater
它在0.5.7中没问题,但是0.5.9已经不支持了。可能要像linux shell语法一样加花括号:${cache-updater}

不过为了减少兼容性问题,如果你需要在命令中引用文件,最好不要带连字符。

回复列表(0|隐藏机器人聊天)
帖子没有回复
添加新回复
回复需要登录