Compare commits

...

29 Commits

Author SHA1 Message Date
df5d08cd68 应用运行库新增bwrap识别
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-21 11:46:54 +08:00
2357c646a1 优化在termux的使用体验 2024-07-21 11:34:44 +08:00
0b0a757765 添加NOVNC 2024-07-21 09:36:40 +08:00
104d197e4b 调整依赖关系以在termux可以获得更好的体验
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-20 22:53:49 +08:00
60f838144d 初步termux支持 2024-07-20 22:26:35 +08:00
3146467477 新增proot和android识别
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-20 09:37:26 +08:00
30d4986214 调整系统判断机制
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-19 22:59:46 +08:00
11ad6f3766 新增Wine tag 取反逻辑(!) 2024-07-19 22:54:12 +08:00
046fe2c103 修复AOSC loong64 因为 pyperclip 问题导致无法正常打开运行器的问题 2024-07-19 22:16:55 +08:00
b672fd93e6 修复打包器选择Wine封装入deb模式时helper只能使用spark dwine helper的问题 2024-07-19 21:59:46 +08:00
a7d478ab93 更改 Wine git 仓库地址以修复 Wine 日构建问题
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-19 11:22:03 +08:00
c4987b4ce6 适配AOSC
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-18 21:13:28 +08:00
6ac4fa72ad 修改下更新日志
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-17 21:37:48 +08:00
15946ccb4e 适配debian testing的7z以修复打包时会把/打入.7z包导致死机的问题 2024-07-17 21:16:36 +08:00
e109502c34 新增开关选项
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-17 14:54:37 +08:00
97f944f4b9 安装更多wine工具支持根据当前机器实际情况自动推荐适合的wine 2024-07-17 14:45:30 +08:00
a447fa6343 清空下过时的helper
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-16 22:39:04 +08:00
3018f4276e 调整run.sh 2024-07-16 22:37:36 +08:00
c3bfb33dd9 推荐安装helper 2024-07-16 22:32:48 +08:00
f1decf51d1 支持导入.7z包时自动移除部分特殊符号
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-15 21:46:24 +08:00
e3c54ffc32 支持手动导入7z包 2024-07-15 20:46:21 +08:00
10db5c042d 安装wine出新增网盘入口
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-15 15:14:20 +08:00
18ce8a080f 支持调用GXDE的deepin-terminal-gtk 2024-07-15 12:52:51 +08:00
f9e9a4eb72 调整运行器缩放机制
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-07-14 18:48:30 +08:00
ebb6c2c5fa 修改打包器包名生成机制以及文本提示 2024-07-14 18:27:01 +08:00
de98af8c99 漏调Makefile
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
2024-07-12 19:06:19 +08:00
5f41d73dbd 跟进dxvk 2024-07-12 19:05:25 +08:00
7aff330137 忘记改启动器虚拟机入口的qemu调用了,现在支持调用Qemu Extra了
Some checks failed
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Has been cancelled
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Has been cancelled
2024-06-30 09:22:16 +08:00
6c53446134 修复deepin23无法正常使用Mono/gecko安装器的问题
Some checks are pending
Auto Building Wine Runner(rpm) / Explore-GitHub-Actions (push) Waiting to run
Auto Building Wine Runner(deb) / Explore-GitHub-Actions (push) Waiting to run
2024-06-29 18:50:56 +08:00
125 changed files with 1291 additions and 5120 deletions

1
.gitignore vendored
View File

@@ -5,3 +5,4 @@ VM-source/Makefile
*.rpm
*.pro.user
.vscode
build-*-Debug

3
.gitmodules vendored Normal file
View File

@@ -0,0 +1,3 @@
[submodule "novnc"]
path = novnc
url = https://github.com/novnc/noVNC

74
ExePreview/.gitignore vendored Normal file
View File

@@ -0,0 +1,74 @@
# This file is used to ignore files which are generated
# ----------------------------------------------------------------------------
*~
*.autosave
*.a
*.core
*.moc
*.o
*.obj
*.orig
*.rej
*.so
*.so.*
*_pch.h.cpp
*_resource.rc
*.qm
.#*
*.*#
core
!core/
tags
.DS_Store
.directory
*.debug
Makefile*
*.prl
*.app
moc_*.cpp
ui_*.h
qrc_*.cpp
Thumbs.db
*.res
*.rc
/.qmake.cache
/.qmake.stash
# qtcreator generated files
*.pro.user*
CMakeLists.txt.user*
# xemacs temporary files
*.flc
# Vim temporary files
.*.swp
# Visual Studio generated files
*.ib_pdb_index
*.idb
*.ilk
*.pdb
*.sln
*.suo
*.vcproj
*vcproj.*.*.user
*.ncb
*.sdf
*.opensdf
*.vcxproj
*vcxproj.*
# MinGW generated files
*.Debug
*.Release
# Python byte code
*.pyc
# Binaries
# --------
*.dll
*.exe

View File

@@ -0,0 +1,3 @@
{
"Keys": ["application/x-ms-dos-executable", "application/x-msi", "application/x-ms-shortcut"]
}

31
ExePreview/ExePreview.pro Normal file
View File

@@ -0,0 +1,31 @@
QT += gui
TEMPLATE = lib
CONFIG += plugin core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
INCLUDEPATH += /usr/include/dde-file-manager/
DISTFILES += dfmpreview-wine-runner-plugin.json
CONFIG += c++17
# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
SOURCES += \
dfmexepreview.cpp \
main.cpp
HEADERS += \
dfmexepreview.h \
main.h
DISTFILES += ExePreview.json
# Default rules for deployment.
unix {
target.path = $$[QT_INSTALL_PLUGINS]/generic
}
!isEmpty(target.path): INSTALLS += target

View File

@@ -0,0 +1,59 @@
#include "dfmexepreview.h"
#include <dfileservices.h>
DFMExePreview::DFMExePreview(QObject *parent) : DFMFilePreview(parent)
{
}
DFMExePreview::~DFMExePreview()
{
if (m_view) {
m_view->deleteLater();
m_view = NULL;
}
if (m_statusBar) {
m_statusBar->deleteLater();
m_statusBar = NULL;
}
}
void DFMExePreview::initialize(QWidget *window, QWidget *statusBar)
{
Q_UNUSED(window)
Q_UNUSED(statusBar)
if (!m_view) {
m_view = new QLabel();
}
if (!m_statusBar) {
m_statusBar = new QLabel();
}
}
bool DFMExePreview::setFileUrl(const DUrl &url)
{
m_url = url;
m_view->setText("114514");
return 1;
}
DUrl DFMExePreview::fileUrl() const
{
return m_url;
}
QWidget *DFMExePreview::contentWidget() const
{
return m_view;
}
QWidget *DFMExePreview::statusBarWidget() const
{
return m_statusBar;
}
QString DFMExePreview::title() const
{
return m_title;
}

View File

@@ -0,0 +1,28 @@
#ifndef DFMEXEPREVIEW_H
#define DFMEXEPREVIEW_H
#include <QObject>
#include <dfmfilepreview.h>
#include <QLabel>
class DFMExePreview : public DFM_NAMESPACE::DFMFilePreview
{
Q_OBJECT
public:
explicit DFMExePreview(QObject *parent = NULL);
~DFMExePreview();
virtual void initialize(QWidget *window, QWidget *statusBar) Q_DECL_OVERRIDE;
virtual bool setFileUrl(const DUrl &url) Q_DECL_OVERRIDE;
virtual DUrl fileUrl() const Q_DECL_OVERRIDE;
virtual QWidget *contentWidget() const Q_DECL_OVERRIDE;
virtual QWidget *statusBarWidget() const Q_DECL_OVERRIDE;
virtual QString title() const Q_DECL_OVERRIDE;
protected:
DUrl m_url;
QLabel *m_view = NULL;
QLabel *m_statusBar = NULL;
QString m_title;
};
#endif // DFMEXEPREVIEW_H

17
ExePreview/main.cpp Normal file
View File

