Compare commits

...

65 Commits

Author SHA1 Message Date
a76191da3a 补个更新日志
Some checks failed
Auto Building Wine Runner / deb (push) Has been cancelled
Auto Building Wine Runner / rpm (push) Has been cancelled
Auto Building Wine Runner / pkg (push) Has been cancelled
Building Wine Runner Off-line Pages / amd64 (push) Has been cancelled
Building Wine Runner Off-line Pages / arm64 (push) Has been cancelled
Building Wine Runner Off-line Pages / loongarch64 (push) Has been cancelled
2025-04-19 21:22:13 +08:00
3fd7b7532f 4.1.5 2025-04-19 21:18:26 +08:00
22f4430a27 更新dxvk至2.6.1 2025-04-19 21:17:49 +08:00
40938dc131 更新winetricks版本 2025-04-19 21:16:07 +08:00
a7bf65f407 适配spark-wine10 2025-04-19 21:07:15 +08:00
3272c825c6 更新dxvk至dxvk2.6
Some checks failed
Auto Building Wine Runner / deb (push) Has been cancelled
Auto Building Wine Runner / rpm (push) Has been cancelled
Auto Building Wine Runner / pkg (push) Has been cancelled
Building Wine Runner Off-line Pages / amd64 (push) Has been cancelled
Building Wine Runner Off-line Pages / arm64 (push) Has been cancelled
Building Wine Runner Off-line Pages / loongarch64 (push) Has been cancelled
2025-03-16 08:54:12 +08:00
acfb32d51f 修复run-system-bwrap问题
Some checks failed
Auto Building Wine Runner / deb (push) Has been cancelled
Auto Building Wine Runner / rpm (push) Has been cancelled
Auto Building Wine Runner / pkg (push) Has been cancelled
Building Wine Runner Off-line Pages / amd64 (push) Has been cancelled
Building Wine Runner Off-line Pages / arm64 (push) Has been cancelled
Building Wine Runner Off-line Pages / loongarch64 (push) Has been cancelled
2025-02-06 17:53:28 +08:00
4629bb495b 补充缺失依赖 2025-02-06 17:43:22 +08:00
76347629d1 拷贝wine
Some checks are pending
Auto Building Wine Runner / deb (push) Waiting to run
Auto Building Wine Runner / rpm (push) Waiting to run
Auto Building Wine Runner / pkg (push) Waiting to run
Building Wine Runner Off-line Pages / amd64 (push) Waiting to run
Building Wine Runner Off-line Pages / arm64 (push) Waiting to run
Building Wine Runner Off-line Pages / loongarch64 (push) Waiting to run
2025-02-06 12:48:45 +08:00
197c5706dd 没拷贝lat的文件 2025-02-06 12:42:30 +08:00
4d318701ac 写入dns 2025-02-06 11:38:23 +08:00
34e2062f83 更换注册方式 2025-02-06 10:01:04 +08:00
0a485769ed 调整依赖
Some checks are pending
Auto Building Wine Runner / deb (push) Waiting to run
Auto Building Wine Runner / rpm (push) Waiting to run
Auto Building Wine Runner / pkg (push) Waiting to run
Building Wine Runner Off-line Pages / amd64 (push) Waiting to run
Building Wine Runner Off-line Pages / arm64 (push) Waiting to run
Building Wine Runner Off-line Pages / loongarch64 (push) Waiting to run
2025-02-05 17:54:42 +08:00
ef7737f0d9 调整 2025-02-05 13:10:39 +08:00
1c13377979 调整binfmt注册方式 2025-02-05 13:06:54 +08:00
931fd3114a 调整
Some checks are pending
Auto Building Wine Runner / deb (push) Waiting to run
Auto Building Wine Runner / rpm (push) Waiting to run
Auto Building Wine Runner / pkg (push) Waiting to run
Building Wine Runner Off-line Pages / amd64 (push) Waiting to run
Building Wine Runner Off-line Pages / arm64 (push) Waiting to run
Building Wine Runner Off-line Pages / loongarch64 (push) Waiting to run
2025-02-05 12:51:58 +08:00
2c8e83c2d4 整合action 2025-02-05 12:50:07 +08:00
9f591340b0 使用actions/upload-artifact@v4 2025-02-05 12:43:17 +08:00
878ce96a50 尝试loongarch64架构离线包 2025-02-05 12:39:46 +08:00
6c0549afe6 支持调用deepin-wine-staging
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2025-01-02 22:25:53 +08:00
4d30f1c04d 调整makefile
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-12-21 15:51:34 +08:00
b481f01609 4.1.3 2024-12-21 15:38:55 +08:00
864be06001 !10 feat: 支持spark-wine9的自动屏蔽安装器
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
Merge pull request !10 from shenmo/N/A
2024-12-16 13:58:15 +00:00
189d7a1ba1 feat: 支持spark-wine9的自动屏蔽安装器
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-12-13 11:13:26 +00:00
c2e598c670 4.1.2
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-11-17 15:48:39 +08:00
15c15dc5f8 更新dxvk版本至2.5 2024-11-17 15:45:08 +08:00
676d52c964 修复安全问题 2024-11-17 15:43:17 +08:00
7138c6fbb9 !9 【轻量级 PR】:Fix: Change %u to %F to avoid low wine version can't resolve file:// protocol
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
Merge pull request !9 from shenmo/N/A
2024-11-07 14:23:49 +00:00
979c573768 Fix: Change %u to %F to avoid low wine version can't resolve file:// protocol
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-11-07 05:46:22 +00:00
9ea5e297b6 修复自动构建问题
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Waiting to run
2024-11-06 22:08:25 +08:00
624b4c8b3a !7 fix: Can not pass args that starts with -- && feat: Now add --uri %u as default
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Waiting to run
Merge pull request !7 from shenmo/main
2024-11-05 13:27:29 +00:00
0c4e736b12 fix: GXDE Deb Installer will install xfce-terminal when installing deb 2024-11-04 12:51:01 +08:00
0d0438bddd bump version to 4112
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-11-04 04:44:46 +00:00
3fe1ff8a61 fix: i18n fail on GXDE 2024-11-04 08:26:29 +08:00
1fe4ed75f4 fix: Can not pass args to exe without --uri
Chore: Bump version to 4.1.1.1
2024-11-04 08:19:01 +08:00
ebf9474bc6 feat: Now we pass %u as default config 2024-11-04 07:55:46 +08:00
d7e131c778 fix: Can not pass '--xxx' options to wine progs 2024-11-04 07:51:41 +08:00
9184f42677 补充更新内容
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-11-02 21:47:52 +08:00
674eff5f10 调整版本号 2024-11-02 21:45:34 +08:00
910404b54d 修复虚拟机因无法创建磁盘导致崩溃的问题 2024-11-02 21:45:08 +08:00
ab60ec15b0 !1 fix:i18n failed
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
Merge pull request !1 from shenmo/N/A
2024-10-27 08:33:25 +00:00
535dccb183 fix:i18n failed
Signed-off-by: shenmo <jifengshenmo@outlook.com>
2024-10-20 12:47:31 +00:00
a515570ee3 漏改了地方
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-10-16 22:25:53 +08:00
c73e32fa39 调整版本号 2024-10-16 22:10:07 +08:00
ca88d5f62c run.sh适配GXDE OS(https://gitee.com/gfdgd-xi/deep-wine-runner/issues/IAW3W3) 2024-10-16 21:56:08 +08:00
df561d3d03 修复APPRUN_CMD值错误的问题(https://gitee.com/gfdgd-xi/deep-wine-runner/issues/IAXE1T) 2024-10-16 21:52:07 +08:00
744d2aa262 修复bug(https://gitee.com/gfdgd-xi/deep-wine-runner/issues/IASRHG)
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-09-22 11:09:48 +08:00
7fb1f60aae 修复没有dxvk的问题
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-09-17 12:21:42 +08:00
058f025353 少一个
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-09-15 17:01:30 +08:00
d8360c6e59 漏改了个地方 2024-09-15 16:53:12 +08:00
7fa1edb3f8 更新更新内容 2024-09-15 16:51:54 +08:00
82bd073ff8 使用gxde-terminal替代deepin-terminal-gtk
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-08-30 22:46:03 +08:00
ebed98fd25 修改错别字
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-08-16 11:29:16 +08:00
1ec62bbf86 修复不存在TMPDIR/tmp文件夹时无法打开程序的问题
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-08-11 09:26:24 +08:00
f79bac9d6c 修复打包缺uos-info.sh文件的问题
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-08-05 12:59:13 +08:00
6863e58413 修复打包器若干bug;修改wine封装入deb机制以便可以被uos商店正常签名
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Waiting to run
2024-08-04 22:22:37 +08:00
96319869b6 termux默认也使用标签页页面
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Has been cancelled
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Has been cancelled
2024-08-03 18:02:02 +08:00
bc5aca0fd7 优化切换的使用体验 2024-08-03 17:46:56 +08:00
bf18411f7a 支持动态读取添加模组 2024-08-03 17:04:46 +08:00
6ce9d63a19 支持deb内置helper(未测试)
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(arm64) / Explore-GitHub-Actions (push) Waiting to run
Building Wine Runner Off-line Pages(amd64) / Explore-GitHub-Actions (push) Waiting to run
2024-08-03 10:05:49 +08:00
4022c3a17b 移除废弃的crossover部分(未测试) 2024-08-03 09:52:08 +08:00
9ae95d6008 初步实现高级打包器脚本文件的抽离(未测试可用性) 2024-08-03 08:42:53 +08:00
81576681e8 Merge branch 'main' of https://gitee.com/gfdgd-xi/deep-wine-runner 2024-08-03 07:28:10 +08:00
aaeb80fde3 开始尝试并入wine helper 2024-08-03 07:27:57 +08:00
df95e7d0b0 单独封装用于实现窗口模块化的组件和调用 2024-08-02 20:59:56 +08:00
139 changed files with 4368 additions and 3052 deletions

17
.github/workflows/DaoXiangHu-stable vendored Normal file
View File

@@ -0,0 +1,17 @@
mirror_style release
download_style apt
finddebs_style from-indices
variants - buildd fakechroot minbase
keyring /usr/share/keyrings/debian-archive-keyring.gpg
default_mirror https://pkg.loongnix.cn/loongnix/20
# include common settings
if [ -e "$DEBOOTSTRAP_DIR/scripts/debian-common" ]; then
. "$DEBOOTSTRAP_DIR/scripts/debian-common"
elif [ -e /debootstrap/debian-common ]; then
. /debootstrap/debian-common
elif [ -e "$DEBOOTSTRAP_DIR/debian-common" ]; then
. "$DEBOOTSTRAP_DIR/debian-common"
else
error 1 NOCOMMON "File not found: debian-common"
fi

View File

@@ -1,33 +0,0 @@
name: Auto Building Wine Runnerpkg
run-name: ${{ github.actor }} Auto Building Wine Runnerpkg 🚀
on:
workflow_dispatch:
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
container: archlinux
steps:
- name: Building PKG
env:
GUSER: ${{ secrets.GUSER }}
PASSWORD: ${{ secrets.PASSWORD }}
UPLOADURL: ${{ secrets.UPLOADURL }}
run: |
# 配置环境
pacman -Sy
pacman -S yay git sudo
pacman -S dpkg qt5-base -y
yay install
git clone https://github.com/gfdgd-xi/deep-wine-runner
cd deep-wine-runner
make package-deb -j4
make package-pkg -j4
cd ..
mv spark-deepin-wine-runner*.pkg.tar.zst ../spark-deepin-wine-runner.pkg.tar.zst
- name: upload result
uses: actions/upload-artifact@v3
with:
name: spark-deepin-wine-runner.pkg.tar.zst
path: spark-deepin-wine-runner.pkg.tar.zst

View File

@@ -1,29 +0,0 @@
name: Auto Building Wine Runnerrpm
run-name: ${{ github.actor }} Auto Building Wine Runnerrpm 🚀
on:
push:
workflow_dispatch:
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- name: Building RPM
env:
GUSER: ${{ secrets.GUSER }}
PASSWORD: ${{ secrets.PASSWORD }}
UPLOADURL: ${{ secrets.UPLOADURL }}
run: |
# 配置环境
sudo apt update
sudo apt install git dpkg-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qt5-qmake rpm -y
git clone https://github.com/gfdgd-xi/deep-wine-runner
cd deep-wine-runner
make package-rpm
mv spark-deepin-wine-runner*.rpm /home/runner/spark-deepin-wine-runner.rpm
- name: upload result
uses: actions/upload-artifact@v1
with:
name: spark-deepin-wine-runner.rpm
path: /home/runner/spark-deepin-wine-runner.rpm

View File

@@ -1,10 +1,10 @@
name: Auto Building Wine Runnerdeb
run-name: ${{ github.actor }} Auto Building Wine Runnerdeb 🚀
name: Auto Building Wine Runner
run-name: ${{ github.actor }} Auto Building Wine Runner 🚀
on:
push:
workflow_dispatch:
jobs:
Explore-GitHub-Actions:
deb:
runs-on: ubuntu-latest
steps:
- name: Building DEB
@@ -18,24 +18,73 @@ jobs:
mv spark-deepin-wine-runner.deb ~
mv spark-deepin-wine-runner-ace.deb ~
- name: upload result
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: spark-deepin-wine-runner.deb
path: /home/runner/spark-deepin-wine-runner.deb
- name: upload result
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: spark-deepin-wine-runner-ace.deb
path: /home/runner/spark-deepin-wine-runner-ace.deb
- name: Building DEB (termux)
run: |
cd deep-wine-runner
make package-deb-termux -j4
make package-termux-deb -j4
mv spark-deepin-wine-runner-termux.deb ~
- name: upload result
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: spark-deepin-wine-runner-termux.deb
path: /home/runner/spark-deepin-wine-runner-termux.deb
rpm:
runs-on: ubuntu-latest
steps:
- name: Building RPM
env:
GUSER: ${{ secrets.GUSER }}
PASSWORD: ${{ secrets.PASSWORD }}
UPLOADURL: ${{ secrets.UPLOADURL }}
run: |
# 配置环境
sudo apt update
sudo apt install git dpkg-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qt5-qmake rpm -y
git clone https://github.com/gfdgd-xi/deep-wine-runner
cd deep-wine-runner
make package-rpm
mv spark-deepin-wine-runner*.rpm /home/runner/spark-deepin-wine-runner.rpm
- name: upload result
uses: actions/upload-artifact@v4
with:
name: spark-deepin-wine-runner.rpm
path: /home/runner/spark-deepin-wine-runner.rpm
pkg:
runs-on: ubuntu-latest
container: archlinux
steps:
- name: Building PKG
env:
GUSER: ${{ secrets.GUSER }}
PASSWORD: ${{ secrets.PASSWORD }}
UPLOADURL: ${{ secrets.UPLOADURL }}
run: |
# 配置环境
pacman -Sy
pacman -S yay git sudo
pacman -S dpkg qt5-base -y
yay install
git clone https://github.com/gfdgd-xi/deep-wine-runner
cd deep-wine-runner
make package-deb -j4
make package-pkg -j4
cd ..
mv spark-deepin-wine-runner*.pkg.tar.zst ../spark-deepin-wine-runner.pkg.tar.zst
- name: upload result
uses: actions/upload-artifact@v4
with:
name: spark-deepin-wine-runner.pkg.tar.zst
path: spark-deepin-wine-runner.pkg.tar.zst

View File

@@ -1,79 +0,0 @@
name: Building Wine Runner Off-line Pages(arm64)
run-name: ${{ github.actor }} Building Wine Runner Off-line Pages(arm64) 🚀
on:
push:
workflow_dispatch:
jobs:
Explore-GitHub-Actions:
runs-on: ubuntu-latest
steps:
- name: Building DEB
run: |
# 获取所需数据
cpu=$(cat /proc/cpuinfo | grep processor | wc -l)
# 配置环境
sudo apt update
sudo apt install python3-requests debootstrap xz-utils qemu-user-static -y
sudo apt install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools psmisc -y
cd ~
mkdir package
# 部署 chroot 环境
sudo debootstrap --arch=arm64 bookworm debian
wget https://github.com/gfdgd-xi/deep-wine-runner/raw/main/pardus-chroot
sudo cp pardus-chroot /usr/bin
sudo chmod 777 /usr/bin/pardus-chroot
sudo pardus-chroot debian
### 配置容器
## 加入 wine 源
sudo chroot debian apt update
sudo chroot debian apt install sudo gpg wget -y
sudo chroot debian wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list
sudo chroot debian bash -c "wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg"
sudo chroot debian apt update
sudo chroot debian apt install box64 wine -y
## 获取 Wine 运行器安装包
git clone https://github.com/gfdgd-xi/deep-wine-runner --depth=1
cd deep-wine-runner
make package-deb
cd ..
url=`python3 deep-wine-runner/off-line-shell/GetNewestDebUrl.py`
#wget $url
mv deep-wine-runner/spark-deepin-wine-runner.deb debian/tmp/wine-runner.deb
## 安装
sudo chroot debian apt install locales /tmp/wine-runner.deb fcitx xfce4-terminal -y
sudo chroot debian apt install libxenmisc4.17 libxenstore4 libxenforeignmemory1 -y
# 构建软件包
mkdir package/runner -p
sudo cp debian/usr/local/bin package -rv
sudo cp debian/usr/bin package -rv
sudo cp debian/usr/lib package -rv
sudo cp debian/usr/share package -rv
#sudo cp debian/usr/lib64 package -rv
sudo cp debian/opt/apps/deepin-wine-runner/* package/runner -rv
# 精简运行器体积
sudo rm -rf package/runner/2048
sudo rm -rf package/runner/geek.exe
sudo rm -rf package/runner/BeCyIconGrabber.exe
sudo rm -rf package/runner/Icon
sudo rm -rf package/runner/RegShot.exe
sudo rm -rf package/runner/novnc
sudo rm -rf package/bin/wine*
# 修复 which 命令的问题导致无法正常识别终端的问题
sudo cp package/bin/which.debianutils package/bin/which -rv
cp deep-wine-runner/off-line-shell/run.sh package -rv
cp deep-wine-runner/off-line-shell/run-system-bwrap.sh package -rv
cp deep-wine-runner/off-line-shell/bwrap_arm64 package/bwrap -rv
sudo chmod 777 -Rv package ; true
cd package
# 添加 Wine 运行器离线模式标识
touch runner/off-line.lock
tar -cvf ../spark-deepin-wine-runner-off-line.tar *
cd ..
xz -T $cpu spark-deepin-wine-runner-off-line.tar
- name: upload result
uses: actions/upload-artifact@v1
with:
name: spark-deepin-wine-runner-off-line.tar.xz
path: /home/runner/spark-deepin-wine-runner-off-line.tar.xz

View File

@@ -1,10 +1,10 @@
name: Building Wine Runner Off-line Pages(amd64)
run-name: ${{ github.actor }} Building Wine Runner Off-line Pages(amd64) 🚀
name: Building Wine Runner Off-line Pages
run-name: ${{ github.actor }} Building Wine Runner Off-line Pages 🚀
on:
push:
workflow_dispatch:
jobs:
Explore-GitHub-Actions:
amd64:
runs-on: ubuntu-latest
steps:
- name: Building DEB
@@ -30,6 +30,8 @@ jobs:
sudo chroot debian apt install sudo gpg wget -y
sudo chroot debian wget -O /etc/apt/keyrings/winehq-archive.key https://dl.winehq.org/wine-builds/winehq.key
sudo chroot debian wget -NP /etc/apt/sources.list.d/ https://dl.winehq.org/wine-builds/debian/dists/bookworm/winehq-bookworm.sources
sudo chroot debian bash -c "echo 'deb [trusted=true] https://repo.gxde.top/gxde-os/bixie ./' | sudo tee /etc/apt/sources.list.d/gxde-stable.list"
sudo chroot debian bash -c "echo 'deb [trusted=true] https://repo.gxde.top/gxde-os/tianlu ./' | sudo tee /etc/apt/sources.list.d/gxde-testing.list"
sudo chroot debian apt update
## 获取 Wine 运行器安装包
git clone https://github.com/gfdgd-xi/deep-wine-runner --depth=1
@@ -41,6 +43,7 @@ jobs:
mv deep-wine-runner/spark-deepin-wine-runner.deb debian/tmp/wine-runner.deb
## 安装
sudo chroot debian apt install locales /tmp/wine-runner.deb winehq-devel fcitx xfce4-terminal -y
sudo chroot debian apt install locales qtwayland5 xwayland thunar -y
sudo chroot debian apt install libxenmisc4.17 libxenstore4 libxenforeignmemory1 -y
# 构建软件包
mkdir package/runner -p
@@ -59,6 +62,8 @@ jobs:
sudo rm -rf package/bin/wine*
# 修复 which 命令的问题导致无法正常识别终端的问题
sudo cp package/bin/which.debianutils package/bin/which -rv
# 内置 winehq
sudo cp debian/opt/wine-devel package/runner/wine -rv
cp deep-wine-runner/off-line-shell/run.sh package -rv
cp deep-wine-runner/off-line-shell/run-system-bwrap.sh package -rv
cp deep-wine-runner/off-line-shell/bwrap_amd64 package/bwrap -rv
@@ -70,9 +75,168 @@ jobs:
cd ..
xz -T $cpu spark-deepin-wine-runner-off-line.tar
- name: upload result
uses: actions/upload-artifact@v1
uses: actions/upload-artifact@v4
with:
name: spark-deepin-wine-runner-off-line.tar.xz
name: spark-deepin-wine-runner-off-line-amd64.tar.xz
path: /home/runner/spark-deepin-wine-runner-off-line.tar.xz
arm64:
runs-on: ubuntu-latest
steps:
- name: Building DEB
run: |
# 获取所需数据
cpu=$(cat /proc/cpuinfo | grep processor | wc -l)
# 配置环境
sudo apt update
sudo apt install python3-requests debootstrap xz-utils qemu-user-static -y
sudo apt install qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools psmisc -y
cd ~
mkdir package
# 部署 chroot 环境
sudo debootstrap --arch=arm64 bookworm debian
wget https://github.com/gfdgd-xi/deep-wine-runner/raw/main/pardus-chroot
sudo cp pardus-chroot /usr/bin
sudo chmod 777 /usr/bin/pardus-chroot
sudo pardus-chroot debian
### 配置容器
## 加入 wine 源
sudo chroot debian apt update
sudo chroot debian apt install sudo gpg wget -y
sudo chroot debian wget https://ryanfortner.github.io/box64-debs/box64.list -O /etc/apt/sources.list.d/box64.list
sudo chroot debian bash -c "wget -qO- https://ryanfortner.github.io/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg"
sudo chroot debian bash -c "echo 'deb [trusted=true] https://repo.gxde.top/gxde-os/bixie ./' | sudo tee /etc/apt/sources.list.d/gxde-stable.list"
sudo chroot debian bash -c "echo 'deb [trusted=true] https://repo.gxde.top/gxde-os/tianlu ./' | sudo tee /etc/apt/sources.list.d/gxde-testing.list"
sudo chroot debian apt update
sudo chroot debian apt install box64 hangover-wine -y
## 获取 Wine 运行器安装包
git clone https://github.com/gfdgd-xi/deep-wine-runner --depth=1
cd deep-wine-runner
make package-deb
cd ..
url=`python3 deep-wine-runner/off-line-shell/GetNewestDebUrl.py`
#wget $url
mv deep-wine-runner/spark-deepin-wine-runner.deb debian/tmp/wine-runner.deb
## 安装
sudo chroot debian apt install locales /tmp/wine-runner.deb fcitx xfce4-terminal qtwayland5 xwayland thunar -y
sudo chroot debian apt install libxenmisc4.17 libxenstore4 libxenforeignmemory1 -y
# 构建软件包
mkdir package/runner -p
sudo cp debian/usr/local/bin package -rv
sudo cp debian/usr/bin package -rv
sudo cp debian/usr/lib package -rv
sudo cp debian/usr/share package -rv
#sudo cp debian/usr/lib64 package -rv
sudo cp debian/opt/apps/deepin-wine-runner/* package/runner -rv
# 精简运行器体积
sudo rm -rf package/runner/2048
sudo rm -rf package/runner/geek.exe
sudo rm -rf package/runner/BeCyIconGrabber.exe
sudo rm -rf package/runner/Icon
sudo rm -rf package/runner/RegShot.exe
sudo rm -rf package/runner/novnc
# 修复 which 命令的问题导致无法正常识别终端的问题
sudo cp package/bin/which.debianutils package/bin/which -rv
cp deep-wine-runner/off-line-shell/run.sh package -rv
cp deep-wine-runner/off-line-shell/run-system-bwrap.sh package -rv
cp deep-wine-runner/off-line-shell/bwrap_arm64 package/bwrap -rv
sudo chmod 777 -Rv package ; true
cd package
# 添加 Wine 运行器离线模式标识
touch runner/off-line.lock
tar -cvf ../spark-deepin-wine-runner-off-line.tar *
cd ..
xz -T $cpu spark-deepin-wine-runner-off-line.tar
- name: upload result
uses: actions/upload-artifact@v4
with:
name: spark-deepin-wine-runner-off-line-arm64.tar.xz
path: /home/runner/spark-deepin-wine-runner-off-line.tar.xz
loongarch64:
runs-on: ubuntu-20.04
steps:
- name: Building DEB
run: |
# 获取所需数据
cpu=$(cat /proc/cpuinfo | grep processor | wc -l)
# 配置环境
sudo apt update
sudo apt install python3-requests debootstrap xz-utils qemu-user-static git aria2 squashfs-tools -y
sudo apt install binfmt-support qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools psmisc wget -y
git clone https://github.com/gfdgd-xi/deep-wine-runner --depth=1
sudo cp deep-wine-runner/.github/workflows/DaoXiangHu-stable /usr/share/debootstrap/scripts/
git clone https://gitee.com/loongarch-kvm/qemu-loongarch64-static
cd qemu-loongarch64-static
tar -xvf qemu-loongarch64-static.tar.gz
cd qemu-loongarch64-static
sudo bash qemu-binfmt-conf.sh
sudo cp qemu-loongarch64 /usr/local/bin/
cd ~
mkdir package
# 部署 chroot 环境
#sudo debootstrap --no-check-gpg --arch=loongarch64 DaoXiangHu-stable debian https://pkg.loongnix.cn/loongnix/20
aria2c -x 16 -s 16 https://sourceforge.net/projects/deep-wine-runner-wine-download/files/loongnix/filesystem.squashfs/download
sudo unsquashfs filesystem.squashfs
sudo mv squashfs-root debian
sudo cp /usr/local/bin/qemu-loongarch64 debian/usr/local/bin/qemu-loongarch64 -rv
# 写入 DNS
echo "nameserver 8.8.8.8" | sudo tee debian/etc/resolv.conf
wget https://github.com/gfdgd-xi/deep-wine-runner/raw/main/pardus-chroot
sudo cp pardus-chroot /usr/bin
sudo chmod 777 /usr/bin/pardus-chroot
sudo pardus-chroot debian
### 配置容器
## 加入 wine 源
sudo chroot debian apt update
sudo chroot debian apt install sudo gpg wget -y
sudo chroot debian apt update
sudo chroot debian apt install -y lat i386-runtime-base i386-runtime-extra
sudo chroot debian apt install -y wine
## 获取 Wine 运行器安装包
git clone https://github.com/gfdgd-xi/deep-wine-runner --depth=1
cd deep-wine-runner
make package-deb
cd ..
url=`python3 deep-wine-runner/off-line-shell/GetNewestDebUrl.py`
#wget $url
mv deep-wine-runner/spark-deepin-wine-runner.deb debian/tmp/wine-runner.deb
## 安装
sudo chroot debian apt install locales /tmp/wine-runner.deb fcitx xfce4-terminal qtwayland5 xwayland thunar -y
# 构建软件包
mkdir package/runner -p
sudo cp debian/usr/local/bin package -rv
sudo cp debian/usr/bin package -rv
sudo cp debian/usr/lib package -rv
sudo cp debian/usr/share package -rv
sudo cp debian/usr/gnemul package -rv
#sudo cp debian/usr/lib64 package -rv
sudo cp debian/opt/apps/deepin-wine-runner/* package/runner -rv
sudo cp debian/opt/wine-6.0 package/runner/wine -rv
# 精简运行器体积
sudo rm -rf package/runner/2048
sudo rm -rf package/runner/geek.exe
sudo rm -rf package/runner/BeCyIconGrabber.exe
sudo rm -rf package/runner/Icon
sudo rm -rf package/runner/RegShot.exe
sudo rm -rf package/runner/novnc
# 修复 which 命令的问题导致无法正常识别终端的问题
cp deep-wine-runner/off-line-shell/run.sh package -rv
cp deep-wine-runner/off-line-shell/run-system-bwrap.sh package -rv
cp deep-wine-runner/off-line-shell/bwrap_loongarch64 package/bwrap -rv
sudo chmod 777 -Rv package ; true
cd package
# 添加 Wine 运行器离线模式标识
touch runner/off-line.lock
tar -cvf ../spark-deepin-wine-runner-off-line.tar *
cd ..
xz -T $cpu spark-deepin-wine-runner-off-line.tar
- name: upload result
uses: actions/upload-artifact@v4
with:
name: spark-deepin-wine-runner-off-line-loongarch64.tar.xz
path: /home/runner/spark-deepin-wine-runner-off-line.tar.xz

0
ConfigLanguareRunner-help.json Normal file → Executable file
View File

0
DefaultSetting.py Normal file → Executable file
View File

View File

@@ -4,7 +4,7 @@ X-Categories=System;Wine;
Exec=/usr/bin/deepin-wine-runner %F
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Runner
Name[zh]=Wine 运行器
Name[zh_CN]=Wine 运行器
Terminal=false
StartupNotify=true
Keywords=exe;scr;

0
DisabledOpengl.reg Normal file → Executable file
View File

0
Download.py Normal file → Executable file
View File

0
EnabledOpengl.reg Normal file → Executable file
View File

0
IconList.json Normal file → Executable file
View File

0
InstallDeepinWine6OnUbuntu.sh Normal file → Executable file
View File

0
InstallDeepinWineOnUbuntu.sh Normal file → Executable file
View File

View File

@@ -39,6 +39,7 @@ copy-files:
cp -rv wine/ deb/opt/apps/deepin-wine-runner/
cp -rv Test/ deb/opt/apps/deepin-wine-runner/
cp -rv dxvk/ deb/opt/apps/deepin-wine-runner/
cp -rv packager-config/ deb/opt/apps/deepin-wine-runner/
cp -rv information.json package-script
zip -v -q -r package-script.zip package-script
cp -rv InstallBox86-cn.sh deb/opt/apps/deepin-wine-runner/
@@ -97,7 +98,7 @@ copy-files:
cp -rv InstallVisualCPlusPlus.py deb/opt/apps/deepin-wine-runner
cp -rv launch.sh deb/opt/apps/deepin-wine-runner
cp -rv LICENSE deb/opt/apps/deepin-wine-runner
cp -rv mainwindow.py deb/opt/apps/deepin-wine-runner/deepin-wine-runner
cp -rv mainwindow.py deb/opt/apps/deepin-wine-runner/
cp -rv package-script.zip deb/opt/apps/deepin-wine-runner
cp -rv Run.bat deb/opt/apps/deepin-wine-runner
cp -rv RunVM.sh deb/opt/apps/deepin-wine-runner
@@ -137,6 +138,10 @@ copy-files:
cp -rv InstallRuntime deb/opt/apps/deepin-wine-runner
cp -rv globalenv.py deb/opt/apps/deepin-wine-runner
cp -rv local deb/opt/apps/deepin-wine-runner
cp -rv WindowModule.py deb/opt/apps/deepin-wine-runner
cp -rv welcome.py deb/opt/apps/deepin-wine-runner
#cp -rv main.py deb/opt/apps/deepin-wine-runner/deepin-wine-runner
cp -rv mainwindow.py deb/opt/apps/deepin-wine-runner/deepin-wine-runner
mkdir -pv deb/opt/apps/deepin-wine-runner/entries/
cp -rv deb/usr/share/applications deb/opt/apps/deepin-wine-runner/entries/applications
python3 UpdateTime.py
@@ -172,8 +177,63 @@ copy-files:
remove-copy-files:
sudo rm -rfv /tmp/spark-deepin-wine-runner-builder
package-deb-to-amd64:
rm -rfv /tmp/wine-runner-package
dpkg -x spark-deepin-wine-runner.deb /tmp/wine-runner-package
dpkg -e spark-deepin-wine-runner.deb /tmp/wine-runner-package/DEBIAN
sudo chown -R root:root /tmp/wine-runner-package/opt
sudo chown -R root:root /tmp/wine-runner-package/usr
sed -i "s/Architecture: all/Architecture: amd64/g" /tmp/wine-runner-package/DEBIAN/control
dpkg-deb -Z xz -z 0 -b /tmp/wine-runner-package spark-deepin-wine-runner-amd64.deb
package-deb-to-arm64:
rm -rfv /tmp/wine-runner-package
dpkg -x spark-deepin-wine-runner.deb /tmp/wine-runner-package
dpkg -e spark-deepin-wine-runner.deb /tmp/wine-runner-package/DEBIAN
sudo chown -R root:root /tmp/wine-runner-package/opt
sudo chown -R root:root /tmp/wine-runner-package/usr
sed -i "s/Architecture: all/Architecture: arm64/g" /tmp/wine-runner-package/DEBIAN/control
dpkg-deb -Z xz -z 0 -b /tmp/wine-runner-package spark-deepin-wine-runner-arm64.deb
package-deb-to-mips64el:
rm -rfv /tmp/wine-runner-package
dpkg -x spark-deepin-wine-runner.deb /tmp/wine-runner-package
dpkg -e spark-deepin-wine-runner.deb /tmp/wine-runner-package/DEBIAN
sudo chown -R root:root /tmp/wine-runner-package/opt
sudo chown -R root:root /tmp/wine-runner-package/usr
sed -i "s/Architecture: all/Architecture: mips64el/g" /tmp/wine-runner-package/DEBIAN/control
dpkg-deb -Z xz -z 0 -b /tmp/wine-runner-package spark-deepin-wine-runner-mips64el.deb
package-deb-to-loongarch64:
rm -rfv /tmp/wine-runner-package
dpkg -x spark-deepin-wine-runner.deb /tmp/wine-runner-package
dpkg -e spark-deepin-wine-runner.deb /tmp/wine-runner-package/DEBIAN
sudo chown -R root:root /tmp/wine-runner-package/opt
sudo chown -R root:root /tmp/wine-runner-package/usr
sed -i "s/Architecture: all/Architecture: loongarch64/g" /tmp/wine-runner-package/DEBIAN/control
dpkg-deb -Z xz -z 0 -b /tmp/wine-runner-package spark-deepin-wine-runner-loongarch64.deb
package-deb-to-loong64:
rm -rfv /tmp/wine-runner-package
dpkg -x spark-deepin-wine-runner.deb /tmp/wine-runner-package
dpkg -e spark-deepin-wine-runner.deb /tmp/wine-runner-package/DEBIAN
sudo chown -R root:root /tmp/wine-runner-package/opt
sudo chown -R root:root /tmp/wine-runner-package/usr
sed -i "s/Architecture: all/Architecture: loong64/g" /tmp/wine-runner-package/DEBIAN/control
dpkg-deb -Z xz -z 0 -b /tmp/wine-runner-package spark-deepin-wine-runner-loong64.deb
package-deb-to-riscv64:
rm -rfv /tmp/wine-runner-package
dpkg -x spark-deepin-wine-runner.deb /tmp/wine-runner-package
dpkg -e spark-deepin-wine-runner.deb /tmp/wine-runner-package/DEBIAN
sudo chown -R root:root /tmp/wine-runner-package/opt
sudo chown -R root:root /tmp/wine-runner-package/usr
sed -i "s/Architecture: all/Architecture: riscv64/g" /tmp/wine-runner-package/DEBIAN/control
dpkg-deb -Z xz -z 0 -b /tmp/wine-runner-package spark-deepin-wine-runner-riscv64.deb
package-deb:
make copy-files -j$(nproc)
sudo chown -R root:root /tmp/spark-deepin-wine-runner-builder
dpkg-deb -Z xz -z 9 -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner.deb
make remove-copy-files -j$(nproc)
# 构建 ace 包
@@ -203,7 +263,7 @@ package-termux-deb:
sudo cp -rv deb-termux/usr/share/applications /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/share/applications
# 加入 termux loader
sudo cp -rv mainwindow-termux-loader.sh /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner
sudo cp -rv mainwindow.py /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/mainwindow.py
sudo cp -rv main.py /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/mainwindow.py
sudo bash builddeb/ChangeDebVersion.sh
dpkg-deb -Z xz -z 9 -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner-termux.deb
make remove-copy-files -j$(nproc)

View File

@@ -13,15 +13,15 @@ programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
# 优先为深度终端
terminal = ""
terminalList = [
"gxde-terminal",
"deepin-terminal",
"deepin-terminal-gtk",
"mate-terminal",
"gnome-terminal",
"xfce4-terminal"
]
terminalEnd = {
f"{programPath}/../launch.sh\" \"deepin-terminal": ["-e", 0],
f"{programPath}/../launch.sh\" \"deepin-terminal-gtk": ["-e", 0],
"gxde-terminal": ["-e", 0],
"mate-terminal": ["-e", 1],
"gnome-terminal": ["--", 0],
"xfce4-terminal": ["-e", 1]
@@ -31,7 +31,7 @@ for i in terminalList:
if i == "deepin-terminal":
i = f"{programPath}/../launch.sh\" \"deepin-terminal"
if i == "deepin-terminal-gtk":
i = f"{programPath}/../launch.sh\" \"deepin-terminal-gtk"
i = f"{programPath}/../launch.sh\" \"gxde-terminal"
terminal = i
break
if terminal == "":

View File

@@ -27,7 +27,7 @@ Wine Runner is a program that allows Linux users to run Windows applications mor
打包器视频教程https://www.bilibili.com/video/BV1Bh4y1Q7nT/
Wine 运行器 QQ 交流群762985460
Wine 运行器离线包下载地址https://www.123pan.com/s/pDSKVv-pAJWv.html
### Wine 运行器 For Termux 安装方法以及注意事项
Wine 运行器 For Termux 使用的是独立的安装包,详细见:
@@ -58,7 +58,8 @@ https://gfdgdxi.lanzouw.com/b0plly5cj
spark-deepin-wine-runner 是普通包spark-deepin-wine-runner-ace 是使用 ace 兼容环境运行的运行器
## Wine 运行器离线包
需要私聊作者定制(有偿服务)
见小黄鱼:
https://m.tb.cn/h.g93KHpR?tk=KPeR3dH09WM
## 软件架构
理论上支持全架构,如果 Python 能运行的话
@@ -156,6 +157,21 @@ desktop文件中StartupWMClass字段。用于让桌面组件将窗口类名与de
![image.png](https://storage.deepin.org/thread/202207190822204627_image.png)
## 更新日志
### 4.1.02024/09/15
**※1、修复在 GXDE OS 下无法正常调用 gxde-terminal 的问题**
**※2、修复部分机器无法打开应用的问题**
**※3、修改打包器 wine 集成封装 机制以便可以被 uos 商店正确签名**
**※4、打包器支持内置 spark dwine helper**
**※5、重构虚拟机安装模块以支持更多机器**
**6、修复打包器设置依赖无法生效的问题**
**※7、补充图标**
**※8、修复 deb 安装过程中可能出现 dpkg 卡死的问题**
**※9、优化 Wine 安装器检测机制**
**※10、删除部分废弃组件**
**※11、修复 AOSC、Termux 无法正常打开 Wine 运行器的问题**
12、修改文案
13、修复其它 bug 若干
### 4.0.02024/07/22
**※1、优化运行器窗口大小机制**
**※2、Wine 安装器支持根据机器实际情况自动推荐适合的 Wine**
@@ -829,8 +845,6 @@ make install -j4
## 请作者喝杯茶
如果您觉得 Wine 运行器对你有帮助,可以请作者喝杯茶
<img src="Icon/QR/Wechat.png" width="250" />
<img src="Icon/QR/Alipay.jpg" width="250" />
<img src="Icon/QR/QQ.png" width="250" >
### 广告
支付宝官方活动,扫描获得支付红包!

0
README_en.md Normal file → Executable file
View File

0
RunCommandWithTerminal.py Normal file → Executable file
View File

120
ShellList/turn-amd64-to-all.sh Executable file
View File

@@ -0,0 +1,120 @@
#!/bin/bash
# A simple loongarch64 => loong64 .deb converter to help traverse the worlds.
#
# Mingcong Bai <jeffbai@aosc.io>, 2024
_display_usage() {
printf "\
Usage:
loong64-it [PACKAGE1] [PACKAGE2] ...
- PACKAGE{1..N}: Path to the old-world .deb package to convert.
"
}
# Autobuild-like echo functions.
abwarn() { echo -e "[\e[33mWARN\e[0m]: \e[1m$*\e[0m"; }
aberr() { echo -e "[\e[31mERROR\e[0m]: \e[1m$*\e[0m"; exit 1; }
abinfo() { echo -e "[\e[96mINFO\e[0m]: \e[1m$*\e[0m"; }
abdbg() { echo -e "[\e[32mDEBUG\e[0m]: \e[1m$*\e[0m"; }
_convert_loong64() {
PKG_PATH=$(realpath $1)
PKG_NAME=$(dpkg-deb -f "$PKG_PATH" Package)
VERSION=$(dpkg-deb -f "$PKG_PATH" Version)
BASEDIR=$(dirname $PKG_PATH)
abinfo "Examining package information: $1 ..."
dpkg -I "$PKG_PATH" || \
aberr "Invalid dpkg package: control (metadata) archive not found: $?"
CONTROL_EXT="$(ar t "$PKG_PATH" | grep control.tar* | cut -f3 -d'.')"
case "${CONTROL_EXT}" in
gz)
TAR_COMP_FLAG="z"
;;
xz)
TAR_COMP_FLAG="J"
;;
bz2)
TAR_COMP_FLAG="j"
;;
"")
TAR_COMP_FLAG=""
;;
*)
aberr "Invalid control archive extension ${CONTROL_EXT}!"
;;
esac
abinfo "Unpacking: $1 ..."
cd $(mktemp -d) || \
aberr "Failed to create temporary directory to unpack $1: $?."
DEBDIR="$(pwd)"
ar xv "$PKG_PATH" || \
aberr "Failed to unpack $1: $?."
abinfo "Unpacking metadata archive: $1 ..."
mkdir "$DEBDIR"/metadata || \
aberr "Failed to create temporary directory for extracting the metdata archive from $1: $?."
tar -C "$DEBDIR"/metadata -xvf control.tar."${CONTROL_EXT}" || \
aberr "Failed to unpack metadata archive from $1: $?."
abinfo "Converting dpkg Architecture key: $1 ..."
#if ! egrep '^Architecture: loongarch64$' "$DEBDIR"/metadata/control; then
# aberr "Failed to detect a \"loongarch64\" architecture signature in control file - this is not a valid old-world LoongArch package!"
#fi
sed -e 's|^Architecture: amd64$|Architecture: all|g' \
-i "$DEBDIR"/metadata/control
abinfo "Building metadata archive (control.tar.${CONTROL_EXT}): $1 ..."
cd "$DEBDIR"/metadata
tar cvf${TAR_COMP_FLAG} "$DEBDIR"/control.tar."${CONTROL_EXT}" * || \
aberr "Failed to build metadata archive (control.tar.${CONTROL_EXT}) for $1: $?."
cd "$DEBDIR"
abinfo "Rebuilding dpkg package $1"
ar rv "$PKG_PATH" control.tar.${CONTROL_EXT} || \
aberr "Failed to rebuild dpkg package $1: $?."
#abinfo "Cleaning up: $1 ..."
#rm -r "$DEBDIR"
mv $1 ${BASEDIR}/${PKG_NAME}_${VERSION}_loong64.deb
abinfo """Your requested package:
$1
Has been successfully converted as a loong64 package and renamed as ${PKG_NAME}_${VERSION}_loong64.deb
However, you may still need to install libLoL for old-world applications to
work properly. Please refer to the libLoL home page:
https://liblol.aosc.io
For details on how to install and configure libLoL.
"""
}
# Display usage info if `-h' or `--help' is specified.
if [[ "$1" == "-h" || "$1" == "--help" ]]; then
_display_usage
exit 0
fi
# Display usage info with directions if no option is specified.
if [ -z "$1" ]; then
abwarn "Please specify package(s) to convert.\n"
_display_usage
exit 1
fi
# Record working directory.
SRCDIR="$(pwd)"
# Rebuilding all requested packages.
for i in "$@"; do
_convert_loong64 $i
done

View File

@@ -70,7 +70,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
echo X86 架构,使用 kvm 加速
$qemuMore qemu-system-x86_64 --enable-kvm -cpu host --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -nic model=rtl8139 $qemuUEFI \
-m ${use}G -display gtk -nic model=rtl8139 $qemuUEFI \
-device AC97 -device ES1370 -device intel-hda -device hda-duplex \
--boot 'splash=VM/boot.jpg,menu=on,splash-time=2000' \
-usb \
@@ -100,7 +100,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
echo 不使用 kvm 加速
$qemuPath --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -nic model=rtl8139 $qemuUEFI \
-m ${use}G -display gtk -nic model=rtl8139 $qemuUEFI \
-device AC97 -device ES1370 -device intel-hda -device hda-duplex \
--boot 'splash=VM/boot.jpg,menu=on,splash-time=2000' \
> $TMPDIR/tmp/windows-virtual-machine-installer-for-wine-runner-run.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
@@ -122,7 +122,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
if [[ $? == 0 ]] && [[ `arch` == "aarch64" ]]; then
$qemuMore qemu-system-arm --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-m ${use}G -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-cpu max -M virt -device virtio-gpu-pci \
-device nec-usb-xhci,id=xhci,addr=0x1b \
-device usb-tablet,id=tablet,bus=xhci.0,port=1 \
@@ -134,7 +134,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
fi
$qemuMore qemu-system-arm --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-m ${use}G -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-cpu max -M virt -device virtio-gpu-pci \
-device nec-usb-xhci,id=xhci,addr=0x1b \
-device usb-tablet,id=tablet,bus=xhci.0,port=1 \
@@ -160,7 +160,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
if [[ $? == 0 ]] && [[ `arch` == "aarch64" ]]; then
$qemuMore qemu-system-aarch64 --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-m ${use}G -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-cpu max -M virt \
-device virtio-gpu-pci \
-device nec-usb-xhci,id=xhci,addr=0x1b \
@@ -173,7 +173,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
fi
$qemuMore qemu-system-aarch64 --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-m ${use}G -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-cpu max -M virt \
-device virtio-gpu-pci \
-device nec-usb-xhci,id=xhci,addr=0x1b \

0
UpdateTime.py Normal file → Executable file
View File

View File

@@ -119,7 +119,7 @@ class buildvbox:
#vm.MountDisk(self.homePath() + "/Qemu/Windows/Windows.qcow2")
vm.MountMainDisk(self.homePath() + "/Qemu/Windows/Windows.qcow2")
if(os.system("/opt/apps/deepin-wine-runner-qemu-system-extra/files/resources/virtio-win.iso")):
if(os.path.exists("/opt/apps/deepin-wine-runner-qemu-system-extra/files/resources/virtio-win.iso")):
vm.MountISO("/opt/apps/deepin-wine-runner-qemu-system-extra/files/resources/virtio-win.iso", "storage_controller_2", 1, 3)
if(not setISOAlready):
vm.MountISO(isoPath, "storage_controller_1", 0, 1)

View File

@@ -148,7 +148,7 @@ def on_install_clicked():
QMessageBox.warning(this, ("提示"), ("VirtualBox 不支持该选项!"))
return
archFile.open(QIODevice.WriteOnly)
archFile.write("aarch64")
#archFile.write("aarch64")
archFile.close()
else:
if(ui.vmChooser.currentIndex() == 0 and QFile.exists(QDir.homePath() + "/.config/deepin-wine-runner/QEMU-EFI")):

View File

@@ -24,18 +24,21 @@ class qemu:
self.qemuPath = "qemu-system-i386"
if (os.path.exists("/opt/apps/deepin-wine-runner-qemu-system-extra/files/run.sh")):
# 如果存在拓展 Qemu则调用此
qemuPath = "/opt/apps/deepin-wine-runner-qemu-system-extra/files/run.sh qemu-system-i386"
self.vboxVersion = subprocess.getoutput(qemuPath + " --version")
self.qemuPath = "/opt/apps/deepin-wine-runner-qemu-system-extra/files/run.sh qemu-system-i386"
self.vboxVersion = subprocess.getoutput(self.qemuPath + " --version")
def Create(self, type = "Windows7"):
if(not os.path.exists(self.name)):
os.makedirs(self.name)
try:
if(not os.path.exists(self.name)):
os.makedirs(self.name)
except:
pass
return 0
def CreateDisk(self, path: str, size: int):
if(os.path.exists(path)):
return 0
return os.system(("qemu-img create -f qcow2 '" + self.path + "' " + str(size) + "M"))
return os.system(("qemu-img create -f qcow2 '" + path + "' " + str(size) + "M"))
def CreateDiskControl(self, controlName = "storage_controller_1"):
return 0
@@ -86,9 +89,9 @@ class qemu:
# 如果存在拓展 Qemu则调用此
qemuPath = "/opt/apps/deepin-wine-runner-qemu-system-extra/files/run.sh qemu-system-arm"
if(subprocess.getoutput("arch").replace("\n", "").replace(" ", "") == "aarch64" and not os.system((self.applicationDirPath() + "/kvm-ok"))):
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display vnc=:5 -display gtk --enable-kvm -cpu host -M virt " + self.commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display gtk --enable-kvm -cpu host -M virt " + self.commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display vnc=:5 -display gtk -cpu max -M virt " + self.commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display gtk -cpu max -M virt " + self.commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
def StartAarch64(self):
bootScreenLogo = ""
@@ -107,9 +110,9 @@ class qemu:
print(self.commandOption)
if(subprocess.getoutput("arch").replace("\n", "").replace(" ", "") == "aarch64" and not os.system((self.applicationDirPath() + "/kvm-ok"))):
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display vnc=:5 -display gtk --enable-kvm -cpu host -M virt " + self.commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display gtk --enable-kvm -cpu host -M virt " + self.commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display vnc=:5 -display gtk -cpu max -M virt " + self.commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display gtk -cpu max -M virt " + self.commandOption + " -device virtio-gpu-pci -device nec-usb-xhci,id=xhci,addr=0x1b -device usb-tablet,id=tablet,bus=xhci.0,port=1 -device usb-kbd,id=keyboard,bus=xhci.0,port=2 > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
def StartLoong64(self):
return 1
@@ -134,8 +137,8 @@ class qemu:
qemuPath = "/opt/apps/deepin-wine-runner-qemu-system-extra/files/run.sh qemu-system-x86_64"
print(self.commandOption)
if(subprocess.getoutput("arch").replace("\n", "").replace(" ", "") == "x86_64" and not os.system((self.applicationDirPath() + "/kvm-ok"))):
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display vnc=:5 -display gtk --enable-kvm -cpu host " + newCommandOption + " > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display vnc=:5 -display gtk -nic model=rtl8139 " + newCommandOption + " > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display gtk --enable-kvm -cpu host " + newCommandOption + " > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
return os.system((qemuPath + " --boot 'splash=" + self.GetBootLogoPath() + ",order=d,menu=on,splash-time=2000' -display gtk -nic model=rtl8139 " + newCommandOption + " > /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 &"))
def Stop(self):
os.system("killall qemu-system-x86_64 -9")

290
VM/test-kvm.asm Normal file
View File

@@ -0,0 +1,290 @@
mov ax,0xb800
mov es,ax
; 清屏
mov cx,80*25
clean:
mov di,cx
add di,di
mov byte [es:di],''
add di,1
mov byte [es:di],0x0F
loop clean
; 显示上方白条
; 移除(0,0)的S字符
mov byte [es:0x00],''
mov cx,80*2-1
mov di,0
push cx
headtitle:
mov di,cx
mov byte [es:di],0xF0
; 写入空字符
add di,di
mov byte [es:di],''
;inc cx
;sub cx,1
loop headtitle
xor di,di
pop cx
; 显示下方白条
tailtitle:
mov di,cx
add di,80*2*24
mov byte [es:di],0xF0
; 写入空字符
mov di,cx
add di,di
add di,80*2*24
mov byte [es:di],''
loop tailtitle
; 在第一行写入文本
jmp near showHeadText
headText: db 'Wine Runner Webiste:http://gitee.com/gfdgd-xi/deep-wine-runner'
showHeadText:
; 虽然可以简单粗暴的用 movsw但是会出现问题
mov cx,showHeadText-headText
mov ax,0x7c0
mov ds,ax ; 定位到汇编程序所在的内存地址
showHeadTextLoop:
mov dx,cx
mov di,cx
add di,di
mov si,headText
sub dx,1
add si,dx
; inc si
; mov al,1000
mov al,[ds:si]
mov byte [es:di],al
loop showHeadTextLoop
jmp near showTailText
tailText: db '2020~Now gfdgd xi'
showTailText:
mov cx,showTailText-tailText
mov ax,0x7c0
mov ds,ax
showTailTextLoop:
mov dx,cx
mov di,cx
add di,di
add di,80*2*24
mov si,tailText
sub dx,1
add si,dx
mov al,[ds:si]
mov byte [es:di],al
loop showTailTextLoop
; 显示中部提示文本
jmp near showCenterText
centerTextScreenSize:
; 第一位是行数
; 第二位是单行偏移量
db 1, -1
centerText:
db 'Mode: Real Mode Demo', 0x0A
db 'Bit: 16', 0x0A
db 'Virtual Machine: qemu-system-i386'
db 0x03 ; 结束符
showCenterText:
centerTextLong equ showCenterText-centerText
mov cx,centerTextLong
xor ax,ax
loopShowCenterText:
jmp near addScreenLineFinish
addScreenLine:
; 如果检测到换行符
mov dx, [centerTextScreenSize]
add dx,1
mov [centerTextScreenSize], dx
dec cx
mov al,-1
mov [centerTextScreenSize+1],al
; 行数+1偏移量设为 -1从头开始
;ret
addScreenLineFinish:
; 偏移量 + 1
mov al,[centerTextScreenSize+1]
add al,1
mov [centerTextScreenSize+1],al
mov di,centerText
add di,centerTextLong
sub di,cx
mov bl,[di]
; 判断是不是结束符
cmp bl,0x03
je showCenterTextEnd
; 判断是不是换行符
cmp bl,0x0A
je addScreenLine ; 换行符检测
xor ah,ah ; 清空高位
add al,al
mov di,ax
; 计算显示位置
xor dx,dx
mov dl,[centerTextScreenSize]
mov ax,80
mul dx
mov dx,2
mul dx
add ax,2
add di,ax
; 显示
mov byte [es:di], bl
loop loopShowCenterText
showCenterTextEnd:
;mov ax,[cs:0x100]
;mov dx,[cs:0x102]
; mov bx,16
; div bx
; mov ds,ax
; mov es,ax
;xor di,di
;mov si,1
;xor ds,ds
;mov bx,512
;xor bx,bx
;call read_hard_disk_0
get_data:
mov di,80*2*25-2
; 读取秒
mov al,0x00
call read_time
mov byte [es:di-4],':'
mov byte [es:di-2],ah
mov byte [es:di],al
; 读取分钟
mov al,0x02
call read_time
mov byte [es:di-10],':'
mov byte [es:di-8],ah
mov byte [es:di-6],al
; 读取小时
mov al,0x04
call read_time
mov byte [es:di-14],ah
mov byte [es:di-12],al
; 读取日
mov al,0x07
call read_time
mov byte [es:di-22],'.'
mov byte [es:di-20],ah
mov byte [es:di-18],al
; 读取月
mov al,0x08
call read_time
mov byte [es:di-28],'.'
mov byte [es:di-26],ah
mov byte [es:di-24],al
; 读取年
mov al,0x09
call read_time
mov byte [es:di-32],ah
mov byte [es:di-30],al
hlt ; 使用停机指令降低 CPU 使用率
jmp near get_data
read_time:
out 0x70,al
in al,0x71
call bcd_to_ascii
ret
; 用于编码转换BCD=》ASCII
; 输入AL=bcd码
; 输出AX=ascii
bcd_to_ascii:
mov ah,al
and al,0x0f
add al,0x30
shr ah,4
and ah,0x0f
add ah,0x30
ret
;poweroff:
; 关机
; mov ax,5307H ; 高级电源管理功能,设置电源状态
; mov bx,0001H ; 设备ID1所有设备
; mov cx,0003H ; 状态3表示关机
; int 15h
end:
times 510-($-$$) db 0
db 0x55,0xaa
; 后面部分暂时废弃
read_hard_disk_0: ; 从硬盘读取一个逻辑扇区
; 输入DI:SI=起始逻辑扇区号
; DS:BX=目标缓冲区地址
push ax
push bx
push cx
push dx
mov dx,0x1f2
mov al,1
out dx,al ; 读取的扇区数
inc dx ; 0x1f3
mov ax,si
out dx,al ; LBA地址7~0
inc dx ; 0x1f4
mov al,ah
out dx,al ; LBA地址15~8
inc dx ; 0x1f5
mov ax,di
out dx,al ; LBA地址23~16
inc dx ; 0x1f6
mov al,0xe0 ; LBA28模式主盘
or al,ah ; LBA地址27~24
out dx,al
inc dx ; 0x1f7
mov al,0x20 ; 读命令
out dx,al
.waits:
in al,dx ; 此时 dx 为 0x1f7此时为命令端口也是状态窗口
and al,0x88
cmp al,0x08
jnz .waits
; 内部操作期间,会将 0x1f7 端口第 7 位设置为“1”准备就绪后会将此位清零并将第 3 位设为 1
mov cx,256 ; 总计要读取的/字/数
mov dx,0x1f0
.readw:
in ax,dx
mov [bx],ax
add bx,2
loop .readw
pop dx
pop cx
pop bx
pop ax

54
WindowModule.py Executable file
View File

@@ -0,0 +1,54 @@
# 用于实现窗口模块化的组件和调用封装
import os
import sys
import PyQt5.QtWidgets as QtWidgets
moduleNameList = {
"mainwindow": {
"Name": "运行器",
"RepeatShow": False
},
"deepin-wine-easy-packager": {
"Name": "简易打包器",
"RepeatShow": False
},
"deepin-wine-packager": {
"Name": "专业打包器",
"RepeatShow": False
},
"VM.mainwindow": {
"Name": "虚拟机管理工具",
"RepeatShow": True
},
"wine.installwine": {
"Name": "Wine 安装工具",
"RepeatShow": True
}
}
class RunnerWindow:
programPath = os.path.split(os.path.realpath(__file__))[0] # 获取当前程序目录
import globalenv
recycleTime = 0
def __init__(self, app: QtWidgets.QApplication, moduleName: str) -> None:
self.globalenv._init() # globalenv 的 init 是必须的,这样才能正确的 import Wine 运行器的窗口
self.globalenv.set_value("app", app) # 用于将该部分的 app 给子模块的 Qt 控件调用以解决 UI 异常以及其它问题
# 因为 Python 有不允许重复 import 的特性从而导致多次返回的控件实际指向同一对象,所以要通过特殊的方式绕过这一限制
# 将使用指向程序所在文件夹的超链接以改变库名称从而实现每次引入时命名控件不同
# 通过嵌套多个 local.local.local 以解决问题
# 同理可以利用该特性使用 globalenv 传值
if (not os.path.exists(f"{self.programPath}/local")):
# 没有存在该超链接,不启用该机制
self.globalenv.set_value("app", app)
self.mainwindow = __import__(moduleName, fromlist=["mainwindow"])
return
while True:
self.recycleTime += 1
testModuleName = "local." * self.recycleTime + moduleName
if (not testModuleName in sys.modules):
self.mainwindow = __import__(testModuleName, fromlist=["mainwindow"]) # 设置 fromlist 就不会返回最上层节点,及 local
break
def Win(self) -> QtWidgets.QMainWindow:
# 输出窗口
return self.mainwindow.window

View File

@@ -18,7 +18,7 @@ Depends: python3,
python3-requests,
python3-pyqt5 | pyqt5,
python3-psutil | pypsutil,
xfce4-terminal | deepin-terminal-gtk | deepin-terminal | mate-terminal | gnome-terminal,
gxde-terminal |xfce4-terminal | deepin-terminal | mate-terminal | gnome-terminal,
python3-dbus,
python3-pip | pip, p7zip-full | p7zip-legacy | p7zip,
sudo,
@@ -28,7 +28,8 @@ Depends: python3,
tree,
dpkg,
fakeroot,
bash
bash,
xdg-utils
Recommends: winbind,
wimtools | wimlib,
python3-pyquery,
@@ -36,13 +37,12 @@ Recommends: winbind,
binfmt-support,
libc6:i386,
libc6:armhf,
libwine,
qemu-system,
qemu-full,
qemu,
alien,
spark-deepin-wine-runner-qemu-system-extra,
deepin-wine8-stable | spark-wine | spark-wine9 | spark-wine9-wow | spark-wine8 | spark-wine8-wow | spark-wine7-devel | deepin-wine6-stable | deepin-wine5-stable | deepin-wine5 | deepin-wine | wine,
deepin-wine-staging | deepin-wine8-stable | hangover-wine | spark-wine | spark-wine9 | spark-wine9-wow | spark-wine8 | spark-wine8-wow | spark-wine7-devel | deepin-wine6-stable | deepin-wine5-stable | deepin-wine5 | deepin-wine | wine | libwine,
spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepin
Section: utils
Conflicts: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52, spark-deepin-wine-runner-termux, termux-exec

View File

@@ -19,12 +19,14 @@ python3 -m pip install --upgrade xpinyin --trusted-host https://repo.huaweicloud
python3 -m pip install --upgrade pynput --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
python3 -m pip install --upgrade xpinyin --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
# 修改 box86/64 国内源错误数据
if [ -f /etc/apt/sources.list.d/box64.list ]; then
sed -i 's/http:\/\/seafile.jyx2048.com:2345/http:\/\/gfdgdxi.v5.idcfengye.com/g' /etc/apt/sources.list.d/box64.list
fi
if [ -f /etc/apt/sources.list.d/box86.list ]; then
sed -i 's/http:\/\/seafile.jyx2048.com:2345/http:\/\/gfdgdxi.v5.idcfengye.com/g' /etc/apt/sources.list.d/box86.list
fi
sudo rm /etc/apt/sources.list.d/box64.list -rfv
sudo rm /etc/apt/sources.list.d/box86.list -rfv
#if [ -f /etc/apt/sources.list.d/box64.list ]; then
# sed -i 's/http:\/\/seafile.jyx2048.com:2345/http:\/\/gfdgdxi.v5.idcfengye.com/g' /etc/apt/sources.list.d/box64.list
#fi
#if [ -f /etc/apt/sources.list.d/box86.list ]; then
# sed -i 's/http:\/\/seafile.jyx2048.com:2345/http:\/\/gfdgdxi.v5.idcfengye.com/g' /etc/apt/sources.list.d/box86.list
#fi
echo 执行完成
echo 移除旧组件
if [ -d /opt/apps/deepin-wine-runner/arm-package ]; then
@@ -36,9 +38,6 @@ fi
if [ -d /opt/apps/deepin-wine-runner/exa ]; then
rm -rf /opt/apps/deepin-wine-runner/exa
fi
if [ -d /opt/apps/deepin-wine-runner/dxvk ]; then
rm -rf /opt/apps/deepin-wine-runner/dxvk
fi
echo 移除完成
# 如果为非 X86 PC可以删除掉一些无用组件主要是用不了
if [[ `arch` != "x86_64" ]]; then
@@ -63,6 +62,6 @@ if [[ `arch` != "x86_64" ]]; then
rm -rf /opt/apps/deepin-wine-runner/InstallNewWineHQ.sh
fi
# 设置目录权限,让用户可读可写,方便后续删除组件
chmod 777 -R /opt/apps/deepin-wine-runner > /dev/null 2>&1 | true
#chmod 777 -R /opt/apps/deepin-wine-runner > /dev/null 2>&1 | true
# 向服务器返回安装数加1不显示内容且忽略错误
python3 /opt/apps/deepin-wine-runner/Download.py $version > /dev/null 2>&1 | true

View File

@@ -4,7 +4,7 @@ X-Categories=System;Wine;
Exec=/usr/bin/deepin-wine-package-builder "~/.wine" %F
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Package Builder
Name[zh]=Wine 打包器
Name[zh_CN]=Wine 打包器
Terminal=false
StartupNotify=true
NoDisplay=true

View File

@@ -4,7 +4,7 @@ X-Categories=System;Wine;
Exec=/usr/bin/deepin-wine-packager-easy-builder %F
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Package Builder
Name[zh]=Wine 简易打包器
Name[zh_CN]=Wine 简易打包器
Terminal=false
StartupNotify=true
NoDisplay=true

View File

@@ -5,6 +5,6 @@ Exec=/usr/bin/deepin-wine-packager-with-script
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Package Builder For UOS
NoDisplay=true
Name[zh]=Wine 打包器(基于活动脚本)
Name[zh_CN]=Wine 打包器(基于活动脚本)
Terminal=false
StartupNotify=true

View File

@@ -4,7 +4,7 @@ X-Categories=System;Wine;
Exec=/opt/apps/deepin-wine-runner/RunVM.sh %F
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Setting VirtualMachine
Name[zh]=设置 Windows 虚拟机
Name[zh_CN]=设置 Windows 虚拟机
NoDisplay=true
Terminal=false
StartupNotify=true

View File

@@ -4,6 +4,6 @@ X-Categories=System;
Exec=/opt/apps/deepin-wine-runner/StartVM.sh %F
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Start Windows VirtualMachine
Name[zh]=开启 Windows 虚拟机
Name[zh_CN]=开启 Windows 虚拟机
Terminal=false
StartupNotify=true

View File

@@ -4,7 +4,7 @@ X-Categories=System;Wine;
Exec=/usr/bin/deepin-wine-runner %F
Icon=/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Runner
Name[zh]=Wine 运行器
Name[zh_CN]=Wine 运行器
Terminal=false
StartupNotify=true
Keywords=exe;scr;

View File

@@ -204,6 +204,8 @@ Get_Dist_Name()
DISTRO='Deepin'
elif grep -Eqi "UnionTech" /etc/issue || grep -Eq "UnionTech" /etc/*-release; then
DISTRO='UniontechOS'
elif grep -Eqi "GXDE" /etc/issue || grep -Eq "GXDE" /etc/*-release; then
DISTRO='GXDE'
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
DISTRO='UniontechOS'
else
@@ -266,7 +268,7 @@ DISABLE_ATTACH_FILE_DIALOG=""
##############<<<<<<<<<禁用文件选择工具开始
Get_Dist_Name
#此功能实现参见开头函数段
if [ "$DISTRO" != "Deepin" ] && [ "$DISTRO" != "UniontechOS" ];then
if [ "$DISTRO" != "Deepin" ] && [ "$DISTRO" != "UniontechOS" ] && [ "$DISTRO" != "GXDE" ];then
DISABLE_ATTACH_FILE_DIALOG="1"
echo "非deepin/UOS默认关闭系统自带的文件选择工具使用Wine的"
echo "如果你想改变这个行为,请到/opt/apps/$DEB_PACKAGE_NAME/files/$0处修改"
@@ -303,7 +305,7 @@ if [ -n "$EXEC_PATH" ];then
if [ -z "${{EXEC_PATH##*.lnk*}}" ];then
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
else
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
fi
else
$START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"
@@ -319,7 +321,7 @@ Encoding=UTF-8
Type=Application
X-Created-By=@@@Maintainer@@@
Icon=@@@Icon@@@
Exec="/opt/apps/@@@Package@@@/files/run.sh"
Exec="/opt/apps/@@@Package@@@/files/run.sh --uri %F"
Name=@@@Name@@@
Comment=@@@Description@@@
MimeType=
@@ -696,6 +698,7 @@ logText.setStyleSheet("""
color: white;
""")
wineChooserList = [
"使用 Deepin Wine Staging 打包应用",
"使用 Deepin Wine8 Stable 打包应用",
"使用 Spark Wine9 wow 打包应用",
"使用 Spark Wine9 打包应用",
@@ -708,7 +711,23 @@ wineChooserList = [
"使用 Spark Wine 打包应用"
]
wineChooserIndex = 2
wineList = ["deepin-wine8-stable", "spark-wine9-wow", "spark-wine9", "spark-wine8", "spark-wine7-devel", "deepin-wine6-stable", "deepin-wine6-vannila", "spark-wine8-wow", "deepin-wine5-stable", "deepin-wine5", "deepin-wine", "spark-wine"]
wineList = [
"deepin-wine-staging",
"deepin-wine8-stable",
"spark-wine10-wow",
"spark-wine10",
"spark-wine9-wow",
"spark-wine9",
"spark-wine8",
"spark-wine7-devel",
"deepin-wine6-stable",
"deepin-wine6-vannila",
"spark-wine8-wow",
"deepin-wine5-stable",
"deepin-wine5",
"deepin-wine",
"spark-wine"
]
for i in range(len(wineList)):
if not os.system(f"which '{wineList[i]}'"):
wineChooserIndex = i
@@ -750,13 +769,13 @@ try:
exePath.setText(sys.argv[1])
except:
pass
if (__name__ != "__main__"):
'''if (__name__ != "__main__"):
# 设置滚动条
areaScroll = QtWidgets.QScrollArea(window)
areaScroll.setWidgetResizable(True)
areaScroll.setWidget(widget)
areaScroll.setFrameShape(QtWidgets.QFrame.NoFrame)
window.setCentralWidget(areaScroll)
window.setCentralWidget(areaScroll)'''
if (__name__ == "__main__"):
window.resize(int(window.frameGeometry().width() * 1.2), int(window.frameGeometry().height() * 1.1))

File diff suppressed because it is too large Load Diff

0
deepin-wine-runner_512x512.png Normal file → Executable file
View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

0
geek.exe Normal file → Executable file
View File

0
globalenv.py Normal file → Executable file
View File

2
information.json Normal file → Executable file
View File

@@ -1,5 +1,5 @@
{
"Version": "4.0.0.2",
"Version": "4.1.5",
"Time": "未知",
"Thank": [
"感谢 @り哥拽的冇气质° 和 @杨 提供了 3a5000新世界的测试机器",

213
main.py Normal file → Executable file
View File

@@ -1,41 +1,31 @@
#!/usr/bin/env python3
# 库的引用
import os
import PyQt5.QtWidgets as QtWidgets
import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
import importlib
import os
import sys
import json
import welcome
import subprocess
import WindowModule
class RunnerWindow:
programPath = os.path.split(os.path.realpath(__file__))[0] # 获取当前程序目录
import globalenv
recycleTime = 0
def __init__(self, app: QtWidgets.QApplication, moduleName: str):
self.globalenv._init() # globalenv 的 init 是必须的,这样才能正确的 import Wine 运行器的窗口
self.globalenv.set_value("app", app) # 用于将该部分的 app 给子模块的 Qt 控件调用以解决 UI 异常以及其它问题
# 因为 Python 有不允许重复 import 的特性从而导致多次返回的控件实际指向同一对象,所以要通过特殊的方式绕过这一限制
# 将使用指向程序所在文件夹的超链接以改变库名称从而实现每次引入时命名控件不同
# 通过嵌套多个 local.local.local 以解决问题
# 同理可以利用该特性使用 globalenv 传值
if (not os.path.exists(f"{self.programPath}/local")):
# 没有存在该超链接,不启用该机制
self.globalenv.set_value("app", app)
self.mainwindow = __import__(moduleName, fromlist=["mainwindow"])
return
while True:
self.recycleTime += 1
testModuleName = "local." * self.recycleTime + moduleName
if (not testModuleName in sys.modules):
self.mainwindow = __import__(testModuleName, fromlist=["mainwindow"]) # 设置 fromlist 就不会返回最上层节点,及 local
break
def Win(self) -> QtWidgets.QMainWindow:
# 输出窗口
return self.mainwindow.window
# 读取文本文档
def readtxt(path):
f = open(path, "r") # 设置文件对象
str = f.read() # 获取内容
f.close() # 关闭文本对象
return str # 返回结果
def ProgramVersion():
information = json.loads(readtxt(f"{programPath}/information.json"))
return information["Version"]
# 创建界面
class Window(QtWidgets.QWidget):
moduleMapList = {}
def __init__(self):
super().__init__()
self.counter_a = 1
@@ -46,7 +36,7 @@ class Window(QtWidgets.QWidget):
def initUI(self):
self.setMinimumSize(800, 600)
self.setWindowTitle("增减测试")
self.setWindowTitle("Wine 运行器 {}".format(ProgramVersion()))
self.mainLayout = QtWidgets.QHBoxLayout()
self.setLayout(self.mainLayout)
@@ -54,91 +44,163 @@ class Window(QtWidgets.QWidget):
self.leftWidget = LeftWidget()
self.mainLayout.addWidget(self.leftWidget)
self.leftWidget.btn1.clicked.connect(self.addA)
self.leftWidget.btn2.clicked.connect(self.addB)
self.leftWidget.btn3.clicked.connect(self.addC)
self.leftWidget.btn4.clicked.connect(self.delCurrent)
time = 0
for i in WindowModule.moduleNameList.keys():
self.moduleMapList[self.leftWidget.actionList[i].text()] = [i, WindowModule.moduleNameList[i]["Name"]]
self.leftWidget.actionList[i].triggered.connect(lambda: self.add(self.sender().text()))
#self.leftWidget.btn4.clicked.connect(self.delCurrent)
self.leftWidget.list1.itemClicked.connect(self.switchWidget)
# 右侧区域
self.rightWidget = RightWidget()
self.mainLayout.addWidget(self.rightWidget)
# 新增a类界面
def addA(self):
self.newTab = "a类页面#{0}".format(self.counter_a)
self.addWelcome()
# 判断运行器是否为第一次打开,如果不是则默认切换至 Wine 运行器主窗口
# 默认为列表里的第一个控件
if (os.path.exists(get_home() + "/.config/deepin-wine-runner")):
self.add(self.leftWidget.actionList[list(WindowModule.moduleNameList.keys())[0]].text())
self.ConfigureConfigFile()
# 新增欢迎界面
def addWelcome(self):
self.newTab = "欢迎页面"
self.leftWidget.list1.addItem(self.newTab)
self.newWidget = welcome.WinWelcome()
self.widgetList.append(self.newWidget)
self.rightWidget.addWidget(self.newWidget)
# 新增界面
def add(self, actionName: str):
self.newInfo = "{}#{}".format(self.moduleMapList[actionName][1], self.counter_a)
self.newTab = ItemWidget(self.newInfo)
self.newTab.btn.clicked.connect(self.delCurrent)
self.counter_a += 1
self.leftWidget.list1.addItem(self.newTab)
self.leftWidget.list1.setItemWidget(self.newTab, self.newTab.widget)
self.newWidget = RunnerWindow(app, "mainwindow").Win()
print(self.newWidget)
self.newWidget = WindowModule.RunnerWindow(app, self.moduleMapList[actionName][0]).Win()
self.widgetList.append(self.newWidget)
self.rightWidget.addWidget(self.newWidget)
# 新增b类界
def addB(self):
self.newTab = "b类页面#{0}".format(self.counter_b)
self.counter_b += 1
self.leftWidget.list1.addItem(self.newTab)
# 自动切换新打开的页
self.leftWidget.list1.setCurrentRow(self.leftWidget.list1.model().rowCount() - 1) # 设置选择最后一项
self.switchWidget()
self.newWidget = RunnerWindow(app, "deepin-wine-packager").Win()
self.widgetList.append(self.newWidget)
self.rightWidget.addWidget(self.newWidget)
# 新增c类界面
def addC(self):
self.newTab = "c类页面#{0}".format(self.counter_c)
self.counter_c += 1
self.leftWidget.list1.addItem(self.newTab)
self.newWidget = RunnerWindow(app, "VM.mainwindow").Win()
self.widgetList.append(self.newWidget)
self.rightWidget.addWidget(self.newWidget)
# 删除_本页面
def delCurrent(self):
self.length = self.leftWidget.list1.count()
print(self.length)
self.row = self.leftWidget.list1.currentRow()
print(self.row)
if self.row == 0:
return 0
self.leftWidget.list1.takeItem(self.row)
self.rightWidget.removeWidget(self.widgetList[self.row])
self.widgetList.pop(self.row)
# 将新界面的关闭按钮设为可用
if self.row == self.length - 1:
if self.row == 1:
return 0
else:
self.leftWidget.list1.item(self.row - 1).btnEnable()
else:
self.leftWidget.list1.item(self.row).btnEnable()
# 切换页面
def switchWidget(self):
self.row = self.leftWidget.list1.currentRow()
self.rightWidget.setCurrentIndex(self.row)
# 将当前页的关闭按钮设为可用
for i in range(self.leftWidget.list1.count()):
if i == 0:
continue
else:
self.leftWidget.list1.item(i).btnDisable()
if self.row != 0:
self.leftWidget.list1.currentItem().btnEnable()
def ConfigureConfigFile(self):
if not os.path.exists(get_home() + "/.config/"): # 如果没有配置文件夹
os.mkdir(get_home() + "/.config/") # 创建配置文件夹
if not os.path.exists(get_home() + "/.config/deepin-wine-runner"): # 如果没有配置文件夹
os.mkdir(get_home() + "/.config/deepin-wine-runner") # 创建配置文件夹
# 左侧区域
class LeftWidget(QtWidgets.QWidget):
actionList = {}
def __init__(self):
super().__init__()
self.initUI()
def initUI(self):
self.setFixedWidth(100)
self.setFixedWidth(120)
self.mainLayout = QtWidgets.QVBoxLayout()
self.mainLayout.setContentsMargins(0, 0, 0, 0)
self.setLayout(self.mainLayout)
# 左侧标题
self.lab1 = QtWidgets.QLabel("页面导航区")
self.lab1 = QtWidgets.QLabel("<h2>页面导航区</h2>")
self.mainLayout.addWidget(self.lab1)
# 新建页面面按钮
self.btnAdd = QtWidgets.QPushButton("新建界面")
self.mainLayout.addWidget(self.btnAdd)
self.menuAdd = QtWidgets.QMenu()
self.btnAdd.setMenu(self.menuAdd)
for i in WindowModule.moduleNameList.keys():
action = QtWidgets.QAction("新建{}".format(WindowModule.moduleNameList[i]["Name"]))
self.actionList[i] = action
self.menuAdd.addAction(action)
# 左侧页面列表
self.list1 = QtWidgets.QListWidget()
self.mainLayout.addWidget(self.list1)
# 新增a类按钮
self.btn1 = QtWidgets.QPushButton("新增a类界面")
self.mainLayout.addWidget(self.btn1)
# 新增b类按钮
self.btn2 = QtWidgets.QPushButton("新增b类界面")
self.mainLayout.addWidget(self.btn2)
# 新增c类按钮
self.btn3 = QtWidgets.QPushButton("新增c类界面")
self.mainLayout.addWidget(self.btn3)
# 删_页面按钮
self.btn4 = QtWidgets.QPushButton("删除_本页面")
self.mainLayout.addWidget(self.btn4)
self.archLabel = QtWidgets.QLabel("系统架构:{}".format(subprocess.getoutput("dpkg --print-architecture")))
self.mainLayout.addWidget(self.archLabel)
# 列表项目组件
class ItemWidget(QtWidgets.QListWidgetItem):
def __init__(self, info):
super().__init__()
self.info = info
self.initUI()
def initUI(self):
self.widget = QtWidgets.QWidget()
self.mainLayout = QtWidgets.QHBoxLayout()
self.mainLayout.setContentsMargins(2, 0, 0, 0)
self.widget.setLayout(self.mainLayout)
# 文字标签
self.lab = QtWidgets.QLabel(self.info)
self.mainLayout.addWidget(self.lab)
self.mainLayout.addStretch()
# 关闭按钮
self.btn = QtWidgets.QPushButton("x")
#self.btn.setMaximumWidth(20)
self.btn.setEnabled(False)
self.mainLayout.addWidget(self.btn)
# 将按钮设为可用
def btnEnable(self):
self.btn.setEnabled(True)
# 将按钮设为不可用
def btnDisable(self):
self.btn.setEnabled(False)
# 右侧区域
class RightWidget(QtWidgets.QStackedWidget):
@@ -148,9 +210,18 @@ class RightWidget(QtWidgets.QStackedWidget):
#def initUI(self):
# 获取用户主目录
def get_home():
return os.path.expanduser('~')
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
iconPath = "{}/deepin-wine-runner.svg".format(programPath)
# 运行程序
if __name__ == "__main__":
app = QtWidgets.QApplication(sys.argv)
mainWindow = Window()
mainWindow.setWindowIcon(QtGui.QIcon(iconPath))
mainWindow.show()
mainWindow.resize(int(mainWindow.geometry().width() * 1.2), int(mainWindow.geometry().height() * 1.2))
sys.exit(app.exec())

View File

@@ -21,4 +21,4 @@ if [[ $DISPLAY == "" ]] && [[ $WAYLAND_DISPLAY == "" ]] && [[ -f /data/data/com.
fi
$CURRENT_DIR/VM/novnc/utils/novnc_proxy --vnc localhost:5905 $noVNCOption &
fi
python3 $CURRENT_DIR/mainwindow.py
python3 $CURRENT_DIR/main.py

View File

@@ -317,32 +317,6 @@ class Runexebutton_threading(QtCore.QThread):
option += "WINEDEBUG=FIXME,ERR,WARN,TRACE,Message "
wineUsingOption = ""
exePath = e2.currentText()
# 禁用没什么用还一堆坑的参数识别问题
if False:
fileName = [".exe"]
changePath = False
for i in fileName:
if i in exePath:
print(i)
print(exePath)
l = exePath.index(i)
exePath = f"{exePath[:l+4]}' {exePath[l+4:]} '"
print(l)
print(exePath)
changePath = True
break
#if not changePath and not os.path.exists(changePath):
if not changePath and not os.path.exists(exePath):
# 删除前后无用空格以防止出现问题
print(exePath)
exePath = exePath.strip()
# 有空格再说
if " " in exePath:
l = exePath.index(" ")
exePath = f"{exePath[:l]}' {exePath[l:]} '"
print(l)
#print(i)
print(exePath)
if o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable":
wineUsingOption = ""
if o1.currentText() == "基于 UOS box86 的 deepin-wine6-stable" or o1.currentText() == "基于 UOS exagear 的 deepin-wine6-stable":
@@ -422,12 +396,8 @@ StartupNotify=true''')
class Temp:
webWindow = None
#QtCore.QUrl().url()
# 显示“关于这个程序”窗口
def about_this_program()->"显示“关于这个程序”窗口":
def about_this_program():
global about
global title
global iconPath
@@ -2192,6 +2162,20 @@ def TransLog():
# 加载配置
###########################
if not os.path.exists(get_home() + "/.deepwinerunner/wine/"): # 如果没有配置文件夹
os.makedirs(get_home() + "/.deepwinerunner/wine/") # 创建配置文件夹
try:
shutil.copy(f"{programPath}/wine/installwine.py", get_home() + "/.deepwinerunner/wine/installwine.py")
shutil.copy(f"{programPath}/globalenv.py", get_home() + "/.deepwinerunner/globalenv.py")
shutil.copy(f"{programPath}/launch.sh", get_home() + "/.deepwinerunner/launch.sh")
if os.path.exists(get_home() + "/.deepwinerunner/Model"):
shutil.rmtree(get_home() + "/.deepwinerunner/Model")
shutil.copytree(f"{programPath}/Model", get_home() + "/.deepwinerunner/Model")
os.system(f"chmod 777 -Rv '{get_home()}/.deepwinerunner/launch.sh'")
except:
traceback.print_exc()
exit()
if not os.path.exists(get_home() + "/.config/"): # 如果没有配置文件夹
os.mkdir(get_home() + "/.config/") # 创建配置文件夹
if not os.path.exists(get_home() + "/.config/deepin-wine-runner"): # 如果没有配置文件夹
@@ -2235,6 +2219,7 @@ def CheckWine():
"基于 UOS box86 的 deepin-wine6-stable": f"WINEPREDLL='{programPath}/dlls-arm' WINEDLLPATH=/opt/deepin-wine6-stable/lib BOX86_NOSIGSEGV=1 /opt/deepin-box86/box86 /opt/deepin-wine6-stable/bin/wine ",
"基于 UOS exagear 的 deepin-wine6-stable": f"WINEPREDLL='{programPath}/dlls-arm' WINEDLLPATH=/opt/deepin-wine6-stable/lib /opt/exagear/bin/ubt_x64a64_al --path-prefix {get_home()}/.deepinwine/debian-buster --utmp-paths-list {get_home()}/.deepinwine/debian-buster/.exagear/utmp-list --vpaths-list {get_home()}/.deepinwine/debian-buster/.exagear/vpaths-list --opaths-list {get_home()}/.deepinwine/debian-buster/.exagear/opaths-list --smo-mode fbase --smo-severity smart --fd-limit 8192 --foreign-ubt-binary /opt/exagear/bin/ubt_x32a64_al -- /opt/deepin-wine6-stable/bin/wine ",
"使用 Flatpak 安装的 Wine": "flatpak run org.winehq.Wine",
"deepin-wine-staging": "deepin-wine-staging",
"deepin-wine8-stable": "deepin-wine8-stable",
"deepin-wine6 stable": "deepin-wine6-stable",
"deepin-wine6-vannila": "deepin-wine6-vannila",
@@ -2245,6 +2230,8 @@ def CheckWine():
"spark-wine8-wow": "spark-wine8-wow",
"spark-wine9": "spark-wine9",
"spark-wine9-wow": "spark-wine9-wow",
"spark-wine10": "spark-wine10",
"spark-wine10-wow": "spark-wine10-wow",
"deepin-wine": "deepin-wine",
"deepin-wine5": "deepin-wine5",
"wine": "wine",
@@ -2334,9 +2321,10 @@ def CheckWine():
traceback.print_exc()
# 不再从列表读取,直接读目录
for i in os.listdir(f"{programPath}/wine/"):
for i in os.listdir(f"{programPath}/wine/") + os.listdir(f"{get_home()}/.deepwinerunner/wine/"):
#for i in json.loads(readtxt(f"{programPath}/wine/winelist.json")):
if os.path.exists(f"{programPath}/wine/{i}") and os.path.isdir(f"{programPath}/wine/{i}"):
if ((os.path.exists(f"{programPath}/wine/{i}") and os.path.isdir(f"{programPath}/wine/{i}")) or
(os.path.exists(f"{get_home()}/.deepwinerunner/wine/{i}") and os.path.isdir(f"{get_home()}/.deepwinerunner/wine/{i}"))):
name = ""
qemuInstall = False
nameValue = [["", ""]]
@@ -2424,6 +2412,10 @@ def CheckWine():
wine[f"{k[0]}{chrootProgramPath}/wine/{i}/bin/{j}"] = f"{k[1]}{chrootProgramPath}/wine/{i}/bin/{j}"
canUseWine.append(f"{k[0]}{chrootProgramPath}/wine/{i}/bin/{j}")
untipsWine.append(f"{k[0]}{chrootProgramPath}/wine/{i}/bin/{j}")
if os.path.exists(f"{get_home()}/.deepwinerunner/wine/{i}/bin/{j}"):
wine[f"{k[0]}{get_home()}/.deepwinerunner/wine/{i}/bin/{j}"] = f"{k[1]}{get_home()}/.deepwinerunner/wine/{i}/bin/{j}"
canUseWine.append(f"{k[0]}{get_home()}/.deepwinerunner/wine/{i}/bin/{j}")
untipsWine.append(f"{k[0]}{get_home()}/.deepwinerunner/wine/{i}/bin/{j}")
except:
traceback.print_exc()
@@ -2508,23 +2500,14 @@ exe路径\' 参数 \'
5、wine 容器如果没有指定,则会默认为 ~/.wine
6、如果可执行文件比较大的话会出现点击“获取该程序运行情况”出现假死的情况因为正在后台读取 SHA1只需要等一下即可读取速度依照您电脑处理速度、读写速度、可执行文件大小等有关
7、如果非 X86 的用户的 UOS 专业版用户想要使用的话,只需要在应用商店安装一个 Wine 版本微信即可在本程序选择正确的 Wine 运行程序;''')
updateThingsString = QtCore.QCoreApplication.translate("U", '''※1、优化运行器窗口大小机制
※2、Wine 安装器支持根据机器实际情况自动推荐适合的 Wine
※3、Wine 安装器支持手动导入 Wine 7z 包并提供相应 7z 包的网盘下载地址
※4、兼容 Deepin 终端deepin 15 经典版本deepin-terminal-gtk
※5、跟进 dxvk 2.4
※6、修复 deepin 23 无法使用 Mono/Gecko 安装器的问题
※7、修复 debian testing 打包时会把 / 打入 .7z 包内导致系统死机的问题
※8、支持 AOSC安同、小小电脑、proot 容器
※9、支持在 Termux 直接运行(单独提供安装包)
10、修复虚拟机启动器入口不会调用安装的 Qemu Extra 的问题
11、优化高级打包器容器名称生成机制
12、修复部分机器无法正常打开高级打包器的问题
13、修复高级打包器选择Wine封装入deb模式时helper只能使用spark dwine helper的问题
updateThingsString = QtCore.QCoreApplication.translate("U", '''※1、修复虚拟机安装工具磁盘创建问题
※2、更新 dxvk 版本至 2.6.1
※3、更新 winetricks 版本
※4、适配 spark-wine10
''')
for i in information["Thank"]:
thankText += f"{i}\n"
updateTime = "2024年07月22"
updateTime = "2025年04月19"
aboutProgram = QtCore.QCoreApplication.translate("U", """<p>Wine运行器是一个能让Linux用户更加方便地运行Windows应用的程序。原版的 Wine 只能使用命令操作且安装过程较为繁琐对小白不友好。于是该运行器为了解决该痛点内置了对Wine图形化的支持、Wine 安装器、微型应用商店、各种Wine工具、自制的Wine程序打包器、运行库安装工具等。</p>
<p>它同时还内置了基于Qemu/VirtualBox制作的、专供小白使用的Windows虚拟机安装工具可以做到只需下载系统镜像并点击安装即可无需考虑虚拟机的安装、创建、分区等操作也能在非 X86 架构安装 X86 架构的 Windows 操作系统(但是效率较低,可以运行些老系统)。</p>
<p>而且对于部分 Wine 应用适配者来说,提供了图形化的打包工具,以及提供了一些常用工具以及运行库的安装方式,以及能安装多种不同的 Wine 以测试效果,能极大提升适配效率。</p>
@@ -2852,7 +2835,7 @@ programmenu.addAction(installWineHQ)
programmenu.addAction(installWineHQOrg)
programmenu.addAction(installMoreWine)
programmenu.addAction(downloadChrootBottle)
programmenu.addAction(installBox86CN)
#programmenu.addAction(installBox86CN)
programmenu.addAction(installBox86)
programmenu.addAction(installLat)
programmenu.addSeparator()
@@ -2873,7 +2856,7 @@ installWineHQ.triggered.connect(InstallWineHQ)
installWineHQOrg.triggered.connect(lambda: threading.Thread(target=OpenTerminal, args=[f"{programPath}/InstallNewWineHQOrg.sh"]).start())
installLat.triggered.connect(lambda: threading.Thread(target=OpenTerminal, args=[f"{programPath}/InstallLat.sh"]).start())
def InstallMoreWine():
os.system(f"'{programPath}/wine/installwine'")
os.system(get_home() + "/.deepwinerunner/wine/installwine.py")
# 更新 Wine 列表
CheckWine()
o1.clear()
@@ -3390,8 +3373,7 @@ window.setCentralWidget(widget)
# 判断是否为小屏幕,是则设置滚动条并全屏
# 获取为 import 为控件,也默认开启滚动条
if (window.frameGeometry().width() > app.primaryScreen().availableGeometry().size().width() * 0.8 or
window.frameGeometry().height() > app.primaryScreen().availableGeometry().size().height() * 0.9 or
__name__ != "__main__"):
window.frameGeometry().height() > app.primaryScreen().availableGeometry().size().height() * 0.9):
# 设置滚动条
areaScroll = QtWidgets.QScrollArea(window)
areaScroll.setWidgetResizable(True)

BIN
off-line-shell/bwrap_loongarch64 Executable file

Binary file not shown.

View File

@@ -11,9 +11,22 @@ if [[ -d /usr/lib64 ]] && [[ -d $SHELL_FOLDER/lib64 ]]; then
option="$option --dev-bind $SHELL_FOLDER/lib64 /usr/lib64 "
fi
if [[ -d /usr/share/fonts ]]; then
option="$option --dev-bind /usr/share/fonts /usr/share/fonts "
fi
if [[ -d $SHELL_FOLDER/gnemul ]]; then
if [[ ! -d /usr/gnemul ]]; then
pkexec mkdir -p /usr/gnemul
fi
option="$option --dev-bind $SHELL_FOLDER/gnemul /usr/gnemul "
fi
bwrap --dev-bind / / \
--dev-bind "$SHELL_FOLDER/bin" /usr/bin \
--dev-bind "$SHELL_FOLDER/bin" /bin \
--dev-bind "$SHELL_FOLDER/lib" /usr/lib \
--dev-bind "$SHELL_FOLDER/lib" /lib \
--dev-bind /usr/lib/locale /usr/lib/locale \
--dev-bind "$SHELL_FOLDER/share" /usr/share \
$option \

View File

@@ -11,9 +11,22 @@ if [[ -d /usr/lib64 ]] && [[ -d $SHELL_FOLDER/lib64 ]]; then
option="$option --dev-bind $SHELL_FOLDER/lib64 /usr/lib64 "
fi
if [[ -d /usr/share/fonts ]]; then
option="$option --dev-bind /usr/share/fonts /usr/share/fonts "
fi
if [[ -d $SHELL_FOLDER/gnemul ]]; then
if [[ ! -d /usr/gnemul ]]; then
pkexec mkdir -p /usr/gnemul
fi
option="$option --dev-bind $SHELL_FOLDER/gnemul /usr/gnemul "
fi
"$SHELL_FOLDER/bwrap" --dev-bind / / \
--dev-bind "$SHELL_FOLDER/bin" /usr/bin \
--dev-bind "$SHELL_FOLDER/bin" /bin \
--dev-bind "$SHELL_FOLDER/lib" /usr/lib \
--dev-bind "$SHELL_FOLDER/lib" /lib \
--dev-bind /usr/lib/locale /usr/lib/locale \
--dev-bind "$SHELL_FOLDER/share" /usr/share \
$option \

View File

@@ -1,5 +1,5 @@
{
"Version": "4.0.0.2",
"Version": "4.1.5",
"Time": "未知",
"Thank": [
"感谢 @り哥拽的冇气质° 和 @杨 提供了 3a5000新世界的测试机器",

View File

@@ -1,4 +1,4 @@
#!/bin/sh
#!/bin/bash
# Copyright (C) 2016 Deepin, Inc.
#
@@ -24,6 +24,8 @@ Get_Dist_Name()
DISTRO='UniontechOS'
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
DISTRO='UniontechOS'
elif grep -Eqi "GXDE" /etc/issue || grep -Eq "GXDE" /etc/*-release; then
DISTRO='GXDE'
else
DISTRO='OtherOS'
fi
@@ -70,7 +72,7 @@ DISABLE_ATTACH_FILE_DIALOG=""
##############<<<<<<<<<禁用文件选择工具开始
Get_Dist_Name
#此功能实现参见开头函数段
if [ "$DISTRO" != "Deepin" ] && [ "$DISTRO" != "UniontechOS" ];then
if [ "$DISTRO" != "Deepin" ] && [ "$DISTRO" != "UniontechOS" ] && [ "$DISTRO" != "GXDE" ];then
DISABLE_ATTACH_FILE_DIALOG="1"
echo "非deepin/UOS默认关闭系统自带的文件选择工具使用Wine的"
echo "如果你想改变这个行为,请到/opt/apps/$DEB_PACKAGE_NAME/files/$0处修改"
@@ -81,7 +83,7 @@ fi
##############<<<<<<<<<屏蔽mono和gecko安装器开始
##默认屏蔽mono和gecko安装器
if [ "$APPRUN_CMD" = "spark-wine7-devel" ] || [ "$APPRUN_CMD" = "spark-wine" ]|| [ "$APPRUN_CMD" = "spark-wine8" ] && [ -z "$ENABLE_DOT_NET" ];then
if [ "$APPRUN_CMD" = "spark-wine9" ] || [ "$APPRUN_CMD" = "spark-wine" ]|| [ "$APPRUN_CMD" = "spark-wine8" ] && [ -z "$ENABLE_DOT_NET" ];then
export WINEDLLOVERRIDES="mscoree=d,mshtml=d"
export WINEDLLOVERRIDES="control.exe=d"
@@ -107,7 +109,7 @@ if [ -n "$EXEC_PATH" ];then
if [ -z "${EXEC_PATH##*.lnk*}" ];then
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
else
$START_SHELL_PATH $BOTTLENAME $APPVER "C:/windows/command/start.exe" "/Unix" "$EXEC_PATH" "$@"
$START_SHELL_PATH $BOTTLENAME $APPVER "$EXEC_PATH" "$@"
fi
else
$START_SHELL_PATH $BOTTLENAME $APPVER "uninstaller.exe" "$@"

View File

@@ -0,0 +1,14 @@
#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Type=Application
X-Created-By=@@@MAINTAINER@@@
Categories=@@@DESKTOP_CATEGORIES@@@;
Icon=@@@ICON@@@
Exec=@@@DESKTOP_EXEC@@@
Name=@@@DESKTOP_NAME@@@
Comment=@@@DESCRIPTION@@@
MimeType=@@@DESKTOP_MIMETYPE@@@
GenericName=@@@DEB_PACKAGE_NAME@@@
Terminal=false
StartupNotify=false

278
packager-config/arm-kill.sh Normal file
View File

@@ -0,0 +1,278 @@
#!/bin/bash
APP_NAME="QQ"
LOG_FILE=$0
SHELL_DIR=$(dirname $0)
SHELL_DIR=$(realpath "$SHELL_DIR")
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
PUBLIC_DIR="/var/public"
UsePublicDir()
{
if [ -z "$USE_PUBLIC_DIR" ]; then
echo "Don't use public dir"
return 1
fi
if [ ! -d "$PUBLIC_DIR" ];then
echo "Not found $PUBLIC_DIR"
return 1
fi
if [ ! -r "$PUBLIC_DIR" ];then
echo "Can't read for $PUBLIC_DIR"
return 1
fi
if [ ! -w "$PUBLIC_DIR" ];then
echo "Can't write for $PUBLIC_DIR"
return 1
fi
if [ ! -x "$PUBLIC_DIR" ];then
echo "Can't excute for $PUBLIC_DIR"
return 1
fi
return 0
}
WINE_BOTTLE="$HOME/.deepinwine"
if UsePublicDir;then
WINE_BOTTLE="$PUBLIC_DIR"
fi
get_wine_by_pid()
{
wine_path=$(cat /proc/$1/maps | grep -E "\/wine$|\/wine64$|\/wine |\/wine64 " | head -1 | awk '{print $6}')
if [ -z "$wine_path" ];then
cat /proc/$1/cmdline| xargs -0 -L1 -I{} echo {} | grep -E "\/wine$|\/wine64$|\/wine |\/wine64 " | head -1
else
echo $wine_path
fi
}
is_wine_process()
{
wine_module=$(get_wine_by_pid $1)
if [ -z "$wine_module" ];then
wine_module=$(cat /proc/$1/maps | grep -E "\/wineserver$" | head -1)
fi
echo $wine_module
}
get_prefix_by_pid()
{
WINE_PREFIX=$(xargs -0 printf '%s\n' < /proc/$1/environ | grep WINEPREFIX)
WINE_PREFIX=${WINE_PREFIX##*=}
if [ -z "$WINE_PREFIX" ] && [ -n "$(is_wine_process $1)" ]; then
#不指定容器的情况用默认容器目录
WINE_PREFIX="$HOME/.wine"
fi
if [ -n "$WINE_PREFIX" ];then
WINE_PREFIX=$(realpath $WINE_PREFIX)
echo $WINE_PREFIX
fi
}
get_wineserver()
{
if [ -z "$1" ];then
return
fi
targ_prefix=$(realpath $1)
ps -ef | grep wineserver | while read server_info ;do
debug_log_to_file "get server info: $server_info"
server_pid=$(echo $server_info | awk '{print $2}')
server_prefix=$(get_prefix_by_pid $server_pid)
debug_log_to_file "get server pid $server_pid, prefix: $server_prefix"
if [ "$targ_prefix" = "$server_prefix" ];then
server=$(echo $server_info | awk '{print $NF}')
if [ "-p0" = "$server" ];then
server=$(echo $server_info | awk '{print $(NF-1)}')
fi
debug_log_to_file "get server $server"
echo $server
return
fi
done
}
init_log_file()
{
if [ -d "$DEBUG_LOG" ];then
LOG_DIR=$(realpath $DEBUG_LOG)
if [ -d "$LOG_DIR" ];then
LOG_FILE="${LOG_DIR}/${LOG_FILE##*/}.log"
echo "" > "$LOG_FILE"
debug_log "LOG_FILE=$LOG_FILE"
fi
fi
}
debug_log_to_file()
{
if [ -d "$DEBUG_LOG" ];then
strDate=$(date)
echo -e "${strDate}:${1}" >> "$LOG_FILE"
fi
}
debug_log()
{
strDate=$(date)
echo "${strDate}:${1}"
}
init_log_file
get_bottle_path_by_process_id()
{
PID_LIST="$1"
PREFIX_LIST=""
for pid_var in $PID_LIST ; do
WINE_PREFIX=$(get_prefix_by_pid $pid_var)
#去掉重复项
for path in $(echo -e $PREFIX_LIST) ; do
if [[ $path == "$WINE_PREFIX" ]]; then
WINE_PREFIX=""
fi
done
if [ -d "$WINE_PREFIX" ]; then
debug_log_to_file "found $pid_var : $WINE_PREFIX"
PREFIX_LIST+="\n$WINE_PREFIX"
fi
done
echo -e $PREFIX_LIST
}
get_pid_by_process_name()
{
PID_LIST=""
for pid_var in $(ps -ef | grep -E -i "$1" | grep -v grep | awk '{print $2}');do
#通过判断是否加载wine来判断是不是wine进程
if [ -n "$(is_wine_process $pid_var)" ];then
PID_LIST+=" $pid_var"
fi
done
echo "$PID_LIST"
}
get_bottle_path_by_process_name()
{
PID_LIST=$(get_pid_by_process_name $1)
debug_log_to_file "get pid list: $PID_LIST"
get_bottle_path_by_process_id "$PID_LIST"
}
get_bottle_path()
{
if [ -z "$1" ];then
return 0
fi
if [ -f "$1/user.reg" ]; then
realpath "$1"
return 0
fi
if [ -f "$WINE_BOTTLE/$1/user.reg" ]; then
realpath "$WINE_BOTTLE/$1"
return 0
fi
get_bottle_path_by_process_name "$1"
}
kill_app()
{
debug_log "try to kill $1"
for path in $(get_bottle_path $1); do
if [ -n "$path" ];then
WINESERVER=$(get_wineserver "$path")
if [ -f "$WINESERVER" ];then
debug_log "kill $path by $WINESERVER"
env WINEPREFIX="$path" "$WINESERVER" -k
fi
PID_LIST=$(get_pid_by_process_name "exe|wine")
for tag_pid in $PID_LIST; do
bottle=$(get_bottle_path_by_process_id "$tag_pid")
bottle=${bottle:1}
if [ "$path" = "$bottle" ];then
echo "kill $tag_pid for $bottle"
kill -9 $tag_pid
fi
done
fi
done
#Kill defunct process
ps -ef | grep -E "$USER.*exe.*<defunct>"
ps -ef | grep -E "$USER.*exe.*<defunct>" | grep -v grep | awk '{print $2}' | xargs -i kill -9 {}
}
get_tray_window()
{
$SHELL_DIR/get_tray_window | grep window_id: | awk -F: '{print $2}'
}
get_stacking_window()
{
xprop -root _NET_CLIENT_LIST_STACKING | awk -F# '{print $2}' | sed -e 's/, / /g'
}
get_window_pid()
{
for winid in $(echo "$1" | sed -e 's/ /\n/g') ;
do
xprop -id $winid _NET_WM_PID | awk -F= '{print $2}'
done
}
get_window_bottle()
{
debug_log_to_file "get_window_bottle $1"
PID_LIST=$(get_window_pid "$1")
debug_log_to_file "get_window_bottle pid list: $PID_LIST"
get_bottle_path_by_process_id "$PID_LIST"
}
get_active_bottles()
{
TRAYWINDOWS=$(get_tray_window)
STACKINGWINDOWS=$(get_stacking_window)
debug_log_to_file "tray window id: $TRAYWINDOWS"
debug_log_to_file "stacking window id: $STACKINGWINDOWS"
PID_LIST="$TRAYWINDOWS $STACKINGWINDOWS"
get_window_bottle "$PID_LIST"
}
kill_exit_block_app()
{
TAGBOTTLE=$(get_bottle_path $1)
debug_log "tag bottle: $TAGBOTTLE"
ACTIVEBOTTLES=$(get_active_bottles)
debug_log "active bottles: $ACTIVEBOTTLES"
if [[ "$ACTIVEBOTTLES" != *"$TAGBOTTLE"* ]]; then
kill_app "$TAGBOTTLE"
fi
}
#get_active_bottles
#exit
debug_log "kill $1 $2"
if [ -n "$1" ]; then
APP_NAME="$1"
fi
if [ "$2" = "block" ]; then
kill_exit_block_app $APP_NAME $3
else
kill_app $APP_NAME
fi

View File

@@ -0,0 +1,39 @@
# ===== Log =====
# log.info xxx
# log.warn xxx
# log.info xxx
# log.debug xxx
# 带颜色的echo
function log.color_output() {
local color=$1
shift 1
echo >&2 -e "\033[${color}m$@\033[0m"
return 0
}
# Log is named without prefix "utils." for convenience
# Usage: log.log <level> ...content
function log.log() {
if [[ $# < 2 ]]; then
return -1
fi
local level=$1
shift 1
case $level in
error) log.color_output "0;31" "[ERROR] $@" ;;
warn) log.color_output "1;33" "[WARN] $@" ;;
info) log.color_output "1;37" "[INFO] $@" ;;
debug) log.color_output "1;30" "[DEBUG] $@" ;;
esac
return 0
}
function log.error() { log.log "error" "$@"; }
function log.warn() { log.log "warn" $@; }
function log.info() { log.log "info" $@; }
function log.debug() { log.log "debug" $@; }

