Compare commits

...

53 Commits
3.6.1 ... 3.7.0

Author SHA1 Message Date
2d829f4243 调整README 2024-02-02 21:16:10 +08:00
9c3707b419 3.7.0 2024-02-02 19:34:23 +08:00
3b8e8566bc 调整 2024-02-02 19:13:55 +08:00
37082fe085 调整以支持pip可以在deepin23 beta3安装所缺失的库 2024-02-02 18:55:57 +08:00
15c28a4820 修复rpm更新失败的问题 2024-02-02 18:14:24 +08:00
7e4620f4c3 初步rpm更新 2024-02-02 18:07:06 +08:00
b0e62a888c 新增rpm包自动构建工程 2024-02-02 13:49:01 +08:00
586b6efb59 Makefile支持构建rpm 2024-02-02 12:41:31 +08:00
c82897fc7b 初步适配Fedora 2024-02-02 11:49:30 +08:00
b6e510eb26 调整更新内容 2024-02-02 10:06:04 +08:00
ca5edef486 漏了 2024-02-02 09:26:21 +08:00
44c7d4fe3b 新增转包功能 2024-02-02 09:23:42 +08:00
1092c2ac2c 脚本有误 2024-02-02 08:31:06 +08:00
a0bc9059de 调整Makefile 2024-02-02 08:29:02 +08:00
c0781b4f3a 初步新增rpm配置文件 2024-02-01 22:58:36 +08:00
de06de7637 初步支持拷贝快捷方式至桌面 2024-02-01 22:31:19 +08:00
e0b2aca8ef 在安装应用时无需手动确认 2024-02-01 18:52:19 +08:00
ff41344e97 arch更新链接错误 2024-02-01 18:47:47 +08:00
0ec98cffcb 修改检测方式 2024-02-01 18:39:47 +08:00
d27c31ae6f 检测有误 2024-02-01 18:37:22 +08:00
5e325a873e 调整更新策略 2024-02-01 18:35:21 +08:00
71917c5451 漏改内容 2024-01-31 22:52:00 +08:00
9cff5358fe 调整postinst 2024-01-31 22:20:43 +08:00
c8786b59bf 语法错误 2024-01-31 22:07:32 +08:00
c46aa8fbea 修改VMInstaller Qemu安装脚本以支持Arch Linux 2024-01-31 22:06:36 +08:00
4f29c5debc 调整依赖关系 2024-01-31 21:35:07 +08:00
d9c52d4aa1 调整Makefile以便可以清理Arch Linux生成的安装包 2024-01-31 21:22:44 +08:00
c77a9b3290 调整依赖关系 2024-01-31 21:21:12 +08:00
fcdd8e7622 调整自动编译工程 2024-01-31 21:06:14 +08:00
9ce7c8a7d0 修复make clean错误 2024-01-31 21:02:37 +08:00
eab5e11e8b 初步支持Arch Linux 2024-01-31 20:54:58 +08:00
d57d53a659 调整README 2024-01-31 15:49:18 +08:00
78de66961e 修复部分机器因为信息识别有误导致无法正常启动虚拟机的问题 2024-01-29 15:24:31 +08:00
b7b798d491 打包器新增 维护打包工具箱 入口 2024-01-29 14:20:20 +08:00
8351dc2838 调整目录 2024-01-29 14:02:28 +08:00
e0717e4fc5 高级打包器支持在选择可执行文件在 c:/User/xxx 时给出提示 https://gitee.com/gfdgd-xi/deep-wine-runner/issues/I8XRWP 2024-01-28 19:01:36 +08:00
99539c58f7 新增spark wine9支持 2024-01-26 13:14:46 +08:00
88bec61044 添加helper脚本 2024-01-21 21:45:18 +08:00
05549090fe 调整postinst以解决老pip无--break-system-packages参数的问题 2024-01-21 08:41:28 +08:00
dc3477eae2 修复简易打包器在UOS无法正常启动的问题 2024-01-20 14:29:57 +08:00
59064fb1c6 漏了mkdir 2024-01-15 22:24:24 +08:00
4669c756c4 修复打包器生成的 deb 包在非 Deepin 系统无法正常在启动器显示快捷方式的问题 2024-01-14 22:25:53 +08:00
0ae06f118c Repair some problems 2024-01-14 17:53:27 +08:00
0c9da25093 Change pardus chroot 2024-01-14 15:06:22 +08:00
a4e8b17ac5 优化公告链接打开 2024-01-14 10:43:43 +08:00
800c523935 新增提示新版本/公告功能 2024-01-14 10:22:50 +08:00
ab7a5c18c5 Change README.md 2024-01-01 13:24:02 +08:00
c34708cbc5 Change README.md 2024-01-01 13:23:40 +08:00
0231e1d461 Change README.md 2024-01-01 13:22:59 +08:00
1ba1ee6b75 Change README.md 2024-01-01 13:21:37 +08:00
dc7a301a45 Change README.md 2024-01-01 13:06:54 +08:00
f6efb8e448 添加arm bwrap 2023-12-29 19:48:31 +08:00
fd410549c3 小调README 2023-12-25 22:29:38 +08:00
102 changed files with 5912 additions and 178 deletions

29
.github/workflows/auto-building-rpm.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
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,5 +1,5 @@
name: Auto Building Wine Runner
run-name: ${{ github.actor }} Auto Building Wine Runner 🚀
name: Auto Building Wine Runnerdeb
run-name: ${{ github.actor }} Auto Building Wine Runnerdeb 🚀
on:
push:
workflow_dispatch:
@@ -18,7 +18,7 @@ jobs:
sudo apt install git dpkg-dev qtbase5-dev qtchooser qt5-qmake qtbase5-dev-tools qt5-qmake -y
git clone https://github.com/gfdgd-xi/deep-wine-runner
cd deep-wine-runner
make build
make package-deb
mv spark-deepin-wine-runner.deb ~
mv spark-deepin-wine-runner-ace.deb ~
- name: upload result

View File

@@ -37,13 +37,13 @@ jobs:
## 获取 Wine 运行器安装包
git clone https://github.com/gfdgd-xi/deep-wine-runner --depth=1
cd deep-wine-runner
make build
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 winehq-devel xfce4-terminal -y
sudo chroot debian apt install locales /tmp/wine-runner.deb winehq-devel fcitx xfce4-terminal -y
# 构建软件包
mkdir package/opt -p
mkdir package/runner -p

1
.gitignore vendored
View File

@@ -1 +1,2 @@
*.user*
__pycache__

View File

@@ -38,6 +38,11 @@ def InstallSparkWine(wine):
else:
os.system(f"sudo apt install \"{wine}\" -y")
def InstallWineWithYay(wine):
if os.system("which yay > /dev/null"):
os.system("sudo pacman -S yay --noconfirm")
os.system(f"yay -S \"{wine}\"")
###################
# 程序功能
###################
@@ -53,6 +58,40 @@ m m "
print("请保证你能有 root 权限以便安装")
print("如果有请按回车,否则按 [Ctrl+C] 退出", end=' ')
input()
# 如果是 Fedora
if os.path.exists("/etc/fedora-release"):
os.system("sudo pacman -Syu")
print("请问是否要安装原版 winewine64[Y/N]", end=' ')
choose = input().upper()
if not choose == "N":
os.system("sudo yum install wine")
print("全部完成!")
exit()
# 判断系统版本,如果是 Arch Linux则另外处理
if os.path.exists("/etc/arch-release"):
os.system("sudo pacman -Syu")
print("请问是否要安装原版 winewine64[Y/N]", end=' ')
choose = input().upper()
if not choose == "N":
os.system("sudo pacman -S wine")
if os.system("which deepin-wine5-stable > /dev/null"):
print("请问是否要安装 deepin-wine5-stable[Y/N]", end=' ')
choose = input().upper()
if not choose == "N":
InstallWineWithYay("deepin-wine5-stable")
if os.system("which deepin-wine6-stable > /dev/null"):
print("请问是否要安装 deepin-wine6-stable[Y/N]", end=' ')
choose = input().upper()
if not choose == "N":
InstallWineWithYay("deepin-wine6-stable")
if os.system("which deepin-wine8-stable > /dev/null"):
print("请问是否要安装 deepin-wine8-stable[Y/N]", end=' ')
choose = input().upper()
if not choose == "N":
InstallWineWithYay("deepin-wine8-stable")
print("全部完成!")
exit()
os.system("sudo apt update")
print("请问是否要更新操作系统?[Y/N]", end=' ')
choose = input().upper()

View File

@@ -9,6 +9,7 @@ import getpass
import datetime
import traceback
import subprocess
import webbrowser
import configparser
import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
@@ -101,6 +102,78 @@ def FileToBase64(filePath):
def SaveLogWindow():
pass
def OpenUrl(url):
print(url.url())
# 判断是否可以使用小窗打开
webbrowser.open_new_tab(url.url())
def Appreciate():
global messageAppreciate
messageAppreciate = QtWidgets.QTextBrowser()
messageAppreciate.setHtml(f"""<h3>请作者喝杯茶</h3>
<p>如果您觉得 Wine 运行器对你有帮助,可以请作者喝杯茶 </p>
<p>
<img src="{programPath}/Icon/QR/Wechat.png" width="250" />
<img src="{programPath}/Icon/QR/Alipay.jpg" width="250" />
<img src="{programPath}/Icon/QR/QQ.png" width="250" >
</p>
<hr/>
<h3>广告</h3>
<p>支付宝官方活动,扫描获得支付红包!</p>
<p><img src="{programPath}/Icon/QR/advertisement0.jpg" width="250" ></p>""")
messageAppreciate.resize(int(messageAppreciate.frameGeometry().width() * 1.5), int(messageAppreciate.frameGeometry().height() * 1.2))
messageAppreciate.setWindowTitle("赞赏作者/请作者喝杯茶")
messageAppreciate.show()
# 显示“关于这个程序”窗口
def about_this_program()->"显示“关于这个程序”窗口":
global about
global title
global iconPath
global clickIconTime
clickIconTime = 0
QT.message = QtWidgets.QMainWindow()
QT.message.setWindowIcon(QtGui.QIcon(iconPath))
messageWidget = QtWidgets.QWidget()
messageWidget.setObjectName("messageWidget")
messageWidget.setStyleSheet(f"QWidget#messageWidget {{background: url({programPath}/Icon/Program/about-background.png) no-repeat;background-position: left bottom;}}")
QT.message.setWindowTitle(f"关于 {title}")
messageLayout = QtWidgets.QGridLayout()
iconShow = QtWidgets.QLabel(f"<a href='https://www.gfdgdxi.top'><img width=256 src='{iconPath}'></a>")
def ChangeIcon():
global clickIconTime
if clickIconTime >= 0:
clickIconTime = clickIconTime + 1
if clickIconTime > 0:
clickIconTime = -1
for k in ["", "Function", "Program"]:
try:
for i in os.listdir(f"{programPath}/Icon/{k}"):
if i[-4:] == ".svg" or i[-4:] == ".png":
iconPathList.append(f"{programPath}/Icon/{k}/{i}")
except:
traceback.print_exec()
randomNumber = random.randint(0, len(iconPathList) - 1)
iconShow.setText(f"<a href='https://www.gfdgdxi.top'><img width=256 src='{iconPathList[randomNumber]}'></a><p align='center'>{randomNumber + 1}/{len(iconPathList)}</p>")
iconShow.linkActivated.connect(ChangeIcon)
messageLayout.addWidget(iconShow, 0, 0, 1, 1, QtCore.Qt.AlignTop)
aboutInfo = QtWidgets.QTextBrowser(messageWidget)
aboutInfo.setFocusPolicy(QtCore.Qt.NoFocus)
#aboutInfo.copyAvailable.connect(lambda: print("b"))
aboutInfo.anchorClicked.connect(OpenUrl)
aboutInfo.setOpenLinks(False)
aboutInfo.setHtml(about)
aboutInfo.setOpenExternalLinks(False)
messageLayout.addWidget(aboutInfo, 0, 1, 1, 1)
ok = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "确定"))
ok.clicked.connect(QT.message.close)
messageLayout.addWidget(ok, 1, 1, 1, 1, QtCore.Qt.AlignBottom | QtCore.Qt.AlignRight)
messageWidget.setLayout(messageLayout)
QT.message.setCentralWidget(messageWidget)
QT.message.resize(int(messageWidget.frameGeometry().width() * 1.5), int(messageWidget.frameGeometry().height() * 1.5))
QT.message.show()
class SaveLogReport():
userName = getpass.getuser()
time = datetime.datetime.now().strftime("%Y/%m/%d %H:%M:%S")

BIN
Icon/Program/about-background.png Executable file

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.9 KiB

BIN
Icon/QR/Alipay.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 270 KiB

BIN
Icon/QR/QQ.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 66 KiB

BIN
Icon/QR/Wechat.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 76 KiB

BIN
Icon/QR/advertisement0.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 338 KiB

View File

@@ -21,13 +21,13 @@ if [[ $? == 0 ]]; then
fi
echo 使用国内源
#sudo wget https://ryanfortner.github.io/box86-debs/box86.list -O /etc/apt/sources.list.d/box86.list
sudo bash -c "echo deb http://seafile.jyx2048.com:2345/spark-deepin-wine-runner/data/box86-debs/debian ./ > /etc/apt/sources.list.d/box86.list"
wget -qO- http://seafile.jyx2048.com:2345/spark-deepin-wine-runner/data/box86-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg
sudo bash -c "echo deb http://gfdgdxi.v5.idcfengye.com/spark-deepin-wine-runner/data/box86-debs/debian ./ > /etc/apt/sources.list.d/box86.list"
wget -qO- http://gfdgdxi.v5.idcfengye.com/spark-deepin-wine-runner/data/box86-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box86-debs-archive-keyring.gpg
echo "adding key..."
installBox=box86-generic-arm
if [[ $PCArch == "arm64" ]]; then
sudo bash -c "echo deb http://seafile.jyx2048.com:2345/spark-deepin-wine-runner/data/box64-debs/debian ./ > /etc/apt/sources.list.d/box64.list"
wget -qO- http://seafile.jyx2048.com:2345/spark-deepin-wine-runner/data/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg
sudo bash -c "echo deb http://gfdgdxi.v5.idcfengye.com/spark-deepin-wine-runner/data/box64-debs/debian ./ > /etc/apt/sources.list.d/box64.list"
wget -qO- http://gfdgdxi.v5.idcfengye.com/spark-deepin-wine-runner/data/box64-debs/KEY.gpg | sudo gpg --dearmor -o /etc/apt/trusted.gpg.d/box64-debs-archive-keyring.gpg
installBox="box86-generic-arm box64-generic-arm"
sudo dpkg --add-architecture armhf
fi
@@ -40,8 +40,8 @@ echo 按回车键后将会自动安装包名为 box86-generic-arm、box64-generi
echo 其他特殊版本及其包名可见如下链接(如适用于 rk3399 的版本):
echo " - Box64https://github.com/ryanfortner/box64-debs/"
echo " - Box86https://github.com/ryanfortner/box86-debs/"
echo " - Box64国内镜像http://seafile.jyx2048.com:2345/spark-deepin-wine-runner/data/box64-debs"
echo " - Box64国内镜像http://seafile.jyx2048.com:2345/spark-deepin-wine-runner/data/box86-debs"
echo " - Box64国内镜像http://gfdgdxi.v5.idcfengye.com/spark-deepin-wine-runner/data/box64-debs"
echo " - Box64国内镜像http://gfdgdxi.v5.idcfengye.com/spark-deepin-wine-runner/data/box86-debs"
read
sudo apt install -y $installBox
echo 安装完成!按回车键退出

View File

@@ -6,6 +6,22 @@ if [[ $? == 0 ]]; then
read
exit 1
fi
# 判断是不是 Fedora
if [[ -f /etc/fedora-release ]]; then
sudo yum update -y
sudo yum install qemu-user qemu-user-static -y
echo 安装完成,按回车键后退出
read
exit
fi
# 判断是不是 Arch Linux
if [[ -f /etc/arch-release ]]; then
sudo pacman -Syu
sudo pacman -S qemu-user qemu-user-static --noconfirm
echo 安装完成,按回车键后退出
read
exit
fi
sudo apt update
sudo apt install binfmt-support qemu-user qemu-user-static -y
echo 安装完成,按回车键后退出

View File

