Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of AOSC OS and loongson architecture #3593

Open
wants to merge 60 commits into
base: develop
Choose a base branch
from
Open
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
b564c27
Add support of AOSC OS and loongson architecture
4Darmygeometry Jan 4, 2025
1e796cc
Update README.md
4Darmygeometry Jan 4, 2025
27bc5e6
Add LoongArch64 build script
4Darmygeometry Jan 4, 2025
4eb12ca
Add LoongArch64 Library Support
4Darmygeometry Jan 4, 2025
34e0507
标记统一使用.NET 9.0使得龙芯新世界代码与主线一致
4Darmygeometry Jan 5, 2025
a98edcd
Update README.md
4Darmygeometry Jan 5, 2025
6a83db6
Update README.en.md
4Darmygeometry Jan 5, 2025
61ba400
Update README.md
4Darmygeometry Jan 5, 2025
193147f
Update README.md
4Darmygeometry Jan 6, 2025
ec5a1d3
Update open-source-library.md
4Darmygeometry Jan 6, 2025
9be4b56
Update open-source-library.md
4Darmygeometry Jan 6, 2025
bfb3223
Merge branch 'BeyondDimension:develop' into develop
4Darmygeometry Jan 6, 2025
158fbba
Update README.md
4Darmygeometry Jan 6, 2025
8765655
Update README.en.md
4Darmygeometry Jan 6, 2025
2aa866d
添加libpng前置依赖所需的loongarch64 c文件
4Darmygeometry Jan 6, 2025
f8ce1d6
✨ 发布工具支持 RiscV64、, LoongArch64 发布
Mossimos Jan 7, 2025
8a10c47
添加龙芯3A6000电脑原生运行截图
4Darmygeometry Jan 7, 2025
17fe8dc
Update README.md
4Darmygeometry Jan 7, 2025
8bf605d
添加龙芯3A6000电脑加速github截图
4Darmygeometry Jan 8, 2025
ff9494c
添加龙芯nuget源注意事项
4Darmygeometry Jan 8, 2025
501b180
删除次要截图
4Darmygeometry Jan 8, 2025
2707dda
删除次要截图
4Darmygeometry Jan 8, 2025
44295a9
Add English screenshots
4Darmygeometry Jan 8, 2025
a805e24
Update README.en.md
4Darmygeometry Jan 8, 2025
700cd73
Add English Support
4Darmygeometry Jan 8, 2025
72d4be1
Update online_install.sh
4Darmygeometry Jan 8, 2025
e52b012
支持AOSC OS
4Darmygeometry Jan 8, 2025
6119ffb
支持中文和其他语言的的桌面文件夹
4Darmygeometry Jan 8, 2025
847d400
更新 README.md
4Darmygeometry Jan 9, 2025
c9d1280
Merge branch 'BeyondDimension:develop' into develop
4Darmygeometry Jan 11, 2025
52e830f
更新判断发行版方式测试文件
4Darmygeometry Jan 12, 2025
2fde011
通过/etc/os-release形式判断发行版并支持slackware等发行版包格式
4Darmygeometry Jan 13, 2025
472f7b8
Update README.md
4Darmygeometry Jan 13, 2025
214af04
紧急修改sh错误
4Darmygeometry Jan 13, 2025
4cd8fc2
Update README.md
4Darmygeometry Jan 13, 2025
7b7fc4c
Add files via upload
4Darmygeometry Jan 13, 2025
03dfad9
Add files via upload
4Darmygeometry Jan 13, 2025
bad37b3
Delete loongson-build.md
4Darmygeometry Jan 13, 2025
152cea3
Update README.md
4Darmygeometry Jan 13, 2025
bf32fef
把AOSC OS放在前面
4Darmygeometry Jan 14, 2025
0538ae5
纠正中科方德安装包错误并支持勇豹系统
4Darmygeometry Jan 16, 2025
1a6441b
脚本已无需依赖pv,去掉pv安装选项
4Darmygeometry Jan 16, 2025
233da9f
Update README.md
4Darmygeometry Jan 16, 2025
2560cdf
恢复回原来的readme
4Darmygeometry Jan 17, 2025
923418c
Delete doc/loongson-build.md
4Darmygeometry Jan 17, 2025
6a15d6e
Delete res/screenshots/linux-3A6000-ASF-en.png
4Darmygeometry Jan 17, 2025
652401e
Delete res/screenshots/linux-3A6000-ASF.png
4Darmygeometry Jan 17, 2025
dd09b1d
Delete res/screenshots/linux-3A6000-accelerate-en.png
4Darmygeometry Jan 17, 2025
a1cb858
Delete res/screenshots/linux-3A6000-accelerate.png
4Darmygeometry Jan 17, 2025
3a1669f
Delete res/screenshots/linux-3A6000-settings-en.png
4Darmygeometry Jan 17, 2025
80bdae0
Delete res/screenshots/linux-3A6000-settings.png
4Darmygeometry Jan 17, 2025
aa712fb
Merge branch 'BeyondDimension:develop' into develop
4Darmygeometry Jan 23, 2025
1a0642b
尝试解决分支冲突
4Darmygeometry Jan 23, 2025
8590d5c
Merge branch 'develop' into develop
4Darmygeometry Jan 23, 2025
a2d834f
重新添加龙架构判断
4Darmygeometry Jan 23, 2025
e90a359
更新龙架构编译脚本
4Darmygeometry Jan 23, 2025
d21c5b7
更新龙架构构建脚本
4Darmygeometry Jan 24, 2025
e05a732
dotnet 9.0
4Darmygeometry Jan 24, 2025
9bca062
update mac script to dotnet 9.0
4Darmygeometry Jan 24, 2025
06b1156
Merge branch 'BeyondDimension:develop' into develop
4Darmygeometry Feb 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 22 additions & 2 deletions build/linux/Steam++.sh
Original file line number Diff line number Diff line change
@@ -6,10 +6,30 @@ export DOTNET_ROOT="$dotnet_path"
link_exec="$run_path/Steam++"
# 判断符号链接是否存在
if [ -L "$link_exec" ]; then
echo "符号链接 $link_exec 已存在"
case $LANG in
zh_CN.UTF-8)
echo "符号链接 $link_exec 已存在"
;;
en_US.UTF-8)
echo "Symbolic link $link_exec has been existed"
;;
*)
echo "Symbolic link $link_exec has been existed"
;;
esac
else
rm -rf "$link_exec" 2>/dev/null
echo "创建符号链接 $dotnet_exec 到 $link_exec"
case $LANG in
zh_CN.UTF-8)
echo "创建符号链接 $dotnet_exec 到 $link_exec"
;;
en_US.UTF-8)
echo "Create symbolic link $dotnet_exec to $link_exec"
;;
*)
echo "Create symbolic link $dotnet_exec to $link_exec"
;;
esac
ln -s "$dotnet_exec" "$link_exec"
chmod +x "$link_exec"
fi
127 changes: 108 additions & 19 deletions build/linux/environment_check.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,105 @@
#!/bin/bash
base_path="$HOME/WattToolkit"
export LC_ALL=en_US.UTF-8
Determine_distribution() {
# 判断发行版类型
# 由于Linux发行版包管理器可以混装,如Debian安装Arch Linux的pacman,此处采用/etc/os-release的形式进行一次判断。
# 读取 /etc/os-release 文件并提取 ID 字段,转换为小写
# $installprefix是该发行版包管理器安装软件前缀
# $nssvar是该发行版certutil包名称
os_id=$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | tr -d '"' | tr '[:upper:]' '[:lower:]')
# 输出 ID
echo "OS ID: $os_id"