View File

@@ -0,0 +1,32 @@
#!/bin/bash
##load transhell
function load_transhell_debug()
{
local WORK_PATH="$(dirname $(realpath $0))"
echo $WORK_PATH
local CURRENT_LANG="$(echo ${LANG%.*})"
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell ..."; fi
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi
if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell ..."; fi
if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; echo "Loading transhell from ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell ..."; fi
echo "-----------------------------------------------------------------------------"
}
function load_transhell()
{
local WORK_PATH="$(dirname $(realpath $0))"
local CURRENT_LANG="$(echo ${LANG%.*})"
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_en_US.transhell; fi
if [ -e "/usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source /usr/share/$(basename $0)/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi
if [ -e "${WORK_PATH}/transhell/$(basename $0)_en_US.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_en_US.transhell; fi
if [ -e "${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell" ]; then source ${WORK_PATH}/transhell/$(basename $0)_$CURRENT_LANG.transhell; fi
}
function update_transhell()
{
load_transhell $@
}

View File

@@ -0,0 +1,36 @@
#!/bin/bash
source $(dirname $0)/log-function.bashimport
Get_Dist_Name()
{
if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
DISTRO='Deepin'
elif grep -Eqi "UnionTech" /etc/issue || grep -Eq "UnionTech" /etc/*-release; then
DISTRO='UniontechOS'
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
DISTRO='UniontechOS'
else
DISTRO='OtherOS'
fi
}
Get_Dist_Name
## 1. If WINEPREFIX is not set, use ~/.wine
if [ "$WINEPREFIX" = "" ];then
export WINEPREFIX=$HOME/.wine
fi
if [ "$DISTRO" != "Deepin" ] && [ "$DISTRO" != "UniontechOS" ];then
log.warn "WARNING:USING BOX64 INSTEAD OF DEEPIN-BOX64,SOME APP MAY FAIL TO LAUNCH"
spark-box64 /opt/deepin-wine8-stable/bin/wine "$@"
else
deepin-wine8-stable "$@"
fi

View File

@@ -0,0 +1,39 @@
# ===== Log =====
# log.info xxx
# log.warn xxx
# log.info xxx
# log.debug xxx
# 带颜色的echo
function log.color_output() {
local color=$1
shift 1
echo >&2 -e "\033[${color}m$@\033[0m"
return 0
}
# Log is named without prefix "utils." for convenience
# Usage: log.log <level> ...content
function log.log() {
if [[ $# < 2 ]]; then
return -1
fi
local level=$1
shift 1
case $level in
error) log.color_output "0;31" "[ERROR] $@" ;;
warn) log.color_output "1;33" "[WARN] $@" ;;
info) log.color_output "1;37" "[INFO] $@" ;;
debug) log.color_output "1;30" "[DEBUG] $@" ;;
esac
return 0
}
function log.error() { log.log "error" "$@"; }
function log.warn() { log.log "warn" $@; }
function log.info() { log.log "info" $@; }
function log.debug() { log.log "debug" $@; }

Binary file not shown.

After

Width:  |  Height:  |  Size: 195 KiB

View File

@@ -0,0 +1,127 @@
#!/usr/bin/env python3
import os
import sys
import time
import subprocess
import threading
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
def check_window():
# 使用 wmctrl 命令列出所有窗口,并使用 grep 过滤出特定的 WMCLASS
windows = subprocess.getoutput(f'wmctrl -lx | grep "{target_wmclass}"')
# 如果窗口存在,则关闭提示
if windows.replace("\n", "").replace(" ", "") != "":
# 提取窗口ID
window_id = windows.replace(" ", " ").split(" ")[0]
print(f"Window with WMCLASS '{target_wmclass}' found")
return 1
# else:
# print(f"Window with WMCLASS '{target_wmclass}' not found.")
def check_wmclass():
if timeout:
time.sleep(timeout)
window.close()
return
# 循环检测窗口是否存在的函数
# 每隔一段时间检测一次窗口是否存在
showtimeout = 20 # 为防止因为应用无法打开而无法正常关闭窗口,于是设置 time out
while True:
if check_window():
break
# 等待一段时间后再次检测
time.sleep(1)
AppInfoShowerRefresh()
showtimeout -= 1
if showtimeout <= 0:
break
window.close()
timeout = 0
if os.getenv("WAYLAND_DISPLAY"):
timeout = 3
if os.system("which wmctrl"):
print("No wmctrl installed. Do not check wmclass")
timeout = 3
target_wmclass = os.getenv("WINE_WMCLASS")
def GetRecommendWindowSize(window: QMainWindow):
# 计算屏幕分辨率
screen = QGuiApplication.primaryScreen()
width = screen.geometry().width()
height = screen.geometry().height()
# 如果为竖状屏幕
if width < height:
temp = height
height = width
width = temp
return [int(width / 4), window.geometry().height()]
def SetWindowSize(window: QMainWindow):
# 计算比例
size = GetRecommendWindowSize(window)
window.resize(size[0], size[1])
def MoveCenter(window: QMainWindow):
# 计算屏幕分辨率
screen = QGuiApplication.primaryScreen()
width = screen.geometry().width()
height = screen.geometry().height()
print(window.geometry().height())
# 计算窗口坐标
window.move(int(width / 2 - window.geometry().width() / 2),
int(height / 2.8 - window.geometry().height() / 2)
)
def AppInfoShowerRefresh():
global appInfoShowerTime
appInfoShower.setText(f"<h3 align='center'>星火Windows应用兼容助手</h3><p align='center'>正在为您启动以下应用:{os.getenv('WINE_APP_NAME')} {'.' * (appInfoShowerTime % 3 + 1)}</p>")
appInfoShowerTime += 1
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
app = QApplication(sys.argv)
# 构建窗口
window = QMainWindow()
widget = QWidget()
layout = QGridLayout()
appInfoShower = QLabel()
appInfoShowerTime = 0
AppInfoShowerRefresh()
# GXDE 彩蛋
if os.path.exists("/usr/share/gxde-resources/spark-dwine-helper.png"):
backgroundImgPath = "/usr/share/gxde-resources/spark-dwine-helper.png"
##########
if os.path.exists(f"{programPath}/fallback.png"):
backgroundImgPath = f"{programPath}/fallback.png"
if os.path.exists(f"/opt/apps/{os.getenv('DEB_PACKAGE_NAME')}/files/banner.png"):
backgroundImgPath = f"/opt/apps/{os.getenv('DEB_PACKAGE_NAME')}/files/banner.png"
window.setWindowTitle("星火Windows应用兼容助手")
layout.addWidget(QLabel(f""), 1, 0)
layout.addWidget(appInfoShower, 2, 0)
layout.addWidget(QLabel(f"<hr>由 Wine 运行器提供支持"), 4, 0)
widget.setLayout(layout)
window.setCentralWidget(widget)
window.setWindowFlags(Qt.CustomizeWindowHint | Qt.WindowStaysOnTopHint)
MoveCenter(window)
SetWindowSize(window)
window.show()
layout.addWidget(QLabel(f"<p align='center'><img width='{window.geometry().width()}' src='{backgroundImgPath}'></p>"), 0, 0)
threading.Thread(target=check_wmclass).start()
MoveCenter(window)
app.exec_()

View File

@@ -0,0 +1,92 @@
___
( )
| | .-. ___ ___ .--. .--.
| |/ \ ( )( ) / \ / \
| .-. . | | | | ; ,-. ' | .-. ;
| | | | | | | | | | | | | | | |
| | | | | | | | | | | | | |/ |
| | | | | | | | | | | | | ' _.'
| | | | | | ; ' | ' | | | .'.-.
| | | | ' `-' / ' `-' | ' `-' /
(___)(___) '.__.' `.__. | `.__.'
( `-' ;
`.__.
___
( )
| |.-. .---. ___ .-. .--. ___ .-.
| / \ / .-, \ ( ) \ / \ ( ) \
| .-. | (__) ; | | ' .-. ; | .-. ; | .-. .
| | | | .'` | | / (___) | | | | | | | |
| | | | / .'| | | | | | | | | | | |
| | | | | / | | | | | | | | | | | |
| ' | | ; | ; | | | | ' | | | | | |
' `-' ; ' `-' | | | ' `-' / | | | |
`.__. `.__.'_. (___) `.__.' (___)(___)
___
( )
| |.-. ___ ___ ___ .-. ___ .-. ___ ___
| / \ ( )( ) ( ) \ ( ) \ ( )( )
| .-. | | | | | | .-. . | .-. . | | | |
| | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | ' | |
| | | | | | | | | | | | | | | | ' `-' |
| ' | | | | ; ' | | | | | | | | `.__. |
' `-' ; ' `-' / | | | | | | | | ___ | |
`.__. '.__.' (___)(___) (___)(___) ( )' |
; `-' '
.__.'
............ .....]OOOo]`....
... ........ ...=OOOOOOOOO\..
.../OOOOOOO`.... ..=OOO@/[\OOOOO.
..=OOOOOOOOO\... .,@OO^/....O@O@`
..OOOOOO[[OOO@`. .=OO@,...=.OOOO.
..OOOOO./O^,@OO` .=OO^....,.@OO^.
..\OOO@^...=OOOO.... .OOO^*..,`/OOO..
...\OOOOOOOooooO^... .=OO^...`=OO@`..
..=@O@OooOOOOO@`...........=@@O]].,@O@`...
.,@OoOO`...O@^......,]]]]/OOOOOOO@@... .
...\OO@]]]OOOO@@@@@@@@@@@@@@@@@@@OO.....
.....[@@OOO@@@@@@@@@@@@@@@@@@@@@@@@@@`..
..OOO@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@`....
.,@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@\...
....=@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@^..
...=@@@@@@@@@@@@@@@@@@@@@@`,\@@@@@@@@@@@@@^.
..,@@@@@@@@@@@@@@@@@@@@@@@O,[].\@@@@@@@@@@@.
../@@@@@@@@@@@@O@@@@@@@@@@@......\@@@@@@@@@^
.,@@@@@@@@@@@O`.\@@@@@@@@@/........\@@@@@@@@...
.=@@@@@@@@@/.....\@@@@@@@@/`...[O`..\@@@@@@@`...
.=@@@@@@@^,O[..,`.,@@@@@/../@@O[`...,@@@@@@@....
....@@@@@@@O`,@@O[]..,@/[`..=oo@O`,^...@@@@@@@@`..
....O@@@@@@@@`,OOO@^*\.........\..../.../@`.=^..
.. ...,@^=@@@^.\`...,^...........[[......O]//...
..,\]@@@\...[`....................=@@/....
.=@@\............,]/`........../@@@\.. .
.....@@@@@\.....................,/@@@@@@\...
...=@@@@@@@@\]..............]@@@@@@@@@@@@`.
...,@@@@@@@@@@@@@@/[\O@@O/[*./@@@@@@@@@@@@@\.......
...@@@@@@@@@@@@@@@^.,O@@@@^../@@@@@@@@@@@@@@@\.....
..........@@@@@@@@@@@@@@@@@`..`\/`../@@@@@@@@@@@@@@@@@@@@]]
........,@@@@@@@@@@@@@@@@/*[\].,`]/[[@@@@@@@@@@@@@@,[[[[`..
..,O\/@@@@@@@@@@@@@@@@@@@`...........O@@O@@@@@@@@@@\....
.....\@@@@@@@@@@@@@@@@@@@OO\`,O.. .,@OOO@@@@@@@@@@. ..
..../@@@@@@@@@@@@@@OO@`.^,O. ..=@OOO@@@@@@@@@.. .
...=@@@@@@@@@@@@@@@@@O[[.... ...\@@@@@@@@@@@/.. .
...=@@@@@@@@@@@@@@,^ ....O...\@@@@@@`
....@@@@@@@@@@@@@/.. ...^/\]/[\@@@@`.
.@@@@/@@@@@@@^O..... ...,@@^]..]@/...
...\@`.[@@@@@@...... .=`@@@@@^..^....
....`....[@@@O\.[,..........OO@@@@@^.,[[....
............\@@@\`...,`**,]@@@@@@@^.........
.. .,@@@@@@@@@@@@@@@@@@/...
..O@@@@@@@@@@@@@@@@@^...
..O@@@@@@^...=@@@@@@@...
..@@@@@@@\...=@@@@@@@^..
.=@@@@@@@@...=@@@@@@@O..
.=@@@@@@@@`..=@@@@@@@@..
.=@@@O@@@@^..=@@OO@@@@^.
.O@OOOOO@O^..=@OOOOOOO^.
.Oo/[\O/\O@..=/[\O/\o*O.
.O^......=O...^......*/.
.=\.....]O^...\\...]//.. .. ........

View File

@@ -0,0 +1,86 @@
#/bin/bash
source ${SHELL_DIR}/bashimport/transhell.bashimport
load_transhell_debug
#########>>>>>>>函数段
Get_Dist_Name()
{
if grep -Eqii "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
DISTRO='Deepin'
elif grep -Eqi "UnionTech" /etc/issue || grep -Eq "UnionTech" /etc/*-release; then
DISTRO='UniontechOS'
elif grep -Eqi "UOS" /etc/issue || grep -Eq "UOS" /etc/*-release; then
DISTRO='UniontechOS'
else
DISTRO='OtherOS'
fi
}
#########<<<<<<<
if [ $# -lt 1 ]; then
echo "无参数无法启动。这是一个set-wine-scale的组件一般来说你不会需要单独启动这个脚本"
echo "请参考set-wine-scale.sh使用"
echo "参数为CONTAINER_PATH"
echo "只读取第一个,其他参数会被放弃"
fi
CONTAINER_PATH="$1"
if [ ! -f "$CONTAINER_PATH/user.reg" ];then
echo "错误找不到user.reg退出。你应当在文件解压结束后调用此脚本"
echo "E: Can not find user.reg. Exit. You should use this script after the extraction"
exit 1
fi
mkdir -p $HOME/.config/spark-wine/
#####全局参数位置
#####能到这一步的说明已经是没有自定义参数了,直接读全局覆盖没问题
#####
if [ -f "$HOME/.config/spark-wine/scale.txt" ];then
cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt
echo "检测到已经设置过全局参数,直接复制"
echo "全局参数的位置在$HOME/.config/spark-wine/scale.txt如果需要更换请删除此文件重新生成"
exit
fi
Get_Dist_Name
if [ "$DISTRO" = "UniontechOS" ];then
echo 1.0 > $HOME/.config/spark-wine/scale.txt
cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt
#####就是1倍缩放
exit
fi
dimensions=`xdpyinfo | grep dimensions | sed -r 's/^[^0-9]*([0-9]+x[0-9]+).*$/\1/'`
scale_factor=`zenity --list \
--width=700 \
--height=350 \
--title="${TRANSHELL_CONTENT_YOUR_DIMENSION_IS} $dimensions ${TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW}" \
--column="${TRANSHELL_CONTENT_OPTION}" \
1.0 \
1.25 \
1.5 \
1.75 \
2.0 \
2.5 \
3.0 \
3.5 \
4.0`
case "$scale_factor" in
"")
zenity --info --text="${TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT}${TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST}" --width=500 --height=150
scale_factor="1.0"
;;
*)
zenity --info --text="${TRANSHELL_CONTENT_SCALE_IS} $scale_factor ${TRANSHELL_CONTENT_SAVED}${TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST}" --width=500 --height=150
;;
esac
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
cat $HOME/.config/spark-wine/scale.txt > $CONTAINER_PATH/scale.txt

View File

@@ -0,0 +1,210 @@
#!/bin/bash
help() {
cat <<EOF
用法:$0 [-h|--help] [-s|--set-scale-factor] path
-h|--help 显示这个帮助
-s|--set-scale-factor 直接指定缩放。支持1.01.251.51.752.0,2.5,3.0,3.5,4.0
path 容器目录
本脚本具有超级兔力。
--------------------------------------------------------------------
Usage: $0 [-h|--help] [-s|--set-scale-factor] path
-h|--help Show this text
-s|--set-scale-factor Set scale factor direcly. Support 1.01.251.51.752.0,2.5,3.0,3.5,4.0
path Wine Container directory path
This script have super bunny power.
EOF
}
#########################帮助文件结束#############################
parse_args() {
while [ $# -gt 0 ]; do
case "$1" in
-h|--help)
help
exit
;;
-s|--set-scale-factor)
appointed_scale_factor="$2"
;;
"bunny")
cat ${SHELL_DIR}/spark-dwine-helper/scale-set-helper/bunny.txt
exit
;;
*)
CONTAINER_PATH="$1"
;;
esac
shift
done
}
################
parse_args "$@"
#####先看看PATH对不对
if [ ! -f "$CONTAINER_PATH/user.reg" ];then
echo "错误找不到user.reg退出。你应当在文件解压结束后调用此脚本。"
echo "如果你不清楚如何使用这个脚本,请使用 $0 -h"
echo "E: Can not find user.reg. Exit. You should use this script after the extraction"
echo "If you don't know how to use this script, try $0 -h"
exit 1
fi
if [ "$appointed_scale_factor" = "" ];then
#########未指定下,读取$CONTAINER_PATH/scale.txt。如果没有优先$DEEPIN_WINE_SCALE设置然后是手动
if [ ! -f "$CONTAINER_PATH/scale.txt" ];then
echo "E: No SCALE profile found. try to use DEEPIN_WINE_SCALE"
echo "错误没有检测到缩放设置读取DEEPIN_WINE_SCALE"
if [ "$DEEPIN_WINE_SCALE" = "" ];then
echo "E: No DEEPIN_WINE_SCALE found. Use get-scale.sh to Set "
echo "错误没有检测到DEEPIN_WINE_SCALE用get-scale.sh设置"
${SHELL_DIR}/spark-dwine-helper/scale-set-helper/get-scale.sh "$CONTAINER_PATH"
wine_scale=`cat $CONTAINER_PATH/scale.txt`
echo "检测到的缩放倍数为:$wine_scale"
echo "Scale is $wine_scale"
else
echo "$DEEPIN_WINE_SCALE" > $CONTAINER_PATH/scale.txt
wine_scale=`cat $CONTAINER_PATH/scale.txt`
echo "检测到的缩放倍数为:$wine_scale"
echo "Scale is $wine_scale"
fi
else
wine_scale=`cat $CONTAINER_PATH/scale.txt`
echo "检测到的缩放倍数为:$wine_scale"
echo "Scale is $wine_scale"
fi
#####非deepin发行版似乎没有这个变量暂时不清楚这个变量是哪个组件做的
else
#######指定了缩放倍数
echo "使用了--set-scale-factor直接指定"
echo "--set-scale-factor detected. Arrange directly"
if [ "$appointed_scale_factor" != "1.0" ] && [ "$appointed_scale_factor" != "1.25" ] && [ "$appointed_scale_factor" != "1.5" ] && [ "$appointed_scale_factor" != "1.75" ] && [ "$appointed_scale_factor" != "2.0" ] && [ "$appointed_scale_factor" != "2.5" ] && [ "$appointed_scale_factor" != "3.0" ] && [ "$appointed_scale_factor" != "3.5" ] && [ "$appointed_scale_factor" != "4.0" ];then
echo "无法识别的倍数:$appointed_scale_factor,请参看$0 -h"
echo "Unrecognizable number. Use $0 -h to get help"
exit 1
fi
#######没问题了再用
echo "$appointed_scale_factor" > $CONTAINER_PATH/scale.txt
wine_scale=`cat $CONTAINER_PATH/scale.txt`
fi
########开始设置
########如果环境变量里没指定了APPRUN_CMD在run.sh中就替换如果有就直接用来设置
if [ "$APPRUN_CMD" = "" ];then
echo "没有检测到APPRUN_CMD环境变量执行sed替换。如果要使用wine原生提供的方法请在环境变量中指定(export)"
case "$wine_scale" in
1.0*)
reg_text="\"LogPixels\"=dword:00000060"
;;
1.25*)
reg_text="\"LogPixels\"=dword:00000078"
;;
1.5*)
reg_text="\"LogPixels\"=dword:00000090"
;;
1.75*)
reg_text="\"LogPixels\"=dword:000000A8"
;;
2.0*)
reg_text="\"LogPixels\"=dword:000000C0"
;;
2.5*)
reg_text="\"LogPixels\"=dword:000000F0"
;;
3.0*)
reg_text="\"LogPixels\"=dword:00000120"
;;
3.5*)
reg_text="\"LogPixels\"=dword:00000150"
;;
4.0*)
reg_text="\"LogPixels\"=dword:00000180"
;;
*)
reg_text="\"LogPixels\"=dword:00000060"
#可能不是Xorg
;;
esac
#####根据scale设置dword值
LogPixels_line=(`sed -n -e "/"LogPixels"/=" $CONTAINER_PATH/user.reg`)
#####关键词行数取得
until [ "${#LogPixels_line[@]}" = "0" ];do
line_num=${LogPixels_line[0]}
sed -i "$line_num"c\ "$reg_text" "$CONTAINER_PATH/user.reg"
LogPixels_line=(${LogPixels_line[@]:1})
done
echo "已经完成替换。位置:$CONTAINER_PATH/user.reg"
echo "在以下行数进行了替换,内容为$reg_text"
echo `sed -n -e "/"LogPixels"/=" $CONTAINER_PATH/user.reg`
echo "---------------------------------------"
else
#####用wine提供的方法
case "$wine_scale" in
1.0*)
dpi="96"
;;
1.25*)
dpi="120"
;;
1.5*)
dpi="144"
;;
1.75*)
dpi="168"
;;
2.0*)
dpi="192"
;;
2.5*)
dpi="240"
;;
3.0*)
dpi="288"
;;
3.5*)
dpi="336"
;;
4.0*)
dpi="384"
;;
*)
dpi="96"
#可能不是Xorg或者是其他错误
;;
esac
echo "$APPRUN_CMD执行指令"
echo "指令为"
echo "env WINEPREFIX="$CONTAINER_PATH" $APPRUN_CMD reg ADD 'HKCU\Control Panel\Desktop' /v LogPixels /t REG_DWORD /d $dpi /f"
env WINEPREFIX="$CONTAINER_PATH" $APPRUN_CMD reg ADD 'HKCU\Control Panel\Desktop' /v LogPixels /t REG_DWORD /d $dpi /f
fi

View File

@@ -0,0 +1,8 @@
#!/bin/bash
TRANSHELL_CONTENT_OPTION="Options"
TRANSHELL_CONTENT_YOUR_DIMENSION_IS="Your dimension is "
TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW="Please choose one option below"
TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT="Setting 1.0 scale as default"
TRANSHELL_CONTENT_SCALE_IS="Scale multiple is "
TRANSHELL_CONTENT_SAVED="saved."
TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST="You can use spark wine helper settings to adjust settings"

View File

@@ -0,0 +1,8 @@
#!/bin/bash
TRANSHELL_CONTENT_OPTION="选项"
TRANSHELL_CONTENT_YOUR_DIMENSION_IS="您的分辨率是:"
TRANSHELL_CONTENT_PLEASE_CHOOSE_ONE_BELOW="请在以下选项中选择一个"
TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT="默认为1倍缩放。"
TRANSHELL_CONTENT_SCALE_IS="缩放倍数为"
TRANSHELL_CONTENT_SAVED="已保存"
TRANSHELL_CONTENT_YOU_CAN_USE_SPARK_WINE_HELPER_SETTINGS_TO_ADJUST="您可以使用星火wine助手设置来重新设置"

View File

@@ -0,0 +1,201 @@
#!/bin/bash
SHELL_DIR=$(dirname $(realpath $0))
# 函数:获取所有应用列表
# 函数:获取所有应用列表
get_apps_list() {
local apps_list=()
local app_dirs=($(find /opt/apps -mindepth 1 -maxdepth 1 -type d -exec test -f {}/files/run.sh \; -print))
if [ ${#app_dirs[@]} -eq 0 ]; then
zenity --error --text="请至少在应用商店安装一个wine应用后启动" --width 200
exit 1
fi
for app_dir in "${app_dirs[@]}"; do
local package_name=$(basename "$app_dir")
local run_script="$app_dir/files/run.sh"
local bottle_name="无法读取"
local version="无法读取"
local use_spark="否"
if [ -f "$run_script" ]; then
bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
version=$(grep -oP 'APPVER="\K[^"]+' "$run_script")
if [ -z "$version" ]; then
version="无法读取"
fi
# START_SHELL_PATH=XXX/spark_run_v4.sh
if grep START_SHELL_PATH= "$run_script" | grep spark_run_v4.sh; then
use_spark="是"
fi
fi
local app_name=$(get_app_name "$package_name")
apps_list+=("$app_name" "$package_name" "$bottle_name" "$version" "$use_spark")
done
echo "${apps_list[@]}"
}
# 函数:获取应用名称
get_app_name() {
local app_name_orig=$(grep -m 1 '^Name=' "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
local app_name_i18n=$(grep -m 1 "^Name\[$LANGUAGE\]\=" "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
local app_name=""
if [ -z "$app_name_i18n" ]; then
app_name="$app_name_orig"
else
app_name="$app_name_i18n"
fi
echo "$app_name"
}
# 函数:选择应用
select_app() {
local apps_list=($(get_apps_list))
local app=$(zenity --print-column=2 --width=800 --height=600 --list --title="选择应用" --text="选择要执行的应用" --column="应用名" --column="包名" --column="容器名" --column="版本号" --column="是否使用星火wine助手" "${apps_list[@]}")
if [ -n "$app" ]; then
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local use_spark="否"
if if grep START_SHELL_PATH= "$run_script" | grep spark_run_v4.sh; then
use_spark="是"
fi
if [ "$use_spark" == "是" ]; then
select_spark_action "$app" "$(get_app_name $app)"
else
select_non_spark_action "$app" "$(get_app_name $app)"
fi
fi
}
select_non_spark_action(){
local app="$1"
local app_name="$2"
local options=("在终端中打开" "打开容器目录" "清理并重置容器目录" "更多操作")
local choice=$(zenity --width=800 --height=600 --list --title="选择操作" --text="选择要对$app_name执行的操作" --column="操作" "${options[@]}")
case "$choice" in
"在终端中打开")
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
x-terminal-emulator -e "$run_script"
;;
"打开容器目录")
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
xdg-open file:///home/$(whoami)/.deepinwine/${bottle_name}
;;
"清理并重置容器目录")
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
$SHELL_DIR/../kill.sh ${bottle_name}
rm -rf /home/$(whoami)/.deepinwine/${bottle_name}/*
zenity --info --width=300 --text="操作已完成请重启Wine应用查看"
;;
"更多操作")
if [ -e /usr/bin/deepin-wine-runner ];then
/usr/bin/deepin-wine-runner
elif [ $(command -v spark-store) ];then
spark-store spk://store/tools/spark-deepin-wine-runner
elif [ $(command -v deepin-home-appstore-client) ];then
xdg-open appstore://deepin-home-appstore-client?app_detail_info/spark-deepin-wine-runner
else
xdg-open https://gitee.com/gfdgd-xi/deep-wine-runner/releases
fi
;;
esac
}
# 函数选择星火wine助手操作
select_spark_action() {
local app="$1"
local app_name="$2"
local options=("在终端中打开" "打开容器目录" "清理并重置容器目录" "修改应用缩放" "修改全局缩放" "更多操作")
local choice=$(zenity --width=800 --height=600 --list --title="选择操作" --text="选择要对$app_name执行的操作" --column="操作" "${options[@]}")
case "$choice" in
"在终端中打开")
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
x-terminal-emulator -e "$run_script"
;;
"打开容器目录")
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
xdg-open file:///home/$(whoami)/.deepinwine/${bottle_name}
;;
"清理并重置容器目录")
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
$SHELL_DIR/../spark_kill.sh ${bottle_name}
rm -rf /home/$(whoami)/.deepinwine/${bottle_name}/*
zenity --info --width=300 --text="操作已完成请重启Wine应用查看"
;;
"修改应用缩放")
select_scale_action "应用" "$app"
;;
"修改全局缩放")
select_scale_action "全局" "$app"
;;
"更多操作")
if [ -e /usr/bin/deepin-wine-runner ];then
/usr/bin/deepin-wine-runner
elif [ $(command -v spark-store) ];then
spark-store spk://store/tools/spark-deepin-wine-runner
elif [ $(command -v deepin-home-appstore-client) ];then
xdg-open appstore://deepin-home-appstore-client?app_detail_info/spark-deepin-wine-runner
else
xdg-open https://gitee.com/gfdgd-xi/deep-wine-runner/releases
fi
;;
*)
;;
esac
}
# 函数:选择缩放操作
select_scale_action() {
local scale_type="$1"
local app="$2"
local app_dir="/opt/apps/$app"
local run_script="$app_dir/files/run.sh"
local bottle_name=$(grep -oP 'BOTTLENAME="\K[^"]+' "$run_script")
local scale_factors=("1.0" "1.25" "1.5" "1.75" "2.0" "2.5" "3.0" "3.5" "4.0" "恢复默认")
local choice=$(zenity --width=800 --height=600 --list --title="选择缩放比例" --text="选择要设置的缩放比例" --column="比例" "${scale_factors[@]}")
if [ -n "$choice" ]; then
local scale_factor="$choice"
if [ "$scale_type" == "应用" ]; then
if [ "$scale_factor" == "恢复默认" ];then
rm $HOME/.deepinwine/$bottle_name/scale.txt
else
$SHELL_DIR/scale-set-helper/set-wine-scale.sh -s "$scale_factor" "$HOME/.deepinwine/$bottle_name"
fi
elif [ "$scale_type" == "全局" ]; then
if [ "$scale_factor" == "恢复默认" ];then
rm $HOME/.config/spark-wine/scale.txt
else
echo "$scale_factor" > "$HOME/.config/spark-wine/scale.txt"
find "$HOME/.deepinwine/" -name "scale.txt" -type f -print -exec rm -rf {} \;
fi
fi
fi
zenity --info --width=300 --text="操作已完成请重启Wine应用查看"
}
select_app

View File

@@ -0,0 +1,57 @@
#!/bin/bash
##### 若有pybanner则尝试启动
#if [ -e ${SHELL_DIR}/spark-dwine-helper/pybanner/pybanner.py ];then
#echo "Protocol upgrade: Trying to activate python banner..."
#python3 ${SHELL_DIR}/spark-dwine-helper/pybanner/pybanner.py
#if [ "$?" = "0" ];then
#exit
#else
#echo "Failed to activate. Fallback to normal zenity."
#fi
#fi
if [ ! -z "$WAYLAND_DISPLAY" ]; then
echo "Wayland detected. Do not check wmclass"
zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=3
exit
fi
if [ -z "$(which wmctrl)" ]; then
echo "No wmctrl installed. Do not check wmclass"
zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=3
exit
fi
target_wmclass="$WINE_WMCLASS"
function check_window() {
# 使用 wmctrl 命令列出所有窗口,并使用 grep 过滤出特定的 WMCLASS
windows=$(wmctrl -lx | grep "$target_wmclass")
# 如果窗口存在,则关闭提示
if [ -n "$windows" ]; then
# 提取窗口ID
window_id=$(echo "$windows" | awk '{print $1}')
echo "Window with WMCLASS '$target_wmclass' found"
exit
else
echo "Window with WMCLASS '$target_wmclass' not found."
fi
}
function check_wmclass(){
# 递归检测窗口是否存在的函数
# 每隔一段时间检测一次窗口是否存在
while true; do
check_window
# 等待一段时间后再次检测
sleep 1
done
}
check_wmclass | zenity --progress --title="星火Windows应用兼容助手" --text="正在为您启动以下应用:$WINE_APP_NAME" --pulsate --width=400 --auto-close --no-cancel --timeout=20

View File

@@ -0,0 +1,22 @@
#!/usr/bin/env python3
# vim: set ts=4 sw=4 fileencoding=utf-8:
# Luomio <nohappiness@gmail.com>
# Filename: dde-first-run.py
# Create Date: 27-03, 13
import dbus
def get_tray_window():
bus = dbus.SessionBus()
traymanager = bus.get_object("com.deepin.dde.TrayManager", "/com/deepin/dde/TrayManager")
traymanager_iface = dbus.Interface(traymanager, dbus_interface='org.freedesktop.DBus.Properties')
windows = traymanager_iface.Get("com.deepin.dde.TrayManager","TrayIcons")
str="window_id:"
for i in range(len(windows)):
str += '{:#x} '.format(windows[i])
print(str)
if __name__ == "__main__":
get_tray_window()

Binary file not shown.

Binary file not shown.

View File

@@ -0,0 +1,19 @@
#/bin/bash
cd $(dirname $0)
SHELL_DIR=$(dirname $(realpath $0))
runtime_path=/opt/deepinwine/runtime-i386
echo $runtime_path
if [ -f "$runtime_path/init_runtime.sh" ];then
source "$runtime_path/init_runtime.sh"
init_runtime
init_32bit_config
echo "use deepinwine runtime"
"$WINELDPATH" ./gl-wine32
exit $?
fi
./gl-wine32
exit $?

View File

@@ -0,0 +1,272 @@
#!/bin/bash
#####因为arm版本的deepin-wine-helper不带这个又不想破坏x86兼容性故改名
APP_NAME="QQ"
LOG_FILE=$0
PUBLIC_DIR="/var/public"
UsePublicDir()
{
if [ -z "$USE_PUBLIC_DIR" ]; then
echo "Don't use public dir"
return 1
fi
if [ ! -d "$PUBLIC_DIR" ];then
echo "Not found $PUBLIC_DIR"
return 1
fi
if [ ! -r "$PUBLIC_DIR" ];then
echo "Can't read for $PUBLIC_DIR"
return 1
fi
if [ ! -w "$PUBLIC_DIR" ];then
echo "Can't write for $PUBLIC_DIR"
return 1
fi
if [ ! -x "$PUBLIC_DIR" ];then
echo "Can't excute for $PUBLIC_DIR"
return 1
fi
return 0
}
WINE_BOTTLE="$HOME/.deepinwine"
if UsePublicDir;then
WINE_BOTTLE="$PUBLIC_DIR"
fi
get_wine_by_pid()
{
wine_path=$(cat /proc/$1/maps | grep -E "\/wine$|\/wine64$|\/wine |\/wine64 " | head -1 | awk '{print $6}')
if [ -z "$wine_path" ];then
cat /proc/$1/cmdline| xargs -0 -L1 -I{} echo {} | grep -E "\/wine$|\/wine64$|\/wine |\/wine64 " | head -1
else
echo $wine_path
fi
}
is_wine_process()
{
wine_module=$(get_wine_by_pid $1)
if [ -z "$wine_module" ];then
wine_module=$(cat /proc/$1/maps | grep -E "\/wineserver$" | head -1)
fi
echo $wine_module
}
get_prefix_by_pid()
{
WINE_PREFIX=$(xargs -0 printf '%s\n' < /proc/$1/environ | grep WINEPREFIX)
WINE_PREFIX=${WINE_PREFIX##*=}
if [ -z "$WINE_PREFIX" ] && [ -n "$(is_wine_process $1)" ]; then
#不指定容器的情况用默认容器目录
WINE_PREFIX="$HOME/.wine"
fi
if [ -n "$WINE_PREFIX" ];then
WINE_PREFIX=$(realpath $WINE_PREFIX)
echo $WINE_PREFIX
fi
}
get_wineserver()
{
if [ -z "$1" ];then
return
fi
targ_prefix=$(realpath $1)
ps -ef | grep wineserver | while read server_info ;do
debug_log_to_file "get server info: $server_info"
server_pid=$(echo $server_info | awk '{print $2}')
server_prefix=$(get_prefix_by_pid $server_pid)
debug_log_to_file "get server pid $server_pid, prefix: $server_prefix"
if [ "$targ_prefix" = "$server_prefix" ];then
server=$(echo $server_info | awk '{print $NF}')
if [ "-p0" = "$server" ];then
server=$(echo $server_info | awk '{print $(NF-1)}')
fi
debug_log_to_file "get server $server"
echo $server
return
fi
done
}
init_log_file()
{
if [ -d "$DEBUG_LOG" ];then
LOG_DIR=$(realpath $DEBUG_LOG)
if [ -d "$LOG_DIR" ];then
LOG_FILE="${LOG_DIR}/${LOG_FILE##*/}.log"
echo "" > "$LOG_FILE"
debug_log "LOG_FILE=$LOG_FILE"
fi
fi
}
debug_log_to_file()
{
if [ -d "$DEBUG_LOG" ];then
strDate=$(date)
echo -e "${strDate}:${1}" >> "$LOG_FILE"
fi
}
debug_log()
{
strDate=$(date)
echo "${strDate}:${1}"
}
init_log_file
get_bottle_path_by_process_id()
{
PID_LIST="$1"
PREFIX_LIST=""
for pid_var in $PID_LIST ; do
WINE_PREFIX=$(get_prefix_by_pid $pid_var)
#去掉重复项
for path in $(echo -e $PREFIX_LIST) ; do
if [[ $path == "$WINE_PREFIX" ]]; then
WINE_PREFIX=""
fi
done
if [ -d "$WINE_PREFIX" ]; then
debug_log_to_file "found $pid_var : $WINE_PREFIX"
PREFIX_LIST+="\n$WINE_PREFIX"
fi
done
echo -e $PREFIX_LIST
}
get_pid_by_process_name()
{
PID_LIST=""
for pid_var in $(ps -ef | grep -E -i "$1" | grep -v grep | awk '{print $2}');do
#通过判断是否加载wine来判断是不是wine进程
if [ -n "$(is_wine_process $pid_var)" ];then
PID_LIST+=" $pid_var"
fi
done
echo "$PID_LIST"
}
get_bottle_path_by_process_name()
{
PID_LIST=$(get_pid_by_process_name $1)
debug_log_to_file "get pid list: $PID_LIST"
get_bottle_path_by_process_id "$PID_LIST"
}
get_bottle_path()
{
if [ -z "$1" ];then
return 0
fi
if [ -f "$1/user.reg" ]; then
realpath "$1"
return 0
fi
if [ -f "$WINE_BOTTLE/$1/user.reg" ]; then
realpath "$WINE_BOTTLE/$1"
return 0
fi
get_bottle_path_by_process_name "$1"
}
kill_app()
{
debug_log "try to kill $1"
for path in $(get_bottle_path $1); do
if [ -n "$path" ];then
WINESERVER=$(get_wineserver "$path")
if [ -f "$WINESERVER" ];then
debug_log "kill $path by $WINESERVER"
env WINEPREFIX="$path" "$WINESERVER" -k
fi
PID_LIST=$(get_pid_by_process_name "exe|wine")
for tag_pid in $PID_LIST; do
bottle=$(get_bottle_path_by_process_id "$tag_pid")
bottle=${bottle:1}
if [ "$path" = "$bottle" ];then
echo "kill $tag_pid for $bottle"
kill -9 $tag_pid
fi
done
fi
done
#Kill defunct process
ps -ef | grep -E "$USER.*exe.*<defunct>"
ps -ef | grep -E "$USER.*exe.*<defunct>" | grep -v grep | awk '{print $2}' | xargs -i kill -9 {}
}
get_tray_window()
{
$SHELL_DIR/spark_get_tray_window | awk -F: '{print $2}'
}
get_stacking_window()
{
xprop -root _NET_CLIENT_LIST_STACKING | awk -F# '{print $2}' | sed -e 's/, / /g'
}
get_window_pid()
{
for winid in $(echo "$1" | sed -e 's/ /\n/g') ;
do
xprop -id $winid _NET_WM_PID | awk -F= '{print $2}'
done
}
get_window_bottle()
{
debug_log_to_file "get_window_bottle $1"
PID_LIST=$(get_window_pid "$1")
debug_log_to_file "get_window_bottle pid list: $PID_LIST"
get_bottle_path_by_process_id "$PID_LIST"
}
get_active_bottles()
{
TRAYWINDOWS=$(get_tray_window)
STACKINGWINDOWS=$(get_stacking_window)
debug_log_to_file "tray window id: $TRAYWINDOWS"
debug_log_to_file "stacking window id: $STACKINGWINDOWS"
PID_LIST="$TRAYWINDOWS $STACKINGWINDOWS"
get_window_bottle "$PID_LIST"
}
kill_exit_block_app()
{
TAGBOTTLE=$(get_bottle_path $1)
debug_log "tag bottle: $TAGBOTTLE"
ACTIVEBOTTLES=$(get_active_bottles)
debug_log "active bottles: $ACTIVEBOTTLES"
if [[ "$ACTIVEBOTTLES" != *"$TAGBOTTLE"* ]]; then
kill_app "$TAGBOTTLE"
fi
}
#get_active_bottles
#exit
debug_log "kill $1 $2"
if [ -n "$1" ]; then
APP_NAME="$1"
fi
if [ "$2" = "block" ]; then
kill_exit_block_app $APP_NAME $3
else
kill_app $APP_NAME
fi