@@ -0,0 +1,17 @@
#include "main.h"
#include "dfmexepreview.h"
GenericPlugin::GenericPlugin(QObject *parent)
: DFM_NAMESPACE::DFMFilePreviewPlugin(parent)
{
}
/*QObject *GenericPlugin::create(const QString &name, const QString &spec)
{
}*/
DFM_NAMESPACE::DFMFilePreview *GenericPlugin::create(const QString &key)
{
Q_UNUSED(key);
return new DFMExePreview;
}

22
ExePreview/main.h Normal file
View File

@@ -0,0 +1,22 @@
#define DFMFilePreviewFactoryInterface_ood "com.deepin.filemanager.DFMFilePreviewFactoryInterface_WineRunner"
#ifndef MAIN_H
#define MAIN_H
#include <QGenericPlugin>
#include <dfmfilepreviewplugin.h>
class GenericPlugin : public DFM_NAMESPACE::DFMFilePreviewPlugin
{
Q_OBJECT
Q_PLUGIN_METADATA(IID QGenericPluginFactoryInterface_iid FILE "ExePreview.json")
public:
explicit GenericPlugin(QObject *parent = nullptr);
virtual DFM_NAMESPACE::DFMFilePreview *create(const QString &key);
};
#endif // MAIN_H

View File

@@ -17,7 +17,7 @@ import traceback
try:
import pyquery
except:
os.system("python3 -m pip install --upgrade pyquery --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple")
os.system("python3 -m pip install --upgrade pyquery --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple --break-system-packages")
if "--help" in sys.argv:
print("作者gfdgd xi")
@@ -127,4 +127,4 @@ except:
file.write(programVersion)
file.close()
if exitInputShow:
input("安装结束,按回车键退出")
input("安装结束,按回车键退出")

View File

