1 Star 0 Fork 25

laranlan/Wine 运行器

forked from gfdgd xi/Wine 运行器 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
deepin-wine-packager-with-script.py 2.10 KB
一键复制 编辑 原始数据 按行查看 历史
gfdgd xi 提交于 2023-04-24 21:42 . change
#!/usr/bin/env python3
# 使用系统默认的 python3 运行
###########################################################################################
# 作者:gfdgd xi
# 版本:1.6.1
# 更新时间:2022年07月14日
# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序
# 基于 Python3 的 tkinter 构建
###########################################################################################
#################
# 引入所需的库
#################
import os
import sys
import json
import updatekiller
import threading
import PyQt5.QtWidgets as QtWidgets
# 读取文本文档
def readtxt(path):
f = open(path, "r") # 设置文件对象
str = f.read() # 获取内容
f.close() # 关闭文本对象
return str # 返回结果
def Unzip():
os.system("mkdir -p ~")
os.chdir(f"{homePath}")
os.system(f"unzip -o \"{programPath}/package-script.zip\"")
print("Unzip Done")
ReStartProgram()
# 重启本应用程序
def ReStartProgram():
python = sys.executable
os.execl(python, python, * sys.argv)
programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string
homePath = os.path.expanduser('~')
information = json.loads(readtxt(f"{programPath}/information.json"))
version = information["Version"]
if not os.path.exists(f"{homePath}/package-script") or not json.loads(readtxt(f"{homePath}/package-script/information.json"))["Version"] == version:
app = QtWidgets.QApplication(sys.argv)
widget = QtWidgets.QWidget()
widgetLayout = QtWidgets.QVBoxLayout()
widget.setWindowTitle("解压中")
widgetLayout.addWidget(QtWidgets.QLabel("正在解压所需程序,请稍后……"))
progress = QtWidgets.QProgressBar()
progress.setMaximum(0)
progress.setMinimum(0)
progress.update()
widgetLayout.addWidget(progress)
widget.setLayout(widgetLayout)
widget.show()
# 解压流程
QtWidgets.QProgressDialog(None)
t = threading.Thread(target=Unzip)
t.start()
sys.exit(app.exec_())
os.chdir(f"{homePath}/package-script")
os.system("./package.py")
print("End")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ChaoYouAi/deep-wine-runner.git
git@gitee.com:ChaoYouAi/deep-wine-runner.git
ChaoYouAi
deep-wine-runner
Wine 运行器
main

搜索帮助