case "$os_id" in
"ubuntu" | "debian" | "kali" | "mx" | "devuan" | "pureos" | "parrot" | "trisquel" | "bunsenlabs" | "deepin" | "antix" | "uos" | "kylin" | "loongnix" | "gxde" | "nfsdesktop")
echo 默认包管理器:apt
sudo apt update
installprefix="sudo apt install -y"
nssvar="libnss3-tools"
;;
"fedora")
echo 默认包管理器:dnf
installprefix="sudo dnf install -y"
nssvar="nss-tools"
;;
"centos" | "rhel" | "rocky" | "alma" | "amzn" | "alt")
echo 默认包管理器:yum
installprefix="sudo yum install -y"
nssvar="nss-tools"
;;
"opensuse")
echo 默认包管理器:zypper
sudo zypper refresh
installprefix="sudo zypper install"
nssvar="mozilla-nss-tools"
;;
"arch" | "manjaro" | "artix" | "chakra" | "blackarch" | "frugalware")
echo 默认包管理器:pacman
installprefix="sudo pacman -S"
nssvar="nss"
;;
"mageia" | "pclinuxos" | "openmandriva" | "rosa" | "vectorlinux")
echo 默认包管理器:urpmi
sudo urpmi.update -a
installprefix="sudo urpmi"
nssvar="nss-tools"
;;
"slackware" | "salix" | "porteus" | "slacko")
echo 默认包管理器:slackpkg
sudo slackpkg update gpg
sudo slackpkg update
installprefix="sudo slackpkg install"
nssvar="nss"
;;
"aosc")
echo 默认包管理器:oma
installprefix="sudo oma install -y"
nssvar="nss"
;;
"gentoo")
echo 默认包管理器:emerge
sudo emerge --sync
installprefix="sudo emerge -av"
nssvar="nss"
;;
"solus")
echo 默认包管理器:eopkg
sudo eopkg update-repo
installprefix="sudo eopkg install"
nssvar="nss-tools"
;;
"clearlinux")
echo 默认包管理器:swupd
# 手动安装判断变量
manualins="1"
;;
"nixos")
echo 默认包管理器:nix
manualins="1"
;;
"void")
echo 默认包管理器:xbps
manualins="1"
;;
"puppy")
echo 默认包管理器:petget
manualins="1"
;;
"tinycore")
echo 默认包管理器:tce-load
manualins="1"
;;
"yongbao")
echo 无包管理器
manualins="1"
;;
*)
echo 未知发行版
manualins="1"
;;
esac
}
if [ "$1" = "-c" ]; then
# 只验证 certutil 是否可用
if command -v certutil &>/dev/null; then
@@ -11,32 +110,21 @@ if [ "$1" = "-c" ]; then
fi
else
Install_certutil() {
# 判断发行版类型
if command -v certutil &>/dev/null; then
echo "certutil 工具已安装。"
elif [ "$manualins" == "1" ]; then
echo "请手动安装 certutil 工具。"
else
echo "证书导入以及验证需要使用 certutil 工具。"
# 判断包管理器
if command -v apt &>/dev/null; then
# 使用 apt (Debian/Ubuntu)
$installprefix $nssvar
# Loongnix 25特殊情况
if [ "$os_id" == "loongnix" ]; then
sudo ln -s /usr/sbin/setcap /usr/bin/setcap
sudo apt update
sudo apt install -y libnss3-tools
elif command -v dnf &>/dev/null; then
# 使用 dnf (Fedora)
sudo dnf install -y nss-tools
elif command -v yum &>/dev/null; then
# 使用 yum (CentOS/Red Hat)
sudo yum install -y nss-tools
elif command -v pacman &>/dev/null; then
# 使用 pacman (Arch Linux)
# sudo pacman -S nss
echo "请手动安装 certutil 工具。"
exit 1
# sudo apt dist-upgrade
else
echo "请手动安装 certutil 工具。"
exit 1
echo "certutil 工具已安装。"
fi
echo "certutil 工具已安装。"
fi
}
certutil_Init() {
@@ -52,6 +140,7 @@ else
echo "certutil nssdb 正常"
fi
}
Determine_distribution
Install_certutil
certutil_Init
exit 0
12 changes: 9 additions & 3 deletions build/linux/init_desktop.sh
Original file line number Diff line number Diff line change
@@ -3,14 +3,20 @@
run_path=$(dirname "$0")
base_path="$(dirname "$run_path")"
exec_name="Steam++"
rm -rf "$HOME/Desktop/Watt Toolkit.desktop" 2>/dev/null
# 检查XDG_DESKTOP_DIR环境变量,如果未设置则使用默认值,支持KDE的中文桌面路径
if command -v xdg-user-dir &>/dev/null; then
XDG_DESKTOP_DIR=$(xdg-user-dir DESKTOP)
else
XDG_DESKTOP_DIR="$HOME/Desktop"
fi
rm -rf "$XDG_DESKTOP_DIR/Watt Toolkit.desktop" 2>/dev/null
echo "#!/usr/bin/env xdg-open
[Desktop Entry]
Name=Watt Toolkit
Exec=$base_path/$exec_name.sh
Icon=$base_path/Icons/Watt-Toolkit.png
Terminal=false
Type=Application
StartupNotify=false" >"$HOME/Desktop/Watt Toolkit.desktop"
chmod +x "$HOME/Desktop/Watt Toolkit.desktop"
StartupNotify=false" >"$XDG_DESKTOP_DIR/Watt Toolkit.desktop"
chmod +x "$XDG_DESKTOP_DIR/Watt Toolkit.desktop"
exit 0
187 changes: 125 additions & 62 deletions build/linux/offline_init.sh
Original file line number Diff line number Diff line change
@@ -10,33 +10,122 @@ tar_path="$base_path/$tar_name"
app_name="Watt Toolkit"
PROCESS_NAMES=("$exec_name" "$app_name")
export LC_ALL=en_US.UTF-8
Install_certutil() {
Determine_distribution() {
# 判断发行版类型
# 由于Linux发行版包管理器可以混装,如Debian安装Arch Linux的pacman,此处采用/etc/os-release的形式进行一次判断。
# 读取 /etc/os-release 文件并提取 ID 字段,转换为小写
# $installprefix是该发行版包管理器安装软件前缀
# $nssvar是该发行版certutil包名称
os_id=$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | tr -d '"' | tr '[:upper:]' '[:lower:]')
# 输出 ID
echo "OS ID: $os_id"

case "$os_id" in
"ubuntu" | "debian" | "kali" | "mx" | "devuan" | "pureos" | "parrot" | "trisquel" | "bunsenlabs" | "deepin" | "antix" | "uos" | "kylin" | "loongnix" | "gxde" | "nfsdesktop")
echo 默认包管理器:apt
sudo apt update
installprefix="sudo apt install -y"
nssvar="libnss3-tools"
;;
"fedora")
echo 默认包管理器:dnf
installprefix="sudo dnf install -y"
nssvar="nss-tools"
;;
"centos" | "rhel" | "rocky" | "alma" | "amzn" | "alt")
echo 默认包管理器:yum
installprefix="sudo yum install -y"
nssvar="nss-tools"
;;
"opensuse")
echo 默认包管理器:zypper
sudo zypper refresh
installprefix="sudo zypper install"
nssvar="mozilla-nss-tools"
;;
"arch" | "manjaro" | "artix" | "chakra" | "blackarch" | "frugalware")
echo 默认包管理器:pacman
installprefix="sudo pacman -S"
nssvar="nss"
;;
"mageia" | "pclinuxos" | "openmandriva" | "rosa" | "vectorlinux")
echo 默认包管理器:urpmi
sudo urpmi.update -a
installprefix="sudo urpmi"
nssvar="nss-tools"
;;
"slackware" | "salix" | "porteus" | "slacko")
echo 默认包管理器:slackpkg
sudo slackpkg update gpg
sudo slackpkg update
installprefix="sudo slackpkg install"
nssvar="nss"
;;
"aosc")
echo 默认包管理器:oma
installprefix="sudo oma install -y"
nssvar="nss"
;;
"gentoo")
echo 默认包管理器:emerge
sudo emerge --sync
installprefix="sudo emerge -av"
nssvar="nss"
;;
"solus")
echo 默认包管理器:eopkg
sudo eopkg update-repo
installprefix="sudo eopkg install"
nssvar="nss-tools"
;;
"clearlinux")
echo 默认包管理器:swupd
# 手动安装判断变量
manualins="1"
;;
"nixos")
echo 默认包管理器:nix
manualins="1"
;;
"void")
echo 默认包管理器:xbps
manualins="1"
;;
"puppy")
echo 默认包管理器:petget
manualins="1"
;;
"tinycore")
echo 默认包管理器:tce-load
manualins="1"
;;
"yongbao")
echo 无包管理器
manualins="1"
;;
*)
echo 未知发行版
manualins="1"
;;
esac
}
Determine_distribution
Install_certutil() {
if command -v certutil &>/dev/null; then
echo "certutil 工具已安装。"
elif [ "$manualins" == "1" ]; then
echo "请手动安装 certutil 工具。"
else
echo "证书导入以及验证需要使用 certutil 工具。"
# 判断包管理器
if command -v apt &>/dev/null; then
# 使用 apt (Debian/Ubuntu)
$installprefix $nssvar
# Loongnix 25特殊情况
if [ "$os_id" == "loongnix" ]; then
sudo ln -s /usr/sbin/setcap /usr/bin/setcap
sudo apt update
sudo apt install -y libnss3-tools
elif command -v dnf &>/dev/null; then
# 使用 dnf (Fedora)
sudo dnf install -y nss-tools
elif command -v yum &>/dev/null; then
# 使用 yum (CentOS/Red Hat)
sudo yum install -y nss-tools
elif command -v pacman &>/dev/null; then
# 使用 pacman (Arch Linux)
# sudo pacman -S nss
echo "请手动安装 certutil 工具。"
exit 1
# sudo apt dist-upgrade
else
echo "请手动安装 certutil 工具。"
exit 1
echo "certutil 工具已安装。"
fi
echo "certutil 工具已安装。"
fi
}
certutil_Init() {
@@ -56,55 +145,22 @@ Install_jq() {
# Check if jq is already installed
if command -v jq &>/dev/null; then
echo "jq 工具已安装。"
elif [ "$manualins" == "1" ]; then
echo "请手动安装 jq 工具。"
else
echo "jq 用来解析版本更新。"
# Check the package manager
if command -v apt &>/dev/null; then
# Using apt (Debian/Ubuntu)
sudo apt update
sudo apt install -y jq
elif command -v dnf &>/dev/null; then
# Using dnf (Fedora)
sudo dnf install -y jq
elif command -v yum &>/dev/null; then
# Using yum (CentOS/Red Hat)
sudo yum install -y jq
elif command -v pacman &>/dev/null; then
# Using pacman (Arch Linux)
sudo pacman -S jq
else
echo "请手动安装 jq 工具。"
exit 1
fi
echo "请手动安装 jq 工具。"
$installprefix jq
echo "jq 工具已安装。"
fi
}
Install_zenity() {
# 判断发行版类型
if command -v zenity &>/dev/null; then
echo "zenity 工具已安装。"
elif [ "$manualins" == "1" ]; then
echo "请手动安装 zenity 工具。"
else
echo "安装过程需要 zenity 工具。"
# 判断包管理器
if command -v apt &>/dev/null; then
# 使用 apt (Debian/Ubuntu)
sudo apt update
sudo apt install -y zenity
elif command -v dnf &>/dev/null; then
# 使用 dnf (Fedora)
sudo dnf install -y zenity
elif command -v yum &>/dev/null; then
# 使用 yum (CentOS/Red Hat)
sudo yum install -y zenity
elif command -v pacman &>/dev/null; then
# 使用 pacman (Arch Linux)
# sudo pacman -S zenity
echo "请手动安装 zenity 工具。"
exit 1
else
echo "请手动安装 zenity 工具。"
exit 1
fi
$installprefix zenity
echo "zenity 工具已安装。"
fi
}
@@ -173,16 +229,23 @@ fi
chmod +x "$base_path/$exec_name.sh"
# xdg-icon-resource install "$base_path/Icons/Watt-Toolkit.png" --size 128 Watt-Toolkit
InitDesktop() {
# 检查XDG_DESKTOP_DIR环境变量,如果未设置则使用默认值,支持KDE的中文桌面路径
if command -v xdg-user-dir &>/dev/null; then
XDG_DESKTOP_DIR=$(xdg-user-dir DESKTOP)
else
XDG_DESKTOP_DIR="$HOME/Desktop"
fi

while true; do
# 使用 zenity 提示用户选择安装路径或使用默认路径
choice=$(zenity --list --radiolist --title="请选择要添加到的位置" --column="选择" --column="路径" TRUE "$HOME/.local/share/applications/" FALSE "$HOME/Desktop")
choice=$(zenity --list --radiolist --title="请选择要添加到的位置" --column="选择" --column="路径" TRUE "$HOME/.local/share/applications/" FALSE "$XDG_DESKTOP_DIR")

# 检查用户输入
if [ "$choice" == "$HOME/.local/share/applications/" ]; then
target_dir="$HOME/.local/share/applications/"
break
elif [ "$choice" == "$HOME/Desktop" ]; then
target_dir="$HOME/Desktop/"
elif [ "$choice" == "$XDG_DESKTOP_DIR" ]; then
target_dir="$XDG_DESKTOP_DIR"
break
else
echo "无效选项,请输入 1 或 2。"
266 changes: 170 additions & 96 deletions build/linux/online_install.sh

Large diffs are not rendered by default.

117 changes: 117 additions & 0 deletions build/linux/testcommand.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,117 @@
#!/bin/bash
# 检查XDG_DESKTOP_DIR环境变量,如果未设置则使用默认值,支持KDE的中文桌面路径
if command -v xdg-user-dir &>/dev/null; then
XDG_DESKTOP_DIR=$(xdg-user-dir DESKTOP)
else
XDG_DESKTOP_DIR="$HOME/Desktop"
fi
echo 桌面位置:$XDG_DESKTOP_DIR
Determine_distribution() {
# 由于Linux发行版包管理器可以混装,如Debian安装Arch Linux的pacman,此处采用/etc/os-release的形式进行一次判断。
# 读取 /etc/os-release 文件并提取 ID 字段,转换为小写
# $installprefix是该发行版包管理器安装软件前缀
# $nssvar是该发行版certutil包名称
os_id=$(grep "^ID=" /etc/os-release | cut -d'=' -f2 | tr -d '"' | tr '[:upper:]' '[:lower:]')
# 输出 ID
echo "OS ID: $os_id"

case "$os_id" in
"ubuntu" | "debian" | "kali" | "mx" | "devuan" | "pureos" | "parrot" | "trisquel" | "bunsenlabs" | "deepin" | "antix" | "uos" | "kylin" | "loongnix" | "gxde" | "nfsdesktop")
echo 默认包管理器:apt
;;
"fedora")
echo 默认包管理器:dnf
;;
"centos" | "rhel" | "rocky" | "alma" | "amzn" | "alt")
echo 默认包管理器:yum
;;
"opensuse")
echo 默认包管理器:zypper
;;
"arch" | "manjaro" | "artix" | "chakra" | "blackarch" | "frugalware")
echo 默认包管理器:pacman
;;
"mageia" | "pclinuxos" | "openmandriva" | "rosa" | "vectorlinux")
echo 默认包管理器:urpmi
;;
"slackware" | "salix" | "porteus" | "slacko")
echo 默认包管理器:slackpkg
;;
"aosc")
echo 默认包管理器:oma
;;
"gentoo")
echo 默认包管理器:emerge
;;
"solus")
echo 默认包管理器:eopkg
;;
"clearlinux")
echo 默认包管理器:swupd
;;
"nixos")
echo 默认包管理器:nix
;;
"void")
echo 默认包管理器:xbps
;;
"puppy")
echo 默认包管理器:petget
;;
"tinycore")
echo 默认包管理器:tce-load
;;
"yongbao")
echo 无包管理器
;;
*)
echo 未知发行版
;;
esac
}
Determine_distribution

