mirror of
https://gitee.com/gfdgd-xi/deep-wine-runner
synced 2025-12-14 19:12:04 +08:00
2.1.0完成
This commit is contained in:
@@ -2,8 +2,8 @@
|
||||
# 使用系统默认的 python3 运行
|
||||
###########################################################################################
|
||||
# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢
|
||||
# 版本:1.8.0
|
||||
# 更新时间:2022年08月06日
|
||||
# 版本:2.1.0
|
||||
# 更新时间:2022年08月25日
|
||||
# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序
|
||||
# 基于 Python3 构建
|
||||
###########################################################################################
|
||||
@@ -12,6 +12,7 @@
|
||||
#################
|
||||
import os
|
||||
import sys
|
||||
import traceback
|
||||
import pyquery
|
||||
|
||||
if "--help" in sys.argv:
|
||||
@@ -47,6 +48,10 @@ else:
|
||||
|
||||
''')
|
||||
homePath = os.path.expanduser('~')
|
||||
try:
|
||||
exitInputShow = int(os.getenv("ENTERNOTSHOW"))
|
||||
except:
|
||||
exitInputShow = True
|
||||
try:
|
||||
# 获取最新版本的版本号
|
||||
programVersionList = pyquery.PyQuery(url=f"http://mirrors.ustc.edu.cn/wine/wine/wine-{sys.argv[3]}/")
|
||||
@@ -54,13 +59,15 @@ except:
|
||||
print("无法连接下载服务器,将使用本地缓存")
|
||||
if not os.path.exists(f"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/install.msi") or not os.path.exists(f"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/information.txt"):
|
||||
print("无本地缓存数据,无法进行、结束")
|
||||
input("按回车键退出")
|
||||
if exitInputShow:
|
||||
input("按回车键退出")
|
||||
exit()
|
||||
file = open(f"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/information.txt", "r")
|
||||
version = file.read().replace("\n", "")
|
||||
print("安装版本:", version)
|
||||
os.system(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} msiexec /i \"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/install.msi\"")
|
||||
input("安装结束,按回车键退出")
|
||||
os.system(f"WINEPREFIX='{sys.argv[1]}' '{sys.argv[2]}' msiexec /i \"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/install.msi\"")
|
||||
if exitInputShow:
|
||||
input("安装结束,按回车键退出")
|
||||
exit()
|
||||
programVersion = programVersionList("a:last-child").attr.href
|
||||
# 获取最新版本安装包的URL
|
||||
@@ -91,8 +98,9 @@ if os.path.exists(f"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/install.m
|
||||
print("缓存版本:", version.replace("/", ""))
|
||||
print("已经缓存,使用本地版本")
|
||||
file.close()
|
||||
os.system(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} msiexec /i \"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/install.msi\"")
|
||||
input("安装结束,按回车键退出")
|
||||
os.system(f"WINEPREFIX='{sys.argv[1]}' '{sys.argv[2]}' msiexec /i \"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/install.msi\"")
|
||||
if exitInputShow:
|
||||
input("安装结束,按回车键退出")
|
||||
exit()
|
||||
|
||||
file = open(f"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/information.txt", "w+")
|
||||
@@ -101,7 +109,7 @@ os.system(f"rm -rf \"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/install.
|
||||
os.system("mkdir -p /tmp/winegeckomonoinstall")
|
||||
os.system(f"aria2c -x 16 -s 16 -d \"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}\" -o install.msi \"{programDownloadUrl}\"")
|
||||
print("开始安装")
|
||||
os.system(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} msiexec /i \"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/install.msi\"")
|
||||
os.system(f"WINEPREFIX='{sys.argv[1]}' '{sys.argv[2]}' msiexec /i \"{homePath}/.cache/deepin-wine-runner/{sys.argv[3]}/install.msi\"")
|
||||
try:
|
||||
if sys.argv[4] == "1":
|
||||
print("写入缓存")
|
||||
@@ -114,4 +122,5 @@ except:
|
||||
print("写入缓存")
|
||||
file.write(programVersion)
|
||||
file.close()
|
||||
input("安装结束,按回车键退出")
|
||||
if exitInputShow:
|
||||
input("安装结束,按回车键退出")
|
||||
Reference in New Issue
Block a user