@@ -1,14 +1,40 @@
build:
make package -j$(nproc)
make package-deb -j$(nproc)
replace:
rm Icon/Program/*
rm Icon/*.svg
rm Icon/doge.png
echo "[[], []]" > IconList.json
clean:
python3 RemovePycacheFile.py
rm *.deb -fv
cd VM-source ; make clean
rm *.pkg.tar* -fv
cd VM-source ; qmake . ; make clean
rm VM-source/VirtualMachine -rfv
rm -rfv VM-source/.qmake.stash
package:
#package-rpm:
package-rpm:
sudo rm -rf /root/rpmbuild/
sudo rm -rf /tmp/deep-wine-runner-builder-source
mkdir /tmp/deep-wine-runner-builder-source -pv
cp * /tmp/deep-wine-runner-builder-source -rv
cp rpm/spark-deepin-wine-runner.spec /tmp/spark-deepin-wine-runner.spec
bash builddeb/ChangeDebVersion.sh
sudo rpmbuild -bb /tmp/spark-deepin-wine-runner.spec --target noarch
sudo bash -c 'cp /root/rpmbuild/RPMS/noarch/spark-deepin-wine-runner-*.rpm .'
sudo rm -rf /root/rpmbuild/
sudo rm -rf /tmp/deep-wine-runner-builder-source
package-pkg:
#sudo debtap -u
sudo debtap -Q spark-deepin-wine-runner.deb
sudo debtap -Q spark-deepin-wine-runner-ace.deb
package-deb:
#cd VM-source && qmake
#cd VM-source && make
#cd wine && make
@@ -16,7 +42,6 @@ package:
mkdir deb/opt/apps/deepin-wine-runner/LANG -pv
cp -rv helperset deb/opt/apps/deepin-wine-runner/
#cp -rv VM-source/VirtualMachine VM
cp -rv VM-source/deepin-wine-runner.svg VM
cp -rv VM-source/Windows7X64Auto.iso VM
cp -rv VM-source/Windows7X86Auto.iso VM
@@ -152,7 +177,8 @@ package:
ln -s /opt/apps/deepin-wine-runner/InstallVisualCPlusPlus.py /tmp/spark-deepin-wine-runner-builder/usr/bin/deepin-wine-runner-wine-vscppruntime-installer
ln -s /opt/apps/deepin-wine-runner/deepin-wine-venturi-setter.py /tmp/spark-deepin-wine-runner-builder/usr/bin/deepin-wine-venturi-setter
bash builddeb/ChangeDebVersion.sh
sudo chown -R root:root /tmp/spark-deepin-wine-runner-builder
chmod -Rv 777 /tmp/spark-deepin-wine-runner-builder/opt
chmod -Rv 777 /tmp/spark-deepin-wine-runner-builder/usr
dpkg-deb -Z xz -z 9 -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner.deb
sudo rm -rfv /tmp/spark-deepin-wine-runner-builder

View File

@@ -36,3 +36,21 @@ if terminal == "":
app = QtWidgets.QApplication(sys.argv)
QtWidgets.QMessageBox.critical(None, "错误", "无法识别到以下的任意一个终端\n" + " ".join(terminalList))
exit()
# 转包
class TurnDeb():
debPath = ""
def __init__(self, debPath):
self.debPath = debPath
def ToRpm(self):
if os.system("which alien"):
raise NameError("无法找到 alien 命令,请先安装 alien")
if os.system("which fakeroot"):
raise NameError("无法找到 fakeroot 命令,请先安装 fakeroot")
os.system(f"fakeroot alien -r '{self.debPath}' -c")
def ToTarZst(self):
if os.system("debtap"):
raise NameError("无法找到 debtap 命令,请先安装 debtap")
os.system(f"debtap -Q '{self.debPath}'")

View File

@@ -1,4 +1,20 @@
#!/bin/bash
# 如果是 Fedora
if [[-f /etc/fedora-release ]]; then
sudo yum update -y
sudo yum install qemu
echo 安装完成!按回车键退出
read
exit
fi
# 如果是 Arch Linux
if [[-f /etc/arch-release ]]; then
sudo pacman -Syu
sudo pacman -S qemu-user qemu-user-static qemu-full --noconfirm
echo 安装完成!按回车键退出
read
exit
fi
sudo apt update
sudo apt install qemu-system qemu-user qemu-efi qemu-efi-aarch64 qemu-efi-arm -y
sudo apt install qemu-user-static binfmt-support qemu-system-gui -y

121
README.md
View File

@@ -1,5 +1,5 @@
<p width=100px align="center"><img src="https://storage.deepin.org/thread/202208031419283599_deepin-wine-runner.png"></p>
<h1 align="center">Wine 运行器 3.6.1</h1>
<h1 align="center">Wine 运行器 3.7.0</h1>
<hr>
<a href='https://gitee.com/gfdgd-xi/deep-wine-runner/stargazers'><img src='https://gitee.com/gfdgd-xi/deep-wine-runner/badge/star.svg?theme=dark' alt='star'></img></a>
<a href='https://gitee.com/gfdgd-xi/deep-wine-runner/members'><img src='https://gitee.com/gfdgd-xi/deep-wine-runner/badge/fork.svg?theme=dark' alt='fork'></img></a>
@@ -10,6 +10,9 @@ Wine运行器是一个能让Linux用户更加方便地运行Windows应用的程
而且对于部分 Wine 应用适配者来说,提供了图形化的打包工具,以及提供了一些常用工具以及运行库的安装方式,以及能安装多种不同的 Wine 以测试效果,能极大提升适配效率。
且对于 Deepin23 用户做了特别优化,以便能在缺少 i386 运行库的情况下运行 Wine32。同时也为非 X86 架构用户提供了 Box86/64、Qemu User 的安装方式
注:
**在使用运行器时不要随便动 .deepinwine 下的容器,否则会导致安装的 wine 应用无法正常打开**
**除非你有把握不会损坏容器**
![截图_选择区域_20221002221112.png](https://storage.deepin.org/thread/202210022215217037_截图_选择区域_20221002221112.png)
@@ -21,9 +24,21 @@ Wine 运行器 QQ 交流群762985460
Wine运行器 QQ 频道https://pd.qq.com/s/edqkgeydx
Wine 运行器离线包下载地址https://www.123pan.com/s/pDSKVv-pAJWv.html
### 注
spark-deepin-wine-runner 是普通包spark-deepin-wine-runner-ace 是使用 ace 兼容环境运行的运行器
## Wine 运行器离线包
### X86
123panhttps://www.123pan.com/s/pDSKVv-pAJWv.html
百度网盘https://pan.baidu.com/s/1klBw63tw2_ZQLzmi11dDBw?pwd=7bu5 提取码: 7bu5
诚通网盘http://ctfile.gfdgdxi.top/d/31540479-59254792-909739?p=2061 (访问密码: 2061)
Githubhttps://github.com/gfdgd-xi/deep-wine-runner/releases/
Sourceforgehttps://sourceforge.net/projects/deep-wine-runner/files/
更多需求需要私聊作者定制(有偿服务)
### ARM
需要私聊作者定制(有偿服务)
## 软件架构
理论上支持全架构,如果 Python 能运行的话
非 X86 架构会利用到 `box86`/`box64``exagear``qemu` 等技术
@@ -120,8 +135,30 @@ desktop文件中StartupWMClass字段。用于让桌面组件将窗口类名与de
![image.png](https://storage.deepin.org/thread/202207190822204627_image.png)
## 更新日志
### 3.7.02023年02月02日
**※1、修复简易打包器在 Deepin/UOS 上无法正常启动的问题**
**※2、打包器生成的 deb 修复在非 Deepin/UOS 且未安装星火应用商店的系统中启动器无程序图标的问题**
**※3、修复 Box86/64 国内源源失效的问题**
**※4、适配 Arch Linux**
**※5、适配 Fedora**
**※6、打包器支持将 deb 包转换为其它格式**
**※7、适配 deepin 23 beta3**
8、新增公告和新版本提示功能
9、修复公告的链接在部分机器无法正常打开的问题
10、新增赞赏入口
11、支持识别 spark-wine9、spark-wine9-wow
![截图_deepin-wine-runner_20240202211238.png](https://storage.deepin.org/thread/20240202131540242_截图_deepin-wine-runner_20240202211238.png)
![VirtualBox_Fedora_02_02_2024_21_00_31.png](https://storage.deepin.org/thread/202402021315383577_VirtualBox_Fedora_02_02_2024_21_00_31.png)
![VirtualBox_Manjaro_02_02_2024_20_46_37.png](https://storage.deepin.org/thread/202402021315363571_VirtualBox_Manjaro_02_02_2024_20_46_37.png)
### 3.6.12023年12月25日
**※1、修复应用无法打开的问题**
**※1、修复应用无法打开的问题**
**※2、修改错别字**
### 3.6.02023年12月24日
**※1、修复高级打包器选择软件适配脚本后无法打包的问题 https://gitee.com/gfdgd-xi/deep-wine-runner/issues/I8I110**
@@ -577,40 +614,18 @@ desktop文件中StartupWMClass字段。用于让桌面组件将窗口类名与de
### 1.0.02021年01月29日
1. 实现内容
## 源码安装教程
1. 安装需要的依赖
## 构建安装包
### deb
```bash
sudo apt install git make
make package-deb -j4
```
2. 下载仓库
### pkg
```bash
git clone https://gitee.com/gfdgd-xi/deep-wine-runner.git
cd deep-wine-runner
```
3. 从源码运行程序(如果是从源码安装请跳过这一步)
```bash
make depend
make run
```
4. 从源码安装程序
```bash
make install
make package-deb -j4
make package-pkg -j4
```
## Openkylin 如何安装这个 Wine 运行器?
首先添加作者的源:
Gitlink 源(国内推荐):
```bash
wget https://code.gitlink.org.cn/gfdgd_xi/gfdgd-xi-apt-mirrors/raw/branch/master/sources/gitlink.sh && bash gitlink.sh && rm gitlink.sh
```
Github 源(国外推荐):
```bash
wget https://gfdgd-xi.github.io/gfdgd-xi-apt-mirrors/sources/github.sh && bash github.sh && rm github.sh
```
上面二选一,添加完后执行
```bash
sudo apt install spark-deepin-wine-runner
```
即可自动补全依赖安装(说实话 openkylin 缺的依赖好多)
现在可以直接安装了
## 对于 Deepin/UOSAMD64 平台)小白如何使用该程序?
下面是送给小白的 wine 运行器简单使用方法先声明wine 并***不能完美的运行所有 exe 文件***,利用此 wine 运行器简易安装可执行文件的方法如下:
@@ -624,42 +639,10 @@ sudo apt install spark-deepin-wine-runner
![image.png](https://storage.deepin.org/thread/202207191920282406_image.png)
## 稍微讲一下目前 deepin 23 Preview 运行自定义 exe 的方法Wine 运行器均已支持)
### 方法一
随便安装一个 linglong 格式包的 wine 程序(要记住包名),然后在终端输入
```bash
ll-cli run 包名 --exec '/bin/deepin-wine6-stable'
```
即可,缺陷可看运行器上方小提示第 6 点
### 方法二(容易翻车)
添加 Deepin 20 的**官方源和商店源**,然后输入如下的命令:**切记不能sudo apt upgrade**,会出现的问题可以看运行器的小提示第 7 点,以及无法保证所有 Wine 均可运行
```bash
sudo dpkg --add-architecture i386
sudo apt update
# 安装普通的 Wine
sudo apt install wine
# 安装 deepin-wine5-stable本机测试 X64 的 Wine 跑不了)
sudo apt install deepin-wine5-stable
# 安装 deepin-wine6-stable
sudo apt install deepin-wine6-stable
```
**使用完后最好删除掉 Deepin 20 的官方源和商店源,防止出问题**
可以看 [@ThinkYoung](user/18570) 写的 https://bbs.deepin.org/post/241148可以参考借鉴
### 方法三
我不知道了,希望能有大佬提供更好的解决方案
## 下载链接
Giteehttps://gitee.com/gfdgd-xi/deep-wine-runner
Githubhttps://github.com/gfdgd-xi/deep-wine-runner
Gitlinkhttps://www.gitlink.org.cn/gfdgd_xi/deep-wine-runner
Sourceforgehttps://sourceforge.com/projects/deep-wine-runner
蓝奏云https://gfdgdxi.lanzouj.com/b01nz7y3e密码:7oii
星火应用商店spk://store/tools/spark-deepin-wine-runner
@@ -745,4 +728,14 @@ 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" >
### 广告
支付宝官方活动,扫描获得支付红包!
<p><img src="Icon/QR/advertisement0.jpg" width="250" ></p>
# ©2020-Now gfdgd xi

View File

@@ -29,7 +29,16 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
CpuCoreNum=`grep 'core id' /proc/cpuinfo | sort -u | wc -l`
# 查看逻辑CPU的个数
CpuCount=`cat /proc/cpuinfo| grep "processor"| wc -l`
# 判断是否检测异常,如果异常则使用默认值
if [[ $CpuSocketNum == 0 ]]; then
CpuSocketNum=1
fi
if [[ $CpuCoreNum == 0 ]]; then
CpuCoreNum=1
fi
if [[ $CpuCount == 0 ]]; then
CpuCount=2
fi
# 总内存大小GB
MemTotal=`awk '($1 == "MemTotal:"){printf "%.2f\n",$2/1024/1024}' /proc/meminfo`
use=$(echo "scale=4; $MemTotal / 3" | bc)

View File

@@ -1,6 +1,6 @@
#############################################################################
# Makefile for building: VirtualMachine
# Generated by qmake (3.1) (Qt 5.15.7)
# Generated by qmake (3.1) (Qt 5.15.8)
# Project: VirtualMachine.pro
# Template: app
# Command: /usr/lib/qt5/bin/qmake -o Makefile VirtualMachine.pro
@@ -127,6 +127,7 @@ DIST = en_US.qm \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_designer.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_devicediscovery_support_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dtkcore.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dtkdeclarative.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dtkgui.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_DtkWidget.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_edid_support_private.pri \
@@ -172,6 +173,10 @@ DIST = en_US.qm \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uiplugin.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uitools.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_vulkan_support_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandclient.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandclient_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandcompositor.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandcompositor_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webchannel.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webengine.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webenginecore.pri \
@@ -184,6 +189,7 @@ DIST = en_US.qm \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xkbcommon_support_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_QApt.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_Solid.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_SonnetCore.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_SonnetUi.pri \
@@ -283,6 +289,7 @@ Makefile: VirtualMachine.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qma
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_designer.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_devicediscovery_support_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dtkcore.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dtkdeclarative.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dtkgui.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_DtkWidget.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_edid_support_private.pri \
@@ -328,6 +335,10 @@ Makefile: VirtualMachine.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qma
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uiplugin.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uitools.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_vulkan_support_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandclient.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandclient_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandcompositor.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandcompositor_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webchannel.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webengine.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webenginecore.pri \
@@ -340,6 +351,7 @@ Makefile: VirtualMachine.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qma
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xkbcommon_support_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_QApt.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_Solid.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_SonnetCore.pri \
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_SonnetUi.pri \
@@ -418,6 +430,7 @@ Makefile: VirtualMachine.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qma
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_designer.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_devicediscovery_support_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dtkcore.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dtkdeclarative.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_dtkgui.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_DtkWidget.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_edid_support_private.pri:
@@ -463,6 +476,10 @@ Makefile: VirtualMachine.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qma
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uiplugin.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_uitools.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_vulkan_support_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandclient.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandclient_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandcompositor.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_waylandcompositor_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webchannel.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webengine.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_webenginecore.pri:
@@ -475,6 +492,7 @@ Makefile: VirtualMachine.pro /usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++/qma
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xkbcommon_support_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_lib_xml_private.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_QApt.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_Solid.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_SonnetCore.pri:
/usr/lib/x86_64-linux-gnu/qt5/mkspecs/modules/qt_SonnetUi.pri:
@@ -593,17 +611,17 @@ compiler_moc_header_clean:
moc_mainwindow.cpp: mainwindow.h \
moc_predefs.h \
/usr/lib/qt5/bin/moc
/usr/lib/qt5/bin/moc $(DEFINES) --include /home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/moc_predefs.h -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/11 -I/usr/include/x86_64-linux-gnu/c++/11 -I/usr/include/c++/11/backward -I/usr/lib/gcc/x86_64-linux-gnu/11/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include mainwindow.h -o moc_mainwindow.cpp
/usr/lib/qt5/bin/moc $(DEFINES) --include /home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/moc_predefs.h -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/13 -I/usr/include/x86_64-linux-gnu/c++/13 -I/usr/include/c++/13/backward -I/usr/lib/gcc/x86_64-linux-gnu/13/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include mainwindow.h -o moc_mainwindow.cpp
moc_infoutils.cpp: infoutils.h \
moc_predefs.h \
/usr/lib/qt5/bin/moc
/usr/lib/qt5/bin/moc $(DEFINES) --include /home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/moc_predefs.h -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/11 -I/usr/include/x86_64-linux-gnu/c++/11 -I/usr/include/c++/11/backward -I/usr/lib/gcc/x86_64-linux-gnu/11/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include infoutils.h -o moc_infoutils.cpp
/usr/lib/qt5/bin/moc $(DEFINES) --include /home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/moc_predefs.h -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/13 -I/usr/include/x86_64-linux-gnu/c++/13 -I/usr/include/c++/13/backward -I/usr/lib/gcc/x86_64-linux-gnu/13/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include infoutils.h -o moc_infoutils.cpp
moc_qemusetting.cpp: qemusetting.h \
moc_predefs.h \
/usr/lib/qt5/bin/moc
/usr/lib/qt5/bin/moc $(DEFINES) --include /home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/moc_predefs.h -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/11 -I/usr/include/x86_64-linux-gnu/c++/11 -I/usr/include/c++/11/backward -I/usr/lib/gcc/x86_64-linux-gnu/11/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include qemusetting.h -o moc_qemusetting.cpp
/usr/lib/qt5/bin/moc $(DEFINES) --include /home/gfdgd_xi/Desktop/deep-wine-runner/VM-source/moc_predefs.h -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++ -I/home/gfdgd_xi/Desktop/deep-wine-runner/VM-source -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtWidgets -I/usr/include/x86_64-linux-gnu/qt5/QtGui -I/usr/include/x86_64-linux-gnu/qt5/QtNetwork -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/include/c++/13 -I/usr/include/x86_64-linux-gnu/c++/13 -I/usr/include/c++/13/backward -I/usr/lib/gcc/x86_64-linux-gnu/13/include -I/usr/local/include -I/usr/include/x86_64-linux-gnu -I/usr/include qemusetting.h -o moc_qemusetting.cpp
compiler_moc_objc_header_make_all:
compiler_moc_objc_header_clean:

View File

@@ -3,5 +3,10 @@
cd `dirname $0`
export PROGRAMVERSION=`python3 GetProgramVersion.py`
export SIZE=`du /tmp/spark-deepin-wine-runner-builder/ | tail -n1 | awk '{print $1}'`
sed -i "s%@@VERSION@@%$PROGRAMVERSION%g" /tmp/spark-deepin-wine-runner-builder/DEBIAN/control
sed -i "s%@@SIZE@@%$SIZE%g" /tmp/spark-deepin-wine-runner-builder/DEBIAN/control
if [[ -f /tmp/spark-deepin-wine-runner-builder/DEBIAN/control ]]; then
sed -i "s%@@VERSION@@%$PROGRAMVERSION%g" /tmp/spark-deepin-wine-runner-builder/DEBIAN/control
sed -i "s%@@SIZE@@%$SIZE%g" /tmp/spark-deepin-wine-runner-builder/DEBIAN/control
fi
if [[ -f /tmp/spark-deepin-wine-runner.spec ]]; then
sed -i "s%@@VERSION@@%$PROGRAMVERSION%g" /tmp/spark-deepin-wine-runner.spec
fi

View File

@@ -8,12 +8,14 @@ Certainty: possible
Check: binaries
Type: binary, udeb
Priority: optional
Depends: python3, python3-pil, libc6, python3-pil.imagetk, python3-pyquery, aria2, curl, unrar | unrar-free , unzip, python3-requests, python3-pyqt5, python3-psutil, deepin-terminal | mate-terminal | gnome-terminal | xfce4-terminal, python3-dbus, python3-pip, p7zip-full, sudo, python3-pyperclip, bubblewrap, zenity, tree
Recommends: winbind, wimtools, python3-pyqt5.qtwebengine, binfmt-support, libc6:i386, libc6:armhf, libwine
Depends: python3, python3-pil, libc6, python3-pil.imagetk, python3-pyquery, aria2, curl, unrar | unrar-free , unzip, python3-requests, python3-pyqt5, python3-psutil, deepin-terminal | mate-terminal | gnome-terminal | xfce4-terminal, python3-dbus, python3-pip, p7zip-full, sudo, python3-pyperclip, bubblewrap, zenity, tree, dpkg, fakeroot
Recommends: winbind, wimtools, python3-pyqt5.qtwebengine, binfmt-support, libc6:i386, libc6:armhf, libwine, qemu-system, qemu-full, alien
Section: utils
Conflicts: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52
Replaces: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52
Provides: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52
Installed-Size: @@SIZE@@
Description: Wine运行器是一个能让Linux用户更加方便地运行Windows应用的程序内置了对Wine图形化的支持、各种Wine工具、自制的Wine程序打包器运行库安装工具等。
它同时还内置了基于Qemu/VirtualBox制作的、专供小白使用的Windows虚拟机安装工具可以做到只需下载系统镜像并点击安装即可无需考虑虚拟机的安装、创建、分区等操作也能在非 X86 架构安装 X86 架构的 Windows 操作系统(但是效率较低)。
Description: Wine运行器是一个能让Linux用户更加方便地运行Windows应用的程序。原版的 Wine 只能使用命令操作且安装过程较为繁琐对小白不友好。于是该运行器为了解决该痛点内置了对Wine图形化的支持、Wine 安装器、微型应用商店、各种Wine工具、自制的Wine程序打包器运行库安装工具等。
它同时还内置了基于Qemu/VirtualBox制作的、专供小白使用的Windows虚拟机安装工具可以做到只需下载系统镜像并点击安装即可无需考虑虚拟机的安装、创建、分区等操作也能在非 X86 架构安装 X86 架构的 Windows 操作系统(但是效率较低,可以运行些老系统)。
而且对于部分 Wine 应用适配者来说,提供了图形化的打包工具,以及提供了一些常用工具以及运行库的安装方式,以及能安装多种不同的 Wine 以测试效果,能极大提升适配效率。
且对于 Deepin23 用户做了特别优化,以便能在缺少 i386 运行库的情况下运行 Wine32。同时也为非 X86 架构用户提供了 Box86/64、Qemu User 的安装方式

View File

@@ -11,8 +11,20 @@
# 程序版本号
version=3.4.1
echo 安装组件
#python3 -m pip install --upgrade pyqt5 --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
#python3 -m pip install --upgrade PyQtWebEngine --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
python3 -m pip install --upgrade pynput --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple --break-system-packages > /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 --break-system-packages > /dev/null 2>&1 | true
# 用于解决老版本 pip 没 --break-system-packages 参数的问题
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
echo 执行完成
echo 移除旧组件
if [ -d /opt/apps/deepin-wine-runner/arm-package ]; then
@@ -29,7 +41,7 @@ if [ -d /opt/apps/deepin-wine-runner/dxvk ]; then
fi
echo 移除完成
# 如果为非 X86 PC可以删除掉一些无用组件主要是用不了
if [ `arch` != "x86_64" ]; then
if [[ `arch` != "x86_64" ]]; then
echo 非X86架构删除对非X86架构无用的组件
# 删除虚拟机功能
#rm -rf /opt/apps/deepin-wine-runner/StartVM.sh
@@ -84,6 +96,6 @@ fi
# fi
#fi
# 设置目录权限,让用户可读可写,方便后续删除组件
chmod 777 -R /opt/apps/deepin-wine-runner
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

@@ -3,11 +3,13 @@ import os
import sys
import json
import time
import threading
import updatekiller
import random
try:
import xpinyin
except:
os.system("python3 -m pip install --upgrade xpinyin --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple")
os.system("python3 -m pip install --upgrade xpinyin --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple --break-system-packages")
import xpinyin
import traceback
@@ -137,7 +139,19 @@ info = f'''{{
"installed_apps": false
}}
}}'''
postinst = f"""#!/bin/bash
PACKAGE_NAME="@@@Package@@@"
for username in $(ls /home)
do
echo /home/$username
if [ -d /home/$username/桌面 ]; then
cp /opt/apps/$PACKAGE_NAME/entries/applications/* /home/$username/桌面
fi
if [ -d /home/$username/Desktop ]; then
cp /opt/apps/$PACKAGE_NAME/entries/applications/* /home/$username/Desktop
fi
done
"""
postrm = f"""#!/bin/bash
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
@@ -525,6 +539,7 @@ class RunThread(QtCore.QThread):
self.RunCommand(f"mkdir -pv '{debBuildPath}/DEBIAN'")
self.RunCommand(f"mkdir -pv '{debBuildPath}/opt/apps/{debPackageName}/files'")
self.RunCommand(f"mkdir -pv '{debBuildPath}/opt/apps/{debPackageName}/entries/applications'")
self.RunCommand(f"mkdir -pv '{debBuildPath}/usr/share/applications'")
#self.RunCommand(f"mkdir -pv '{debBuildPath}/opt/apps/{debPackageName}/entries/icons/hicolor/scalable/apps/'")
############ 处理容器
# 对用户目录进行处理
@@ -560,21 +575,25 @@ class RunThread(QtCore.QThread):
["@@@Wine@@@", chooseWine]
]
debControl = ReplaceText(control, replaceMap)
debPostinst = ReplaceText(postinst, replaceMap)
debPostrm = ReplaceText(postrm, replaceMap)
debInfo = ReplaceText(info, replaceMap)
debRunSh = ReplaceText(runsh, replaceMap)
debDesktop = ReplaceText(desktopFile, replaceMap)
########### 写入文件
WriteTxt(f"{debBuildPath}/opt/apps/{debPackageName}/entries/applications/{debPackageName}.desktop", debDesktop)
WriteTxt(f"{debBuildPath}/usr/share/applications/{debPackageName}.desktop", debDesktop)
WriteTxt(f"{debBuildPath}/opt/apps/{debPackageName}/files/run.sh", debRunSh)
WriteTxt(f"{debBuildPath}/opt/apps/{debPackageName}/info", debInfo)
WriteTxt(f"{debBuildPath}/DEBIAN/control", debControl)
WriteTxt(f"{debBuildPath}/DEBIAN/postinst", debPostinst)
WriteTxt(f"{debBuildPath}/DEBIAN/postrm", debPostrm)
########### 赋值权限
self.RunCommand(f"chmod -Rv 644 '{debBuildPath}/opt/apps/{debPackageName}/info'")
self.RunCommand(f"chmod -Rv 0755 '{debBuildPath}/DEBIAN'")
self.RunCommand(f"chmod -Rv 755 '{debBuildPath}/opt/apps/{debPackageName}/files/'*.sh")
self.RunCommand(f"chmod -Rv 755 '{debBuildPath}/opt/apps/{debPackageName}/entries/applications/'*.desktop")
self.RunCommand(f"chmod -Rv 755 '{debBuildPath}/usr/share/applications/'*.desktop")
########### 打包 deb
print(debPackageVersion)
self.RunCommand(f"dpkg-deb -Z xz -b '{debBuildPath}' '{desktopPath}/{debPackageName}_{debPackageVersion}_all.deb'")
@@ -643,15 +662,18 @@ if __name__ == "__main__":
""")
wineChooserList = [
"使用 Deepin Wine8 Stable 打包应用",
"使用 Spark Wine9 wow 打包应用",
"使用 Spark Wine9 打包应用",
"使用 Spark Wine8 打包应用",
"使用 Spark Wine7 Devel 打包应用",
"使用 Deepin Wine6 Stable 打包应用",
"使用 Deepin Wine5 Stable 打包应用",
"使用 Deepin Wine5 打包应用",
"使用 Deepin Wine2 打包应用"
"使用 Deepin Wine2 打包应用",
"使用 Spark Wine 打包应用"
]
wineChooserIndex = 2
wineList = ["deepin-wine8-stable", "spark-wine8", "spark-wine7-devel", "deepin-wine6-stable", "deepin-wine6-vannila", "spark-wine8-wow", "deepin-wine5-stable", "deepin-wine5", "deepin-wine"]
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"]
for i in range(len(wineList)):
if not os.system(f"which '{wineList[i]}'"):
wineChooserIndex = i
@@ -664,14 +686,22 @@ if __name__ == "__main__":
buildButton = QtWidgets.QPushButton("现在打包……")
installCmpleteButton = QtWidgets.QPushButton("安装程序执行完成")
helpButton = QtWidgets.QPushButton("帮助")
installUosPackingTool = QtWidgets.QPushButton("安装维护工具箱(可以安装测试 deb")
browserExeButton.clicked.connect(BrowserExe)
buildButton.clicked.connect(RunBuildThread)
installCmpleteButton.clicked.connect(PressCompleteDownload)
helpButton.clicked.connect(ReadMe)
def InstallUosPackingTool():
if os.system("which spark-store"):
QtWidgets.QMessageBox.critical(window, "提示", "未安装星火应用商店,无法继续\n星火应用商店官网https://spark-app.store/")
return 0
threading.Thread(target=os.system, args=["spark-store spk://store/tools/uos-packaging-tools"]).start()
installUosPackingTool.clicked.connect(InstallUosPackingTool)
installCmpleteButton.setDisabled(True)
controlLayout.addWidget(buildButton)
controlLayout.addWidget(installCmpleteButton)
controlLayout.addWidget(helpButton)
controlLayout.addWidget(installUosPackingTool)
layout.addWidget(QtWidgets.QLabel("选择 EXE"), 0, 0)
layout.addWidget(exePath, 0, 1)
layout.addWidget(browserExeButton, 0, 2)
@@ -689,4 +719,4 @@ if __name__ == "__main__":
window.show()
# 设置字体
SetFont(app)
sys.exit(app.exec_())
sys.exit(app.exec_())

View File

@@ -26,6 +26,7 @@ import PyQt5.QtCore as QtCore
import PyQt5.QtWidgets as QtWidgets
from trans import *
from DefaultSetting import *
from Model import *
#################
# 程序所需事件
@@ -48,6 +49,7 @@ def button4_cl():
def disabled_or_NORMAL_all(choose):
choose = not choose
enableCopyIconToDesktop.setDisabled(choose)
disabledMono.setDisabled(choose)
e1_text.setDisabled(choose)
e2_text.setDisabled(choose)
@@ -269,16 +271,21 @@ def make_deb(build=False):
disabled_or_NORMAL_all(True)
return
# 警告信息
if os.path.exists(e7_text.text()):
if QtWidgets.QMessageBox.warning(window, "警告", "输入的路径似乎是一个绝对路径\n不建议打包绝对路径,建议是 Wine 容器内路径\n是否继续打包?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No) == QtWidgets.QMessageBox.No:
disabled_or_NORMAL_all(True)
return
if e7_text.text()[:2].lower() == "c:" and not os.path.exists("{}/drive_c/{}".format(
e6_text.text(),
e7_text.text()[3:].replace("\\", '/'))):
if QtWidgets.QMessageBox.warning(window, "警告", "输入的路径似乎在 Wine 容器不存在(如果只是大小写错误导致的误判,请忽略)\n是否继续打包?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No) == QtWidgets.QMessageBox.No:
disabled_or_NORMAL_all(True)
return
for i in iconUiList:
if os.path.exists(i[0].text()):
if QtWidgets.QMessageBox.warning(window, "警告", "输入的路径似乎是一个绝对路径\n不建议打包绝对路径,建议是 Wine 容器内路径\n是否继续打包?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No) == QtWidgets.QMessageBox.No:
disabled_or_NORMAL_all(True)
return
if "c:/user" in i[0].text().replace(" ", "").replace("\\", "/").lower():
if QtWidgets.QMessageBox.warning(window, "警告", "输入的路径似乎是在容器的用户目录内,打包后可能会出现找不到 exe 的情况,是否继续?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No) == QtWidgets.QMessageBox.No:
disabled_or_NORMAL_all(True)
return
if i[0].text()[:2].lower() == "c:" and not os.path.exists("{}/drive_c/{}".format(
e6_text.text(),
i[0].text()[3:].replace("\\", '/'))):
if QtWidgets.QMessageBox.warning(window, "警告", "输入的路径似乎在 Wine 容器不存在(如果只是大小写错误导致的误判,请忽略)\n是否继续打包?", QtWidgets.QMessageBox.Yes | QtWidgets.QMessageBox.No) == QtWidgets.QMessageBox.No:
disabled_or_NORMAL_all(True)
return
#thread = threading.Thread(target=make_deb_threading)
QT.thread = make_deb_threading(build)
QT.thread.signal.connect(chang_textbox1_things)
@@ -405,7 +412,18 @@ class make_deb_threading(QtCore.QThread):
f"{wine[wineVersion.currentText()]}, deepin-wine-helper (>= 5.1.30-1), fonts-wqy-microhei, fonts-wqy-zenhei",
f"{wine[wineVersion.currentText()]}, spark-dwine-helper | store.spark-app.spark-dwine-helper, fonts-wqy-microhei, fonts-wqy-zenhei"
][int(chooseWineHelperValue.isChecked())],
"postinst": "",
"postinst": ['', f'''#!/bin/bash
PACKAGE_NAME="{e1_text.text()}"
for username in $(ls /home)
do
echo /home/$username
if [ -d /home/$username/桌面 ]; then
cp /opt/apps/$PACKAGE_NAME/entries/applications/* /home/$username/桌面
fi
if [ -d /home/$username/Desktop ]; then
cp /opt/apps/$PACKAGE_NAME/entries/applications/* /home/$username/Desktop
fi
done'''][enableCopyIconToDesktop.isChecked()],
"postrm": ["", f"""#!/bin/bash
if [ "$1" = "remove" ] || [ "$1" = "purge" ];then
@@ -618,8 +636,18 @@ fi
"Wine": f"WINEPREDLL='{programPath}/dlls-arm' WINEDLLPATH=/opt/deepin-wine6-stable/lib BOX86_NOSIGSEGV=1 /opt/deepin-box86/box86 /opt/deepin-wine6-stable/bin/wine ",
"Architecture": "arm64",
"Depends": "com.deepin-wine6-stable.deepin (>= 6.0deepin31), com.wine-helper.deepin (>= 0.0.8), com.deepin-box86.deepin (>= 0.2.6deepin3), deepin-elf-verify (>= 1.1.1-1)",
"postinst": f"""#!/bin/sh
"postinst": f"""#!/bin/bash
{['', f'''PACKAGE_NAME="{e1_text.text()}"
for username in $(ls /home)
do
echo /home/$username
if [ -d /home/$username/桌面 ]; then
cp /opt/apps/$PACKAGE_NAME/entries/applications/* /home/$username/桌面
fi
if [ -d /home/$username/Desktop ]; then
cp /opt/apps/$PACKAGE_NAME/entries/applications/* /home/$username/Desktop
fi
done'''][enableCopyIconToDesktop.isChecked()]}
ACTIVEX_NAME=""
if [ -f "/opt/apps/{e1_text.text()}/files/install.sh" ];then
@@ -1087,7 +1115,19 @@ fi
"Depends": "cxoffice20 | cxoffice5 | cxoffice5:i386",
"run.sh": None,
"info": None,
"postinst": f'''#!/bin/sh
"postinst": f'''#!/bin/bash
{["", f"""PACKAGE_NAME="{e1_text.text()}"
for username in $(ls /home)
do
echo /home/$username
if [ -d /home/$username/桌面 ]; then
cp /opt/apps/$PACKAGE_NAME/entries/applications/* /home/$username/桌面
fi
if [ -d /home/$username/Desktop ]; then
cp /opt/apps/$PACKAGE_NAME/entries/applications/* /home/$username/Desktop
fi
done"""][enableCopyIconToDesktop.isChecked()]}
# (c) Copyright 2008. CodeWeavers, Inc.
# Setup logging
@@ -1384,6 +1424,7 @@ fi
if debArch.currentIndex() != 2:
# Deepin Wine 包目录结构
os.makedirs("{}/opt/apps/{}/entries/applications".format(debPackagePath, e1_text.text()))
os.makedirs("{}/usr/share/applications".format(debPackagePath))
os.makedirs("{}/opt/apps/{}/entries/icons/hicolor/scalable/apps".format(debPackagePath, e1_text.text()))
os.makedirs("{}/opt/apps/{}/files".format(debPackagePath, e1_text.text()))
else:
@@ -1519,6 +1560,7 @@ Description: {e3_text.text()}
]
line = "\\"
if desktopIconTab.count() <= 1 and debArch.currentIndex() != 2:
write_txt("{}/usr/share/applications/{}.desktop".format(debPackagePath, e1_text.text()), '#!/usr/bin/env xdg-open\n[Desktop Entry]\nEncoding=UTF-8\nType=Application\nX-Created-By={}\nCategories={};\nIcon={}\nExec="/opt/apps/{}/files/run.sh" --uri {}\nName={}\nComment={}\nMimeType={}\nGenericName={}\nTerminal=false\nStartupNotify=false\n'.format(e4_text.text(), option1_text.currentText(), a, e1_text.text(), e15_text.text(), e8_text.text(), e3_text.text(), e10_text.text(), e1_text.text()))
write_txt("{}/opt/apps/{}/entries/applications/{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text()), '#!/usr/bin/env xdg-open\n[Desktop Entry]\nEncoding=UTF-8\nType=Application\nX-Created-By={}\nCategories={};\nIcon={}\nExec="/opt/apps/{}/files/run.sh" --uri {}\nName={}\nComment={}\nMimeType={}\nGenericName={}\nTerminal=false\nStartupNotify=false\n'.format(e4_text.text(), option1_text.currentText(), a, e1_text.text(), e15_text.text(), e8_text.text(), e3_text.text(), e10_text.text(), e1_text.text()))
elif debArch.currentIndex() == 2:
# 直接跳过 .desktop 文件生成
@@ -1529,7 +1571,7 @@ Description: {e3_text.text()}
command = f"--uri {iconUiList[i][2].text()}"
else:
command = iconUiList[i][2].text()
write_txt("{}/opt/apps/{}/entries/applications/{}-{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text(), os.path.splitext(os.path.basename(iconUiList[i][0].text().replace("\\", "/")))[0]), f'''#!/usr/bin/env xdg-open
desktopFile = f'''#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Type=Application
@@ -1543,7 +1585,9 @@ MimeType={iconUiList[i][5].text()}
GenericName={e1_text.text()}
Terminal=false
StartupNotify=false
''')
'''
write_txt("{}/opt/apps/{}/entries/applications/{}-{}.desktop".format(debPackagePath, e1_text.text(), e1_text.text(), os.path.splitext(os.path.basename(iconUiList[i][0].text().replace("\\", "/")))[0]), desktopFile)
write_txt("{}/usr/share/applications/{}-{}.desktop".format(debPackagePath, e1_text.text(), os.path.splitext(os.path.basename(iconUiList[i][0].text().replace("\\", "/")))[0]), desktopFile)
# 要开始分类讨论了
if debArch.currentIndex() == 0 or debArch.currentIndex() == 1 and debArch.currentIndex() != 2:
if desktopIconTab.count() <= 1:
@@ -1601,6 +1645,7 @@ StartupNotify=false
#self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/*_with_box86.sh".format(debPackagePath, e1_text.text()))
#self.run_command("chmod -Rv 755 {}/opt/apps/{}/files/*_with_exagear.sh".format(debPackagePath, e1_text.text()))
self.run_command("chmod -Rv 755 {}/opt/apps/{}/entries/applications/*.desktop".format(debPackagePath, e1_text.text(), e1_text.text()))
self.run_command("chmod -Rv 755 {}/usr/share/applications/*.desktop".format(debPackagePath, e1_text.text()))
################
# 构建 deb 包
################
@@ -2177,14 +2222,31 @@ def LockBottleName():
def get_now_lang()->"获取当前语言":
return os.getenv('LANG')
def ToRpm():
if os.system("which alien"):
QtWidgets.QMessageBox.critical(window, "错误", "无法找到 alien 命令,请先安装 alien")
return
if os.system("which fakeroot"):
QtWidgets.QMessageBox.critical(window, "错误", "无法找到 fakeroot 命令,请先安装 fakeroot")
return
os.system(f"cd '{os.path.dirname(e12_text.text())}' ; fakeroot alien -r '{e12_text.text()}' -c")
QtWidgets.QMessageBox.information(window, "提示", "打包完成!")
def ToTarZst():
if os.system("which debtap"):
QtWidgets.QMessageBox.critical(window, "错误", "无法找到 debtap 命令,请先安装 debtap")
return
OpenTerminal(f"sudo debtap -Q '{e12_text.text()}'")
QtWidgets.QMessageBox.information(window, "提示", "打包完成!")
bottleNameLock = False
###############
# 程序信息
###############
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
# 如果要添加其他 wine请在字典添加其名称和执行路径
wine = {"deepin-wine": "deepin-wine", "deepin-wine5": "deepin-wine5", "wine": "wine", "wine64": "wine64", "deepin-wine5 stable": "deepin-wine5-stable", "deepin-wine6 stable": "deepin-wine6-stable", "spark-wine7-devel": "spark-wine7-devel", "ukylin-wine": "ukylin-wine", "okylin-wine": "okylin-wine", "spark-wine8": "spark-wine8", "spark-wine8-wow": "spark-wine8-wow", "deepin-wine6-vannila": "deepin-wine6-vannila", "deepin-wine8-stable": "deepin-wine8-stable"}
wineValue = {"deepin-wine": "deepin-wine", "deepin-wine5": "deepin-wine5", "wine": "wine", "wine64": "wine64", "deepin-wine5-stable": "deepin-wine5 stable", "deepin-wine6-stable": "deepin-wine6 stable", "spark-wine7-devel": "spark-wine7-devel", "ukylin-wine": "ukylin-wine", "okylin-wine": "okylin-wine", "spark-wine8": "spark-wine8", "spark-wine8-wow": "spark-wine8-wow", "deepin-wine6-vannila": "deepin-wine6-vannila", "deepin-wine8-stable": "deepin-wine8-stable"}
wine = {"deepin-wine": "deepin-wine", "deepin-wine5": "deepin-wine5", "wine": "wine", "wine64": "wine64", "deepin-wine5 stable": "deepin-wine5-stable", "deepin-wine6 stable": "deepin-wine6-stable", "spark-wine7-devel": "spark-wine7-devel", "ukylin-wine": "ukylin-wine", "okylin-wine": "okylin-wine", "spark-wine8": "spark-wine8", "spark-wine8-wow": "spark-wine8-wow", "deepin-wine6-vannila": "deepin-wine6-vannila", "deepin-wine8-stable": "deepin-wine8-stable", "spark-wine9": "spark-wine9", "spark-wine9-wow": "spark-wine9-wow", "spark-wine": "spark-wine"}
wineValue = {"deepin-wine": "deepin-wine", "deepin-wine5": "deepin-wine5", "wine": "wine", "wine64": "wine64", "deepin-wine5-stable": "deepin-wine5 stable", "deepin-wine6-stable": "deepin-wine6 stable", "spark-wine7-devel": "spark-wine7-devel", "ukylin-wine": "ukylin-wine", "okylin-wine": "okylin-wine", "spark-wine8": "spark-wine8", "spark-wine8-wow": "spark-wine8-wow", "deepin-wine6-vannila": "deepin-wine6-vannila", "deepin-wine8-stable": "deepin-wine8-stable", "spark-wine": "spark-wine"}
# 读取 wine 本地列表
for i in os.listdir("/opt"):
if os.path.exists(f"/opt/{i}/bin/wine"):
@@ -2271,6 +2333,7 @@ debControlFrame.addWidget(installDeb)
rmBash = QtWidgets.QCheckBox(transla.transe("U", "设置卸载该 deb 后自动删除该容器"))
cleanBottonByUOS = QtWidgets.QCheckBox(transla.transe("U", "使用统信 Wine 生态适配活动容器清理脚本"))
disabledMono = QtWidgets.QCheckBox(transla.transe("U", "禁用 Mono 和 Gecko 安装器"))
enableCopyIconToDesktop = QtWidgets.QCheckBox(transla.transe("U", "安装时自动拷贝快捷方式至桌面"))
debArch = QtWidgets.QComboBox()
debArch.addItems(["默认选项", "arm64(box86+exagear)"])
#debArch.addItems(["i386", "arm64(box86+exagear)", "all(crossover)"])
@@ -2383,6 +2446,7 @@ moreSettingLayout.addWidget(cleanBottonByUOS)
moreSettingLayout.addWidget(chooseWineHelperValue)
moreSettingLayout.addLayout(helperConfigPathLayout)
moreSettingLayout.addWidget(disabledMono)
moreSettingLayout.addWidget(enableCopyIconToDesktop)
moreSettingLayout.addWidget(QtWidgets.QLabel(transla.transe("U", "deb 的依赖(强制,如无特殊需求默认即可)")))
moreSettingLayout.addWidget(debDepends)
moreSettingLayout.addWidget(QtWidgets.QLabel(transla.transe("U", "deb 的推荐依赖(非强制,一般默认即可)")))
@@ -2439,6 +2503,22 @@ saveFile.triggered.connect(SaveConfigList)
hideShowText.triggered.connect(lambda: textbox1.setHidden(hideShowText.isChecked()))
exit.triggered.connect(window.close)
tip.triggered.connect(helps)
wineDepend = menu.addMenu("Wine 应用依赖(非 Deepin/UOS 发行版)")
uosPackingTools = QtWidgets.QAction("安装维护打包工具箱(需要先安装星火应用商店)")
sparkStoreWebsite = QtWidgets.QAction("打开星火应用商店官网")
if os.system("which spark-store"):
uosPackingTools.setDisabled(True)
uosPackingTools.triggered.connect(lambda: threading.Thread(target=os.system, args=["spark-store spk://store/tools/uos-packaging-tools"]).start())
sparkStoreWebsite.triggered.connect(lambda: webbrowser.open_new_tab("https://spark-app.store/"))
wineDepend.addAction(sparkStoreWebsite)
wineDepend.addAction(uosPackingTools)
turnDebToOther = menu.addMenu("转换安装包格式")
toRpm = QtWidgets.QAction("转 rpm")
toTarZst = QtWidgets.QAction("转 tar.zst")
toRpm.triggered.connect(ToRpm)
toTarZst.triggered.connect(ToTarZst)
turnDebToOther.addAction(toRpm)
turnDebToOther.addAction(toTarZst)
programmenu.addAction(openFile)
programmenu.addAction(saveFile)
#programmenu.addSeparator()
@@ -2534,6 +2614,7 @@ allInfoList = {
"CleanBottleByUOS": ["Ch", cleanBottonByUOS],
"ChooseWineHelperValue": ["Ch", chooseWineHelperValue],
"DisabledMono": ["Ch", disabledMono],
"EnableCopyIconToDesktop": ["Ch", enableCopyIconToDesktop],
"DebDepends": ["L", debDepends],
"DebRecommend": ["L", debRecommend],
"DebFirstArch": ["Co", debFirstArch],
@@ -2545,4 +2626,4 @@ SetFont(app)
#window.setWindowFlag(QtGui.Qt)
window.show()
sys.exit(app.exec_())
# Flag解包只读control和解包全部读取
# Flag解包只读control和解包全部读取

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,82 @@
#/bin/bash
source /opt/durapps/transhell/transhell.sh
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" = "Deepin" ] || [ "$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`
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,186 @@
#!/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
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
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 /opt/durapps/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设置"
/opt/durapps/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" ] ;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"
;;
*)
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"
;;
*)
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,109 @@
#/bin/bash
source /opt/durapps/transhell/transhell.sh
load_transhell_debug
until [ "$IS_CLOSE" = "1" ];do
CHOSEN_SETTINGS=`zenity --list \
--width=700 \
--height=350 \
--title="${TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN}" \
--column="${TRANSHELL_CONTENT_OPTION}" \
"${TRANSHELL_CONTENT_SET_GLOBAL_SCALE}" \
"${TRANSHELL_CONTENT_SET_APP_SCALE}" \
"${TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL}" \
"${TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP}" `
echo "$CHOSEN_SETTINGS"
case "$CHOSEN_SETTINGS" in
"${TRANSHELL_CONTENT_SET_GLOBAL_SCALE}")
########
zenity --info --text="${TRANSHELL_CONTENT_THIS_WILL_NOT_TAKE_EFFECT_IN_DEEPIN_BECAUSE_READ_ENVIRONMENT_FIRST}" --width=500 --height=150
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`
case "$scale_factor" in
"")
zenity --info --text="${TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT}" --width=500 --height=150
scale_factor="1.0"
;;
*)
zenity --info --text="${TRANSHELL_CONTENT_SCALE_IS} $scale_factor ${TRANSHELL_CONTENT_SAVED}" --width=500 --height=150
;;
esac
echo "$scale_factor" > $HOME/.config/spark-wine/scale.txt
;;
########
"${TRANSHELL_CONTENT_SET_APP_SCALE}")
zenity --info --text="${TRANSHELL_CONTENT_PLEASE_CHOOSE_WINE_BOTTLE_DIRECTORY}" --width=500 --height=150
CONTAINER_PATH=`zenity --file-selection --filename="$HOME/.deepinwine/" --directory`
if [ ! -f "$CONTAINER_PATH/user.reg" ];then
zenity --info --text="${TRANSHELL_CONTENT_ERROR_NO_USER_REG_AS_NOT_A_WINE_BOTTLE}" --width=500 --height=150
else
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 \
${TRANSHELL_CONTENT_SYNC_SCALE_WITH_GLOBAL} `
case "$scale_factor" in
"")
zenity --info --text="${TRANSHELL_CONTENT_1_SCALE_AS_DEFAULT}" --width=500 --height=150
scale_factor="1.0"
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh -s $scale_factor $CONTAINER_PATH
;;
"${TRANSHELL_CONTENT_SYNC_SCALE_WITH_GLOBAL}")
zenity --info --text="${TRANSHELL_CONTENT_WILL_SYNC_SCALE_WITH_GLOBAL}" --width=500 --height=150
rm $CONTAINER_PATH/scale.txt
;;
*)
zenity --info --text="${TRANSHELL_CONTENT_SCALE_IS} $scale_factor ${TRANSHELL_CONTENT_SAVED}" --width=500 --height=150
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh -s $scale_factor $CONTAINER_PATH
;;
esac
fi
;;
"${TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL}")
find ${HOME}/.deepinwine/ -name "scale.txt" -type f -print -exec rm -rf {} \;
zenity --info --text="${TRANSHELL_CONTENT_BOTTLES_BELOW_HAVE_SYNCED_SCALE_WITH_GLOBAL}\n`cd ${HOME}/.deepinwine/ && ls`" --width=500 --height=150
;;
"${TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP}")
;;
*)
IS_CLOSE="1"
;;
esac
done

View File

@@ -0,0 +1,18 @@
#!/bin/bash
TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN="Welcome to spark wine helper settingsPlease choose one option below to excute"
TRANSHELL_CONTENT_OPTION="Options"
TRANSHELL_CONTENT_SET_GLOBAL_SCALE="Set global scale"
TRANSHELL_CONTENT_SET_APP_SCALE="Set app scale"
TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL="Sync all the wine app scale with global scale in one key"
TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP="Note: The options above only take effect on spark-dwine-helper apps"
TRANSHELL_CONTENT_THIS_WILL_NOT_TAKE_EFFECT_IN_DEEPIN_BECAUSE_READ_ENVIRONMENT_FIRST="NoteThis option is invalid in deepin/UOS,for the script will read deepin/UOS scale settings first"
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_PLEASE_CHOOSE_WINE_BOTTLE_DIRECTORY="Please choose the directory the app you want to adjust inPlease choose DIRECTORY instead of file"
TRANSHELL_CONTENT_ERROR_NO_USER_REG_AS_NOT_A_WINE_BOTTLE="Euser.reg can not be found.This is not a wine bottle"
TRANSHELL_CONTENT_SYNC_SCALE_WITH_GLOBAL="Sync with global scale settings"
TRANSHELL_CONTENT_WILL_SYNC_SCALE_WITH_GLOBAL="Will sync with global scale settings"
TRANSHELL_CONTENT_BOTTLES_BELOW_HAVE_SYNCED_SCALE_WITH_GLOBAL="The scale settings of apps in bottle below is already syncd with global scale settings"

View File

@@ -0,0 +1,18 @@
#!/bin/bash
TRANSHELL_CONTENT_WELCOME_AND_CHOOSE_ONE_TO_RUN="欢迎使用星火wine助手控制中心请在以下选项中选择一个执行"
TRANSHELL_CONTENT_OPTION="选项"
TRANSHELL_CONTENT_SET_GLOBAL_SCALE="设置全局缩放"
TRANSHELL_CONTENT_SET_APP_SCALE="设置单独应用缩放"
TRANSHELL_CONTENT_SYNC_APP_SCALE_WITH_GLOBAL="一键将所有已安装应用的缩放设置改为与全局缩放一致"
TRANSHELL_CONTENT_ONLY_AVAILABLE_TO_SPARK_DWINE_HELPER_APP="备注以上操作仅对使用了spark-dwine-helper的应用生效"
TRANSHELL_CONTENT_THIS_WILL_NOT_TAKE_EFFECT_IN_DEEPIN_BECAUSE_READ_ENVIRONMENT_FIRST="请注意此选项对deepin/UOS无效会优先读取deepin/UOS的缩放设置进行缩放"
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_PLEASE_CHOOSE_WINE_BOTTLE_DIRECTORY="请在接下来的文件选择框选中所需的应用所在的容器文件夹(注意要选择文件夹)"
TRANSHELL_CONTENT_ERROR_NO_USER_REG_AS_NOT_A_WINE_BOTTLE="错误找不到user.reg.这不是一个wine容器"
TRANSHELL_CONTENT_SYNC_SCALE_WITH_GLOBAL="与全局设置同步"
TRANSHELL_CONTENT_WILL_SYNC_SCALE_WITH_GLOBAL="将会与全局设置同步"
TRANSHELL_CONTENT_BOTTLES_BELOW_HAVE_SYNCED_SCALE_WITH_GLOBAL="以下容器中的应用的缩放设置已与全局设置同步"

15
helper/tools/README.txt Normal file
View File

@@ -0,0 +1,15 @@
#autostart
#autostart在系统启动时自启动根据配置“autostart”文件策略预启动容器不需要用户手动启动
1.默认不会预启动任何容器
2.如果需要启动所有已运行过的容器,请将文件"autostart" 改名 "autostart.all" 示例如下:
sudo mv /opt/deepinwine/tools/autostart /opt/deepinwine/tools/autostart.all
3.如果需要启动用户自己关注的应用,那么将容器名称按行写入"autostart",格式如下:
com.qq.weixin.work.deepin
com.qq.im.deepin
com.meituxiuxiu.deepin
4.兼容原来的kill.sh逻辑

74
helper/tools/SetDpi.sh Executable file
View File

@@ -0,0 +1,74 @@
#!/bin/bash
BASE_DIR="$HOME/.deepinwine/Deepin-QQ"
WINE_CMD="deepin-wine"
PUBLIC_DIR="/var/public"
SHELL_DIR="/opt/deepinwine/tools"
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
_SetRegistryValue()
{
env WINEPREFIX="$BASE_DIR" $WINE_CMD reg ADD "$1" /v "$2" /t $3 /d "$4" /f
}
_SetOverride()
{
_SetRegistryValue 'HKCU\Software\Wine\DllOverrides' "$2" REG_SZ "$1"
}
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
}
if [ -z "$1" ] || [ -z "$2" ]; then
echo "Please input two args, first is dpi, second is bottle name"
exit 0
fi
if (("$1" < 96)) || (($1 > 400)) ; then
echo "Invaild dpi vaule, min 96 max 400"
exit 0
fi
BASE_DIR="$HOME/.deepinwine/$2"
if UsePublicDir; then
BASE_DIR="$PUBLIC_DIR/$2"
fi
if [ ! -d "$BASE_DIR" ]; then
echo "Invaild bottle name, $2 is not exist"
exit 0
fi
$SHELL_DIR/kill.sh $2
_SetRegistryValue 'HKCU\Control Panel\Desktop' LogPixels REG_DWORD $1
exit 0

59
helper/tools/add_hotkeys Executable file
View File

@@ -0,0 +1,59 @@
#!/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
from os import path, rename, remove
import locale
import subprocess
import os
import shutil
import json
import math
import dbus
_action = "/opt/deepinwine/tools/sendkeys.sh"
def system_screenshot_isA():
bus = dbus.SessionBus()
keybinding = bus.get_object("com.deepin.daemon.Keybinding", "/com/deepin/daemon/Keybinding")
keybinding_iface = dbus.Interface(keybinding, dbus_interface='com.deepin.daemon.Keybinding')
obj = json.loads(keybinding_iface.List())
for i in range(len(obj)):
if obj[i]['Id'] == "screenshot":
if '<Control><Alt>A' in obj[i]['Accels']:
return True
return False
def add_qq_shortcut(_name, _key, _short_cut):
if path.exists(_action):
bus = dbus.SessionBus()
keybinding = bus.get_object("com.deepin.daemon.Keybinding", "/com/deepin/daemon/Keybinding")
keybinding_iface = dbus.Interface(keybinding, dbus_interface='com.deepin.daemon.Keybinding')
obj = json.loads(keybinding_iface.List())
for i in range(len(obj)):
if obj[i]['Name'] == _name:
keybinding_iface.Delete(obj[i]['Id'], obj[i]['Type'])
_, ok = keybinding_iface.Add(_name, _action+_key, _short_cut)
if ok == False:
return False
if __name__ == "__main__":
import sys
_action = os.path.realpath(os.path.dirname(sys.argv[0]))
_action = os.path.join(_action, "sendkeys.sh")
if len(sys.argv) < 4:
add_qq_shortcut(u"提取QQ消息", " z", "<Control><Alt>Z")
if system_screenshot_isA():
add_qq_shortcut(u"QQ截图", " a", "<Control><Alt>S")
else:
add_qq_shortcut(u"QQ截图", " a", "<Control><Alt>A")
sys.exit(0)
add_qq_shortcut(str(sys.argv[1]), sys.argv[2], sys.argv[3])

0
helper/tools/autostart Normal file
View File

57
helper/tools/autostart_all.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/bash
get_value()
{
cat $1 | grep -m 1 ${2}= | awk -F = '{print $NF}' | awk -F \" '{print $2}'
}
init_bottle()
{
RUN_FILE=$1
if [ ! -f "$RUN_FILE" ];then
echo "$RUN_FILE 未安装"
return
fi
DEB_PACKAGE_NAME="$(get_value $RUN_FILE DEB_PACKAGE_NAME)"
BOTTLENAME="$(get_value $RUN_FILE BOTTLENAME)"
APPRUN_CMD="$(get_value $RUN_FILE APPRUN_CMD)"
BOTTLEPATH="$HOME/.deepinwine/$BOTTLENAME"
if [ $2 ]&&[ $2 == "-c" ];then
$RUN_FILE -c
fi
# KILL="/opt/deepinwine/tools/kill.bak"
# if [ -f $KILL ];then
# $KILL "$BOTTLENAME"
# fi
if [ -d "$BOTTLEPATH" ];then
APPRUN_CMD=${APPRUN_CMD/\$HOME/$HOME}
if [ ! -f "$APPRUN_CMD" ];then
export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64
fi
ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files"
export WINEPREDLL="$ARCHIVE_FILE_DIR/dlls"
WINEPREFIX="$BOTTLEPATH" $APPRUN_CMD /opt/deepinwine/tools/startbottle.exe &
fi
}
AUTOSTART="/opt/deepinwine/tools/autostart"
if [ -f "$AUTOSTART.all" ];then
find /opt/apps -name run.sh | while read package;do
init_bottle $package "$@"
done
elif [ -f $AUTOSTART ];then
debs=`cat $AUTOSTART`
for deb in $debs
do
debname=`echo $deb | sed -e 's/\s//g'`
init_bottle "/opt/apps/$debname/files/run.sh" "$@"
done
fi

58
helper/tools/autostart_wine.sh Executable file
View File

@@ -0,0 +1,58 @@
#!/bin/bash
DEB_PACKAGE_NAME="com.qq.im.deepin"
get_value()
{
cat $1 | grep -m 1 ${2}= | awk -F = '{print $NF}' | awk -F \" '{print $2}'
}
if [ -n "$1" ];then
DEB_PACKAGE_NAME="$1"
fi
RUN_FILE="/opt/apps/$DEB_PACKAGE_NAME/files/run.sh"
if [ ! -f "$RUN_FILE" ];then
echo "$DEB_PACKAGE_NAME 未安装"
exit
fi
BOTTLENAME="$(get_value $RUN_FILE BOTTLENAME)"
APPRUN_CMD="$(get_value $RUN_FILE APPRUN_CMD)"
BOTTLEPATH="$HOME/.deepinwine/$BOTTLENAME"
bottle_started()
{
ps -ef | grep startbottle.exe | while read startb;do
starts=(${startb// / })
envfile=/proc/${starts[1]}/environ
if [ -f $envfile ];then
grep -c $BOTTLENAME /proc/${starts[1]}/environ > /dev/null
if [ $? -eq 0 ];then
echo ${starts[1]}
break
fi
fi
done
}
if [ "$(bottle_started)" ];then
exit
fi
$RUN_FILE -c
if [ -d "$BOTTLEPATH" ];then
APPRUN_CMD=${APPRUN_CMD/\$HOME/$HOME}
if [ ! -f "$APPRUN_CMD" ];then
export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64
fi
ARCHIVE_FILE_DIR="/opt/apps/$DEB_PACKAGE_NAME/files"
export WINEPREDLL="$ARCHIVE_FILE_DIR/dlls"
WINEPREFIX="$BOTTLEPATH" $APPRUN_CMD /opt/deepinwine/tools/startbottle.exe &
fi

1
helper/tools/box86-activex Symbolic link
View File

@@ -0,0 +1 @@
../../deepin-box86/stable/box86

BIN
helper/tools/deepin-wine-banner Executable file

Binary file not shown.

22
helper/tools/get_tray_window Executable file
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()

291
helper/tools/kill.sh Executable file
View File

@@ -0,0 +1,291 @@
#!/bin/bash
APP_NAME="QQ"
LOG_FILE=$0
SHELL_DIR=${0%/*}
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
}
set_emu_by_pid()
{
emu_cmd=$(xargs -0 printf '%s\n' < /proc/$1/environ | grep ^EMU_CMD=)
emu_args=$(xargs -0 printf '%s\n' < /proc/$1/environ | grep ^EMU_ARGS=)
if [ -n "$emu_cmd" ];then
export "$emu_cmd"
fi
if [ -n "$emu_args" ];then
export "$emu_args"
fi
debug_log_to_file "$1 EMU_CMD: $EMU_CMD, EMU_ARGS: $EMU_ARGS"
}
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_pid()
{
if [ -z "$1" ];then
return
fi
targ_prefix=$(realpath $1)
for server_pid in $(ps -ef | grep wineserver | awk '{print $2}') ;do
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
echo $server_pid
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 bottle_path in $(echo -e $PREFIX_LIST) ; do
if [[ $bottle_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"
}
get_wineserver_path_by_pid()
{
server_info=$(ps -ef | grep -E "${1}.*wineserver" | grep -v grep)
debug_log_to_file "get server info $server_info"
WINESERVER=$(echo $server_info | awk '{print $NF}')
if [ ! -f "$WINESERVER" ];then
WINESERVER=$(echo $server_info | awk '{print $(NF-1)}')
WINESERVER=${WINESERVER%*.real}
fi
debug_log_to_file "get server $WINESERVER"
}
kill_app()
{
debug_log "try to kill $1"
for bottle_path in $(get_bottle_path $1); do
if [ -n "$bottle_path" ];then
server_pid=$(get_wineserver_pid "$bottle_path")
if [ -z "$server_pid" ];then
continue
fi
set_emu_by_pid $server_pid
get_wineserver_path_by_pid $server_pid
if [ -f "$WINESERVER" ];then
debug_log "kill $bottle_path by $WINESERVER"
# 兼容arm版本通过模拟器运行
env WINEPREFIX="$bottle_path" $EMU_CMD $EMU_ARGS "$WINESERVER" -k
fi
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 | 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

44
helper/tools/log.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
BOTTLE_NAME="Deepin-QQ"
DEBUG_MSG="+pid,+tid,+timestamp"
SHELL_DIR=$(dirname $0)
SHELL_DIR=$(realpath "$SHELL_DIR")
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
if [ -n "$1" ]; then
BOTTLE_NAME="$1"
fi
if [ -n "$2" ]; then
DEBUG_MSG="$2"
fi
RUN_CMD="/opt/deepinwine/apps/${BOTTLE_NAME}/run.sh"
if [ ! -f "$RUN_CMD" ]; then
RUN_CMD="/opt/apps/$BOTTLE_NAME/files/run.sh"
if [ ! -f "$RUN_CMD" ]; then
echo "Invaild bottle name, $BOTTLE_NAME is not exist"
exit 0
fi
fi
mkdir $HOME/log &> /dev/null
export DEBUG_LOG="$HOME/log"
dpkg -l | grep "Deepin Wine" > $HOME/log/${BOTTLE_NAME}.log
dpkg -l | grep deepin-wine >> $HOME/log/${BOTTLE_NAME}.log
ps -ef | grep -i c: >> $HOME/log/${BOTTLE_NAME}.log
$SHELL_DIR/kill.sh ${BOTTLE_NAME}
if [ -z "$3" ]; then
WINEDEBUG=${DEBUG_MSG} $RUN_CMD &>> $HOME/log/${BOTTLE_NAME}.log &
else
WINEDEBUG=${DEBUG_MSG} $RUN_CMD -u "$3" &>> $HOME/log/${BOTTLE_NAME}.log &
fi
dde-file-manager $HOME/log &> /dev/null &

51
helper/tools/map_device.sh Executable file
View File

@@ -0,0 +1,51 @@
#!/bin/bash
#$1 link path
#$2 real path
Update_link()
{
if [ -f "$1" ];then
echo "$1 is a file"
rm "$1"
fi
if [ -L "$1" ];then
real_path=$(realpath $1)
echo "${1} is a symlink, $real_path"
if [ "$2" = "$real_path" ];then
echo "not need create"
return
fi
rm "$1"
fi
link_dir=$(dirname "$1")
mkdir -p "$link_dir"
echo "link $1 to $2"
ln -s "$2" "$1"
}
map_lp()
{
ls /dev/lp* |\
while read line; do
Update_link "${HOME}/.deepinwine/lp0" "$line"
return
done
}
map_serial()
{
i=0
COMS=("COM1" "COM2" "COM3" "COM4")
dmesg | grep -E "0000:01.*tty" | awk '{print $4}'|\
while read line;do
ttypath=$(echo "/dev/$line")
compath=$(echo "${HOME}/.deepinwine/${COMS[i]}")
let "i++"
Update_link "$compath" "$ttypath"
done
}
map_lp
map_serial

40
helper/tools/register_font.sh Executable file
View File

@@ -0,0 +1,40 @@
#!/bin/bash
APPS="Deepin-QQ Deepin-QQLigth"
WINE_CMD="deepin-wine5-stable"
RE_TAG="Source Han Sans SC Regular"
WINE_PREFIX=""
_SetRegistryValue()
{
env WINEPREFIX="$WINE_PREFIX" $WINE_CMD reg ADD "$1" /v "$2" /t $3 /d "$4"
}
_DeleteRegistryValue()
{
env WINEPREFIX="$WINE_PREFIX" $WINE_CMD reg DELETE "$1" /v "$2"
}
_SetFontReplacements()
{
echo "$1 -> $2"
# _DeleteRegistryValue 'HKCU\Software\Wine\\Fonts\Replacements' "$1"
_SetRegistryValue 'HKCU\Software\Wine\\Fonts\Replacements' "$1" REG_SZ "$2"
}
if [ -z "$1" ]; then
echo "No font name"
exit 0
fi
if [ -n "$2" ]; then
RE_TAG="$2"
fi
for name in ${APPS}; do
WINE_PREFIX="$HOME/.deepinwine/$name"
echo $WINE_PREFIX
if [ -d "$WINE_PREFIX" ]; then
_SetFontReplacements "$1" "$RE_TAG"
fi
done

787
helper/tools/run.sh Executable file
View File

@@ -0,0 +1,787 @@
#!/bin/bash
# Copyright (C) 2016 Deepin, Inc.
#
# Author: Li LongYu <lilongyu@linuxdeepin.com>
# Peng Hao <penghao@linuxdeepin.com>
WINEPREFIX="$HOME/.deepinwine/@public_bottle_name@"
APPDIR="/opt/deepinwine/apps/@public_bottle_name@"
APPVER="@deb_version_string@"
APPTAR="files.7z"
BOTTLENAME=""
WINE_CMD="deepin-wine"
CREATE_BOTTLE=""
LOG_FILE=$0
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
strDate=$(date)
echo -e "${strDate}:${1}" >> "$LOG_FILE"
fi
}
debug_log()
{
strDate=$(date)
echo "${strDate}:${1}"
}
init_log_file
_SetRegistryValue()
{
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg ADD "$1" /v "$2" /t $3 /d "$4" /f
}
_DeleteRegistry()
{
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg DELETE "$1" /f &> /dev/null
}
_SetOverride()
{
_SetRegistryValue 'HKCU\Software\Wine\DllOverrides' "$2" REG_SZ "$1"
}
_DisableAliUpdate()
{
if [ -f "${WINEPREFIX}/.disable" ];then
return
fi
debug_log "Disable AliUpdate"
touch ${WINEPREFIX}/.disable
/opt/deepinwine/tools/kill.sh AliWorkbench block
VERSIONS=$(ls ${WINEPREFIX}'/drive_c/Program Files/AliWorkbench' | grep -E '*.*.*N')
VERSIONS=$(echo $VERSIONS | awk '{print $2}')
debug_log $VERSIONS
if [ -n "$VERSIONS" ];then
debug_log "Remove bottle"
rm -rf "$WINEPREFIX"
/opt/deepinwine/apps/Deepin-QianNiu/run.sh -c
fi
_SetOverride "" "AliUpdate"
}
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"
}
FixLink()
{
if [ -d ${WINEPREFIX} ]; then
CUR_DIR=$PWD
cd "${WINEPREFIX}/dosdevices"
rm c: z:
ln -s -f ../drive_c c:
ln -s -f / z:
cd $CUR_DIR
ls -l "${WINEPREFIX}/dosdevices"
fi
}
urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
uridecode()
{
local path=$(urldecode "$1")
path=${path/file:\/\//}
echo $path
}
get_bottle_path_by_process_id()
{
PID_LIST="$1"
PREFIX_LIST=""
for pid_var in $PID_LIST ; do
WINE_PREFIX=$(xargs -0 printf '%s\n' < /proc/$pid_var/environ | grep WINEPREFIX)
WINE_PREFIX=${WINE_PREFIX##*=}
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 | grep $HOME
}
get_bottle_path_by_process_name()
{
PID_LIST=$(ps -ef | grep -E -i "c:.*${1}" | grep -v grep | awk '{print $2}')
debug_log_to_file "get pid list: $PID_LIST"
get_bottle_path_by_process_id "$PID_LIST"
}
CallYMDY()
{
SERVER_BOTTLE=$(get_bottle_path_by_process_name sqlservr.exe | grep $WINEPREFIX)
if [ -z "$SERVER_BOTTLE" ]; then
debug_log "Starting SQL Server ..."
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Microsoft SQL Server\\MSSQL\\Binn\\sqlservr.exe" -s MSSQLSERVER &
else
debug_log "SQL Server is running in $SERVER_BOTTLE"
fi
if [ "autostart" == "$1" ]; then
debug_log "Auto start SQL Server"
elif [ "tongji" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\旗帜软件\\党内信息管理系统(统计版)\\CReport.exe" &
elif [ "createdb" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\旗帜软件\\党内信息管理系统(统计版)\\数据库安装\\SetupDb.exe" &
elif [ "servermanger" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Microsoft SQL Server\\80\\Tools\\Binn\\sqlmangr.exe" /n &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\旗帜软件\\党内信息管理系统(统计版)\\QZCPMIS.exe" &
fi
}
CallYMGWY()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD uninstaller --list
elif [ "tongji" == "$1" ]; then
firefox "http://127.0.0.1:64022/hzbtj" &
else
firefox "http://127.0.0.1:64022/hzb" &
fi
}
CallATM()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
if [ ! -f "$WINEPREFIX/drive_c/Program Files/TradeManager/AliIM.exe" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\deepin\\AliIM2015_ATM.exe"
fi
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\TradeManager\\AliIM.exe" &
fi
}
CallMaxthon2()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Maxthon2\\Maxthon.exe" &
fi
}
CallQIANNIU()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
_DisableAliUpdate
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\AliWorkbench\\AliWorkbench.exe" &
fi
}
CallYMPOPS()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\全国持久性有机污染物统计年报信息管理系统(2017)\\POPs.exe" &
fi
}
CallYMRLZY()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\人力资源社会保障统计报表系统SMIS2012\\bin\\Omni.exe" &
fi
}
CallYMDATJ()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
if [ ! -f "$WINEPREFIX/drive_c/Program Files/JoinCheer/全国档案事业统计年报信息管理系统/ReportE.exe" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\deepin\\install\\setup.exe"
fi
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\JoinCheer\\全国档案事业统计年报信息管理系统\\ReportE.exe" &
fi
}
CallYMWZXX()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\全国政府网站信息报送客户端\\UFReader.exe" &
fi
}
CallRTX2015()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
cd "$WINEPREFIX/drive_c/Program Files/Tencent/RTXC"
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Tencent\\RTXC\\RTX.exe" &
fi
}
CallYMRDWS()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\饮用水水源环境基础信息采集系统\\RDWS.exe" &
fi
}
CallQQGame()
{
debug_log "run $1"
/opt/deepinwine/tools/kill.sh QQMicroGameBox block
env WINEPREFIX="$WINEPREFIX" /opt/deepinwine/tools/QQGameRunner $1 &
}
CallWXWork()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
/opt/deepinwine/tools/kill.sh WXWork.exe block
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\WXWork\\WXWork.exe" &
fi
}
CallRTX2009()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
cd "$WINEPREFIX/drive_c/Program Files/Tencent/RTXC"
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Tencent\\RTXC\\RTX.exe" &
fi
}
CallIrfanView()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
OPEN_FILE=$(uridecode $1)
if [ -f "$OPEN_FILE" ]; then
OPEN_FILE=$(realpath "$OPEN_FILE")
OPEN_FILE="z:$OPEN_FILE"
debug_log "fond file $OPEN_FILE"
OPEN_FILE=$(echo $OPEN_FILE | sed -e 's/\//\\\\/g')
fi
echo "file path: $OPEN_FILE"
if [ -n "$OPEN_FILE" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\IrfanView\\i_view32.exe" "$OPEN_FILE" &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\IrfanView\\i_view32.exe" &
fi
fi
}
CallQQ()
{
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
debug_log "first run time"
/opt/deepinwine/tools/add_hotkeys
/opt/deepinwine/tools/fontconfig
touch "$WINEPREFIX/../.QQ_run"
fi
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
#Support use native file dialog
export ATTACH_FILE_DIALOG=1
#Auto kill block process
/opt/deepinwine/tools/kill.sh QQ.exe block
debug_log "start running..."
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Tencent\\QQ\\Bin\\QQ.exe" &
fi
}
CallTIM()
{
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
debug_log "first run time"
/opt/deepinwine/tools/add_hotkeys
/opt/deepinwine/tools/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
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
#Auto kill block process
/opt/deepinwine/tools/kill.sh TIM.exe block
#Support use native file dialog
export ATTACH_FILE_DIALOG=1
debug_log "start running..."
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Tencent\\TIM\\Bin\\TIM.exe" &
#disable Tencent MiniBrowser
_DeleteRegistry "HKCU\\Software\\Tencent\\MiniBrowser"
fi
}
fun1(){
xwininfo -root -children | grep -E -i "WeChat.exe.*Wine.*60x60"
}
CallWeChat()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
debug_log "Disable auto update"
_DeleteRegistry "HKCU\\Software\\Tencent\\WeChat" "UpdateFailCnt"
_DeleteRegistry "HKCU\\Software\\Tencent\\WeChat" "NeedUpdateType"
rm "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WeChat/All Users/config/configEx.ini"
export DISABLE_RENDER_CLIPBOARD=1
export ATTACH_FILE_DIALOG=1
debug_log "start running..."
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Tencent\\WeChat\\WeChat.exe" &
fi
}
CallFoobar2000()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\foobar2000\\foobar2000.exe" &
fi
}
Call7zip()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\7-Zip\\7zFM.exe" &
fi
}
Callgtjafuyi()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\GTJA\\RichEZ\\TdxW.exe" &
fi
}
CallAAAlog()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\AAALOGO\\alogo.exe" &
fi
}
CallWinRAR()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\WinRAR\\WinRAR.exe" &
fi
}
Call360Zip()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\360\\360zip\\360zip.exe" &
fi
}
CallJCJCJSC()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\金长江网上交易\\金长江网上交易财智版\\tdxw.exe" &
fi
}
CallQQEIM()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Tencent\\QQEIM\\Bin\\QQEIM.exe" &
fi
}
CallMTXX()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Meitu\\XiuXiu\\XiuXiu.exe " &
fi
}
CallDecryptDoc()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\DecryptDoc.exe " &
fi
}
CallYNote()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Youdao\\YoudaoNote\\YoudaoNote.exe " &
fi
}
CallQQCRM()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Tencent\\BizQQ\\Bin\\QQCRM.exe" &
fi
}
CallPRCReader()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Founder\\Apabi Reader 4.0\\ApaReader.exe" &
fi
}
CallMiniCADSee()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\CAD迷你看图\\DWGView.exe" &
fi
}
CallCMBChina()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
/opt/deepinwine/tools/kill.sh PersonalBankPortal.exe block
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\windows\\system32\\PersonalBankPortal.exe" &
fi
}
CallWangWang()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
xdg-mime default deepin.com.taobao.wangwang.desktop x-scheme-handler/aliim
chmod 700 "$WINEPREFIX/drive_c/Program Files/AliWangWang/9.12.10C/wwbizsrv.exe"
chmod 700 "$WINEPREFIX/drive_c/Program Files/Alibaba/wwbizsrv/wwbizsrv.exe"
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\AliWangWang\\9.12.10C\\WWCmd.exe" "$1" &
fi
}
CallEM263()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\263\\263 Enterprise Messenger\\263em.exe " &
fi
}
CallThunderSpeed()
{
if [ "autostart" == "$1" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
else
/opt/deepinwine/tools/kill.sh Thunder.exe block
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\Program Files\\Thunder Network\\Thunder\\Program\\Thunder.exe" &
fi
}
CallApp()
{
FixLink
debug_log "CallApp $BOTTLENAME $1 $2"
case $BOTTLENAME in
"Deepin-WangWang")
CallWangWang "$1" "$2"
;;
"Deepin-ThunderSpeed")
CallThunderSpeed "$1" "$2"
;;
"Deepin-EM263")
CallEM263 "$1" "$2"
;;
"Deepin-MTXX")
CallMTXX "$1" "$2"
;;
"Deepin-PRCReader")
CallPRCReader "$1" "$2"
;;
"Deepin-MiniCADSee")
CallMiniCADSee "$1" "$2"
;;
"Deepin-CMBChina")
CallCMBChina "$1" "$2"
;;
"Deepin-DecryptDoc")
CallDecryptDoc "$1" "$2"
;;
"Deepin-YNote")
CallYNote "$1" "$2"
;;
"Deepin-Maxthon")
CallMaxthon2 "$1" "$2"
;;
"Deepin-Foobar2000")
CallFoobar2000 "$1" "$2"
;;
"Deepin-QQCRM")
CallQQCRM "$1" "$2"
;;
"Deepin-QQEIM")
CallQQEIM "$1" "$2"
;;
"com.95579.cjsc")
CallJCJCJSC "$1" "$2"
;;
"Deepin-360YaSuo")
Call360Zip "$1" "$2"
;;
"Deepin-WinRAR")
CallWinRAR "$1" "$2"
;;
"Deepin-AAAlog")
CallAAAlog "$1" "$2"
;;
"com.gtja.fuyi")
Callgtjafuyi "$1" "$2"
;;
"Deepin-7zip")
Call7zip "$1" "$2"
;;
"Deepin-QQ")
CallQQ "$1" "$2"
;;
"Deepin-TIM")
CallTIM "$1" "$2"
;;
"Deepin-RTX2015")
CallRTX2015 "$1" "$2"
;;
"Deepin-RTX2009")
CallRTX2009 "$1" "$2"
;;
"Deepin-IrfanView")
CallIrfanView "$1" "$2"
;;
"Deepin-YMRDWS")
CallYMRDWS "$1" "$2"
;;
"Deepin-WeChat")
CallWeChat "$1" "$2"
;;
"Deepin-wangzhanxinxi")
CallYMWZXX "$1" "$2"
;;
"Deepin-dangantongji")
CallYMDATJ "$1" "$2"
;;
"Deepin-renliziyuan")
CallYMRLZY "$1" "$2"
;;
"Deepin-YMPOPS")
CallYMPOPS "$1" "$2"
;;
"Deepin-YMDY")
CallYMDY "$1" "$2"
;;
"Deepin-YMGWY")
CallYMGWY "$1" "$2"
;;
"Deepin-QQHlddz")
CallQQGame 363 "$1" "$2"
;;
"Deepin-QQHlmj")
CallQQGame 1101070761 "$1" "$2"
;;
"Deepin-QQWzry")
CallQQGame 1106084547 "$1" "$2"
;;
"Deepin-QQMnsj")
CallQQGame 1105856612 "$1" "$2"
;;
"Deepin-QQBydr")
CallQQGame 1104632801 "$1" "$2"
;;
"Deepin-QQJlhmjq")
CallQQGame 1105370739 "$1" "$2"
;;
"Deepin-QQXwsd")
CallQQGame 1101328322 "$1" "$2"
;;
"Deepin-QQDldl")
CallQQGame 1105208044 "$1" "$2"
;;
"Deepin-QQSszb")
CallQQGame 1105640244 "$1" "$2"
;;
"Deepin-QQCszj")
CallQQGame 1105974527 "$1" "$2"
;;
"Deepin-WXWork")
CallWXWork "$1" "$2"
;;
"Deepin-QianNiu")
CallQIANNIU "$1" "$2"
;;
"Deepin-ATM")
CallATM "$1" "$2"
;;
*)
debug_log "unkown bottle $BOTTLENAME"
;;
esac
}
ExtractApp()
{
$SHELL_DIR/deepin-wine-banner unpack &
mkdir -p "$1"
7z x "$APPDIR/$APPTAR" -o"$1"
mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER"
sed -i "s#@current_user@#$USER#" $1/*.reg
$SHELL_DIR/deepin-wine-banner unpacked
}
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 [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then
return
fi
if [ -d "${WINEPREFIX}.tmpdir" ]; then
rm -rf "${WINEPREFIX}.tmpdir"
fi
ExtractApp "${WINEPREFIX}.tmpdir"
/opt/deepinwine/tools/updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v
rm -rf "${WINEPREFIX}.tmpdir"
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
}
RunApp()
{
$SHELL_DIR/deepin-wine-banner
if [[ $? != 0 ]]; then
debug_log "检测到 deepin-wine-banner 运行, exit 1"
exit 1
fi
$SHELL_DIR/deepin-wine-banner start &
if [ -d "$WINEPREFIX" ]; then
UpdateApp
else
DeployApp
fi
CallApp "$1" "$2"
}
CreateBottle()
{
CREATE_BOTTLE="1"
if [ -d "$WINEPREFIX" ]; then
UpdateApp
else
DeployApp
fi
}
# Check if some visual feedback is possible
if command -v zenity >/dev/null 2>&1; then
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
}
else
progressbar()
{
cat -
}
fi
if [ -z $1 ] || [ -z $2 ]; then
debug_log "Invalid params"
exit 0
fi
BOTTLENAME="$1"
WINEPREFIX="$HOME/.deepinwine/$1"
APPDIR="/opt/deepinwine/apps/$1"
APPVER="$2"
debug_log "Run $1 $2"
if [ -z "$WINE_WMCLASS" ]; then
export WINE_WMCLASS="$DEB_PACKAGE_NAME"
fi
if [ -z "$3" ]; then
RunApp
exit 0
fi
case $3 in
"-r" | "--reset")
ResetApp
;;
"-cb" | "--create")
CreateBottle
;;
"-e" | "--remove")
RemoveApp
;;
"-u" | "--uri")
RunApp "$4" "$5"
;;
"-h" | "--help")
HelpApp
;;
*)
echo "Invalid option: $3"
echo "Use -h|--help to get help"
exit 1
;;
esac
exit 0

1
helper/tools/run_activex.sh Symbolic link
View File

@@ -0,0 +1 @@
run_v4.sh

536
helper/tools/run_v2.sh Executable file
View File

@@ -0,0 +1,536 @@
#!/bin/bash
# Copyright (C) 2016 Deepin, Inc.
#
# Author: Li LongYu <lilongyu@linuxdeepin.com>
# Peng Hao <penghao@linuxdeepin.com>
WINEPREFIX="$HOME/.deepinwine/@public_bottle_name@"
APPDIR="/opt/deepinwine/apps/@public_bottle_name@"
APPVER="@deb_version_string@"
APPTAR="files.7z"
BOTTLENAME=""
WINE_CMD="deepin-wine"
CREATE_BOTTLE=""
LOG_FILE=$0
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()
{
echo "${1}"
}
init_log_file
_SetRegistryValue()
{
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg ADD "$1" /v "$2" /t $3 /d "$4" /f
}
_DeleteRegistry()
{
env WINEPREFIX="$WINEPREFIX" $WINE_CMD reg DELETE "$1" /f &> /dev/null
}
_SetOverride()
{
_SetRegistryValue 'HKCU\Software\Wine\DllOverrides' "$2" REG_SZ "$1"
}
_DisableAliUpdate()
{
if [ -f "${WINEPREFIX}/.disable" ];then
return
fi
debug_log "Disable AliUpdate"
touch ${WINEPREFIX}/.disable
/opt/deepinwine/tools/kill.sh AliWorkbench block
VERSIONS=$(ls ${WINEPREFIX}'/drive_c/Program Files/AliWorkbench' | grep -E '*.*.*N')
VERSIONS=$(echo $VERSIONS | awk '{print $2}')
debug_log $VERSIONS
if [ -n "$VERSIONS" ];then
debug_log "Remove bottle"
rm -rf "$WINEPREFIX"
/opt/deepinwine/apps/Deepin-QianNiu/run.sh -c
fi
_SetOverride "" "AliUpdate"
}
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"
}
FixLink()
{
if [ -d ${WINEPREFIX} ]; then
CUR_DIR=$PWD
cd "${WINEPREFIX}/dosdevices"
rm c: z: y:
ln -s -f ../drive_c c:
ln -s -f / z:
ln -s -f $HOME y:
cd $CUR_DIR
ls -l "${WINEPREFIX}/dosdevices"
fi
}
urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
uridecode()
{
local path=$(urldecode "$1")
path=${path/file:\/\//}
echo $path
}
UnixUriToDosPath()
{
OPEN_FILE=$(uridecode "$1")
if [ -f "$OPEN_FILE" ]; then
OPEN_FILE=$(realpath "$OPEN_FILE")
OPEN_FILE="z:$OPEN_FILE"
debug_log "fond file $OPEN_FILE"
OPEN_FILE=$(echo $OPEN_FILE | sed -e 's/\//\\\\/g')
fi
echo "OPEN_FILE"
}
get_bottle_path_by_process_id()
{
PID_LIST="$1"
PREFIX_LIST=""
for pid_var in $PID_LIST ; do
WINE_PREFIX=$(xargs -0 printf '%s\n' < /proc/$pid_var/environ | grep WINEPREFIX)
WINE_PREFIX=${WINE_PREFIX##*=}
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 | grep $HOME
}
get_bottle_path_by_process_name()
{
PID_LIST=$(ps -ef | grep -E -i "c:.*${1}" | grep -v grep | awk '{print $2}')
debug_log_to_file "get pid list: $PID_LIST"
get_bottle_path_by_process_id "$PID_LIST"
}
#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
name="${path##*/}"
/opt/deepinwine/tools/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 $* ..."
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
}
AutoStartBottle()
{
debug_log "Auto start $WINEPREFIX"
env WINEPREFIX="$WINEPREFIX" $WINE_CMD /opt/deepinwine/tools/startbottle.exe &
}
CallZhuMu()
{
#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 $* ..."
if [ -n "$2" ];then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" "--url=$2" &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
fi
}
#arg 1: startserver just start server, or process file path
#arg 2-*: windows process args
CallYMDY()
{
SERVER_BOTTLE=$(get_bottle_path_by_process_name sqlservr.exe | grep $WINEPREFIX)
if [ -z "$SERVER_BOTTLE" ]; then
debug_log "Starting SQL Server ..."
CallProcess "c:\\Program Files\\Microsoft SQL Server\\MSSQL\\Binn\\sqlservr.exe" -s MSSQLSERVER
else
debug_log "SQL Server is running in $SERVER_BOTTLE"
fi
if [ "startserver" == "$1" ]; then
debug_log "Auto start SQL Server"
else
CallProcess "$@"
fi
}
CallYMGWY()
{
if [ "tongji" == "$1" ]; then
firefox "http://127.0.0.1:64022/hzbtj" &
else
firefox "http://127.0.0.1:64022/hzb" &
fi
}
CallATM()
{
if [ ! -f "$WINEPREFIX/drive_c/Program Files/TradeManager/AliIM.exe" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\deepin\\AliIM2015_ATM.exe"
fi
CallProcess "$@"
}
CallQIANNIU()
{
_DisableAliUpdate
CallProcess "$@"
}
CallYMDATJ()
{
if [ ! -f "$WINEPREFIX/drive_c/Program Files/JoinCheer/全国档案事业统计年报信息管理系统/ReportE.exe" ]; then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "c:\\deepin\\install\\setup.exe"
fi
CallProcess "$@"
}
CallQQGame()
{
debug_log "run $1"
/opt/deepinwine/tools/kill.sh QQMicroGameBox block
env WINEPREFIX="$WINEPREFIX" /opt/deepinwine/tools/QQGameRunner $1 &
}
CallIrfanView()
{
OPEN_FILE="$(UnixUriToDosPath "$2")"
debug_log "file path: $OPEN_FILE"
if [ -n "$OPEN_FILE" ]; then
CallProcess "$1" "$OPEN_FILE"
else
CallProcess "$1"
fi
}
CallQQ()
{
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
debug_log "first run time"
/opt/deepinwine/tools/add_hotkeys
/opt/deepinwine/tools/fontconfig
touch "$WINEPREFIX/../.QQ_run"
fi
#Support use native file dialog
export ATTACH_FILE_DIALOG=1
CallProcess "$@"
}
CallTIM()
{
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
debug_log "first run time"
/opt/deepinwine/tools/add_hotkeys
/opt/deepinwine/tools/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
#Support use native file dialog
export ATTACH_FILE_DIALOG=1
CallProcess "$@"
#disable Tencent MiniBrowser
_DeleteRegistry "HKCU\\Software\\Tencent\\MiniBrowser"
}
CallWeChat()
{
debug_log "Disable auto update"
_DeleteRegistry "HKCU\\Software\\Tencent\\WeChat" "UpdateFailCnt"
_DeleteRegistry "HKCU\\Software\\Tencent\\WeChat" "NeedUpdateType"
rm "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WeChat/All Users/config/configEx.ini"
export DISABLE_RENDER_CLIPBOARD=1
export ATTACH_FILE_DIALOG=1
CallProcess "$@"
}
CallWXWork()
{
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
export ATTACH_FILE_DIALOG=1
CallProcess "$@"
}
CallWangWang()
{
chmod 700 "$WINEPREFIX/drive_c/Program Files/AliWangWang/9.12.10C/wwbizsrv.exe"
chmod 700 "$WINEPREFIX/drive_c/Program Files/Alibaba/wwbizsrv/wwbizsrv.exe"
CallProcess "$@"
}
#arg 1: exec file path
#arg 2: autostart ,or exec arg 1
#arg 3: exec arg 2
CallApp()
{
FixLink
debug_log "CallApp $BOTTLENAME $*"
if [ "autostart" == "$2" ];then
AutoStartBottle
return
fi
case $BOTTLENAME in
"Deepin-WangWang")
CallWangWang "$@"
;;
"Deepin-ZhuMu")
CallZhuMu "$@"
;;
"Deepin-QQ")
CallQQ "$@"
;;
"Deepin-TIM")
CallTIM "$@"
;;
"Deepin-IrfanView")
CallIrfanView "$@"
;;
"Deepin-dangantongji")
CallYMDATJ "$@"
;;
"Deepin-YMDY")
CallYMDY "$@"
;;
"Deepin-YMGWY")
CallYMGWY "$@"
;;
"Deepin-QQGame"*)
CallQQGame "$@"
;;
"Deepin-QianNiu")
CallQIANNIU "$@"
;;
"Deepin-ATM")
CallATM "$@"
;;
"Deepin-WeChat")
CallWeChat "$@"
;;
"Deepin-WXWork")
CallWXWork "$@"
;;
*)
CallProcess "$@"
;;
esac
}
ExtractApp()
{
$SHELL_DIR/deepin-wine-banner unpack &
mkdir -p "$1"
7z x "$APPDIR/$APPTAR" -o"$1"
mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER"
sed -i "s#@current_user@#$USER#" $1/*.reg
FixLink
$SHELL_DIR/deepin-wine-banner unpacked
}
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 [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then
return
fi
if [ -d "${WINEPREFIX}.tmpdir" ]; then
rm -rf "${WINEPREFIX}.tmpdir"
fi
case $BOTTLENAME in
"Deepin-Intelligent" | "Deepin-QQ" | "Deepin-TIM" | "Deepin-WeChat" | "Deepin-WXWork")
rm -rf "$WINEPREFIX"
DeployApp
return
;;
esac
ExtractApp "${WINEPREFIX}.tmpdir"
/opt/deepinwine/tools/updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v
rm -rf "${WINEPREFIX}.tmpdir"
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
}
RunApp()
{
$SHELL_DIR/deepin-wine-banner
if [[ $? != 0 ]]; then
debug_log "检测到 deepin-wine-banner 运行, exit 1"
exit 1
fi
$SHELL_DIR/deepin-wine-banner start &
if [ -d "$WINEPREFIX" ]; then
UpdateApp
else
DeployApp
fi
CallApp "$@"
}
CreateBottle()
{
CREATE_BOTTLE="1"
if [ -d "$WINEPREFIX" ]; then
UpdateApp
else
DeployApp
fi
}
# Check if some visual feedback is possible
if command -v zenity >/dev/null 2>&1; then
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
}
else
progressbar()
{
cat -
}
fi
if [ -z $1 ] || [ -z $2 ] || [ -z "$3" ]; then
debug_log "Invalid params"
exit 0
fi
BOTTLENAME="$1"
WINEPREFIX="$HOME/.deepinwine/$1"
APPDIR="/opt/deepinwine/apps/$1"
APPVER="$2"
debug_log "Run $*"
if [ -z "$WINE_WMCLASS" ]; then
export WINE_WMCLASS="$DEB_PACKAGE_NAME"
fi
if [ -z "$4" ]; then
RunApp "$3"
exit 0
fi
case $4 in
"-r" | "--reset")
ResetApp
;;
"-cb" | "--create")
CreateBottle
;;
"-e" | "--remove")
RemoveApp
;;
"-u" | "--uri")
RunApp "$3" "$5" "$6"
;;
"-h" | "--help")
HelpApp
;;
*)
echo "Invalid option: $4"
echo "Use -h|--help to get help"
exit 1
;;
esac
exit 0

600
helper/tools/run_v3.sh Executable file
View File

@@ -0,0 +1,600 @@
#!/bin/bash
# Copyright (C) 2016 Deepin, Inc.
#
# Author: Li LongYu <lilongyu@linuxdeepin.com>
# Peng Hao <penghao@linuxdeepin.com>
WINEPREFIX="$HOME/.deepinwine/@public_bottle_name@"
APPDIR="/opt/deepinwine/apps/@public_bottle_name@"
APPVER="@deb_version_string@"
APPTAR="files.7z"
BOTTLENAME=""
WINE_CMD="deepin-wine"
LOG_FILE=$0
CREATE_BOTTLE=""
SHELL_DIR=$(dirname $0)
SHELL_DIR=$(realpath "$SHELL_DIR")
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
if [ $APPRUN_CMD ]; then
WINE_CMD=$APPRUN_CMD
fi
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
_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()
{
echo "${1}"
}
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"
}
FixLink()
{
if [ -d ${WINEPREFIX} ]; then
CUR_DIR=$PWD
cd "${WINEPREFIX}/dosdevices"
rm c: z: y:
ln -s -f ../drive_c c:
ln -s -f / z:
ln -s -f $HOME y:
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 "$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
}
#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 ];then
$SHELL_DIR/kill.sh "$BOTTLENAME" block
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
debug_log_to_file "Starting process $* ..."
export ATTACH_FILE_DIALOG=1
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
#start autobottle
if [ $autostart -eq 0 ];then
$SHELL_DIR/autostart_wine.sh $DEB_PACKAGE_NAME
fi
}
CallZhuMu()
{
#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 $* ..."
if [ -n "$2" ];then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" "--url=$2" &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
fi
}
CallQQGame()
{
debug_log "run $1"
$SHELL_DIR/kill.sh qqgame block
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
}
CallQQ()
{
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"
#Support use native file dialog
export ATTACH_FILE_DIALOG=1
CallProcess "$@"
}
CallTIM()
{
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
debug_log "first run time"
$SHELL_DIR/add_hotkeys
$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
#Support use native file dialog
export ATTACH_FILE_DIALOG=1
CallProcess "$@"
#disable Tencent MiniBrowser
_DeleteRegistry "HKCU\\Software\\Tencent\\MiniBrowser"
}
CallWeChat()
{
debug_log "Disable auto update"
_DeleteRegistry "HKCU\\Software\\Tencent\\WeChat" "UpdateFailCnt"
_DeleteRegistry "HKCU\\Software\\Tencent\\WeChat" "NeedUpdateType"
rm "${WINEPREFIX}/drive_c/users/${USER}/Application Data/Tencent/WeChat/All Users/config/configEx.ini"
export DISABLE_RENDER_CLIPBOARD=1
export ATTACH_FILE_DIALOG=1
CallProcess "$@"
}
CallWangWang()
{
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"
export ATTACH_FILE_DIALOG=1
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$EXEC_PATH" "$2" &
else
CallProcess "$@"
fi
}
CallWXWork()
{
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
export ATTACH_FILE_DIALOG=1
CallProcess "$@"
}
CallDingTalk()
{
debug_log "run $1"
$SHELL_DIR/kill.sh DingTalk block
export ATTACH_FILE_DIALOG=1
CallProcess "$@"
}
urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
CallMeiTuXiuXiu()
{
#set -- "$1" "${2#file://*}"
local path=$(urldecode "$2")
path=${path/file:\/\//}
set -- "$1" $path
CallProcess "$@"
}
CallFastReadPDF()
{
#set -- "$1" "${2#file://*}"
local path=$(urldecode "$2")
path=${path/file:\/\//}
set -- "$1" $path
CallProcess "$@"
}
CallEvernote()
{
local path=$(urldecode "$2")
path=${path/file:\/\//}
set -- "$1" $path
CallProcess "$@"
}
CallTencentVideo()
{
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 "$@"
}
CallFoxmail()
{
sed -i '/LogPixels/d' ${WINEPREFIX}/user.reg
CallProcess "$@"
}
CallTHS()
{
$SHELL_DIR/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/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
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
}
CallQQGameV2()
{
debug_log "run $1"
$SHELL_DIR/kill.sh QQMicroGameBox block
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" -action:force_download -appid:${2} -pid:8 -bin_version:1.1.2.4 -loginuin: &
}
CallEBS250()
{
CallProcess "$@"
}
CallPsCs6()
{
#get file full path
path="$1"
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
path=$(echo ${path//\\/\/})
#kill bloack process
name="${path##*/}"
$SHELL_DIR/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 $* ..."
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
}
#arg 1: exec file path
#arg 2: autostart ,or exec arg 1
#arg 3: exec arg 2
CallApp()
{
FixLink
debug_log "CallApp $BOTTLENAME $*"
case $BOTTLENAME in
"Deepin-WangWang")
CallWangWang "$@"
;;
"Deepin-ZhuMu")
CallZhuMu "$@"
;;
"Deepin-QQ")
CallQQ "$@"
;;
"Deepin-TIM")
CallTIM "$@"
;;
"Deepin-QQGame"*)
CallQQGame "$@"
;;
"Deepin-ATM")
CallATM "$@"
;;
"Deepin-WeChat")
CallWeChat "$@"
;;
"Deepin-WXWork")
CallWXWork "$@"
;;
"Deepin-Dding")
CallDingTalk "$@"
;;
"Deepin-MTXX")
CallMeiTuXiuXiu "$@"
;;
"Deepin-FastReadPDF")
CallFastReadPDF "$@"
;;
"Deepin-Evernote")
CallEvernote "$@"
;;
"Deepin-TencentVideo")
CallTencentVideo "$@"
;;
"Deepin-Foxmail")
CallFoxmail "$@"
;;
"Deepin-THS")
CallTHS "$@"
;;
"Deepin-QQHlddz")
CallQQGameV2 "$1" 363
;;
"Deepin-QQBydr")
CallQQGameV2 "$1" 1104632801
;;
"Deepin-QQMnsj")
CallQQGameV2 "$1" 1105856612
;;
"Deepin-QQSszb")
CallQQGameV2 "$1" 1105640244
;;
"Deepin-CS6")
CallPsCs6 "$@"
;;
"Deepin-EBS250")
CallEBS250 "$1"
;;
*)
CallProcess "$@"
;;
esac
}
ExtractApp()
{
$SHELL_DIR/deepin-wine-banner unpack &
mkdir -p "$1"
7z x "$APPDIR/$APPTAR" -o"$1"
mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER"
sed -i "s#@current_user@#$USER#" $1/*.reg
FixLink
$SHELL_DIR/deepin-wine-banner unpacked
}
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 [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then
return
fi
if [ -d "${WINEPREFIX}.tmpdir" ]; then
rm -rf "${WINEPREFIX}.tmpdir"
fi
case $BOTTLENAME in
"Deepin-Intelligent" | "Deepin-QQ" | "Deepin-TIM" | "Deepin-WeChat" | "Deepin-WXWork" | "Deepin-Dding")
rm -rf "$WINEPREFIX"
DeployApp
return
;;
esac
ExtractApp "${WINEPREFIX}.tmpdir"
$SHELL_DIR/updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v
rm -rf "${WINEPREFIX}.tmpdir"
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
}
RunApp()
{
$SHELL_DIR/deepin-wine-banner
if [[ $? != 0 ]]; then
debug_log "检测到 deepin-wine-banner 运行, exit 1"
exit 1
fi
$SHELL_DIR/deepin-wine-banner start &
if [ -d "$WINEPREFIX" ]; then
UpdateApp
else
DeployApp
fi
CallApp "$@"
}
CreateBottle()
{
CREATE_BOTTLE="1"
if [ -d "$WINEPREFIX" ]; then
UpdateApp
else
DeployApp
fi
}
init_log_file
# Check if some visual feedback is possible
if command -v zenity >/dev/null 2>&1; then
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
}
else
progressbar()
{
cat -
}
fi
if [ -z $1 ] || [ -z $2 ] || [ -z "$3" ]; then
debug_log "Invalid params"
exit 0
fi
BOTTLENAME="$1"
WINEPREFIX="$HOME/.deepinwine/$1"
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 $*"
if [ -z "$WINE_WMCLASS" ]; then
export WINE_WMCLASS="$DEB_PACKAGE_NAME"
fi
if [ -z "$4" ]; then
RunApp "$3"
exit 0
fi
case $4 in
"-r" | "--reset")
ResetApp
;;
"-cb" | "--create")
CreateBottle
;;
"-e" | "--remove")
RemoveApp
;;
"-u" | "--uri")
RunApp "$3" "$5" "$6"
;;
"-h" | "--help")
HelpApp
;;
*)
echo "Invalid option: $4"
echo "Use -h|--help to get help"
exit 1
;;
esac
exit 0

698
helper/tools/run_v4.sh Executable file
View File

@@ -0,0 +1,698 @@
#!/bin/bash
# Copyright (C) 2016 Deepin, Inc.
#
# Author: Li LongYu <lilongyu@linuxdeepin.com>
# Peng Hao <penghao@linuxdeepin.com>
BOTTLENAME="$1"
WINEPREFIX="$HOME/.deepinwine/$1"
APPDIR="/opt/apps/${DEB_PACKAGE_NAME}/files"
APPVER=""
APPTAR="files.7z"
WINE_CMD="deepin-wine"
LOG_FILE=$0
PUBLIC_DIR="/var/public"
export WINEBANNER=1
SHELL_DIR=${0%/*}
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
if [ $APPRUN_CMD ]; then
WINE_CMD=$APPRUN_CMD
fi
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
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
}
_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()
{
echo "${1}"
}
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
if [[ $WINE_CMD == *"deepin-wine8-stable"* ]];then
check_link "$HOME/Documents" Documents
else
check_link "$HOME/Documents" "My Documents"
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 "$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
}
#arg 1: windows process file path
#arg 2-*: windows process args
CallProcess()
{
#get file full path
path="$1"
path=${path/c:/${WINEPREFIX}/drive_c}
path=${path//\\/\/}
#kill bloack process
is_autostart $DEB_PACKAGE_NAME
autostart=$?
if [[ $autostart -ne 0 ]] && [[ "$1" != *"pluginloader.exe" ]];then
$SHELL_DIR/kill.sh "$BOTTLENAME" block
fi
#change current dir to excute path
path=${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 "Starting process $* ..."
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
#start autobottle
if [ $autostart -eq 0 ];then
$SHELL_DIR/autostart_wine.sh $DEB_PACKAGE_NAME
fi
}
CallZhuMu()
{
#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 $* ..."
if [ -n "$2" ];then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" "--url=$2" &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
fi
}
CallQQGame()
{
debug_log "run $1"
$SHELL_DIR/kill.sh qqgame block
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
}
CallQQ()
{
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 "$@"
}
CallTIM()
{
if [ ! -f "$WINEPREFIX/../.QQ_run" ]; then
debug_log "first run time"
$SHELL_DIR/add_hotkeys
$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"
}
CallWeChat()
{
export DISABLE_RENDER_CLIPBOARD=1
CallProcess "$@"
}
CallWangWang()
{
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
}
CallWXWork()
{
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 "$@"
}
CallDingTalk()
{
debug_log "run $1"
$SHELL_DIR/kill.sh DingTalk block
CallProcess "$@"
}
urldecode() { : "${*//+/ }"; echo -e "${_//%/\\x}"; }
CallMeiTuXiuXiu()
{
#set -- "$1" "${2#file://*}"
local path=$(urldecode "$2")
path=${path/file:\/\//}
set -- "$1" $path
CallProcess "$@"
}
CallFastReadPDF()
{
#set -- "$1" "${2#file://*}"
local path=$(urldecode "$2")
path=${path/file:\/\//}
set -- "$1" $path
CallProcess "$@"
}
CallEvernote()
{
local path=$(urldecode "$2")
path=${path/file:\/\//}
set -- "$1" $path
CallProcess "$@"
}
CallTencentVideo()
{
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 "$@"
}
CallFoxmail()
{
sed -i '/LogPixels/d' ${WINEPREFIX}/user.reg
CallProcess "$@"
}
CallTHS()
{
$SHELL_DIR/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/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
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
}
CallQQGameV2()
{
debug_log "run $1"
$SHELL_DIR/kill.sh QQMicroGameBox block
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" -action:force_download -appid:${2} -pid:8 -bin_version:1.1.2.4 -loginuin: &
}
CallPsCs6()
{
#get file full path
path="$1"
path=$(echo ${path/c:/${WINEPREFIX}/drive_c})
path=$(echo ${path//\\/\/})
#kill bloack process
name="${path##*/}"
$SHELL_DIR/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 $* ..."
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$@" &
}
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()
{
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
case $BOTTLENAME in
"Deepin-WangWang")
CallWangWang "$@"
;;
"Deepin-ZhuMu")
CallZhuMu "$@"
;;
"Deepin-QQ")
CallQQ "$@"
;;
"Deepin-TIM")
CallTIM "$@"
;;
"Deepin-QQGame"*)
CallQQGame "$@"
;;
"Deepin-ATM")
CallATM "$@"
;;
"Deepin-WeChat")
CallWeChat "$@"
;;
"Deepin-WXWork")
CallWXWork "$@"
;;
"Deepin-Dding")
CallDingTalk "$@"
;;
"Deepin-MTXX")
CallMeiTuXiuXiu "$@"
;;
"Deepin-FastReadPDF")
CallFastReadPDF "$@"
;;
"Deepin-Evernote")
CallEvernote "$@"
;;
"Deepin-TencentVideo")
CallTencentVideo "$@"
;;
"Deepin-Foxmail")
CallFoxmail "$@"
;;
"Deepin-THS")
CallTHS "$@"
;;
"Deepin-QQHlddz")
CallQQGameV2 "$1" 363
;;
"Deepin-QQBydr")
CallQQGameV2 "$1" 1104632801
;;
"Deepin-QQMnsj")
CallQQGameV2 "$1" 1105856612
;;
"Deepin-QQSszb")
CallQQGameV2 "$1" 1105640244
;;
"Deepin-CS6")
CallPsCs6 "$@"
;;
*)
CallProcess "$@"
;;
esac
}
ExtractApp()
{
$SHELL_DIR/deepin-wine-banner unpack &
mkdir -p "$1"
7z x "$APPDIR/$APPTAR" -o"$1"
if [ $? != 0 ];then
$SHELL_DIR/deepin-wine-banner info "解压失败"
rm -rf "$1"
exit 1
fi
mv "$1/drive_c/users/@current_user@" "$1/drive_c/users/$USER"
sed -i "s#@current_user@#$USER#" $1/*.reg
FixLink
$SHELL_DIR/deepin-wine-banner unpacked
}
DeployApp()
{
ExtractApp "$WINEPREFIX"
if UsePublicDir;then
chgrp -R users "$WINEPREFIX"
chmod -R 0775 "$WINEPREFIX"
fi
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 "/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")
rm -rf "$WINEPREFIX"
DeployApp
return
;;
esac
ExtractApp "${WINEPREFIX}.tmpdir"
$SHELL_DIR/updater -s "${WINEPREFIX}.tmpdir" -c "${WINEPREFIX}" -v
if UsePublicDir;then
chgrp -R users "$WINEPREFIX"
chmod -R 0775 "$WINEPREFIX"
fi
rm -rf "${WINEPREFIX}.tmpdir"
echo "$APPVER" > "$WINEPREFIX/PACKAGE_VERSION"
}
RunApp()
{
$SHELL_DIR/deepin-wine-banner
if [[ $? != 0 ]]; then
debug_log "检测到 deepin-wine-banner 运行, exit 1"
exit 1
fi
$SHELL_DIR/deepin-wine-banner start &
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
# Check if some visual feedback is possible
if command -v zenity >/dev/null 2>&1; then
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
}
else
progressbar()
{
cat -
}
fi
if [ $# -lt 3 ]; then
debug_log "参数个数小于3个"
exit 0
fi
if UsePublicDir;then
WINEPREFIX="$PUBLIC_DIR/$1"
fi
if [ -f "$APPDIR/files.md5sum" ];then
APPVER="$(cat $APPDIR/files.md5sum)"
else
APPVER="$2"
fi
# ARM 需要指定模拟器参数
if [ -f "/opt/deepinemu/tools/init_emu.sh" ];then
source "/opt/deepinemu/tools/init_emu.sh"
export EMU_CMD="$EMU_CMD"
export EMU_ARGS="$EMU_ARGS"
fi
debug_log "Run $*"
if [ -z "$WINE_WMCLASS" ]; then
export WINE_WMCLASS="$DEB_PACKAGE_NAME"
fi
#执行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

BIN
helper/tools/sendkeys.exe Executable file

Binary file not shown.

122
helper/tools/sendkeys.sh Executable file
View File

@@ -0,0 +1,122 @@
#!/bin/bash
# $1 key value
# $2 process name , default QQ|TIM
# $3 control mode , default ctrl+alt
# 0 no control key
# 1 shift+
# 2 ctrl+
# 3 alt+
# 4 ctrl+alt+
# 5 ctrl+shift+
# 6 alt+shift+
# 7 ctrl+alt+shift+
SHELL_DIR=$(dirname $0)
SHELL_DIR=$(realpath "$SHELL_DIR")
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
get_wine_by_pid()
{
cat /proc/$1/maps | grep -E "\/wine$|\/wine64$|\/wine |\/wine64 " | head -1 | awk '{print $6}'
}
get_winepredll_by_pid()
{
WINE_PREDLL=$(xargs -0 printf '%s\n' < /proc/$1/environ | grep WINEPREDLL)
WINE_PREDLL=${WINE_PREDLL##*=}
echo $WINE_PREDLL
}
get_winedllpath_by_pid()
{
WINE_DLLPATH=$(xargs -0 printf '%s\n' < /proc/$1/environ | grep WINEDLLPATH)
WINE_DLLPATH=${WINE_DLLPATH##*=}
echo $WINE_DLLPATH
}
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
WINE_PREFIX=$(realpath $WINE_PREFIX)
echo $WINE_PREFIX
}
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
prefix=${path#*=}
if [ "$prefix" == "$WINE_PREFIX" ]; then
WINE_PREFIX=""
fi
done
if [ -n "$WINE_PREFIX" ];then
PREFIX_LIST+="\n$pid_var=$WINE_PREFIX"
fi
done
echo -e $PREFIX_LIST
}
get_bottle_path_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
get_bottle_path_by_process_id "$PID_LIST"
}
send_to_process()
{
if [ -z "$2" ]; then
return 0
fi
for path in $(get_bottle_path_by_process_name $2); do
proc_pid=${path%=*}
prefix=${path#*=}
wine_cmd=$(get_wine_by_pid $proc_pid)
wine_name=$(echo $wine_cmd | awk -F / '{print $(NF-2)}')
if command -v $wine_name > /dev/null 2>&1; then
wine_cmd="$wine_name"
fi
echo "send to $path by $wine_cmd"
env WINEPREDLL="$(get_winepredll_by_pid $proc_pid)" WINEDLLPATH="$(get_winedllpath_by_pid $proc_pid)" WINEPREFIX="$prefix" "$wine_cmd" "$SHELL_DIR/sendkeys.exe" $1 $3
done
}
if [ -z "$1" ]; then
echo "Please input a key [a-zA-Z]"
exit 0
fi
if [ -n "$2" ]; then
send_to_process $1 $2 $3
else
send_to_process $1 "QQ|TIM"
fi

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()

277
helper/tools/spark_kill.sh Executable file
View File

@@ -0,0 +1,277 @@
#!/bin/bash
#####因为arm版本的deepin-wine-helper不带这个又不想破坏x86兼容性故改名
APP_NAME="QQ"
LOG_FILE=$0
SHELL_DIR=${0%/*}
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/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

427
helper/tools/spark_run_v4.sh Executable file
View File

@@ -0,0 +1,427 @@
#!/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>
#
#
source /opt/durapps/transhell/transhell.sh
load_transhell_debug
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"
SHELL_DIR=$(dirname $0)
SHELL_DIR=$(realpath "$SHELL_DIR")
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
if [ $APPRUN_CMD ]; then
WINE_CMD=$APPRUN_CMD
fi
if [ $SPECIFY_SHELL_DIR ]; then
SHELL_DIR=$SPECIFY_SHELL_DIR
fi
# Check if some visual feedback is possible
if command -v zenity >/dev/null 2>&1; then
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
}
else
progressbar()
{
cat -
}
fi
_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()
{
echo "${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"
# 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
rm c: z: y:
ln -s -f ../drive_c c:
ln -s -f / z:
ln -s -f $HOME y:
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 "$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
}
#########自动启动相关,等用到了再研究
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
#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_to_file "Starting process $* ..."
############# WARNING: Here is the modified content: Now will run set-dwine-scale.sh
/opt/durapps/spark-dwine-helper/scale-set-helper/set-wine-scale.sh "$WINEPREFIX"
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()
{
PID_BANNER=$!
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
APP_CONFIG_PATH="/opt/deepinwine/tools/spark_run_v4_app_configs/${BOTTLENAME}.sh"
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"
(7z 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} $BOTTLENAME..." --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 [ -f "$WINEPREFIX/PACKAGE_VERSION" ] && [ "$(cat "$WINEPREFIX/PACKAGE_VERSION")" = "$APPVER" ]; then
return
fi
if [ -d "${WINEPREFIX}.tmpdir" ]; then
rm -rf "${WINEPREFIX}.tmpdir"
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
UpdateApp
else
DeployApp
fi
CallApp "$@"
}
CreateBottle()
{
if [ -d "$WINEPREFIX" ]; then
UpdateApp
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
BOTTLENAME="$1"
WINEPREFIX="$HOME/.deepinwine/$1"
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

View File

@@ -0,0 +1,2 @@
export DISABLE_RENDER_CLIPBOARD=1
CallProcess "$@"

View File

@@ -0,0 +1,18 @@
#!/bin/bash
#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 $* ..."
if [ -n "$2" ];then
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" "--url=$2" &
else
env WINEPREFIX="$WINEPREFIX" $WINE_CMD "$1" &
fi

View File

@@ -0,0 +1,3 @@
rm -f "$WINEPREFIX/system.reg"
cp $APPDIR/system.reg "$WINEPREFIX/system.reg"
CallProcess "$@"

View File

@@ -0,0 +1,4 @@
#!/bin/bash
CallProcess "$@"
sleep 2
/opt/apps/com.163.music.spark/files/disable_cloudmusic_shadows

View File

@@ -0,0 +1,3 @@
CallProcess "$@"
sleep 2
/opt/apps/com.163.dashi.mailmaster.spark/files/disable_mailmaster_shadows

View File

@@ -0,0 +1,4 @@
if [ -f "${WINEPREFIX}/drive_c/ProgramData/Microsoft/Windows/Start\ Menu/Programs/MuBu.lnk" ]; then
chmod 555 ${WINEPREFIX}/drive_c/ProgramData/Microsoft/Windows/Start\ Menu/Programs/MuBu.lnk
fi
CallProcess "$@"

View File

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

View File

@@ -0,0 +1,16 @@
if [ -e ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/QQMusic.exe ]; then
sleep 1
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.log
else
mkdir ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.dll ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.exe ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.rdb ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/*.log ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic/QQMusic* ${WINEPREFIX}/drive_c/Program\ Files/Tencent
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/updatetemp
rm -rf ${WINEPREFIX}/drive_c/Program\ Files/Tencent/*.log
mv ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic* ${WINEPREFIX}/drive_c/Program\ Files/Tencent/QQMusic
fi
CallProcess "$@"

View File

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

View File

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

View File

@@ -0,0 +1,6 @@
if [ -f "${WINEPREFIX}/drive_c/users/${USER}/Application Data/douyin" ]; then
rm "${WINEPREFIX}/drive_c/users/${USER}/Application Data/douyin"
mv ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/*.tmp ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/douyin
chmod 755 ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/douyin
fi
CallProcess "$@"

View File

@@ -0,0 +1,2 @@
DisableWrite ${WINEPREFIX}/drive_c/users/${USER}/Temp
CallProcess "$@"

View File

@@ -0,0 +1,5 @@
if [ -w ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/飞项/Crashpad/reports ]; then
rm -rf ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/飞项/Crashpad/reports/*
chmod 555 ${WINEPREFIX}/drive_c/users/${USER}/Application\ Data/飞项/Crashpad/reports
fi
CallProcess "$@"

View File

@@ -0,0 +1,37 @@
echo
echo "⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⡟⠉⠻⣷⡄⠀⠀⠀⠀⠀⠀⢀⣀⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣴⣶⣶⣿⣿⡄⠀⠀⢀⣤⣾⠿⠻⣿⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣤⣾⣿⣏⡁⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣼⡿⢿⣿⣯⣀⣿⣿⡿⢿⣿⣿⣿⣿⣿⣷⣄⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢸⣿⣿⣶⣬⡙⠿⠋⣡⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣀⣀⣀⣀⣀⠀⠀⠀⠀⠀⠈⢻⣿⣿⠟⣁⣴⣤⡙⠻⣿⣿⣿⣿⣿⣿⣿⣿⡿⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠺⢿⣿⣿⣿⢿⠇⠀⠀⠀⠀⠀⠀⠹⣷⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣖⣆⣀⣀⣀⣀⣀⣀⣀⡀⠀⠀⠀⠀⠀⠀⠀⠙⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠉⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣿⠟⠛⠛⠛⠛⠛⠛⠛⠷⠿⠿⢿⣷⣶⣤⣤⣀⣸⣿⣿⣿⣿⣿⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⠛⢻⡏⠁⣈⢻⠙⣿⡆⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠛⣲⡟⠞⢀⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣿⡇⠀⠀⠀⠀⢀⣀⣀⣤⣤⣤⣤⣤⣶⣶⣶⣶⣾⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⣿⣷⣶⣾⡿⠿⠿⠛⢛⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⠀⠀⠀⠀⠀⠀⠀⢀⣠⡤⣀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠙⠋⠀⠀⠀⠀⢀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⡄⠀⠀⠀⢠⣾⣿⣿⣿⣿⡆⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣠⣿⣿⣿⣿⣥⣼⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣆⠀⠀⠸⠽⠻⣿⡿⠟⠁⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣼⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣁⣼⣿⣿⣿⣿⣿⢻⣿⡀⠙⣿⣿⣿⣿⣿⣧⠀⠀⠀⠀⣀⣤⣤⣄⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢰⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣾⣿⣿⣶⣿⣿⣿⣿⣿⣿⣇⠀⠀⠀⢿⣿⣿⣿⠇⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡄⠀⠀⠀⠉⠉⠁⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⡿⠿⠾⣿⣿⣿⣿⣿⣿⣿⡿⠷⣬⡻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡇⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣄⠀⢘⣿⣿⣿⣿⣿⠏⠀⠀⣀⣤⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠻⣿⣿⣿⣿⣿⣿⣿⣿⠁⠀⠈⠙⢿⣿⣷⣾⣿⠿⣿⣿⣇⣤⣶⣿⣿⠿⠛⠋⠙⠻⣿⣿⣿⣿⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠉⠻⣿⣿⣿⣿⣷⠀⠀⣠⣶⣿⠿⠉⠁⠀⠀⠀⠉⠉⠉⠻⣿⣷⣄⠀⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣶⣤⣤⣤⣤⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣷⠿⡿⠋⠀⠀⠀⠀⣄⢀⣀⠀⠀⠀⠀⠀⠙⢿⣷⣄⠀⢀⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠛⠀⠀⠀⠀⠀
⣀⣀⠀⠀⠀⠀⢀⣴⣿⣿⠛⠀⠀⢸⣧⡿⠀⠀⣸⠋⠋⠉⢻⡄⠀⠀⠀⠀⠀⠉⢁⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠟⠋⠁⠀⠀⠀⠀⠀⠀⠀
⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣷⣄⠀⠀⠈⠀⠀⠀⢻⣀⣀⣀⣀⡿⠀⠀⠀⠀⠀⠀⠀⢉⣭⣭⣽⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⠀⠀⠀⠀⠀⣀⣤⡄
⠘⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣄⣀⠀⠀⠀⠉⠀⠀⠉⠀⠀⠀⠀⠀⢀⣀⣴⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠃
⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⢟⣿⣿⣿⣿⣶⣶⡶⣶⣶⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀
⠀⠀⠀⠈⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⢿⡸⣿⣿⣿⣿⣎⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠋⠀⠀⠀
⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣯⣽⣿⣿⡟⠁⠀⢙⣿⣿⣿⢿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡏⠉⠀⠀⠀⠀⠀⠀
⠀⠀⠀⢸⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⣿⣿⣿⣿⣿⣦⣶⣿⣿⣿⣿⣿⡿⠿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⠇⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⢿⣿⣿⣿⣿⣿⣿⣿⡿⠁⠀⠘⣿⣿⡿⠟⠉⢿⣯⣿⣿⣿⠁⠀⠀⠈⠻⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⡿⠃⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠙⠿⣿⣿⣿⣿⣿⡇⠀⠀⢸⡟⠋⠀⠀⠀⠀⠙⠛⠋⢸⠀⠀⠀⠀⠀⠘⣿⣿⣿⣿⣿⣿⣿⡿⠿⠛⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠉⠉⢻⣿⠀⠀⠀⢸⡇⠀⠀⠀⠀⠀⠀⠀⠀⢸⡆⠀⠀⠀⠀⠀⢻⣿⣿⣿⣿⠟⠋⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀"
echo "以此纪念2.4.0版本"
CallProcess "$@"

View File

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

View File

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

42
helper/tools/spark_updater Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/bash
# 检查是否提供了-c和-s选项
if [[ ! "$*" =~ "-c" ]] || [[ ! "$*" =~ "-s" ]]; then
echo "用法: updater -c <目标目录> -s <源目录> [-v]"
exit 1
fi
# 解析命令行参数
while getopts ":c:s:v" opt; do
case $opt in
c)
destination_dir=$OPTARG
;;
s)
source_dir=$OPTARG
;;
v)
verbose=true
;;
\?)
echo "无效选项: -$OPTARG" >&2
exit 1
;;
:)
echo "选项 -$OPTARG 需要一个参数." >&2
exit 1
;;
esac
done
# 从源目录复制文件到目标目录
if [ "$verbose" = true ]; then
echo "正在从 $source_dir 复制文件到 $destination_dir"
fi
# 使用cp命令覆盖同名文件
cp -rf "$source_dir"/* "$destination_dir"
echo "文件复制完成!"
exit 0

BIN
helper/tools/startbottle.exe Executable file

Binary file not shown.

View File

@@ -0,0 +1,3 @@
#!/bin/bash
TRANSHELL_CONTENT_UNPACKING="Preparing the following APP:"
TRANSHELL_CONTENT_SPARK_WINDOWS_COMPATIBILITY_TOOL="Spark Windows APP Compatibility Helper"

View File

@@ -0,0 +1,3 @@
#!/bin/bash
TRANSHELL_CONTENT_UNPACKING="正在为您准备以下应用:"
TRANSHELL_CONTENT_SPARK_WINDOWS_COMPATIBILITY_TOOL="星火Windows应用兼容助手"

BIN
helper/tools/updater Executable file

Binary file not shown.

View File

@@ -0,0 +1 @@
../../bashimport/transhell.sh

View File

@@ -1,5 +1,5 @@
{
"Version": "3.6.1",
"Version": "3.7.0",
"Time": "未知",
"Thank": [
"感谢 @ёжезийлёзйз 进行 Loongarch 架构的测试(旧世界,远程)",

View File

@@ -27,14 +27,20 @@ import updatekiller
import subprocess
import req as requests
import urllib.parse as parse
import PyQt5.QtGui as QtGui
try:
import PyQt5.QtGui as QtGui
except:
os.system("python3 -m pip install --upgrade pyqt5 --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple")
os.system("python3 -m pip install --upgrade pyqt5 --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple --break-system-packages")
import PyQt5.QtGui as QtGui
import PyQt5.QtCore as QtCore
import PyQt5.QtWidgets as QtWidgets
try:
import PyQt5.QtWebEngineWidgets as QtWebEngineWidgets
bad = False
except:
threading.Thread(target=os.system, args=["python3 -m pip install --upgrade PyQtWebEngine --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple"]).start()
threading.Thread(target=os.system, args=["python3 -m pip install --upgrade PyQtWebEngine --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple --break-system-packages"]).start()
bad = True
from trans import *
from Model import *
@@ -353,6 +359,8 @@ class Runexebutton_threading(QtCore.QThread):
res = subprocess.Popen([runCommand], shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
# 实时读取程序返回
#
print(runCommand)
lastRunCommand = runCommand
if not setting["TerminalOpen"]:
while res.poll() is None:
try:
@@ -361,8 +369,8 @@ class Runexebutton_threading(QtCore.QThread):
text = ""
self.signal.emit(text)
print(text, end="")
lastRunCommand = runCommand
print(runCommand)
if len(findExeHistory) == 0 or findExeHistory[-1] != wineBottonPath:
findExeHistory.append(wineBottonPath) # 将记录写进数组
write_txt(get_home() + "/.config/deepin-wine-runner/FindExeHistory.json", str(json.dumps(ListToDictionary(findExeHistory)))) # 将历史记录的数组转换为字典并写入
@@ -397,19 +405,7 @@ StartupNotify=true''')
class Temp:
webWindow = None
def OpenUrl(url):
print(url.url())
# 判断是否可以使用小窗打开
if not bad:
'''Temp.webWindow = QtWidgets.QMainWindow()
web = QtWebEngineWidgets.QWebEngineView()
web.setUrl(url)
Temp.webWindow.setWindowTitle("浏览页面")
Temp.webWindow.setCentralWidget(web)
Temp.webWindow.setWindowIcon(QtGui.QIcon(iconPath))
Temp.webWindow.show()
return'''
webbrowser.open_new_tab(url.url())
#QtCore.QUrl().url()
@@ -423,6 +419,8 @@ def about_this_program()->"显示“关于这个程序”窗口":
QT.message = QtWidgets.QMainWindow()
QT.message.setWindowIcon(QtGui.QIcon(iconPath))
messageWidget = QtWidgets.QWidget()
messageWidget.setObjectName("messageWidget")
messageWidget.setStyleSheet(f"QWidget#messageWidget {{background: url({programPath}/Icon/Program/about-background.png) no-repeat;background-position: left bottom;}}")
QT.message.setWindowTitle(f"关于 {title}")
messageLayout = QtWidgets.QGridLayout()
iconShow = QtWidgets.QLabel(f"<a href='https://www.gfdgdxi.top'><img width=256 src='{iconPath}'></a>")
@@ -430,12 +428,15 @@ def about_this_program()->"显示“关于这个程序”窗口":
global clickIconTime
if clickIconTime >= 0:
clickIconTime = clickIconTime + 1
if clickIconTime > 5:
if clickIconTime > 0:
clickIconTime = -1
for k in ["", "Function"]:
for i in os.listdir(f"{programPath}/Icon/{k}"):
if i[-4:] == ".svg" or i[-4:] == ".png":
iconPathList.append(f"{programPath}/Icon/{k}/{i}")
for k in ["", "Function", "Program"]:
try:
for i in os.listdir(f"{programPath}/Icon/{k}"):
if i[-4:] == ".svg" or i[-4:] == ".png":
iconPathList.append(f"{programPath}/Icon/{k}/{i}")
except:
traceback.print_exec()
randomNumber = random.randint(0, len(iconPathList) - 1)
iconShow.setText(f"<a href='https://www.gfdgdxi.top'><img width=256 src='{iconPathList[randomNumber]}'></a><p align='center'>{randomNumber + 1}/{len(iconPathList)}</p>")
iconShow.linkActivated.connect(ChangeIcon)
@@ -452,6 +453,7 @@ def about_this_program()->"显示“关于这个程序”窗口":
ok.clicked.connect(QT.message.close)
messageLayout.addWidget(ok, 1, 1, 1, 1, QtCore.Qt.AlignBottom | QtCore.Qt.AlignRight)
messageWidget.setLayout(messageLayout)
QT.message.setCentralWidget(messageWidget)
QT.message.resize(int(messageWidget.frameGeometry().width() * 1.5), int(messageWidget.frameGeometry().height() * 1.5))
QT.message.show()
@@ -1227,6 +1229,7 @@ class UpdateWindow():
versionLabel = QtWidgets.QLabel(f"当前版本:{version}\n最新版本:未知\n更新内容:")
updateText = QtWidgets.QTextBrowser()
updateText.anchorClicked.connect(OpenUrl)
updateText.setOpenLinks(False)
updateText.setOpenExternalLinks(False)
ok = QtWidgets.QPushButton(QtCore.QCoreApplication.translate("U", "更新(更新时会自动关闭 Wine 运行器)"))
ok.clicked.connect(UpdateWindow.Update)
@@ -1278,9 +1281,20 @@ class UpdateWindow():
if os.path.exists("/tmp/spark-deepin-wine-runner/update"):
shutil.rmtree("/tmp/spark-deepin-wine-runner/update")
os.makedirs("/tmp/spark-deepin-wine-runner/update")
unPackageNew = False
isArch = False
isFedora = False
if os.path.exists("/etc/arch-release"):
isArch = True
if UpdateWindow.data["Url-pkg"][0] == None:
unPackageNew = True
if os.path.exists("/etc/fedora-release"):
isFedora = True
if UpdateWindow.data["Url-rpm"][0] == None:
unPackageNew = True
try:
print(UpdateWindow.data["Url"])
if os.path.exists(f"{programPath}/off-line.lock") or programPath != "/opt/apps/deepin-wine-runner":
if os.path.exists(f"{programPath}/off-line.lock") or programPath != "/opt/apps/deepin-wine-runner" or unPackageNew:
# 使用解压法更新
write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
echo 删除多余的安装包
@@ -1300,8 +1314,37 @@ zenity --info --text=\"更新完毕!\" --ellipsize
OpenTerminal("bash /tmp/spark-deepin-wine-runner/update.sh")
return
else:
# 使用 deb 安装更新
write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
if isArch:
# 使用 pacman 安装更新
write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
echo 删除多余的安装包
rm -rfv /tmp/spark-deepin-wine-runner/update/*
echo 关闭“Wine 运行器”
python3 "{programPath}/updatekiller.py"
echo 下载安装包
wget -P /tmp/spark-deepin-wine-runner/update {UpdateWindow.data["Url-pkg"][0]}
echo 安装安装包
pacman -U /tmp/spark-deepin-wine-runner/update/* --noconfirm
notify-send -i "{iconPath}" "更新完毕!"
zenity --info --text=\"更新完毕!\" --ellipsize
""")
elif isFedora:
# 使用 yum 安装更新
write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
echo 删除多余的安装包
rm -rfv /tmp/spark-deepin-wine-runner/update/*
echo 关闭“Wine 运行器”
python3 "{programPath}/updatekiller.py"
echo 下载安装包
wget -O /tmp/spark-deepin-wine-runner/update/spark-deepin-wine-runner.rpm {UpdateWindow.data["Url-rpm"][0]}
echo 安装安装包
yum reinstall /tmp/spark-deepin-wine-runner/update/spark-deepin-wine-runner.rpm -y
notify-send -i "{iconPath}" "更新完毕!"
zenity --info --text=\"更新完毕!\" --ellipsize
""")
else:
# 使用 deb 安装更新
write_txt("/tmp/spark-deepin-wine-runner/update.sh", f"""#!/bin/bash
echo 删除多余的安装包
rm -rfv /tmp/spark-deepin-wine-runner/update/*
echo 关闭“Wine 运行器”
@@ -2065,7 +2108,10 @@ def SaveLog():
def GetNewInformation():
try:
text = requests.get("http://wine-runner.gfdgdxi.top/info/").text
# 获取是否为最新版本的公告
informationID = requests.get("http://update.gfdgdxi.top/wine-runner/info/id.json").json()["Number"]
text = requests.get("http://update.gfdgdxi.top/wine-runner/info/").text.replace("Icon/QR/", f"{programPath}/Icon/QR/")
write_txt(f"{get_home()}/.config/deepin-wine-runner/information/{informationID}", informationID)
except:
traceback.print_exc()
text = f"""<p>无法连接到服务器</p>
@@ -2077,12 +2123,18 @@ def GetNewInformation():
global webInformation
if bad:
webInformation = QtWidgets.QTextBrowser()
webInformation.anchorClicked.connect(OpenUrl)
webInformation.setOpenLinks(False)
webInformation.setOpenExternalLinks(False)
else:
webInformation = QtWebEngineWidgets.QWebEngineView()
webInformation.setHtml(text)
webInformation.setWindowTitle("获取程序公告")
webInformation.setWindowIcon(QtGui.QIcon(iconPath))
webInformation.resize(int(webInformation.frameGeometry().width() * 1.3), int(webInformation.frameGeometry().height() * 1.1))
webInformation.setWindowFlags(webInformation.windowFlags() | QtCore.Qt.Dialog)
webInformation.setWindowModality(QtCore.Qt.ApplicationModal)
webInformation.show()
def getFileFolderSize(fileOrFolderPath):
@@ -2294,6 +2346,8 @@ 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") # 创建配置文件夹
if not os.path.exists(f"{get_home()}/.config/deepin-wine-runner/information"): # 如果没有配置文件夹
os.mkdir(f"{get_home()}/.config/deepin-wine-runner/information") # 创建配置文件夹
if not os.path.exists(get_home() + "/.config/deepin-wine-runner/ShellHistory.json"): # 如果没有配置文件
write_txt(get_home() + "/.config/deepin-wine-runner/ShellHistory.json", json.dumps({})) # 创建配置文件
if not os.path.exists(get_home() + "/.config/deepin-wine-runner/FindExeHistory.json"): # 如果没有配置文件
@@ -2339,6 +2393,8 @@ def CheckWine():
"spark-wine7-devel": "spark-wine7-devel",
"spark-wine8": "spark-wine8",
"spark-wine8-wow": "spark-wine8-wow",
"spark-wine9": "spark-wine9",
"spark-wine9-wow": "spark-wine9-wow",
"deepin-wine": "deepin-wine",
"deepin-wine5": "deepin-wine5",
"wine": "wine",
@@ -2580,12 +2636,6 @@ app.installTranslator(trans)
iconPath = "{}/deepin-wine-runner.svg".format(programPath)
iconPathList = [
"{}/deepin-wine-runner.svg".format(programPath),
f"{programPath}/Icon/Program/AboutIcon1.png",
f"{programPath}/Icon/Program/AboutIcon0.png",
f"{programPath}/Icon/Program/webp2.png",
f"{programPath}/Icon/Program/webp3.png",
f"{programPath}/Icon/Program/Windows虚拟机.png",
f"{programPath}/Icon/Program/wine打包器.png"
]
#iconPath = "{}/Icon/Program/wine运行器.png".format(programPath)
@@ -2605,23 +2655,20 @@ exe路径\' 参数 \'
5、wine 容器如果没有指定,则会默认为 ~/.wine
6、如果可执行文件比较大的话会出现点击“获取该程序运行情况”出现假死的情况因为正在后台读取 SHA1只需要等一下即可读取速度依照您电脑处理速度、读写速度、可执行文件大小等有关
7、如果非 X86 的用户的 UOS 专业版用户想要使用的话,只需要在应用商店安装一个 Wine 版本微信即可在本程序选择正确的 Wine 运行程序;''')
updateThingsString = QtCore.QCoreApplication.translate("U", '''<b>3.6.1 更新内容:</b>
1、修复应用无法打开的问题
<b>3.6.0 更新内容:</b>
1、修复高级打包器选择软件适配脚本后无法打包的问题 https://gitee.com/gfdgd-xi/deep-wine-runner/issues/I8I110
2、支持调用 Deepin Wine8 Stable
3、移除过时的 Wine 安装程序入口
※4、Wine 安装器支持根据地区自动选择国内源以及国际源
※5、Wine 安装器新增 Sourceforge 源
※6、新增 Wine 运行报告生成功能
※7、初步英语翻译
※8、新增离线安装包只支持 amd64
※9、支持识别 /opt 文件夹下的 Wine
10、新增 Wine 运行器视频教程的 Youtube 入口''')
updateThingsString = QtCore.QCoreApplication.translate("U", '''※1、修复简易打包器在 Deepin/UOS 上无法正常启动的问题
2、打包器生成的 deb 修复在非 Deepin/UOS 且未安装星火应用商店的系统中启动器无程序图标的问题
※3、修复 Box86/64 国内源源失效的问题
※4、适配 Arch Linux
5、适配 Fedora
6、打包器支持将 deb 包转换为其它格式
7、适配 deepin 23 beta3
8、新增公告和新版本提示功能
9、修复公告的链接在部分机器无法正常打开的问题
10、新增赞赏入口
11、支持识别 spark-wine9、spark-wine9-wow''')
for i in information["Thank"]:
thankText += f"{i}\n"
updateTime = "2023年12月24"
updateTime = "2024年02月02"
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>
@@ -2663,9 +2710,57 @@ Deepin 论坛:<a href="https://bbs.deepin.org">https://bbs.deepin.org</a>
gfdgd xi<a href="https://gfdgd-xi.github.io">https://gfdgd-xi.github.io</a>
<hr>
<h1>©2020~{time.strftime("%Y")} By gfdgd xi</h1>'''
defaultCommandText = """<pre>在此可以看到wine安装应用时的终端输出内容
=============================================================
如果解决了你的问题请不要吝啬你的star哟
也可以<a href='http://update.gfdgdxi.top/Appreciate'>请作者喝一杯茶</a>
程序地址:
<a href='https://gitee.com/gfdgd-xi/deep-wine-runner'>https://gitee.com/gfdgd-xi/deep-wine-runner</a>
<a href='https://github.com/gfdgd-xi/deep-wine-runner'>https://github.com/gfdgd-xi/deep-wine-runner</a>
<a href='https://sourceforge.net/projects/deep-wine-runner'>https://sourceforge.net/projects/deep-wine-runner</a>"""
# 创建线程用于获取是否有更新
class GetUpdateToShow(QtCore.QThread):
signal = QtCore.pyqtSignal(str)
def __init__(self):
super().__init__()
def run(self):
global defaultCommandText
# 获取更新
url = "http://update.gfdgdxi.top/update.json"
try:
data = json.loads(requests.get(url).text)
if data["Version"] != version:
# 版本号读取(防止出现高版本号提示要“升级”到低版本号的问题)
localVersionList = version.split(".")
webVersionList = data['Version'].split(".")
for i in range(len(localVersionList)):
local = int(localVersionList[i])
web = int(webVersionList[i])
if web < local:
break
if web > local:
defaultCommandText += f"""\n=============================================================
Wine运行器 {data['Version']} 发布了!<a href='http://update.gfdgdxi.top/update-wine-runner'>点此立即更新</a>"""
except:
traceback.print_exc()
# 获取应用公告
try:
informationID = requests.get("http://update.gfdgdxi.top/wine-runner/info/id.json").json()["Number"]
if not os.path.exists(f"{get_home()}/.config/deepin-wine-runner/information/{informationID}"):
defaultCommandText += f"""\n=============================================================
程序有新的公告,<a href='http://update.gfdgdxi.top/information-wine-runner'>点此立即查看</a>"""
except:
traceback.print_exc()
if lastRunCommand == "暂未运行命令":
self.signal.emit(defaultCommandText + "</pre>")
offLineInformation = ""
if os.path.exists(f"{programPath}/off-line.lock"):
title = "Wine 运行器 {}(离线模式)".format(version)
try:
offLineInformation = readtxt(f"{programPath}/off-line.lock")
except:
traceback.print_exc()
else:
title = "Wine 运行器 {}".format(version)
#<h1>©2020~{time.strftime("%Y")} <a href="https://gitee.com/gfdgd-xi">By gfdgd xi</h1>'''
@@ -2821,17 +2916,27 @@ button_r_6.setSizePolicy(size)
wineConfig.setSizePolicy(size)
returnText = QtWidgets.QTextBrowser()
getUpdate = GetUpdateToShow()
getUpdate.signal.connect(returnText.setHtml)
getUpdate.start()
def ReturnTextOpenUrl(url):
print(url)
if url.url() == "http://update.gfdgdxi.top/update-wine-runner":
UpdateWindow.ShowWindow()
elif url.url() == "http://update.gfdgdxi.top/information-wine-runner":
GetNewInformation()
elif url.url() == "http://update.gfdgdxi.top/Appreciate":
Appreciate()
else:
webbrowser.open_new_tab(url.url())
returnText.anchorClicked.connect(ReturnTextOpenUrl)
returnText.setOpenExternalLinks(False)
returnText.setOpenLinks(False)
returnText.setStyleSheet("""
background-color: black;
color: white;
""")
returnText.setText(QtCore.QCoreApplication.translate("U", """在此可以看到wine安装应用时的终端输出内容
=============================================
如果解决了你的问题请不要吝啬你的star哟
地址:
https://gitee.com/gfdgd-xi/deep-wine-runner
https://github.com/gfdgd-xi/deep-wine-runner
https://sourceforge.net/projects/deep-wine-runner"""))
returnText.setHtml(QtCore.QCoreApplication.translate("U", defaultCommandText) + "</pre>")
mainLayout.setRowStretch(0, 2)
mainLayout.setRowStretch(1, 1)
mainLayout.setColumnStretch(0, 2)
@@ -2839,9 +2944,15 @@ mainLayout.setColumnStretch(1, 1)
mainLayout.addWidget(returnText, 0, 1, 2, 1)
# 版权
copy = QtWidgets.QLabel(f"""程序版本:{version}<b>提示Wine 无法保证可以运行所有的 Windows 程序,如果想要运行更多 Windows 程序,可以考虑虚拟机和双系统</b><br/>
if offLineInformation.replace("\n", "").replace(" ", "") == "":
copy = QtWidgets.QLabel(f"""程序版本:{version}<b>提示Wine 无法保证可以运行所有的 Windows 程序,如果想要运行更多 Windows 程序,可以考虑虚拟机和双系统</b><br/>
<b>注:部分二进制兼容层会自动注册 binfmt如原版的 Box86/64、Qemu User Static则意味着无需在 Wine 版本那里特别指定兼容层,直接指定 Wine 即可</b><br/>
©2020~{time.strftime("%Y")} gfdgd xi""")
else:
copy = QtWidgets.QLabel(f"""程序版本:{version}<b>提示Wine 无法保证可以运行所有的 Windows 程序,如果想要运行更多 Windows 程序,可以考虑虚拟机和双系统</b><br/>
<b>注:部分二进制兼容层会自动注册 binfmt如原版的 Box86/64、Qemu User Static则意味着无需在 Wine 版本那里特别指定兼容层,直接指定 Wine 即可</b><br/>
{offLineInformation}<br/>
©2020~{time.strftime("%Y")} gfdgd xi""")
mainLayout.addWidget(copy, 2, 0, 1, 1)
# 程序运行
@@ -3305,6 +3416,7 @@ wineRunnerHelp = QtWidgets.QAction(QtWidgets.QApplication.style().standardIcon(2
h3 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "更新内容"))
h4 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "鸣谢名单"))
h5 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "更新这个程序"))
appreciate = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "赞赏作者/请作者喝杯茶"))
programInformation = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "获取程序公告(也可以在这里看程序安装/打开量)"))
h6 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "反馈这个程序的建议和问题"))
fenUpload = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "程序评分"))
@@ -3338,6 +3450,7 @@ help.addAction(h5)
help.addAction(h6)
help.addAction(fenUpload)
help.addAction(programInformation)
help.addAction(appreciate)
help.addAction(h7)
help.addAction(h8)
help.addSeparator()
@@ -3351,6 +3464,7 @@ gitlab.triggered.connect(lambda: webbrowser.open_new_tab("https://gitlab.com/gfd
jihu.triggered.connect(lambda: webbrowser.open_new_tab("https://sourceforge.net/projects/deep-wine-runner/"))
runStatusWebSize.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgd-xi.github.io/wine-runner-info"))
h2.triggered.connect(helps)
appreciate.triggered.connect(Appreciate)
h3.triggered.connect(UpdateThings)
wineRunnerHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://bbs.deepin.org/post/246837"))
h4.triggered.connect(ThankWindow)
@@ -3366,7 +3480,7 @@ programInformation.triggered.connect(GetNewInformation)
#threading.Thread(target=GetVersion).start()
GetVersion()
# 窗口设置
window.resize(widget.frameGeometry().width() * 2, widget.frameGeometry().height())
window.resize(int(widget.frameGeometry().width() * 2), int(widget.frameGeometry().height()))
widget.setLayout(mainLayout)
window.setWindowIcon(QtGui.QIcon(f"{programPath}/deepin-wine-runner.svg"))
widget.show()
@@ -3392,6 +3506,16 @@ for i in [
if not os.path.exists(i[1]):
for x in i[0]:
x.setDisabled(True)
# 有些功能是 Arch Linux 不适用的,需要屏蔽
if os.path.exists("/etc/arch-release") or os.path.exists("/etc/fedora-release"):
if os.path.exists(f"{programPath}/off-line.lock"):
for i in [p1]:
i.setDisabled(True)
for i in [installLat, installWineHQ, installWineHQOrg,
installBox86CN, installBox86, installBox86Own, addWineDebMirrorForDeepin20]:
i.setDisabled(True)
for i in actionList:
i.setDisabled(True)
# 有些功能是非 X86 不适用的,需要屏蔽
if subprocess.getoutput("arch").lower() != "x86_64":
p1.setDisabled(True)
@@ -3400,7 +3524,8 @@ if subprocess.getoutput("arch").lower() != "x86_64":
#v1.setDisabled(True)
installWineHQ.setDisabled(True)
installWineHQOrg.setDisabled(True)
pass
if os.path.exists("/etc/arch-release"):
p1.setEnabled(True)
o1.setCurrentText(setting["DefultWine"])
e1.setEditText(setting["DefultBotton"])
e2.setEditText("")
@@ -3416,6 +3541,7 @@ if o1.currentText() == "":
canUseWine.append("没有识别到任何Wine请在菜单栏“程序”安装Wine或安装任意Wine应用")
o1.addItem("没有识别到任何Wine请在菜单栏“程序”安装Wine或安装任意Wine应用")
SetFont(setting["FontSize"])
# Mini 模式
# MiniMode(True)
sys.exit(app.exec_())

BIN
off-line-shell/bwrap_arm64 Executable file

Binary file not shown.

View File

@@ -1,5 +1,5 @@
{
"Version": "3.6.1",
"Version": "3.7.0",
"Time": "未知",
"Thank": [
"感谢 @ёжезийлёзйз 进行 Loongarch 架构的测试(旧世界,远程)",

View File

@@ -307,7 +307,9 @@ TranslateTemplateFileUos "$outdir/info"
#if no desktop_file_categories, don't create desktop
if [ -n "$desktop_file_categories" ]; then
mkdir -p "$outentries/applications"
mkdir -p "$dstdir/usr/share/applications"
cp "$curdir/template/target.desktop" "$outentries/applications/$deb_package_name.desktop"
cp "$curdir/template/target.desktop" "$dstdir/usr/share/applications/$deb_package_name.desktop"
TranslateTemplateFileUos "$outentries/applications/$deb_package_name.desktop"
# TODO: We should generate icons from main program automatically.

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