default_base_path="$HOME/WattToolkit"
# Linux发行版一般都内置dialog(yongbao除外),yongbao内置whiptail且无包管理器(没有zenity),某些linux发行版内置zenity
command -v dialog &>/dev/null && dialog1="dialog" || dialog1="whiptail"
if command -v zenity &>/dev/null; then
custom_base_path=$(zenity --entry --title="安装路径" --text="请输入安装路径(默认为 "$default_base_path",不输入则使用默认路径)")
else
custom_base_path=$($dialog1 --title "安装路径" --inputbox "请输入安装路径(默认为 "$default_base_path",不输入则使用默认路径)" 10 60 3>&1 1>&2 2>&3)
fi
echo $custom_base_path
read
if [ "$os_id" != "yongbao" ]; then zenity --question --text="$1" --width=400; else whiptail --yesno "$1" 10 60; fi
[ "$os_id" != "yongbao" ] && zenity --info --text="未知的设备架构:$arch!" --width=300 || whiptail --msgbox "未知的设备架构:$arch!" 10 60
[ "$os_id" != "yongbao" ] && zenity --info --text="未知的最新版本 Hash:$n_sha384!" --width=300 || whiptail --msgbox "未知的最新版本 Hash:$n_sha384!" 10 60
if [ "$os_id" != "yongbao" ]; then
wget "$downloads_url" -O "$tar_path" 2>&1 | sed -u 's/.* \([0-9]\+%\)\ \+\([0-9.]\+.\) \(.*\)/\1\n# 下载中 \2\/s, 剩余时间: \3/' | zenity --progress --title="$title Watt Toolkit" --auto-close --width=500
else
wget "$downloads_url" -O "$tar_path" 2>&1 | sed -u 's/.* \([0-9]\+\)%.*/\1/' | whiptail --title "$title" --gauge "正在下载中" 10 60 0
fi
[ "$os_id" != "yongbao" ] && zenity --error --text="下载错误。" --width=500 || whiptail --msgbox "下载错误。" 10 60
Decompression() {
echo "正在校验安装包"
TOTAL_FILES=$(tar tf "$tar_name" 2>/dev/null | wc -l)
{
COUNTER=0
tar -xzvf "$tar_name" 2>/dev/null | while read -r FILE; do
COUNTER=$((COUNTER + 1))
PERCENTAGE=$((COUNTER * 100 / TOTAL_FILES))
echo "# 解压 $FILE"
echo "$PERCENTAGE"
done
echo "100"
}| { ([ "$os_id" != "yongbao" ] && zenity --progress --title="安装中" --text="正在解压文件..." --width=500 --percentage=0 --auto-close --no-cancel || whiptail --title "安装中" --gauge "正在解压文件..." 10 60 0)}
rm -f "$appVer_path" &>/dev/null
dotnet_path="$base_path/dotnet"
dotnet_exec="$dotnet_path/dotnet"
[ -x "$dotnet_exec" ] || chmod +x "$dotnet_exec"
chmod +x "$base_path/$exec_name.sh"
}
if [ "$os_id" != "yongbao" ]; then zenity --question --text="本地已有最新安装包是否继续解压?" --width=400; else whiptail --yesno "本地已有最新安装包是否继续解压?" 10 60; fi
choice=$([ "$os_id" != "yongbao" ] && { zenity --list --radiolist --title="请选择要添加到的位置" --column="选择" --column="路径" TRUE "$XDG_DESKTOP_DIR" FALSE "$HOME/.local/share/applications/";} || { whiptail --title "请选择要添加到的位置" --radiolist "" 10 60 2 "$XDG_DESKTOP_DIR" "" ON "$HOME/.local/share/applications/" "" OFF 3>&1 1>&2 2>&3;} )
echo $choice
read
[ "$os_id" != "yongbao" ] && zenity --info --text="无效选项,请重新选择。" --width=300 || whiptail --msgbox "无效选项,请重新选择。" 10 60
if [ "$os_id" = "yongbao" ]; then sudo chmod u+s $(which pkexec); fi
8 changes: 7 additions & 1 deletion build/linux/uninstall.sh
Original file line number Diff line number Diff line change
@@ -95,5 +95,11 @@ fi
rm -rf $Cache 2>/dev/null
rm -rf $Cache_t 2>/dev/null
rm -rf $base_path 2>/dev/null
rm -rf "$HOME/Desktop/Watt Toolkit.desktop" 2>/dev/null
# 检查XDG_DESKTOP_DIR环境变量,如果未设置则使用默认值,支持KDE的中文桌面路径
if command -v xdg-user-dir &>/dev/null; then
XDG_DESKTOP_DIR=$(xdg-user-dir DESKTOP)
else
XDG_DESKTOP_DIR="$HOME/Desktop"
fi
rm -rf "$XDG_DESKTOP_DIR/Watt Toolkit.desktop" 2>/dev/null
zenity --info --text="卸载完成!" --width=300
16 changes: 16 additions & 0 deletions build/loongarch build/neko_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
set -e
dotnet workload restore src/BD.WTTS.Client.Avalonia.App/BD.WTTS.Client.Avalonia.App.csproj
#发布主程序
dotnet publish -c Release src/BD.WTTS.Client.Avalonia.App/BD.WTTS.Client.Avalonia.App.csproj -p:UseAppHost=false -p:PublishDir=realbuild/assemblies -p:PublishSingleFile=false -p:PublishReadyToRun=false -p:PublishTrimmed=false -p:PublishDocumentationFile=false -p:PublishDocumentationFiles=false -p:PublishReferencesDocumentationFiles=false -f net9.0 -r linux-loongarch64 -v q /property:WarningLevel=1 --sc false --force --nologo -o "realbuild/assemblies"
#发布插件
dotnet publish -c Release src/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy.csproj -p:UseAppHost=true -p:PublishDir=realbuild/modules/Accelerator -p:PublishSingleFile=true -p:PublishReadyToRun=false -p:PublishTrimmed=false -p:PublishDocumentationFile=false -p:PublishDocumentationFiles=false -p:PublishReferencesDocumentationFiles=false -f net9.0 -r linux-loongarch64 -v q /property:WarningLevel=1 --sc false --force --nologo -o "realbuild/modules/Accelerator"