View File

@@ -0,0 +1,500 @@
#!/bin/bash
# Copyright (C) 2016 Deepin, Inc.
# Copyright (C) 2022 The Spark Project
#
# Author: Li LongYu <lilongyu@linuxdeepin.com>
# Peng Hao <penghao@linuxdeepin.com>
#
# Modifier: shenmo <shenmo@spark-app.store>
#
#
SHELL_DIR=$(dirname $(realpath $0))
export SHELL_DIR
source ${SHELL_DIR}/bashimport/log-function.bashimport
source ${SHELL_DIR}/bashimport/transhell.bashimport
load_transhell_debug
#########Preload functions
function get_app_name() {
local app_name_orig=$(grep -m 1 '^Name=' "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
local app_name_i18n=$(grep -m 1 "^Name\[$LANGUAGE\]\=" "/usr/share/applications/$1.desktop" | cut -d '=' -f 2)
local app_name=""
if [ -z "$app_name_i18n" ]; then
app_name="$app_name_orig"
else
app_name="$app_name_i18n"
fi
echo "$app_name"
}
######### Vars
BOTTLENAME="$1"
WINEPREFIX="$HOME/.deepinwine/$1"
APPDIR="/opt/apps/${DEB_PACKAGE_NAME}/files"
APPVER=""
APPTAR="files.7z"
BOTTLENAME=""
WINE_CMD="deepin-wine"
#这里会被后续覆盖
LOG_FILE=$0
PUBLIC_DIR="/var/public"
if [ -z $WINE_WMCLASS ];then
export WINE_WMCLASS="$DEB_PACKAGE_NAME"
fi
export WINE_APP_NAME=$(get_app_name ${DEB_PACKAGE_NAME})
if [ -z "$WINE_APP_NAME" ];then
export WINE_APP_NAME=$BOTTLENAME
fi
if [ -e /opt/p7zip-legacy/bin/7z ];then
log.debug "Using p7zip-legacy as unpacker"
UNPACK_CMD=/opt/p7zip-legacy/bin/7z
else
UNPACK_CMD=7z
log.debug "Using system 7z as unpacker"
fi
if [ $APPRUN_CMD ]; then
WINE_CMD=$APPRUN_CMD
fi
#####################
if [ "$WINE_CMD" = "deepin-wine8-stable" ] && [ "$(arch)" != "x86_64" ];then
WINE_CMD="${SHELL_DIR}/spark-dwine-helper/deepin-wine8-stable-wrapper/deepin-wine8-stable"
log.warn "Using deepin-wine8-stable wrapper to fix arm problem"
fi
##################### Functions
progressbar()
{
WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close --no-cancel ||
WINDOWID="" zenity --progress --title="$1" --text="$2" --pulsate --width=400 --auto-close
}
_DeleteRegistry()
{
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg DELETE "$1" /f &> /dev/null
}
#########功能:删除注册表
init_log_file()
{
if [ ! -d "$DEBUG_LOG" ];then
return
fi
LOG_DIR=$(realpath $DEBUG_LOG)
if [ -d "$LOG_DIR" ];then
LOG_FILE="${LOG_DIR}/${LOG_FILE##*/}.log"
echo "" > "$LOG_FILE"
debug_log "LOG_FILE=$LOG_FILE"
fi
}
debug_log_to_file()
{
if [ -d "$DEBUG_LOG" ];then
echo -e "${1}" >> "$LOG_FILE"
fi
}
debug_log()
{
log.debug "${1}"
}
################log相关功能
HelpApp()
{
echo " Extra Commands:"
echo " -r/--reset Reset app to fix errors"
echo " -e/--remove Remove deployed app files"
echo " -h/--help Show program help info"
}
#############帮助文件
check_link()
{
if [ ! -d "$1" ];then
echo "$1 不是目录,不能创建$2软连接"
return
fi
link_path=$(realpath "$2")
target_path=$(realpath "$1")
if [ "$link_path" != "$target_path" ];then
if [ -d "$2" ];then
mv "$2" "${2}.bak"
else
rm "$2"
fi
echo "修复$2软连接为$1"
ln -s -f "$1" "$2"
fi
}
FixLink()
{
if [ -d ${WINEPREFIX} ]; then
CUR_DIR=$PWD
cd "${WINEPREFIX}/dosdevices"
check_link ../drive_c c:
check_link / z:
check_link $HOME y:
cd "../drive_c/users/$USER"
check_link "$HOME/Desktop" Desktop
check_link "$HOME/Downloads" Downloads
# Link to Document
if [ -L "$WINEPREFIX/drive_c/users/$(whoami)/My Documents" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' /t REG_EXPAND_SZ /v Personal /d "%USERPROFILE%\My Documents" /f
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders' /t REG_EXPAND_SZ /v Personal /d "%USERPROFILE%\Documents" /f
fi
cd $CUR_DIR
#ls -l "${WINEPREFIX}/dosdevices"
fi
}
###########会在应用启动和解压时执行,驱动器绑定
DisableWrite()
{
if [ -d "${1}" ]; then
chmod +w "${1}"
rm -rf "${1}"
fi
mkdir "${1}"
chmod -w "${1}"
}
########如果有该文件夹则删除,然后再创建一个不允许写入的
is_autostart()
{
AUTOSTART="/opt/deepinwine/tools/autostart"
if [[ -f "$SHELL_DIR/autostart" ]]; then
# 如果打包时自带 autostart则使用自带的
AUTOSTART="$SHELL_DIR/autostart"
fi
if [ -f "$AUTOSTART.all" ]&&[ -f "/opt/apps/$1/files/run.sh" ];then
return 0
fi
if [ -f $AUTOSTART ];then
grep -c "$1" $AUTOSTART > /dev/null
return $?
fi
return 1
}
#########自动启动相关,等用到了再研究
Test_GL_wine()
{
gl_wine_path="${SHELL_DIR}/spark_gl-wine"
#如果不支持32的GLX,d3d改为gdi的实现
if [[ ! -f "${WINEPREFIX}/.init_d3d" ]];then
if [[ $WINE_CMD == *"deepin-wine8-stable"* ]];then
gl_wine="${gl_wine_path}/gl-wine64"
else
gl_wine="${gl_wine_path}/run_gl.sh"
fi
run_gl=`${gl_wine} 2>&1`
#如果opengl测试程序运行失败所有进程的渲染方式改为gdi渲染模式
if [ $? != 0 ];then
WINEPREFIX="$WINEPREFIX" $WINE_CMD regedit /S "${gl_wine_path}/gdid3d.reg"
fi
touch "${WINEPREFIX}/.init_d3d"
fi
}
urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
#######url转义
#arg 1: windows process file path
#arg 2-*: windows process args
CallProcess()
{
#get file full path
path="$1"
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
path=$(echo ${path//\\/\/})
#kill bloack process
is_autostart $DEB_PACKAGE_NAME
autostart=$?
if [[ $autostart -ne 0 ]] && [[ "$1" != *"pluginloader.exe" ]];then
$SHELL_DIR/spark_kill.sh "$BOTTLENAME" block
fi
#run gl-wine for test opengl
get_arch=`uname -m`
if [[ $get_arch = "x86_64" ]];then
Test_GL_wine
fi
#change current dir to excute path
path=$(dirname "$path")
cd "$path"
pwd
#Set default mime type
if [ -n "$MIME_TYPE" ]; then
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
fi
# Disable winemenubuilder
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v winemenubuilder.exe /f
debug_log "Starting process $* ..."
############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh
${SHELL_DIR}/spark-dwine-helper/scale-set-helper/set-wine-scale.sh "$WINEPREFIX"
$SHELL_DIR/spark-wine-banner &
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@"
#start autobottle
if [ $autostart -eq 0 ];then
$SHELL_DIR/autostart_wine.sh $DEB_PACKAGE_NAME
fi
}
###通用启动APP逻辑。对于没有被case捕捉的非适配APP则直接执行此部分。似乎已经有了防止残留的功能
###一些自定义的应用不会使用这个启动,而另一些则会调用这个
###有设置mimetype和自动启动(这个暂时没分析)的功能
###########专属优化段:
UnixUriToDosPath()
{
OPEN_FILE="$1"
if [ -f "$OPEN_FILE" ]; then
OPEN_FILE=$(realpath "$OPEN_FILE")
OPEN_FILE="z:$OPEN_FILE"
OPEN_FILE=$(echo $OPEN_FILE | sed -e 's/\//\\\\/g')
fi
echo $OPEN_FILE
}
#arg 1: exec file path
#arg 2: autostart ,or exec arg 1
#arg 3: exec arg 2
#### CallApp段根据容器名找专属优化没有就走通用启动
CallApp()
{
FixLink
debug_log "CallApp $BOTTLENAME arg count $#: $*"
if [ -f "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_run.sh" ];then
source "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_run.sh"
CallPreRun "$@"
fi
if [ -e "/opt/deepinwine/tools/spark_run_v4_app_configs/${BOTTLENAME}.sh" ];then
APP_CONFIG_PATH="/opt/deepinwine/tools/spark_run_v4_app_configs/${BOTTLENAME}.sh"
else
APP_CONFIG_PATH="${SHELL_DIR}/spark_run_v4_app_configs/${BOTTLENAME}.sh"
fi
if [ -f "$APP_CONFIG_PATH" ]; then
echo "执行 ${BOTTLENAME}.sh ..."
source $APP_CONFIG_PATH
else
echo "$APP_CONFIG_PATH 文件不存在,执行通用启动"
CallProcess "$@"
fi
}
ExtractApp()
{
local tmp_log=$(mktemp)
mkdir -p "$1"
(${UNPACK_CMD} x "$APPDIR/$APPTAR" -o"$1" -bsp1 -bb1 -bse2 | grep --line-buffered -oP "(\d+(\.\d+)?(?=%))" > $tmp_log)&
cmd_pid=$!
(while kill -0 $cmd_pid 2> /dev/null; do
tail -n 1 "${tmp_log}"
sleep 1
done)| zenity --progress --title="${TRANSHELL_CONTENT_SPARK_WINDOWS_COMPATIBILITY_TOOL}" --text="${TRANSHELL_CONTENT_UNPACKING} $WINE_APP_NAME..." --width=600 --auto-close --no-cancel
rm $tmp_log
mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER"
sed -i "s#@current_user@#$USER#" $1/*.reg
FixLink
}
DeployApp()
{
ExtractApp "$WINEPREFIX"
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
}
RemoveApp()
{
rm -rf "$WINEPREFIX"
}
ResetApp()
{
debug_log "Reset $PACKAGENAME....."
read -p "* Are you sure?(Y/N)" ANSWER
if [ "$ANSWER" = "Y" -o "$ANSWER" = "y" -o -z "$ANSWER" ]; then
EvacuateApp
DeployApp
CallApp
fi
}
UpdateApp()
{
if [ -d "${WINEPREFIX}.tmpdir" ]; then
rm -rf "${WINEPREFIX}.tmpdir"
fi
if [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then
return
fi
if [ -f "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_update.sh" ];then
source "/opt/apps/${DEB_PACKAGE_NAME}/files/pre_update.sh"
CallPreUpdate
return
fi
case $BOTTLENAME in
"Deepin-Intelligent" | "Deepin-QQ" | "Deepin-TIM" | "Deepin-WeChat" | "Deepin-WXWork" | "Deepin-Dding" | "Wine-QQ" | "Spark-QQ" | "Spark-weixin")
rm -rf "$WINEPREFIX"
DeployApp
return
;;
esac
ExtractApp "${WINEPREFIX}.tmpdir"
$SHELL_DIR/spark_updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v
rm -rf "${WINEPREFIX}.tmpdir"
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
}
RunApp()
{
progpid=$(ps -ef | grep "zenity --progress --title=${BOTTLENAME}" | grep -v grep)
debug_log "run ${BOTTLENAME} progress pid $progpid"
if [ -n "$progpid" ]; then
debug_log "$BOTTLENAME is running"
exit 0
fi
if [ -d "$WINEPREFIX" ]; then
if [ ! -f "$WINEPREFIX/PACKAGE_VERSION" ] || [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" != "$APPVER" ]; then
UpdateApp
fi
else
DeployApp
fi
CallApp "$@"
}
CreateBottle()
{
if [ -d "$WINEPREFIX" ]; then
if [ ! -f "$WINEPREFIX/PACKAGE_VERSION" ] || [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" != "$APPVER" ]; then
UpdateApp
fi
else
DeployApp
fi
}
ParseArgs()
{
if [ $# -eq 4 ];then
RunApp "$3"
elif [ -f "$5" ];then
if [ -n "$MIME_EXEC" ];then
RunApp "$MIME_EXEC" "$(UnixUriToDosPath "$5")" "${@:6}"
else
RunApp "$3" "$(UnixUriToDosPath "$5")" "${@:6}"
fi
else
RunApp "$3" "${@:5}"
fi
}
#init_log_file
#####准备启动进程,分析在 https://blog.shenmo.tech/post/deepin-wine6%E7%9A%84run_v4%E8%84%9A%E6%9C%AC%E6%8E%A2%E7%B4%A2%E5%90%AF%E5%8A%A8%E6%96%B9%E5%BC%8F/
if [ $# -lt 3 ]; then
debug_log "参数个数小于3个"
exit 0
fi
APPDIR="/opt/apps/${DEB_PACKAGE_NAME}/files"
if [ -f "$APPDIR/files.md5sum" ];then
APPVER="$(cat $APPDIR/files.md5sum)"
else
APPVER="$2"
fi
debug_log "Run $*"
#执行lnk文件通过判断第5个参数是否是“/Unix”来判断
if [ "$4" == "/Unix" ];then
RunApp "$3" "$4" "$5"
exit 0
fi
if [ $# -lt 4 ]; then
RunApp "$3"
exit 0
fi
case $4 in
"-r" | "--reset")
ResetApp
;;
"-cb" | "--create")
CreateBottle
;;
"-e" | "--remove")
RemoveApp
;;
"-u" | "--uri")
ParseArgs "$@"
;;
"-f" | "--file")
ParseArgs "$@"
;;
"-h" | "--help")
HelpApp
;;
*)
echo "Invalid option: $4"
echo "Use -h|--help to get help"
exit 1
;;
esac
exit 0

View File

@@ -0,0 +1,22 @@
#get file full path
path="$1"
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
path=$(echo ${path//\\/\/})
#kill bloack process
name="${path##*/}"
$SHELL_DIR/spark_kill.sh "$name" block
#change current dir to excute path
path=$(dirname "$path")
cd "$path"
pwd
#Set default mime type
if [ -n "$MIME_TYPE" ]; then
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
fi
debug_log_to_file "Starting process $* ..."
CallProcess "$@"

View File

@@ -0,0 +1,4 @@
debug_log "run $1"
$SHELL_DIR/spark_kill.sh DingTalk block
CallProcess "$@"

View File

@@ -0,0 +1,9 @@
#set -- "$1" "${2#file://*}"
local path=$(urldecode "$2")
path=${path/file:\/\//}
set -- "$1" "$path"
if [ "$path" ];then
CallProcess "$@"
else
CallProcess "$1"
fi

View File

@@ -0,0 +1,9 @@
#set -- "$1" "${2#file://*}"
local path=$(urldecode "$2")
path=${path/file:\/\//}
set -- "$1" "$path"
if [ "$path" ];then
CallProcess "$@"
else
CallProcess "$1"
fi

View File

@@ -0,0 +1,2 @@
sed -i '/LogPixels/d' ${WINEPREFIX}/user.reg
CallProcess "$@"

View File

@@ -0,0 +1,9 @@
#set -- "$1" "${2#file://*}"
local path=$(urldecode "$2")
path=${path/file:\/\//}
set -- "$1" "$path"
if [ "$path" ];then
CallProcess "$@"
else
CallProcess "$1"
fi

View File

@@ -0,0 +1 @@
Deepin-QQ.sh

View File

@@ -0,0 +1,25 @@
#!/bin/bash
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
debug_log "first run time"
$SHELL_DIR/add_hotkeys
$SHELL_DIR/fontconfig
touch "$WINEPREFIX/../.QQ_run"
fi
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QQ/Bin/QQLiveMPlayer"
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QQ/Bin/QQLiveMPlayer1"
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QzoneMusic"
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Tencent/QQBrowser"
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Common Files/Tencent/QQBrowser"
DisableWrite "${WINEPREFIX}/drive_c/users/Public/Application Data/Tencent/QQBrowserBin"
DisableWrite "${WINEPREFIX}/drive_c/users/Public/Application Data/Tencent/QQBrowserDefault"
DisableWrite "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/QQBrowserDefault"
DisableWrite "${WINEPREFIX}/drive_c/users/Public/Application Data/Tencent/QQPCMgr"
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Common Files/Tencent/QQPCMgr"
DisableWrite "${WINEPREFIX}/drive_c/Program Files/Common Files/Tencent/HuaYang"
DisableWrite "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/HuaYang"
CallProcess "$@"

View File

@@ -0,0 +1,3 @@
debug_log "run $1"
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
CallProcess "$1" -action:force_download -appid:1104632801 -pid:8 -bin_version:1.1.2.4 -loginuin:

View File

@@ -0,0 +1,4 @@
#!/bin/bash
debug_log "run $1"
$SHELL_DIR/spark_kill.sh qqgame block
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &

View File

@@ -0,0 +1,3 @@
debug_log "run $1"
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
CallProcess "$1" -action:force_download -appid:363 -pid:8 -bin_version:1.1.2.4 -loginuin:

View File

@@ -0,0 +1,3 @@
debug_log "run $1"
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
CallProcess "$1" -action:force_download -appid:1105856612 -pid:8 -bin_version:1.1.2.4 -loginuin:

View File

@@ -0,0 +1,3 @@
debug_log "run $1"
$SHELL_DIR/spark_kill.sh QQMicroGameBox block
CallProcess "$1" -action:force_download -appid:1105640244 -pid:8 -bin_version:1.1.2.4 -loginuin:

View File

@@ -0,0 +1,23 @@
$SHELL_DIR/spark_kill.sh ths block
debug_log "Start run $1"
#get file full path
path="$1"
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
path=$(echo ${path//\\/\/})
#kill bloack process
name="${path##*/}"
$SHELL_DIR/spark_kill.sh "$name" block
#change current dir to excute path
path=$(dirname "$path")
cd "$path"
pwd
#Set default mime type
if [ -n "$MIME_TYPE" ]; then
xdg-mime default "$DEB_PACKAGE_NAME".desktop "$MIME_TYPE"
fi
CallProcess "$@"

View File

@@ -0,0 +1,17 @@
#!/bin/bash
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
debug_log "first run time"
$SHELL_DIR/add_hotkeys
####似乎是给dde-control-center添加快捷键
$SHELL_DIR/fontconfig
####暂时无法得知用途和用法
# If the bottle not exists, run reg may cost lots of times
# So create the bottle befor run reg
env WINEPREFIX="$WINEPREFIX" $WINE_CMD uninstaller --list
touch $WINEPREFIX/../.QQ_run
fi
CallProcess "$@"
#disable Tencent MiniBrowser
_DeleteRegistry "HKCU\\Software\\Tencent\\MiniBrowser"

View File

@@ -0,0 +1,5 @@
if [ -f "${WINEPREFIX}/drive_c/Program Files/Tencent/QQLive/Upgrade.dll" ]; then
rm -rf "${WINEPREFIX}/drive_c/Program Files/Tencent/QQLive/Upgrade.dll"
fi
CallProcess "$@"

View File

@@ -0,0 +1,9 @@
if [ -d "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/Update" ]; then
rm -rf "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/Update"
fi
if [ -d "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/upgrade" ]; then
rm -rf "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WXWork/upgrade"
fi
#Support use native file dialog
CallProcess "$@"

View File

@@ -0,0 +1,9 @@
#/bin/bash
chmod 700 "$WINEPREFIX/drive_c/Program Files/AliWangWang/9.12.10C/wwbizsrv.exe"
chmod 700 "$WINEPREFIX/drive_c/Program Files/Alibaba/wwbizsrv/wwbizsrv.exe"
if [ $# = 3 ] && [ -z "$3" ];then
EXEC_PATH="c:/Program Files/AliWangWang/9.12.10C/WWCmd.exe"
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$EXEC_PATH" "$2" &
else
CallProcess "$@"
fi

Some files were not shown because too many files have changed in this diff Show More