@@ -34,7 +34,7 @@ package-pkg:
sudo debtap -Q spark-deepin-wine-runner.deb
sudo debtap -Q spark-deepin-wine-runner-ace.deb
package-deb:
copy-files:
#cd VM-source && qmake
#cd VM-source && make
#cd wine && make
@@ -49,6 +49,7 @@ package-deb:
cp -rv VM-source/*.fd VM
cp -rv wine/ deb/opt/apps/deepin-wine-runner/
cp -rv Test/ deb/opt/apps/deepin-wine-runner/
cp -rv dxvk/ deb/opt/apps/deepin-wine-runner
cp -rv information.json package-script
zip -v -q -r package-script.zip package-script
cp -rv InstallBox86-cn.sh deb/opt/apps/deepin-wine-runner/
@@ -116,7 +117,6 @@ package-deb:
cp -rv UpdateGeek.sh deb/opt/apps/deepin-wine-runner
cp -rv AppStore.py deb/opt/apps/deepin-wine-runner
cp -rv InstallWineOnDeepin23.py deb/opt/apps/deepin-wine-runner
cp -rv dxvk.7z deb/opt/apps/deepin-wine-runner
cp -rv InstallFont.py deb/opt/apps/deepin-wine-runner
cp -rv CheckDLL deb/opt/apps/deepin-wine-runner
cp -rv InstallLat.sh deb/opt/apps/deepin-wine-runner
@@ -146,6 +146,8 @@ package-deb:
cp -rv RemoveQemuUser.sh deb/opt/apps/deepin-wine-runner
cp -rv InstallBox86.sh deb/opt/apps/deepin-wine-runner
cp -rv InstallRuntime deb/opt/apps/deepin-wine-runner
if [[ ! -d novnc/utils/websockify ]]; then git submodule update --init --recursive ; fi
cp -rv novnc deb/opt/apps/deepin-wine-runner
mkdir -pv deb/opt/apps/deepin-wine-runner/entries/
cp -rv deb/usr/share/applications deb/opt/apps/deepin-wine-runner/entries/applications
python3 UpdateTime.py
@@ -177,16 +179,45 @@ package-deb:
bash builddeb/ChangeDebVersion.sh
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
remove-copy-files:
sudo rm -rfv /tmp/spark-deepin-wine-runner-builder
package-deb:
make copy-files -j$(nproc)
dpkg-deb -Z xz -z 9 -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner.deb
make remove-copy-files -j$(nproc)
# 构建 ace 包
cp -rv deb-ace /tmp/spark-deepin-wine-runner-builder
cp -rv spark-deepin-wine-runner.deb /tmp/spark-deepin-wine-runner-builder/opt/apps/spark-deepin-wine-runner-ace
bash builddeb/ChangeDebVersion.sh
sudo chown -R root:root /tmp/spark-deepin-wine-runner-builder
dpkg-deb -Z xz -z 9 -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner-ace.deb
sudo rm -rfv /tmp/spark-deepin-wine-runner-builder
dpkg-deb -Z xz -z 0 -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner-ace.deb
make remove-copy-files -j$(nproc)
package-termux-deb:
make copy-files -j$(nproc)
# 替换 DEBIAN
sudo rm -rf /tmp/spark-deepin-wine-runner-builder/DEBIAN
sudo rm -rf /tmp/spark-deepin-wine-runner-builder/usr/bin/*
sudo rm -rf /tmp/spark-deepin-wine-runner-builder/usr/share/applications/*
sudo rm -rf /tmp/spark-deepin-wine-runner-builder/opt/apps/deepin-wine-runner/entries/applications/*
sudo mkdir -pv /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/
sudo mv /tmp/spark-deepin-wine-runner-builder/usr/ /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/ -v
sudo mv /tmp/spark-deepin-wine-runner-builder/opt /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt -v
sudo ln -s /data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/bin/deepin-wine-runner
sudo ln -s /data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-packager.py /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/bin/deepin-wine-package-builder
sudo ln -s /data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-packager-with-script.py /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/bin/deepin-wine-packager-with-script
sudo ln -s /data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-easy-packager.py /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/bin/deepin-wine-packager-easy-builder
sudo cp deb-termux/DEBIAN /tmp/spark-deepin-wine-runner-builder/DEBIAN -rv
sudo cp -rv deb-termux/usr/share/applications /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/entries/applications
sudo cp -rv deb-termux/usr/share/applications /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/share/applications
# 加入 termux loader
sudo cp -rv mainwindow-termux-loader.sh /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner
sudo cp -rv mainwindow.py /tmp/spark-deepin-wine-runner-builder/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/mainwindow.py
sudo bash builddeb/ChangeDebVersion.sh
dpkg-deb -Z xz -z 9 -b /tmp/spark-deepin-wine-runner-builder spark-deepin-wine-runner-termux.deb
make remove-copy-files -j$(nproc)
install:
make build -j$(nproc)

View File

@@ -14,12 +14,14 @@ programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
terminal = ""
terminalList = [
"deepin-terminal",
"deepin-terminal-gtk",
"mate-terminal",
"gnome-terminal",
"xfce4-terminal"
]
terminalEnd = {
f"{programPath}/../launch.sh\" \"deepin-terminal": ["-e", 0],
f"{programPath}/../launch.sh\" \"deepin-terminal-gtk": ["-e", 0],
"mate-terminal": ["-e", 1],
"gnome-terminal": ["--", 0],
"xfce4-terminal": ["-e", 1]
@@ -28,6 +30,8 @@ for i in terminalList:
if not os.system(f"which {i}"):
if i == "deepin-terminal":
i = f"{programPath}/../launch.sh\" \"deepin-terminal"
if i == "deepin-terminal-gtk":
i = f"{programPath}/../launch.sh\" \"deepin-terminal-gtk"
terminal = i
break
if terminal == "":

View File

@@ -11,6 +11,8 @@ Wine运行器是一个能让Linux用户更加方便地运行Windows应用的程
而且对于部分 Wine 应用适配者来说,提供了图形化的打包工具,以及提供了一些常用工具以及运行库的安装方式,以及能安装多种不同的 Wine 以测试效果,能极大提升适配效率。
且对于 Deepin23 用户做了特别优化,以便能在缺少 i386 运行库的情况下运行 Wine32。同时也为非 X86 架构用户提供了 Box86/64、Qemu User 的安装方式
当前支持 amd64、arm64、mips64el、loong64新世界、loongarch64旧世界、riscv64
注:
**在使用运行器时不要随便动 .deepinwine 下的容器,否则会导致安装的 wine 应用无法正常打开**
**除非你有把握不会损坏容器**

View File

@@ -0,0 +1,30 @@
#!/bin/bash
import os
import sys
import binascii
def Replace(fileName: str):
with open(f"{fileName}", "rb") as file:
data = file.read()
if (sys.argv[2] == "x86_64"):
data = data.replace(bytes("/lib64/ld-linux-x86-64.so.2".encode()),
bytes("/data/data/com.termux/gfdgd".encode())) # 替换与被替换需要保证字符数量相同
if (sys.argv[2] == "aarch64"):
data = data.replace(bytes("/lib/ld-linux-aarch64.so.1".encode()),
bytes("/data/data/com.termux/gfdg".encode())) # 替换与被替换需要保证字符数量相同
with open(f"{fileName}", "wb") as file:
file.write(data)
longest = 0
def Find(path: str):
global longest
for i in os.listdir(path):
newpath = f"{path}/{i}"
if (len(newpath) > longest):
longest = len(newpath)
print(f"\r{newpath}" + " " * (longest - len(newpath)), end="")
if (os.path.isfile(newpath)):
Replace(newpath)
if (os.path.isdir(newpath)):
Find(newpath)
Find(sys.argv[1])

View File

@@ -16,6 +16,7 @@ if [[ 0 == $? ]]; then
exit
fi
# 检查是否有 QEMU
export PATH=/opt/apps/deepin-wine-runner-qemu-system-extra/files/usr/local/bin:$PATH
which qemu-system-x86_64
if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
if [[ -f "$HOME/.config/deepin-wine-runner/QemuSetting.json" ]]; then
@@ -24,6 +25,10 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
python3 ./VM/StartQemu.py
exit
fi
# 判断是否有安装增强 Qemu
if [[ -f /opt/apps/deepin-wine-runner-qemu-system-extra/files/run.sh ]]; then
qemuMore=/opt/apps/deepin-wine-runner-qemu-system-extra/files/run.sh
fi
# 查看CPU个数
CpuSocketNum=`cat /proc/cpuinfo | grep "cpu cores" | uniq | wc -l`
# 查看CPU核心数
@@ -63,7 +68,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
./VM/kvm-ok
if [[ $? == 0 ]] && [[ `arch` == "x86_64" ]]; then
echo X86 架构,使用 kvm 加速
qemu-system-x86_64 --enable-kvm -cpu host --hda "$HOME/Qemu/Windows/Windows.qcow2" \
$qemuMore qemu-system-x86_64 --enable-kvm -cpu host --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-device AC97 -device ES1370 -device intel-hda -device hda-duplex \
@@ -88,6 +93,9 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
qemuPath="bwrap --dev-bind / / --bind ./VM/MipsQemu/usr/lib/mips64el-linux-gnuabi64/qemu/ui-gtk.so /usr/lib/mips64el-linux-gnuabi64/qemu/ui-gtk.so ./VM/MipsQemu/usr/bin/qemu-system-x86_64"
fi
fi
if [[ $qemuMore != "" ]]; then
qemuPath=$qemuMore
fi
echo 不使用 kvm 加速
$qemuPath --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
@@ -111,7 +119,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
echo $qemuUEFI
./VM/kvm-ok
if [[ $? == 0 ]] && [[ `arch` == "aarch64" ]]; then
qemu-system-arm --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" \
$qemuMore qemu-system-arm --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-cpu max -M virt -device virtio-gpu-pci \
@@ -123,7 +131,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
> /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
exit
fi
qemu-system-arm --hda "$HOME/Qemu/Windows/Windows.qcow2" \
$qemuMore qemu-system-arm --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-cpu max -M virt -device virtio-gpu-pci \
@@ -149,7 +157,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
echo $qemuUEFI
./VM/kvm-ok
if [[ $? == 0 ]] && [[ `arch` == "aarch64" ]]; then
qemu-system-aarch64 --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" \
$qemuMore qemu-system-aarch64 --enable-kvm --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-cpu max -M virt \
@@ -162,7 +170,7 @@ if [[ $? == 0 ]] && [[ -f "$HOME/Qemu/Windows/Windows.qcow2" ]]; then
> /tmp/windows-virtual-machine-installer-for-wine-runner-install.log 2>&1 # 最新的 qemu 已经移除参数 -soundhw all
exit
fi
qemu-system-aarch64 --hda "$HOME/Qemu/Windows/Windows.qcow2" \
$qemuMore qemu-system-aarch64 --hda "$HOME/Qemu/Windows/Windows.qcow2" \
-smp $CpuCount,sockets=$CpuSocketNum,cores=$(($CpuCoreNum / $CpuSocketNum)),threads=$(($CpuCount / $CpuCoreNum / $CpuSocketNum)) \
-m ${use}G -display vnc=:5 -display gtk -usb -nic model=rtl8139 $qemuUEFI \
-cpu max -M virt \

View File

@@ -1,6 +1,8 @@
#!/usr/bin/env python3
import os
import sys
import subprocess
import PyQt5.QtWidgets as QtWidgets
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
arch = subprocess.getoutput("dpkg --print-architecture").replace(" ", "").replace("\n", "")
if os.path.exists(f"{programPath}/VirtualMachine-{arch}"):
@@ -13,6 +15,10 @@ if not os.path.exists(f"{programPath}/VirtualMachine-amd64"):
if os.path.exists(f"{programPath}/VirtualMachine-{arch}"):
os.system(f"{programPath}/VirtualMachine-{arch}")
exit()
app = QtWidgets.QApplication(sys.argv)
QtWidgets.QMessageBox.information(None, "提示", "虚拟机安装器暂不支持此系统")
exit(1)
# 后面已废弃
# 只能使用 Qemu User 运行程序
if os.path.exists("/usr/lib/x86_64-linux-gnu/") and not os.system("which qemu-x86_64"):
os.system(f"qemu-x86_64 '{programPath}/VirtualMachine-x86_64'")

59
deb-termux/DEBIAN/control Executable file
View File

@@ -0,0 +1,59 @@
Package: spark-deepin-wine-runner-termux
Version: @@VERSION@@
Maintainer: gfdgd xi <3025613752@qq.com>
Homepage: https://gitee.com/gfdgd-xi/deep-wine-runner
Architecture: all
Severity: serious
Certainty: possible
Check: binaries
Type: binary, udeb
Priority: optional
Depends: python3,
python3-pil | pillow | python-pillow,
python3-pil.imagetk | pillow | python-tkinter,
aria2,
curl,
unrar | unrar-free ,
unzip,
python3-pyqt5 | pyqt5,
xfce4-terminal | deepin-terminal-gtk | deepin-terminal | mate-terminal | gnome-terminal,
p7zip-full | p7zip-legacy | p7zip,
zenity,
tree,
dpkg,
fakeroot,
which,
git,
xfwm4,
tigervnc,
proot,
bash
Recommends: winbind,
wimtools | wimlib,
python3-pyquery,
python3-pyqt5.qtwebengine | pyqtwebengine,
binfmt-support,
libc6:i386,
libc6:armhf,
libwine,
qemu-system,
qemu-full,
qemu,
qemu-system-x86-64,
qemu-system-i386,
qemu-system-arm,
qemu-system-aarch64,
qemu-utils,
alien,
spark-deepin-wine-runner-qemu-system-extra,
deepin-wine8-stable | spark-wine | spark-wine9 | spark-wine9-wow | spark-wine8 | spark-wine8-wow | spark-wine7-devel | deepin-wine6-stable | deepin-wine5-stable | deepin-wine5 | deepin-wine | wine | wine-stable,
spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepin
Section: utils
Conflicts: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52
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 安装器、微型应用商店、各种Wine工具、自制的Wine程序打包器、运行库安装工具等。
它同时还内置了基于Qemu/VirtualBox制作的、专供小白使用的Windows虚拟机安装工具可以做到只需下载系统镜像并点击安装即可无需考虑虚拟机的安装、创建、分区等操作也能在非 X86 架构安装 X86 架构的 Windows 操作系统(但是效率较低,可以运行些老系统)。
而且对于部分 Wine 应用适配者来说,提供了图形化的打包工具,以及提供了一些常用工具以及运行库的安装方式,以及能安装多种不同的 Wine 以测试效果,能极大提升适配效率。
且对于 Deepin23 用户做了特别优化,以便能在缺少 i386 运行库的情况下运行 Wine32。同时也为非 X86 架构用户提供了 Box86/64、Qemu User 的安装方式

111
deb-termux/DEBIAN/postinst Executable file
View File

@@ -0,0 +1,111 @@
#!/bin/bash
# 使用系统默认的 sh 运行
#################################################################################################################
# 作者gfdgd xi
# 版本3.0.0
# 更新时间2022年10月02日
# 感谢:感谢 wine、deepin-wine 以及星火团队,提供了 wine、deepin-wine、spark-wine-devel 给大家使用,让我能做这个程序
# 基于 sh
#################################################################################################################
# 非强制性的必应组件,所以成功不成功都行
# 程序版本号
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 requests --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 psutil --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple --break-system-packages > /dev/null 2>&1 | true
# termux 在使用 pip 安装 dbus-python 时会卡住
# python3 -m pip install --upgrade dbus-python --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 pyperclip --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 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
python3 -m pip install --upgrade requests --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
python3 -m pip install --upgrade psutil --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
# termux 在使用 pip 安装 dbus-python 时会卡住
# python3 -m pip install --upgrade dbus-python --trusted-host https://repo.huaweicloud.com -i https://repo.huaweicloud.com/repository/pypi/simple > /dev/null 2>&1 | true
python3 -m pip install --upgrade pyperclip --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
rm -rf /opt/apps/deepin-wine-runner/arm-package
fi
if [ -d /opt/apps/deepin-wine-runner/dlls-arm ]; then
rm -rf /opt/apps/deepin-wine-runner/dlls-arm
fi
if [ -d /opt/apps/deepin-wine-runner/exa ]; then
rm -rf /opt/apps/deepin-wine-runner/exa
fi
if [ -d /opt/apps/deepin-wine-runner/dxvk ]; then
rm -rf /opt/apps/deepin-wine-runner/dxvk
fi
echo 移除完成
# 如果为非 X86 PC可以删除掉一些无用组件主要是用不了
if [[ `arch` != "x86_64" ]]; then
echo 非X86架构删除对非X86架构无用的组件
# 删除虚拟机功能
#rm -rf /opt/apps/deepin-wine-runner/StartVM.sh
#rm -rf /opt/apps/deepin-wine-runner/RunVM.sh
#rm -rf /opt/apps/deepin-wine-runner/VM
#rm -rf /usr/share/applications/spark-deepin-wine-runner-control-vm.desktop
#rm -rf /usr/share/applications/spark-deepin-wine-runner-start-vm.desktop
# 删除安装 wine 功能
rm -rf "/opt/apps/deepin-wine-runner/wine install"
# 这个注释掉的理论可用,不移除
#rm -rf "/opt/apps/deepin-wine-runner/wine"
rm -rf /usr/bin/deepin-wine-runner-wine-installer
rm -rf /usr/bin/deepin-wine-runner-wine-install-deepin23
rm -rf /usr/bin/deepin-wine-runner-wine-install
rm -rf /usr/bin/deepin-wine-runner-winehq-install
rm -rf /opt/apps/deepin-wine-runner/InstallWineOnDeepin23.py
rm -rf /opt/apps/deepin-wine-runner/sparkstore.list
rm -rf /opt/apps/deepin-wine-runner/AllInstall.py
rm -rf /opt/apps/deepin-wine-runner/InstallNewWineHQ.sh
fi
# 处理 VM 工具
vmPath=/opt/apps/deepin-wine-runner/VM/VirtualMachine-`dpkg --print-architecture`
echo 当前架构为:`dpkg --print-architecture`
if [ -f $vmPath ]; then
echo 虚拟机工具有该架构的预编译文件
# 移除辅助文件
rm -f /opt/apps/deepin-wine-runner/VM/VirtualMachine
# 移动
mv $vmPath /opt/apps/deepin-wine-runner/VM/VirtualMachine
rm -f /opt/apps/deepin-wine-runner/VM/VirtualMachine-*
else
echo 虚拟机工具无该架构的预编译文件
rm -f /opt/apps/deepin-wine-runner/VM/VirtualMachine-*
fi
echo 处理完成!
# 修复 3.3.0.1 Box86 源挂了的问题
if [ -f /etc/apt/sources.list.d/box86.list ]; then
bash -c "echo deb http://seafile.jyx2048.com:2345/spark-deepin-wine-runner/data/box86-debs/debian ./ > /etc/apt/sources.list.d/box86.list"
fi
# Gitlink 源挂了
# 到时候切换 gpg 源会方便很多
#if [ -r /etc/apt/sources.list.d/better-dde.list ]; then
# if [ -d /usr/share/deepin-installer ]; then
# # 用于修复 Deepin Community Live CD Install 版签名过期的问题
# wget -P /tmp/gfdgd-xi-sources https://code.gitlink.org.cn/gfdgd_xi/gfdgd-xi-apt-mirrors/raw/branch/master/gpg.asc
# rm -rfv /etc/apt/trusted.gpg.d/gfdgdxi-list.gpg | true
# cp -v /tmp/gfdgd-xi-sources/gpg.asc.gpg /etc/apt/trusted.gpg.d/gfdgdxi-list.gpg
# # 用于修复 2022.11.25 Better DDE 导致的 Deepin Community Live CD Install 版问题
# # 移除 Better DDE 源
# rm -rfv /etc/apt/sources.list.d/better-dde.list
# apt update > /dev/null 2>&1 | true
# fi
#fi
# 设置目录权限,让用户可读可写,方便后续删除组件
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

54
deb-termux/DEBIAN/postrm Executable file
View File

@@ -0,0 +1,54 @@
#!/bin/bash
# 使用系统默认的 sh 运行
#################################################################################################################
# 作者gfdgd xi
# 版本2.2.0
# 更新时间2022年09月24日
# 感谢:感谢 wine、deepin-wine 以及星火团队,提供了 wine、deepin-wine、spark-wine-devel 给大家使用,让我能做这个程序
# 基于 sh
#################################################################################################################
# 删除软件残留,简单粗暴一点直接全部删掉,防止出现警告
# 加判断是为了怕 reinstall 后程序就再也打不开了(除非卸载后重新安装)
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
rm -rf /opt/apps/deepin-wine-runner/
fi
# 删除软件缓存(留着也没什么用了)
# 缓存目录:~/.cache/deepin-wine-runner
if [ "$1" = "remove" ] || [ "$1" = "purge" ]; then
echo "清理程序缓存"
for username in $(ls /home); do
echo /home/$username
if [ -d "/home/$username/.cache/deepin-wine-runner/" ]; then
rm -rf "/home/$username/.cache/deepin-wine-runner/"
fi
done
# 清理 root 用户的缓存文件
echo /root
if [ -d "/root/.cache/deepin-wine-runner/" ]; then
rm -rf "/root/.cache/deepin-wine-runner/"
fi
else
echo "非卸载,跳过清理"
fi
# 删除软件配置文件只限“purge”
# 配置目录:~/.config/deepin-wine-runner
if [ "$1" = "purge" ]; then
echo "清理程序配置文件"
for username in $(ls /home); do
echo /home/$username
if [ -d "/home/$username/.config/deepin-wine-runner/" ]; then
rm -rf "/home/$username/.config/deepin-wine-runner/"
fi
done
# 清理 root 用户的配置文件
echo /root
if [ -d "/root/.config/deepin-wine-runner/" ]; then
rm -rf "/root/.config/deepin-wine-runner/"
fi
else
echo "非 purge跳过清理"
fi

View File

@@ -0,0 +1 @@
/opt/apps/deepin-wine-runner/API/Python/

View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
X-Categories=System;Wine;
Exec=/data/data/com.termux/files/usr/bin/deepin-wine-package-builder "~/.wine" %F
Icon=/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Package Builder
Name[zh]=Wine 打包器
Terminal=false
StartupNotify=true
NoDisplay=true
Keywords=exe;scr;
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;

View File

@@ -0,0 +1,12 @@
[Desktop Entry]
Type=Application
X-Categories=System;Wine;
Exec=/data/data/com.termux/files/usr/bin/deepin-wine-packager-easy-builder %F
Icon=/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Package Builder
Name[zh]=Wine 简易打包器
Terminal=false
StartupNotify=true
NoDisplay=true
Keywords=exe;scr;
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;

View File

@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
X-Categories=System;Wine;
Exec=/data/data/com.termux/files/usr/bin/deepin-wine-packager-with-script
Icon=/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Package Builder For UOS
NoDisplay=true
Name[zh]=Wine 打包器(基于活动脚本)
Terminal=false
StartupNotify=true

View File

@@ -0,0 +1,10 @@
[Desktop Entry]
Type=Application
X-Categories=System;Wine;
Exec=/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/RunVM.sh %F
Icon=/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Setting VirtualMachine
Name[zh]=设置 Windows 虚拟机
NoDisplay=true
Terminal=false
StartupNotify=true

View File

@@ -0,0 +1,9 @@
[Desktop Entry]
Type=Application
X-Categories=System;
Exec=/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/StartVM.sh %F
Icon=/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Start Windows VirtualMachine
Name[zh]=开启 Windows 虚拟机
Terminal=false
StartupNotify=true

View File

@@ -0,0 +1,11 @@
[Desktop Entry]
Type=Application
X-Categories=System;Wine;
Exec=/data/data/com.termux/files/usr/bin/deepin-wine-runner %F
Icon=/data/data/com.termux/files/usr/opt/apps/deepin-wine-runner/deepin-wine-runner.svg
Name=Wine Runner
Name[zh]=Wine 运行器
Terminal=false
StartupNotify=true
Keywords=exe;scr;
MimeType=application/x-ms-dos-executable;application/x-msi;application/x-ms-shortcut;

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<vendor>gfdgd xi</vendor>
<vendor_url>https://gitee.com/gfdgd-xi/deep-wine-runner/</vendor_url>
<action id="com.deepin.pkexec.deepin-wine-venturi-setter">
<message>Authentication is required to change run_v3 file manager</message>
<message xml:lang="zh_CN">修改 run_v3 文管需要输入密码</message>
<icon_name>preferences-system</icon_name>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/opt/apps/deepin-wine-runner/deepin-wine-venturi-setter.py</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<vendor>gfdgd xi</vendor>
<vendor_url>https://gitee.com/gfdgd-xi/deep-wine-runner/</vendor_url>
<action id="com.deepin.pkexec.mount">
<message>Authentication is required to mount file</message>
<message xml:lang="zh_CN">挂载文件需要输入密码</message>
<icon_name>preferences-system</icon_name>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/mount</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

View File

@@ -0,0 +1,21 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
"-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
"http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
<vendor>gfdgd xi</vendor>
<vendor_url>https://gitee.com/gfdgd-xi/deep-wine-runner/</vendor_url>
<action id="com.deepin.pkexec.umount">
<message>Authentication is required to unmount file</message>
<message xml:lang="zh_CN">卸载文件需要输入密码</message>
<icon_name>preferences-system</icon_name>
<defaults>
<allow_any>no</allow_any>
<allow_inactive>no</allow_inactive>
<allow_active>auth_admin_keep</allow_active>
</defaults>
<annotate key="org.freedesktop.policykit.exec.path">/usr/bin/umount</annotate>
<annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
</action>
</policyconfig>

View File

@@ -8,8 +8,42 @@ Certainty: possible
Check: binaries
Type: binary, udeb
Priority: optional
Depends: python3, python3-pil, python3-pil.imagetk, python3-pyquery, aria2, curl, unrar | unrar-free , unzip, python3-requests, python3-pyqt5, python3-psutil, xfce4-terminal | deepin-terminal | mate-terminal | gnome-terminal, python3-dbus, python3-pip, p7zip-full | p7zip-legacy, 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, spark-deepin-wine-runner-qemu-system-extra, deepin-wine8-stable | spark-wine | spark-wine9 | spark-wine9-wow | spark-wine8 | spark-wine8-wow | spark-wine7-devel | deepin-wine6-stable | deepin-wine5-stable | deepin-wine5 | deepin-wine | wine
Depends: python3,
python3-pil | pillow,
python3-pil.imagetk | pillow,
aria2,
curl,
unrar | unrar-free ,
unzip,
python3-requests,
python3-pyqt5 | pyqt5,
python3-psutil | pypsutil,
xfce4-terminal | deepin-terminal-gtk | deepin-terminal | mate-terminal | gnome-terminal,
python3-dbus,
python3-pip | pip, p7zip-full | p7zip-legacy | p7zip,
sudo,
python3-pyperclip | pyperclip,
bubblewrap,
zenity,
tree,
dpkg,
fakeroot,
bash
Recommends: winbind,
wimtools | wimlib,
python3-pyquery,
python3-pyqt5.qtwebengine | pyqtwebengine,
binfmt-support,
libc6:i386,
libc6:armhf,
libwine,
qemu-system,
qemu-full,
qemu,
alien,
spark-deepin-wine-runner-qemu-system-extra,
deepin-wine8-stable | spark-wine | spark-wine9 | spark-wine9-wow | spark-wine8 | spark-wine8-wow | spark-wine7-devel | deepin-wine6-stable | deepin-wine5-stable | deepin-wine5 | deepin-wine | wine,
spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepin
Section: utils
Conflicts: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52
Replaces: spark.deepin-venturi-setter, spark-deepin-wine5-application-packer, spark-deepin-wine-runner-52

View File

@@ -220,10 +220,18 @@ BOTTLENAME="@@@Package@@@"
APPVER="@@@Version@@@"
EXEC_PATH="@@@EXEC_PATH@@@"
##### 软件在wine中的启动路径
##### 软件在wine中的启动路径
SHELL_DIR=$(dirname $(realpath $0))
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
if [ -e "$SHELL_DIR/deepinwine/tools/spark_run_v4.sh" ] ;then
# 如果 helper 在 run.sh 相同目录的 deepinwine/tools/spark_run_v4.sh 则可以调用
START_SHELL_PATH="$SHELL_DIR/deepinwine/tools/spark_run_v4.sh"
fi
if [ -e "/opt/deepinwine/tools/run_v4.sh" ] ;then
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
fi
if [ -e "/opt/deepinwine/tools/spark_run_v4.sh" ] ;then
START_SHELL_PATH="/opt/deepinwine/tools/spark_run_v4.sh"
else
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
fi
ENABLE_DOT_NET=""
####若使用spark-wine时需要用到.net则请把ENABLE_DOT_NET设为true同时在依赖中写spark-wine7-mono
@@ -557,7 +565,7 @@ class RunThread(QtCore.QThread):
self.RunCommand(f"cp -rv '{folderExePath}' '{bottlePath}/drive_c/Program Files'")
debPackageVersion = self.GetEXEVersion(exePath.text(), bottlePath)
debDescription = f"{exeName} By Build By Wine Runner Easy Packager"
debDepends = f"{chooseWine} | {chooseWine}-bcm | {chooseWine}-dcm | com.{chooseWine}.deepin, spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepin, fonts-wqy-microhei, fonts-wqy-zenhei"
debDepends = f"{chooseWine} | {chooseWine}-bcm | {chooseWine}-dcm | com.{chooseWine}.deepin, spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepinwinerunner, fonts-wqy-microhei, fonts-wqy-zenhei"
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'")
@@ -581,7 +589,7 @@ class RunThread(QtCore.QThread):
self.RunCommand(f"rm -fv '{bottlePath}/drive_c/users/@current_user@/Downloads'")
self.RunCommand(f"rm -fv '{bottlePath}/drive_c/users/@current_user@/Templates'")
########### 打包容器
self.RunCommand(f"7z a '{bottlePackagePath}' '{bottlePath}/'*")
self.RunCommand(f"7z a -snh -snl '{bottlePackagePath}' '{bottlePath}/'*")
########### 生成文件内容
buildProgramSize = getFileFolderSize(debBuildPath) / 1000
replaceMap = [

View File

@@ -215,9 +215,9 @@ def Build7z(b, self, debInformation, debPackagePath):
os.system(f"cp -rv '{b}' '{debPackagePath}/opt/cxoffice/support/{e5_text.text()}'")
return
if debPackagePath[-3: ] == ".7z":
self.run_command("7z a '{}' '{}/'*".format(debPackagePath, b))
self.run_command("7z a -snh -snl '{}' '{}/'*".format(debPackagePath, b))
else:
self.run_command("7z a {}/opt/apps/{}/files/files.7z '{}/'*".format(debPackagePath, e1_text.text(), b))
self.run_command("7z a -snh -snl {}/opt/apps/{}/files/files.7z '{}/'*".format(debPackagePath, e1_text.text(), b))
def Build7zButton_Clicked():
@@ -410,7 +410,7 @@ class make_deb_threading(QtCore.QThread):
"Architecture": debFirstArch.currentText(),
"Depends": [
f"{wine[wineVersion.currentText()]}, deepin-wine-helper | com.wine-helper.deepin, fonts-wqy-microhei, fonts-wqy-zenhei",
f"{wine[wineVersion.currentText()]}, spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepin, fonts-wqy-microhei, fonts-wqy-zenhei"
f"{wine[wineVersion.currentText()]}, spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepinwinerunner, fonts-wqy-microhei, fonts-wqy-zenhei"
][int(chooseWineHelperValue.isChecked())],
"postinst": ['', f'''#!/bin/bash
PACKAGE_NAME="{e1_text.text()}"
@@ -537,10 +537,17 @@ BOTTLENAME="@@@BOTTLENAME@@@"
APPVER="@@@APPVER@@@"
EXEC_PATH="@@@EXEC_PATH@@@"
##### 软件在wine中的启动路径
SHELL_DIR=$(dirname $(realpath $0))
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
if [ -e "$SHELL_DIR/deepinwine/tools/spark_run_v4.sh" ] ;then
# 如果 helper 在 run.sh 相同目录的 deepinwine/tools/spark_run_v4.sh 则可以调用
START_SHELL_PATH="$SHELL_DIR/deepinwine/tools/spark_run_v4.sh"
fi
if [ -e "/opt/deepinwine/tools/run_v4.sh" ] ;then
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
fi
if [ -e "/opt/deepinwine/tools/spark_run_v4.sh" ] ;then
START_SHELL_PATH="/opt/deepinwine/tools/spark_run_v4.sh"
else
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
fi
ENABLE_DOT_NET=""
####若使用spark-wine时需要用到.net则请把ENABLE_DOT_NET设为true同时在依赖中写spark-wine7-mono
@@ -1054,10 +1061,18 @@ BOTTLENAME="@@@BOTTLENAME@@@"
APPVER="@@@APPVER@@@"
EXEC_PATH="@@@EXEC_PATH@@@"
##### 软件在wine中的启动路径
##### 软件在wine中的启动路径
SHELL_DIR=$(dirname $(realpath $0))
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
if [ -e "$SHELL_DIR/deepinwine/tools/spark_run_v4.sh" ] ;then
# 如果 helper 在 run.sh 相同目录的 deepinwine/tools/spark_run_v4.sh 则可以调用
START_SHELL_PATH="$SHELL_DIR/deepinwine/tools/spark_run_v4.sh"
fi
if [ -e "/opt/deepinwine/tools/run_v4.sh" ] ;then
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
fi
if [ -e "/opt/deepinwine/tools/spark_run_v4.sh" ] ;then
START_SHELL_PATH="/opt/deepinwine/tools/spark_run_v4.sh"
else
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
fi
ENABLE_DOT_NET=""
####若使用spark-wine时需要用到.net则请把ENABLE_DOT_NET设为true同时在依赖中写spark-wine7-mono
@@ -1341,7 +1356,7 @@ true
print("c")
if os.path.exists(wine[wineVersion.currentText()]):
debInformation[0]["Depends"] = ["deepin-wine-helper | com.wine-helper.deepin",
"spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepin"
"spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepinwinerunner"
][int(chooseWineHelperValue.isChecked())] #+ ["", "libasound2 (>= 1.0.16), libc6 (>= 2.28), libglib2.0-0 (>= 2.12.0), libgphoto2-6 (>= 2.5.10), libgphoto2-port12 (>= 2.5.10), libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0), liblcms2-2 (>= 2.2+git20110628), libldap-2.4-2 (>= 2.4.7), libmpg123-0 (>= 1.13.7), libopenal1 (>= 1.14), libpcap0.8 (>= 0.9.8), libpulse0 (>= 0.99.1), libudev1 (>= 183), libvkd3d1 (>= 1.0), libx11-6, libxext6, libxml2 (>= 2.9.0), ocl-icd-libopencl1 | libopencl1, udis86, zlib1g (>= 1:1.1.4), libasound2-plugins, libncurses6 | libncurses5 | libncurses, deepin-wine-plugin-virtual\nRecommends: libcapi20-3, libcups2, libdbus-1-3, libfontconfig1, libfreetype6, libglu1-mesa | libglu1, libgnutls30 | libgnutls28 | libgnutls26, libgsm1, libgssapi-krb5-2, libjpeg62-turbo | libjpeg8, libkrb5-3, libodbc1, libosmesa6, libpng16-16 | libpng12-0, libsane | libsane1, libsdl2-2.0-0, libtiff5, libv4l-0, libxcomposite1, libxcursor1, libxfixes3, libxi6, libxinerama1, libxrandr2, libxrender1, libxslt1.1, libxxf86vm1"][]
print("d")
debInformation[0]["run.sh"] = f'''#!/bin/sh
@@ -1404,6 +1419,13 @@ export WINEDLLPATH=/opt/$APPRUN_CMD/lib:/opt/$APPRUN_CMD/lib64
export WINEPREDLL="$ARCHIVE_FILE_DIR/dlls"
##### 软件在wine中的启动路径
if [ -e "/opt/deepinwine/tools/spark_run_v4.sh"] ;then
START_SHELL_PATH="/opt/deepinwine/tools/spark_run_v4.sh"
else
START_SHELL_PATH="/opt/deepinwine/tools/run_v4.sh"
fi
if [ -n "$PATCH_LOADER_ENV" ] && [ -n "$EXEC_PATH" ];then
export $PATCH_LOADER_ENV
fi
@@ -1499,7 +1521,7 @@ fi
# 都有了为什么要打包呢?
shutil.copy(wine[wineVersion.currentText()], f"{debPackagePath}/opt/apps/{e1_text.text()}/files/wine_archive.7z")
else:
self.run_command(f"7z a '{debPackagePath}/opt/apps/{e1_text.text()}/files/wine_archive.7z' '{wine[wineVersion.currentText()]}/*'")
self.run_command(f"7z a -snh -snl '{debPackagePath}/opt/apps/{e1_text.text()}/files/wine_archive.7z' '{wine[wineVersion.currentText()]}/*'")
###############
# 复制文件
###############
@@ -1892,14 +1914,14 @@ def BrowserHelperConfigPathText():
def ChangeWine():
useInstallWineArch.setEnabled(os.path.exists(wine[wineVersion.currentText()]))
debDepends.setText([f"{wine[wineVersion.currentText()]} | {wine[wineVersion.currentText()]}-bcm | {wine[wineVersion.currentText()]}-dcm | com.{wine[wineVersion.currentText()]}.deepin, deepin-wine-helper | com.wine-helper.deepin, fonts-wqy-microhei, fonts-wqy-zenhei",
f"{wine[wineVersion.currentText()]} | {wine[wineVersion.currentText()]}-bcm | {wine[wineVersion.currentText()]}-dcm | com.{wine[wineVersion.currentText()]}.deepin, spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepin, fonts-wqy-microhei, fonts-wqy-zenhei"
f"{wine[wineVersion.currentText()]} | {wine[wineVersion.currentText()]}-bcm | {wine[wineVersion.currentText()]}-dcm | com.{wine[wineVersion.currentText()]}.deepin, spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepinwinerunner, fonts-wqy-microhei, fonts-wqy-zenhei"
][int(chooseWineHelperValue.isChecked())])
debRecommend.setText("")
helperConfigPathText.setEnabled(chooseWineHelperValue.isChecked())
helperConfigPathButton.setEnabled(chooseWineHelperValue.isChecked())
if os.path.exists(wine[wineVersion.currentText()]):
debDepends.setText(["deepin-wine-helper | com.wine-helper.deepin",
"spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepin"
"spark-dwine-helper | store.spark-app.spark-dwine-helper | deepin-wine-helper | com.wine-helper.deepinwinerunner"
][int(chooseWineHelperValue.isChecked())])
#if "deepin-wine5-stable" in wine[wineVersion.currentText()]:
# debDepends.setText("libasound2 (>= 1.0.16), libc6 (>= 2.28), libglib2.0-0 (>= 2.12.0), libgphoto2-6 (>= 2.5.10), libgphoto2-port12 (>= 2.5.10), libgstreamer-plugins-base1.0-0 (>= 1.0.0), libgstreamer1.0-0 (>= 1.4.0), liblcms2-2 (>= 2.2+git20110628), libldap-2.4-2 (>= 2.4.7), libmpg123-0 (>= 1.13.7), libopenal1 (>= 1.14), libpcap0.8 (>= 0.9.8), libpulse0 (>= 0.99.1), libudev1 (>= 183), libvkd3d1 (>= 1.0), libx11-6, libxext6, libxml2 (>= 2.9.0), ocl-icd-libopencl1 | libopencl1, udis86, zlib1g (>= 1:1.1.4), libasound2-plugins, libncurses6 | libncurses5 | libncurses, deepin-wine-plugin-virtual")
@@ -2255,20 +2277,10 @@ def ChangeBottleName():
if len(e2_text.text()) > 0:
if ord(e2_text.text()[0]) < 48 or ord(e2_text.text()[0]) > 57:
e2_text.setText(e2_text.text()[1:])
if bottleNameLock:
return
if os.path.basename(e6_text.text()) == ".wine" or e6_text.text() == "":
bottleNameChangeLock = True
e5_text.setText(e1_text.text())
return
# 调整逻辑,容器名默认与包名相同
bottleNameChangeLock = True
e5_text.setText(os.path.basename(e6_text.text().replace(" ", "")))
e5_text.setText(e1_text.text())
def LockBottleName():
global bottleNameLock
if bottleNameChangeLock:
return
bottleNameLock = True
# 获取当前语言
def get_now_lang()->"获取当前语言":
@@ -2419,14 +2431,13 @@ installDeb.clicked.connect(InstallDeb)
wineFrame.addWidget(wineVersion)
e1_text.textChanged.connect(ChangeBottleName)
e2_text.textChanged.connect(ChangeBottleName)
e5_text.textChanged.connect(LockBottleName)
e6_text.textChanged.connect(ChangeBottleName)
e7_text.textChanged.connect(ChangeTapTitle)
widgetLayout.addWidget(QtWidgets.QLabel(transla.transe("U", "要打包的 deb 包的包名(※必填):")), 0, 0, 1, 1)
widgetLayout.addWidget(QtWidgets.QLabel(transla.transe("U", "deb 包版本号(※必填):")), 1, 0, 1, 1)
widgetLayout.addWidget(QtWidgets.QLabel(transla.transe("U", "deb 包说明(※必填):")), 2, 0, 1, 1)
widgetLayout.addWidget(QtWidgets.QLabel(transla.transe("U", "deb 包维护者(※必填):")), 3, 0, 1, 1)
widgetLayout.addWidget(QtWidgets.QLabel(transla.transe("U", "要解压 wine 容器名称(※必填):")), 4, 0, 1, 1)
widgetLayout.addWidget(QtWidgets.QLabel(transla.transe("U", "Wine 容器名称(※必填,推荐默认")), 4, 0, 1, 1)
widgetLayout.addWidget(QtWidgets.QLabel(transla.transe("U", "要打包 wine 容器的路径(※必填):")), 5, 0, 1, 1)
desktopIconTab = QtWidgets.QTabWidget()
controlWidget = QtWidgets.QWidget()
@@ -2680,14 +2691,18 @@ allInfoList = {
SetFont(app)
#window.setWindowFlag(QtGui.Qt)
# 设置滚动条
areaScroll = QtWidgets.QScrollArea(window)
areaScroll.setWidgetResizable(True)
areaScroll.setWidget(widget)
areaScroll.setFrameShape(QtWidgets.QFrame.NoFrame)
window.setCentralWidget(areaScroll)
window.resize(int(app.primaryScreen().availableGeometry().size().width() * 0.9), int(app.primaryScreen().availableGeometry().size().height() * 0.9))
window.setCentralWidget(widget)
# 判断是否为小屏幕,是则设置滚动条并全屏
if (window.frameGeometry().width() > app.primaryScreen().availableGeometry().size().width() * 0.8 or
window.frameGeometry().height() > app.primaryScreen().availableGeometry().size().height() * 0.9):
# 设置滚动条
areaScroll = QtWidgets.QScrollArea(window)
areaScroll.setWidgetResizable(True)
areaScroll.setWidget(widget)
areaScroll.setFrameShape(QtWidgets.QFrame.NoFrame)
window.setCentralWidget(areaScroll)
window.showMaximized() # 设置全屏
window.show()
window.show()
sys.exit(app.exec_())

BIN
dxvk.7z

Binary file not shown.

219
dxvk/setup_dxvk.sh Executable file
View File

@@ -0,0 +1,219 @@
#!/usr/bin/env bash
function wait(){
echo Press Enter To Exit
read
}
# default directories
dxvk_lib32=${dxvk_lib32:-"x32"}
dxvk_lib64=${dxvk_lib64:-"x64"}
# figure out where we are
basedir="$(dirname "$(readlink -f "$0")")"
# figure out which action to perform
action="$1"
case "$action" in
install)
;;
uninstall)
;;
*)
echo "Unrecognized action: $action"
echo "Usage: $0 [install|uninstall] [--without-dxgi] [--symlink]"
exit 1
esac
# process arguments
shift
with_dxgi=true
file_cmd="cp -v --reflink=auto"
while (($# > 0)); do
case "$1" in
"--without-dxgi")
with_dxgi=false
;;
"--symlink")
file_cmd="ln -s -v"
;;
esac
shift
done
# check wine prefix before invoking wine, so that we
# don't accidentally create one if the user screws up
if [ -n "$WINEPREFIX" ] && ! [ -f "$WINEPREFIX/system.reg" ]; then
echo "$WINEPREFIX:"' Not a valid wine prefix.' >&2
exit 1
fi
# find wine executable
export WINEDEBUG=-all
# disable mscoree and mshtml to avoid downloading
# wine gecko and mono
export WINEDLLOVERRIDES="mscoree,mshtml="
# 专门添加,为了可以使用自定义的 wine
wine=$WINE
wine64=$WINE64
wineboot="$WINE wineboot"
if [[ $WINE == "" ]];then
wine="wine"
fi
if [[ $WINE64 == "" ]];then
wine64="wine64"
fi
# $PATH is the way for user to control where wine is located (including custom Wine versions).
# Pure 64-bit Wine (non Wow64) requries skipping 32-bit steps.
# In such case, wine64 and winebooot will be present, but wine binary will be missing,
# however it can be present in other PATHs, so it shouldn't be used, to avoid versions mixing.
wine_path=$(dirname "$(which $wineboot)")
wow64=true
if ! [ -f "$wine_path/$wine" ]; then
wine=$wine64
wow64=false
fi
# resolve 32-bit and 64-bit system32 path
winever=$($wine --version | grep wine)
if [ -z "$winever" ]; then
echo "$wine:"' Not a wine executable. Check your $wine.' >&2
exit 1
fi
# ensure wine placeholder dlls are recreated
# if they are missing
$wineboot -u
win64_sys_path=$($wine64 winepath -u 'C:\windows\system32' 2> /dev/null)
win64_sys_path="${win64_sys_path/$'\r'/}"
if $wow64; then
win32_sys_path=$($wine winepath -u 'C:\windows\system32' 2> /dev/null)
win32_sys_path="${win32_sys_path/$'\r'/}"
fi
if [ -z "$win32_sys_path" ] && [ -z "$win64_sys_path" ]; then
echo 'Failed to resolve C:\windows\system32.' >&2
wait
exit 1
fi
# create native dll override
overrideDll() {
$wine reg add 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /d native /f >/dev/null 2>&1
if [ $? -ne 0 ]; then
echo -e "Failed to add override for $1"
wait
exit 1
fi
}
# remove dll override
restoreDll() {
$wine reg delete 'HKEY_CURRENT_USER\Software\Wine\DllOverrides' /v $1 /f > /dev/null 2>&1
if [ $? -ne 0 ]; then
echo "Failed to remove override for $1"
fi
}
# copy or link dxvk dll, back up original file
installFile() {
dstfile="${1}/${3}.dll"
srcfile="${basedir}/${2}/${3}.dll"
if [ -f "${srcfile}.so" ]; then
srcfile="${srcfile}.so"
fi
if ! [ -f "${srcfile}" ]; then
echo "${srcfile}: File not found. Skipping." >&2
return 1
fi
if [ -n "$1" ]; then
if [ -f "${dstfile}" ] || [ -h "${dstfile}" ]; then
if ! [ -f "${dstfile}.old" ]; then
mv -v "${dstfile}" "${dstfile}.old"
else
rm -v "${dstfile}"
fi
$file_cmd "${srcfile}" "${dstfile}"
else
echo "${dstfile}: File not found in wine prefix" >&2
return 1
fi
fi
return 0
}
# remove dxvk dll, restore original file
uninstallFile() {
dstfile="${1}/${3}.dll"
srcfile="${basedir}/${2}/${3}.dll"
if [ -f "${srcfile}.so" ]; then
srcfile="${srcfile}.so"
fi
if ! [ -f "${srcfile}" ]; then
echo "${srcfile}: File not found. Skipping." >&2
return 1
fi
if ! [ -f "${dstfile}" ] && ! [ -h "${dstfile}" ]; then
echo "${dstfile}: File not found. Skipping." >&2
return 1
fi
if [ -f "${dstfile}.old" ]; then
rm -v "${dstfile}"
mv -v "${dstfile}.old" "${dstfile}"
return 0
else
return 1
fi
}
install() {
installFile "$win64_sys_path" "$dxvk_lib64" "$1"
inst64_ret="$?"
inst32_ret=-1
if $wow64; then
installFile "$win32_sys_path" "$dxvk_lib32" "$1"
inst32_ret="$?"
fi
if (( ($inst32_ret == 0) || ($inst64_ret == 0) )); then
overrideDll "$1"
fi
}
uninstall() {
uninstallFile "$win64_sys_path" "$dxvk_lib64" "$1"
uninst64_ret="$?"
uninst32_ret=-1
if $wow64; then
uninstallFile "$win32_sys_path" "$dxvk_lib32" "$1"
uninst32_ret="$?"
fi
if (( ($uninst32_ret == 0) || ($uninst64_ret == 0) )); then
restoreDll "$1"
fi
}
# skip dxgi during install if not explicitly
# enabled, but always try to uninstall it
if $with_dxgi || [ "$action" == "uninstall" ]; then
$action dxgi
fi
$action d3d9
$action d3d10core
$action d3d11
wait

BIN
dxvk/x32/d3d10core.dll Executable file

Binary file not shown.

BIN
dxvk/x32/d3d11.dll Executable file

Binary file not shown.

BIN
dxvk/x32/d3d8.dll Executable file

Binary file not shown.

BIN
dxvk/x32/d3d9.dll Executable file

Binary file not shown.

BIN
dxvk/x32/dxgi.dll Executable file

Binary file not shown.

BIN
dxvk/x64/d3d10core.dll Executable file

Binary file not shown.

BIN
dxvk/x64/d3d11.dll Executable file

Binary file not shown.

BIN
dxvk/x64/d3d8.dll Executable file

Binary file not shown.

BIN
dxvk/x64/d3d9.dll Executable file

Binary file not shown.

BIN
dxvk/x64/dxgi.dll Executable file

Binary file not shown.

View File

@@ -1,92 +0,0 @@
___
( )
| | .-. ___ ___ .--. .--.
| |/ \ ( )( ) / \ / \
| .-. . | | | | ; ,-. ' | .-. ;
| | | | | | | | | | | | | | | |
| | | | | | | | | | | | | |/ |
| | | | | | | | | | | | | ' _.'
| | | | | | ; ' | ' | | | .'.-.
| | | | ' `-' / ' `-' | ' `-' /
(___)(___) '.__.' `.__. | `.__.'
( `-' ;
`.__.
___
( )
| |.-. .---. ___ .-. .--. ___ .-.
| / \ / .-, \ ( ) \ / \ ( ) \
| .-. | (__) ; | | ' .-. ; | .-. ; | .-. .
| | | | .'` | | / (___) | | | | | | | |
| | | | / .'| | | | | | | | | | | |
| | | | | / | | | | | | | | | | | |
| ' | | ; | ; | | | | ' | | | | | |
' `-' ; ' `-' | | | ' `-' / | | | |
`.__. `.__.'_. (___) `.__.' (___)(___)
___
( )
| |.-. ___ ___ ___ .-. ___ .-. ___ ___
| / \ ( )( ) ( ) \ ( ) \ ( )( )
| .-. | | | | | | .-. . | .-. . | | | |
| | | | | | | | | | | | | | | | | | | |
| | | | | | | | | | | | | | | | | ' | |
| | | | | | | | | | | | | | | | ' `-' |
| ' | | | | ; ' | | | | | | | | `.__. |
' `-' ; ' `-' / | | | | | | | | ___ | |
`.__. '.__.' (___)(___) (___)(___) ( )' |
; `-' '
.__.'
............ .....]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

@@ -1,82 +0,0 @@
#/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

@@ -1,186 +0,0 @@
#!/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

@@ -1,8 +0,0 @@
#!/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

@@ -1,8 +0,0 @@
#!/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

@@ -1,109 +0,0 @@
#/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

@@ -1,18 +0,0 @@
#!/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

@@ -1,18 +0,0 @@
#!/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="以下容器中的应用的缩放设置已与全局设置同步"

View File

@@ -1,15 +0,0 @@
#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逻辑

View File

@@ -1,74 +0,0 @@
#!/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

View File

@@ -1,59 +0,0 @@
#!/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])

View File

View File

@@ -1,57 +0,0 @@
#!/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

View File

@@ -1,58 +0,0 @@
#!/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

View File

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

Binary file not shown.

View File

@@ -1,22 +0,0 @@
#!/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()

View File

@@ -1,291 +0,0 @@
#!/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

View File

@@ -1,44 +0,0 @@
#!/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 &

View File

@@ -1,51 +0,0 @@
#!/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

View File

@@ -1,40 +0,0 @@
#!/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

View File

@@ -1,787 +0,0 @@
#!/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

View File

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

View File

@@ -1,536 +0,0 @@
#!/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

View File

@@ -1,600 +0,0 @@
#!/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

View File

@@ -1,698 +0,0 @@
#!/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

Binary file not shown.

View File

@@ -1,122 +0,0 @@
#!/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

@@ -1,22 +0,0 @@
#!/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()

View File

@@ -1,277 +0,0 @@
#!/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

View File

@@ -1,427 +0,0 @@
#!/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

@@ -1,22 +0,0 @@
#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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1,25 +0,0 @@
#!/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

@@ -1,3 +0,0 @@
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

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

View File

@@ -1,3 +0,0 @@
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

@@ -1,3 +0,0 @@
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

@@ -1,3 +0,0 @@
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

@@ -1,23 +0,0 @@
$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

@@ -1,17 +0,0 @@
#!/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

@@ -1,5 +0,0 @@
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

@@ -1,9 +0,0 @@
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

@@ -1,9 +0,0 @@
#/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

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

View File

@@ -1,18 +0,0 @@
#!/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

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

View File

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

View File

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

View File

@@ -1,4 +0,0 @@
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

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

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