dotnet build -c Release src/BD.WTTS.Client.Plugins.GameAccount/BD.WTTS.Client.Plugins.GameAccount.csproj --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly -o "realbuild/modules/GameAccount"
dotnet build -c Release src/BD.WTTS.Client.Plugins.GameList/BD.WTTS.Client.Plugins.GameList.csproj --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly -o "realbuild/modules/GameList"
dotnet build -c Release src/BD.WTTS.Client.Plugins.Authenticator/BD.WTTS.Client.Plugins.Authenticator.csproj --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly -o "realbuild/modules/Authenticator"
dotnet build -c Release src/BD.WTTS.Client.Plugins.SteamIdleCard/BD.WTTS.Client.Plugins.SteamIdleCard.csproj --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly -o "realbuild/modules/SteamIdleCard"
dotnet build -c Release src/BD.WTTS.Client.Plugins.Accelerator/BD.WTTS.Client.Plugins.Accelerator.csproj --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly -o "realbuild/modules/Accelerator"
#dotnet test src/BD.WTTS.UnitTest/BD.WTTS.UnitTest.csproj -c Release -p:GeneratePackageOnBuild=false --nologo -v q --property:WarningLevel=1 --property:DebugType=pdbonly -a loongarch64 -o "realbuild/"
echo "Publish Done!"
echo "Start Copy File"
# to do
192 changes: 96 additions & 96 deletions build/macos/build.sh
Original file line number Diff line number Diff line change
@@ -1,96 +1,96 @@
#!/bin/bash
# 判断是否提供了 Build_Mode 参数
if [ -z "$1" ]; then
Build_Mode="any" # 如果没有提供参数,则设置默认值为 "any"
else
Build_Mode="$1"
fi

