diff --git a/.github/workflows/build-qv2ray-cmake.yml b/.github/workflows/build-qv2ray-cmake.yml index 56fff80..ed7d6c4 100644 --- a/.github/workflows/build-qv2ray-cmake.yml +++ b/.github/workflows/build-qv2ray-cmake.yml @@ -176,7 +176,7 @@ jobs: mv windows64 nekoray zip -r $version_standalone-windows64.zip nekoray rm -rf nekoray - - name: Pack debian + - name: Pack Debian if: github.event.inputs.publish != 'y' run: | source libs/deploy_common.sh @@ -186,9 +186,24 @@ jobs: cp -r public_res/* windows64 rm -rf public_res *.pdb #### - sudo bash ../libs/package_debian.sh ${{ github.event.inputs.tag }} + bash ../libs/package_debian.sh ${{ github.event.inputs.tag }} mv nekoray.deb $version_standalone-debian-x64.deb sudo rm -rf nekoray + - name: Pack AppImage + run: | + source libs/deploy_common.sh + find . -name artifacts.tgz | xargs -n1 tar xvzf + cd deployment + cp -r public_res/* linux64 + rm -rf public_res *.pdb + #### + bash ../libs/package_appimage.sh + mv nekoray-x86_64.AppImage $version_standalone-linux-x64.AppImage + - name: Clean Up + run: | + cd deployment + rm -rf linux64 + rm -rf windows64 - name: Uploading Artifact uses: actions/upload-artifact@master with: diff --git a/README.md b/README.md index 5963fcb..3ab3f37 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,8 @@ Support Windows / Linux / ~~macOS amd64~~ out of the box now. 1. AUR [nekoray-git](https://aur.archlinux.org/packages/nekoray-git) 2. Scoop extras: `scoop install nekoray` +3. Homebrew (非官方发布 / unoffical): [homebrew-nekoray](https://github.com/tdjnodj/homebrew-nekoray) +4. APT (非官方发布 / unoffical): [tdjnodj/apt](https://github.com/tdjnodj/apt) ## 更改记录 & 发布频道 / Changelog & Telegram channel @@ -108,3 +110,4 @@ XMR - [yaml-cpp](https://github.com/jbeder/yaml-cpp) - [zxing-cpp](https://github.com/nu-book/zxing-cpp) - [QHotkey](https://github.com/Skycoder42/QHotkey) +- [AppImageKit](https://github.com/AppImage/AppImageKit) diff --git a/README_fa.md b/README_fa.md index bb3e2b1..80118e0 100644 --- a/README_fa.md +++ b/README_fa.md @@ -18,6 +18,8 @@ 1. AUR [nekoray-git](https://aur.archlinux.org/packages/nekoray-git) 2. Scoop extras: `scoop install nekoray` +3. Homebrew (unoffical): [homebrew-nekoray](https://github.com/tdjnodj/homebrew-nekoray) +4. APT (unoffical): [tdjnodj/apt](https://github.com/tdjnodj/apt) ## تغییرات برنامه و کانال تلگرام / Changelog & Telegram channel @@ -88,3 +90,4 @@ XMR - [yaml-cpp](https://github.com/jbeder/yaml-cpp) - [zxing-cpp](https://github.com/nu-book/zxing-cpp) - [QHotkey](https://github.com/Skycoder42/QHotkey) +- [AppImageKit](https://github.com/AppImage/AppImageKit) diff --git a/docs/Run_Linux.md b/docs/Run_Linux.md index e6ca905..e780f1c 100644 --- a/docs/Run_Linux.md +++ b/docs/Run_Linux.md @@ -12,9 +12,13 @@ sudo apt install ./nekoray-*-debian-x64.deb ### 其他发行版 -下载 .zip 文件,解压到合理的路径,开箱即用。具体使用方法见下文。 +下载 .zip 文件,解压到合适的路径,开箱即用。 -或者使用 AUR `nekoray-git` +或下载 .AppImage,并使用 `chmod +x nekoray-*-AppImage-x64.AppImage` 给予可执行权限。 + +具体使用方法见下文。 + +或者使用 AUR `nekoray-git`。 ## Linux 运行 diff --git a/libs/package_appimage.sh b/libs/package_appimage.sh new file mode 100644 index 0000000..bbcd9f0 --- /dev/null +++ b/libs/package_appimage.sh @@ -0,0 +1,35 @@ +#!/bin/bash + +sudo apt install fuse -y + +cp -r linux64 nekoray.AppDir + +# The file for Appimage + +cat >nekoray.AppDir/nekoray.desktop<<-EOF +[Desktop Entry] +Name=nekoray +Exec=/launcher -- -appdata +Icon=nekoray +Type=Application +Categories=Network +EOF + +cat >nekoray.AppDir/AppRun<<-EOF +#!/bin/bash +HERE="\$(dirname "\$(readlink -f "\${0}")")" +\${HERE}/launcher -- -appdata +EOF + +chmod +x nekoray.AppDir/AppRun + +# build + +curl -L -O https://github.com/AppImage/AppImageKit/releases/latest/download/appimagetool-x86_64.AppImage +chmod +x appimagetool-x86_64.AppImage +./appimagetool-x86_64.AppImage nekoray.AppDir + +# remove + +rm appimagetool-x86_64.AppImage +rm -rf nekoray.AppDir \ No newline at end of file diff --git a/ui/mainwindow.cpp b/ui/mainwindow.cpp index a6f2be8..e511d64 100644 --- a/ui/mainwindow.cpp +++ b/ui/mainwindow.cpp @@ -642,7 +642,9 @@ void MainWindow::on_menu_exit_triggered() { QDir::setCurrent(QApplication::applicationDirPath()); auto arguments = NekoRay::dataStore->argv; if (arguments.length() > 0) arguments.removeFirst(); - QProcess::startDetached(qEnvironmentVariable("NKR_FROM_LAUNCHER") == "1" ? "./launcher" : QApplication::applicationFilePath(), arguments); + auto isLauncher = qEnvironmentVariable("NKR_FROM_LAUNCHER") == "1"; + if (isLauncher) arguments.prepend("--"); + QProcess::startDetached(isLauncher ? "./launcher" : QApplication::applicationFilePath(), arguments); } tray->hide(); QCoreApplication::quit();