Base_Path="/Users/moxiansheng/Documents/GitHub/SteamTools"
App_Path="$Base_Path/src/BD.WTTS.Client.Avalonia.App"
Publish_Path="bin/Release/Publish/assemblies"
Plugins_Release_Path="bin/Release"
CodesignKey_Name="mossimo code"
App_Modules_Path="$App_Path/$Publish_Path/modules"
echo "编译主程序"
cd "$App_Path"
dotnet publish -c Release -p:PublishDir="$Publish_Path" -f net8.0-macos -p:CreatePackage=false -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"

rm -r "$App_Modules_Path"
mkdir -p "$App_Modules_Path"
echo "编译插件"
#复制插件
Copy_Plugins() {
local Plugins_Folder=$1
local Plugins_Folder_Name=$2
local Plugins_FileName=$3
mkdir -p "$App_Modules_Path/$Plugins_Folder_Name"
cp -r "$Plugins_Folder/$Plugins_FileName" "$App_Modules_Path/$Plugins_Folder_Name/$Plugins_FileName"
}
echo "编译加速插件"
Plugins_Accelerator_Path="$Base_Path/src/BD.WTTS.Client.Plugins.Accelerator"
cd "$Plugins_Accelerator_Path"
dotnet publish -c Release -p:PublishDir="$Publish_Path" -f net8.0-macos
Copy_Plugins "$Plugins_Release_Path/net8.0-macos" "Accelerator" "BD.WTTS.Client.Plugins.Accelerator.dll"

Plugins_Accelerator_ReverseProxy_Path="$Base_Path/src/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy"
cd "$Plugins_Accelerator_ReverseProxy_Path"
# 根据 Build_Mode 执行不同逻辑
if [ "$Build_Mode" = "any" ]; then
dotnet publish -c Release -p:PublishDir="$Publish_Path/arm64" -f net8.0 -r osx-arm64 -p:PublishSingleFile=true --self-contained -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
dotnet publish -c Release -p:PublishDir="$Publish_Path/x64" -f net8.0 -r osx-x64 -p:PublishSingleFile=true --self-contained -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
lipo -create "$Publish_Path/arm64/Steam++.Accelerator" "$Publish_Path/x64/Steam++.Accelerator" -output "$Publish_Path/Steam++.Accelerator"
Copy_Plugins "$Publish_Path" "Accelerator" "Steam++.Accelerator"
elif [ "$Build_Mode" = "arm64" ]; then
dotnet publish -c Release -p:PublishDir="$Publish_Path/arm64" -f net8.0 -r osx-arm64 -p:PublishSingleFile=true --self-contained -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
Copy_Plugins "$Publish_Path/arm64" "Accelerator" "Steam++.Accelerator"
elif [ "$Build_Mode" = "x64" ]; then
dotnet publish -c Release -p:PublishDir="$Publish_Path/x64" -f net8.0 -r osx-x64 -p:PublishSingleFile=true --self-contained -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
Copy_Plugins "$Publish_Path/x64" "Accelerator" "Steam++.Accelerator"
fi

echo "编译令牌插件"
Plugins_Authenticator_Path="$Base_Path/src/BD.WTTS.Client.Plugins.Authenticator"
cd "$Plugins_Authenticator_Path"
dotnet publish -c Release -p:PublishDir="$Publish_Path" -f net8.0-macos -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
Copy_Plugins "$Plugins_Release_Path/net8.0-macos" "Authenticator" "BD.WTTS.Client.Plugins.Authenticator.dll"

echo "编译账户插件"
Plugins_GameAccount_Path="$Base_Path/src/BD.WTTS.Client.Plugins.GameAccount"
cd "$Plugins_GameAccount_Path"
dotnet publish -c Release -p:PublishDir="$Publish_Path" -f net8.0-macos -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
Copy_Plugins "$Plugins_Release_Path/net8.0-macos" "GameAccount" "BD.WTTS.Client.Plugins.GameAccount.dll"

echo "编译游戏库插件"
Plugins_GameList_Path="$Base_Path/src/BD.WTTS.Client.Plugins.GameList"
cd "$Plugins_GameList_Path"
dotnet publish -c Release -p:PublishDir="$Publish_Path" -f net8.0-macos -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
Copy_Plugins "$Plugins_Release_Path/net8.0-macos" "GameList" "BD.WTTS.Client.Plugins.GameList.dll"

echo "复制插件到程序目录"
cd "$App_Path"

# 根据 Build_Mode 执行不同逻辑
if [ "$Build_Mode" = "any" ]; then
cp -r "$App_Modules_Path" "$Plugins_Release_Path/net8.0-macos/Steam++.app/Contents/MonoBundle"
elif [ "$Build_Mode" = "arm64" ]; then
cp -r "$App_Modules_Path" "$Plugins_Release_Path/net8.0-macos/osx-arm64/Steam++.app/Contents/MonoBundle"
cp -r "$Plugins_Release_Path/net8.0-macos/Steam++.app/Contents/Resources" "$Plugins_Release_Path/net8.0-macos/Steam++.app/Contents"
elif [ "$Build_Mode" = "x64" ]; then
cp -r "$App_Modules_Path" "$Plugins_Release_Path/net8.0-macos/osx-x64/Steam++.app/Contents/MonoBundle"
cp -r "$Plugins_Release_Path/net8.0-macos/Steam++.app/Contents/Resources" "$Plugins_Release_Path/net8.0-macos/Steam++.app/Contents"
fi

echo "代码签名重新手动签名"
App_Publish_Path="$App_Path/bin/Release/net8.0-macos/Steam++.app"
# #代码签名重新手动签名
codesign --remove-signature "$App_Publish_Path"
codesign --remove-signature "$App_Publish_Path/Contents/MacOS/Steam++"
dylibs=$(find "$App_Publish_Path/Contents/MonoBundle" -type f -name "*.dylib")
for dylib in $dylibs; do
codesign --remove-signature "$dylib"
codesign -f -s "$CodesignKey_Name" "$dylib"
done
codesign -f -s "$CodesignKey_Name" "$App_Publish_Path/Contents/MacOS/Steam++"
codesign -f -s "$CodesignKey_Name" "$App_Publish_Path"
sudo xattr -rd com.apple.quarantine "$App_Publish_Path"
#!/bin/bash
# 判断是否提供了 Build_Mode 参数
if [ -z "$1" ]; then
Build_Mode="any" # 如果没有提供参数,则设置默认值为 "any"
else
Build_Mode="$1"
fi

Base_Path="/Users/moxiansheng/Documents/GitHub/SteamTools"
App_Path="$Base_Path/src/BD.WTTS.Client.Avalonia.App"
Publish_Path="bin/Release/Publish/assemblies"
Plugins_Release_Path="bin/Release"
CodesignKey_Name="mossimo code"
App_Modules_Path="$App_Path/$Publish_Path/modules"
echo "编译主程序"
cd "$App_Path"
dotnet publish -c Release -p:PublishDir="$Publish_Path" -f net9.0-macos -p:CreatePackage=false -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"

rm -r "$App_Modules_Path"
mkdir -p "$App_Modules_Path"
echo "编译插件"
#复制插件
Copy_Plugins() {
local Plugins_Folder=$1
local Plugins_Folder_Name=$2
local Plugins_FileName=$3
mkdir -p "$App_Modules_Path/$Plugins_Folder_Name"
cp -r "$Plugins_Folder/$Plugins_FileName" "$App_Modules_Path/$Plugins_Folder_Name/$Plugins_FileName"
}
echo "编译加速插件"
Plugins_Accelerator_Path="$Base_Path/src/BD.WTTS.Client.Plugins.Accelerator"
cd "$Plugins_Accelerator_Path"
dotnet publish -c Release -p:PublishDir="$Publish_Path" -f net9.0-macos
Copy_Plugins "$Plugins_Release_Path/net9.0-macos" "Accelerator" "BD.WTTS.Client.Plugins.Accelerator.dll"

Plugins_Accelerator_ReverseProxy_Path="$Base_Path/src/BD.WTTS.Client.Plugins.Accelerator.ReverseProxy"
cd "$Plugins_Accelerator_ReverseProxy_Path"
# 根据 Build_Mode 执行不同逻辑
if [ "$Build_Mode" = "any" ]; then
dotnet publish -c Release -p:PublishDir="$Publish_Path/arm64" -f net9.0 -r osx-arm64 -p:PublishSingleFile=true --self-contained -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
dotnet publish -c Release -p:PublishDir="$Publish_Path/x64" -f net9.0 -r osx-x64 -p:PublishSingleFile=true --self-contained -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
lipo -create "$Publish_Path/arm64/Steam++.Accelerator" "$Publish_Path/x64/Steam++.Accelerator" -output "$Publish_Path/Steam++.Accelerator"
Copy_Plugins "$Publish_Path" "Accelerator" "Steam++.Accelerator"
elif [ "$Build_Mode" = "arm64" ]; then
dotnet publish -c Release -p:PublishDir="$Publish_Path/arm64" -f net9.0 -r osx-arm64 -p:PublishSingleFile=true --self-contained -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
Copy_Plugins "$Publish_Path/arm64" "Accelerator" "Steam++.Accelerator"
elif [ "$Build_Mode" = "x64" ]; then
dotnet publish -c Release -p:PublishDir="$Publish_Path/x64" -f net9.0 -r osx-x64 -p:PublishSingleFile=true --self-contained -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
Copy_Plugins "$Publish_Path/x64" "Accelerator" "Steam++.Accelerator"
fi

echo "编译令牌插件"
Plugins_Authenticator_Path="$Base_Path/src/BD.WTTS.Client.Plugins.Authenticator"
cd "$Plugins_Authenticator_Path"
dotnet publish -c Release -p:PublishDir="$Publish_Path" -f net9.0-macos -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
Copy_Plugins "$Plugins_Release_Path/net9.0-macos" "Authenticator" "BD.WTTS.Client.Plugins.Authenticator.dll"

echo "编译账户插件"
Plugins_GameAccount_Path="$Base_Path/src/BD.WTTS.Client.Plugins.GameAccount"
cd "$Plugins_GameAccount_Path"
dotnet publish -c Release -p:PublishDir="$Publish_Path" -f net9.0-macos -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
Copy_Plugins "$Plugins_Release_Path/net9.0-macos" "GameAccount" "BD.WTTS.Client.Plugins.GameAccount.dll"

echo "编译游戏库插件"
Plugins_GameList_Path="$Base_Path/src/BD.WTTS.Client.Plugins.GameList"
cd "$Plugins_GameList_Path"
dotnet publish -c Release -p:PublishDir="$Publish_Path" -f net9.0-macos -p:EnableCodeSigning=true -p:CodesignKey="$CodesignKey_Name"
Copy_Plugins "$Plugins_Release_Path/net9.0-macos" "GameList" "BD.WTTS.Client.Plugins.GameList.dll"

echo "复制插件到程序目录"
cd "$App_Path"

# 根据 Build_Mode 执行不同逻辑
if [ "$Build_Mode" = "any" ]; then
cp -r "$App_Modules_Path" "$Plugins_Release_Path/net9.0-macos/Steam++.app/Contents/MonoBundle"
elif [ "$Build_Mode" = "arm64" ]; then
cp -r "$App_Modules_Path" "$Plugins_Release_Path/net9.0-macos/osx-arm64/Steam++.app/Contents/MonoBundle"
cp -r "$Plugins_Release_Path/net9.0-macos/Steam++.app/Contents/Resources" "$Plugins_Release_Path/net9.0-macos/Steam++.app/Contents"
elif [ "$Build_Mode" = "x64" ]; then
cp -r "$App_Modules_Path" "$Plugins_Release_Path/net9.0-macos/osx-x64/Steam++.app/Contents/MonoBundle"
cp -r "$Plugins_Release_Path/net9.0-macos/Steam++.app/Contents/Resources" "$Plugins_Release_Path/net9.0-macos/Steam++.app/Contents"
fi

echo "代码签名重新手动签名"
App_Publish_Path="$App_Path/bin/Release/net9.0-macos/Steam++.app"
# #代码签名重新手动签名
codesign --remove-signature "$App_Publish_Path"
codesign --remove-signature "$App_Publish_Path/Contents/MacOS/Steam++"
dylibs=$(find "$App_Publish_Path/Contents/MonoBundle" -type f -name "*.dylib")
for dylib in $dylibs; do
codesign --remove-signature "$dylib"
codesign -f -s "$CodesignKey_Name" "$dylib"
done
codesign -f -s "$CodesignKey_Name" "$App_Publish_Path/Contents/MacOS/Steam++"
codesign -f -s "$CodesignKey_Name" "$App_Publish_Path"
sudo xattr -rd com.apple.quarantine "$App_Publish_Path"
2 changes: 1 addition & 1 deletion build/publish_apphost_linux_x64.sh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
dotnet publish "..\src\BD.WTTS.Client.AppHost\BD.WTTS.Client.AppHost.csproj" -f net7.0 -c Release -p:PublishProfile=linux-x64 -p:DeployOnBuild=true --nologo
dotnet publish "..\src\BD.WTTS.Client.AppHost\BD.WTTS.Client.AppHost.csproj" -f net9.0 -c Release -p:PublishProfile=linux-x64 -p:DeployOnBuild=true --nologo
3 changes: 3 additions & 0 deletions doc/open-source-library.md
Original file line number Diff line number Diff line change
@@ -76,3 +76,6 @@
* [.NET Runtime](https://github.com/dotnet/runtime)
* [Fluent UI System Icons](https://github.com/microsoft/fluentui-system-icons)
* [Material design icons](https://github.com/google/material-design-icons)

For LoongArch64, it also included:
* [libpng](https://github.com/winlibs/libpng)
412 changes: 412 additions & 0 deletions libpng/loongson/filter_lsx_intrinsics.c

Large diffs are not rendered by default.

65 changes: 65 additions & 0 deletions libpng/loongson/loongarch_lsx_init.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
/* loongarch_lsx_init.c - LSX optimized filter functions
*
* Copyright (c) 2021 Loongson Technology Corporation Limited
* All rights reserved.
* Contributed by Jin Bo <jinbo@loongson.cn>
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/

#include "../pngpriv.h"

#ifdef PNG_READ_SUPPORTED
#if PNG_LOONGARCH_LSX_IMPLEMENTATION == 1

#include <sys/auxv.h>

#define LA_HWCAP_LSX (1<<4)
static int png_has_lsx(void)
{
int flags = 0;
int flag = (int)getauxval(AT_HWCAP);

if (flag & LA_HWCAP_LSX)
return 1;

return 0;
}

void
png_init_filter_functions_lsx(png_structp pp, unsigned int bpp)
{
/* IMPORTANT: any new external functions used here must be declared using
* PNG_INTERNAL_FUNCTION in ../pngpriv.h. This is required so that the
* 'prefix' option to configure works:
*
* ./configure --with-libpng-prefix=foobar_
*
* Verify you have got this right by running the above command, doing a build
* and examining pngprefix.h; it must contain a #define for every external
* function you add. (Notice that this happens automatically for the
* initialization function.)
*/

if (png_has_lsx())
{
pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_lsx;
if (bpp == 3)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_lsx;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_lsx;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth3_lsx;
}
else if (bpp == 4)
{
pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_lsx;
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_lsx;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_lsx;
}
}
}

#endif /* PNG_LOONGARCH_LSX_IMPLEMENTATION == 1 */
#endif /* PNG_READ_SUPPORTED */
16 changes: 13 additions & 3 deletions src/BD.WTTS.Client.Tools.Publish/Commands/IDotNetPublishCommand.cs
Original file line number Diff line number Diff line change
@@ -1126,9 +1126,19 @@ static void SetPublishCommandArgumentList(
argumentList.Add("-f");
argumentList.Add(arg.Framework);

// 发布针对给定运行时的应用程序。 有关运行时标识符 (RID) 的列表,请参阅 RID 目录。
argumentList.Add("-r");
argumentList.Add(arg.RuntimeIdentifier);
if (arg.Architecture.HasValue && (Architecture.LoongArch64 | Architecture.RiscV64).HasFlag(arg.Architecture.Value))
{
argumentList.Add($"--arch");
argumentList.Add(ArchToString(arg.Architecture.Value));
argumentList.Add($"--os");
argumentList.Add("linux");
}
else
{
// 发布针对给定运行时的应用程序。 有关运行时标识符 (RID) 的列表,请参阅 RID 目录。
argumentList.Add("-r");
argumentList.Add(arg.RuntimeIdentifier);
}

argumentList.Add("-v");
argumentList.Add("q");