From 303161d10e0634cf6b842bdc2194faf42513ed20 Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Tue, 2 Aug 2022 08:49:42 +0800 Subject: [PATCH] =?UTF-8?q?1.8.0=E5=88=9D=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AppStore.py | 1 + InstallWineOnDeepin23.py | 74 ++++++++++++++++++ Makefile | 5 +- deb/opt/apps/deepin-wine-runner/AppStore.py | 1 + .../InstallWineOnDeepin23.py | 74 ++++++++++++++++++ .../deepin-wine-runner/deepin-wine-runner | 38 ++++++--- .../deepin-wine-runner/package-script.zip | Bin 299994 -> 300000 bytes .../deepin-wine-runner-wine-install-deepin23 | 1 + deepin.list | 4 + mainwindow.py | 37 ++++++--- package-script.zip | Bin 299994 -> 300000 bytes package-script/information.json | 2 +- sparkstore.list | 1 + 13 files changed, 214 insertions(+), 24 deletions(-) create mode 100755 InstallWineOnDeepin23.py create mode 100755 deb/opt/apps/deepin-wine-runner/InstallWineOnDeepin23.py create mode 120000 deb/usr/bin/deepin-wine-runner-wine-install-deepin23 create mode 100644 deepin.list create mode 100644 sparkstore.list diff --git a/AppStore.py b/AppStore.py index 24823cf..f4183c1 100755 --- a/AppStore.py +++ b/AppStore.py @@ -89,6 +89,7 @@ if __name__ == "__main__": os.system("mkdir -p /tmp/wineappstore") os.system(f"aria2c -x 16 -s 16 -d /tmp/wineappstore -o install.exe \"{downloadUrl[choose]}\"") print("开始安装……") + print(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} /tmp/wineappstore/install.exe") os.system(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} /tmp/wineappstore/install.exe") print("安装结束……") input("按回车键继续……") diff --git a/InstallWineOnDeepin23.py b/InstallWineOnDeepin23.py new file mode 100755 index 0000000..1c82677 --- /dev/null +++ b/InstallWineOnDeepin23.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 +# 使用系统默认的 python3 运行 +########################################################################################### +# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 +# 版本:1.8.0 +# 更新时间:2022年08月02日 +# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序 +# 基于 Python3 构建 +########################################################################################### +################# +# 引入所需的库 +################# +import os + +def InstallWithDeepinSource(program): + os.system(f"sudo cp '{programPath}/deepin.list' /etc/apt/sources.list.d/deepin20-withwinerunner.list") + os.system(f"sudo dpkg --add-architecture i386") + os.system(f"sudo apt update") + os.system(f"sudo apt install {program}") + os.system(f"sudo rm /etc/apt/sources.list.d/deepin20-withwinerunner.list") + os.system(f"sudo dpkg --remove-architecture i386") + os.system(f"sudo apt update") + +def InstallWithSparkStoreSource(program): + os.system(f"sudo cp '{programPath}/sparkstore.list' /etc/apt/sources.list.d/sparkstore-withwinerunner.list") + os.system(f"sudo cp '{programPath}/deepin.list' /etc/apt/sources.list.d/deepin20-withwinerunner.list") + os.system(f"sudo dpkg --add-architecture i386") + os.system(f"sudo mkdir /tmp/spark-store-install") + os.system(f"sudo rm -rf /tmp/spark-store-install/spark-store.asc") + os.system(f"sudo wget -O /tmp/spark-store-install/spark-store.asc https://d.store.deepinos.org.cn/dcs-repo.gpg-key.asc") + os.system(f"sudo gpg --dearmor /tmp/spark-store-install/spark-store.asc") + os.system(f"sudo cp /tmp/spark-store-install/spark-store.asc.gpg /etc/apt/trusted.gpg.d/spark-store.gpg") + os.system(f"sudo apt update") + os.system(f"sudo apt install {program}") + os.system(f"sudo rm /etc/apt/sources.list.d/sparkstore-withwinerunner.list") + os.system(f"sudo dpkg --remove-architecture i386") + os.system(f"sudo apt update") + +def Repair(): + print("修复中……") + os.system(f"rm -f /etc/apt/sources.list.d/sparkstore-withwinerunner.list") + os.system(f"rm -f /etc/apt/sources.list.d/deepin20-withwinerunner.list") + print("修复完成!") + +if __name__ == "__main__": + programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string + print("能不用这个就不用这个!!!真心建议!!!\n") + print("下面的安装过程皆需要换源等操作,安装过程千万不要中断,以及千万不要 apt upgrade,感谢\n") + print("如果真一不小心中断了,可以在下面输入“repair”进行修复") + print("所有操作均需要 Root 权限,请知悉\n") + print("千万不要中断且 apt upgrade、千万不要中断且 apt upgrade、千万不要中断且 apt upgrade,重要的事情说三遍") + print("以及无法保证安装的 Wine 能使用、无法保证安装的 Wine 能使用、无法保证安装的 Wine 能使用,重要的事情说三遍") + repair = input("按回车后继续") + if repair.lower() == "repair": + Repair() + exit() + for i in [ + ["原版 Wine(Wine64)", "wine"], + ["deepin-wine5-stable", "deepin-wine5-stable"], + ["deepin-wine6-stable", "deepin-wine6-stable"] + ]: + choose = input(f"安装{i[0]}?(添加深度源)[Y/N]").upper() + if choose == "Y": + print("安装中……") + InstallWithDeepinSource(i[1]) + print("安装完成!") + exit() + for i in [ + ["deepin-wine", "deepin-wine"], + ["spark-wine7-devel", "spark-wine7-devel"] + ]: + choose = input(f"安装{i[0]}?(添加深度、星火源)[Y/N]").upper() + if choose == "Y": + InstallWithSparkStoreSource(i[1]) \ No newline at end of file diff --git a/Makefile b/Makefile index 42f379c..796f010 100755 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ build: - cd VM-source && qmake - cd VM-source && make + #cd VM-source && qmake + #cd VM-source && make cp -rv VM-source/VirtualMachine VM cp -rv VM-source/deepin-wine-runner.svg VM cp -rv VM-source/api VM @@ -36,6 +36,7 @@ build: cp -rv dlls deb/opt/apps/deepin-wine-runner 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 dpkg -b deb spark-deepin-wine-runner.deb install: diff --git a/deb/opt/apps/deepin-wine-runner/AppStore.py b/deb/opt/apps/deepin-wine-runner/AppStore.py index 24823cf..f4183c1 100755 --- a/deb/opt/apps/deepin-wine-runner/AppStore.py +++ b/deb/opt/apps/deepin-wine-runner/AppStore.py @@ -89,6 +89,7 @@ if __name__ == "__main__": os.system("mkdir -p /tmp/wineappstore") os.system(f"aria2c -x 16 -s 16 -d /tmp/wineappstore -o install.exe \"{downloadUrl[choose]}\"") print("开始安装……") + print(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} /tmp/wineappstore/install.exe") os.system(f"WINEPREFIX={sys.argv[1]} {sys.argv[2]} /tmp/wineappstore/install.exe") print("安装结束……") input("按回车键继续……") diff --git a/deb/opt/apps/deepin-wine-runner/InstallWineOnDeepin23.py b/deb/opt/apps/deepin-wine-runner/InstallWineOnDeepin23.py new file mode 100755 index 0000000..1c82677 --- /dev/null +++ b/deb/opt/apps/deepin-wine-runner/InstallWineOnDeepin23.py @@ -0,0 +1,74 @@ +#!/usr/bin/env python3 +# 使用系统默认的 python3 运行 +########################################################################################### +# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 +# 版本:1.8.0 +# 更新时间:2022年08月02日 +# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序 +# 基于 Python3 构建 +########################################################################################### +################# +# 引入所需的库 +################# +import os + +def InstallWithDeepinSource(program): + os.system(f"sudo cp '{programPath}/deepin.list' /etc/apt/sources.list.d/deepin20-withwinerunner.list") + os.system(f"sudo dpkg --add-architecture i386") + os.system(f"sudo apt update") + os.system(f"sudo apt install {program}") + os.system(f"sudo rm /etc/apt/sources.list.d/deepin20-withwinerunner.list") + os.system(f"sudo dpkg --remove-architecture i386") + os.system(f"sudo apt update") + +def InstallWithSparkStoreSource(program): + os.system(f"sudo cp '{programPath}/sparkstore.list' /etc/apt/sources.list.d/sparkstore-withwinerunner.list") + os.system(f"sudo cp '{programPath}/deepin.list' /etc/apt/sources.list.d/deepin20-withwinerunner.list") + os.system(f"sudo dpkg --add-architecture i386") + os.system(f"sudo mkdir /tmp/spark-store-install") + os.system(f"sudo rm -rf /tmp/spark-store-install/spark-store.asc") + os.system(f"sudo wget -O /tmp/spark-store-install/spark-store.asc https://d.store.deepinos.org.cn/dcs-repo.gpg-key.asc") + os.system(f"sudo gpg --dearmor /tmp/spark-store-install/spark-store.asc") + os.system(f"sudo cp /tmp/spark-store-install/spark-store.asc.gpg /etc/apt/trusted.gpg.d/spark-store.gpg") + os.system(f"sudo apt update") + os.system(f"sudo apt install {program}") + os.system(f"sudo rm /etc/apt/sources.list.d/sparkstore-withwinerunner.list") + os.system(f"sudo dpkg --remove-architecture i386") + os.system(f"sudo apt update") + +def Repair(): + print("修复中……") + os.system(f"rm -f /etc/apt/sources.list.d/sparkstore-withwinerunner.list") + os.system(f"rm -f /etc/apt/sources.list.d/deepin20-withwinerunner.list") + print("修复完成!") + +if __name__ == "__main__": + programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string + print("能不用这个就不用这个!!!真心建议!!!\n") + print("下面的安装过程皆需要换源等操作,安装过程千万不要中断,以及千万不要 apt upgrade,感谢\n") + print("如果真一不小心中断了,可以在下面输入“repair”进行修复") + print("所有操作均需要 Root 权限,请知悉\n") + print("千万不要中断且 apt upgrade、千万不要中断且 apt upgrade、千万不要中断且 apt upgrade,重要的事情说三遍") + print("以及无法保证安装的 Wine 能使用、无法保证安装的 Wine 能使用、无法保证安装的 Wine 能使用,重要的事情说三遍") + repair = input("按回车后继续") + if repair.lower() == "repair": + Repair() + exit() + for i in [ + ["原版 Wine(Wine64)", "wine"], + ["deepin-wine5-stable", "deepin-wine5-stable"], + ["deepin-wine6-stable", "deepin-wine6-stable"] + ]: + choose = input(f"安装{i[0]}?(添加深度源)[Y/N]").upper() + if choose == "Y": + print("安装中……") + InstallWithDeepinSource(i[1]) + print("安装完成!") + exit() + for i in [ + ["deepin-wine", "deepin-wine"], + ["spark-wine7-devel", "spark-wine7-devel"] + ]: + choose = input(f"安装{i[0]}?(添加深度、星火源)[Y/N]").upper() + if choose == "Y": + InstallWithSparkStoreSource(i[1]) \ No newline at end of file diff --git a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner index dfd3503..d96017e 100755 --- a/deb/opt/apps/deepin-wine-runner/deepin-wine-runner +++ b/deb/opt/apps/deepin-wine-runner/deepin-wine-runner @@ -85,7 +85,7 @@ run = None def runexebutton(self): global run DisableButton(True) - if not CheckProgramIsInstall(wine[o1.currentText()]): + if not CheckProgramIsInstall(wine[o1.currentText()]) and o1.currentText() != "基于 linglong 的 deepin-wine6-stable(不推荐)": if QtWidgets.QMessageBox.question(widget, "提示", "检查到您未安装这个 wine,是否继续使用这个 wine 运行?") == QtWidgets.QMessageBox.No: DisableButton(False) return @@ -307,6 +307,9 @@ def KillProgram(): def InstallWine(): threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -e \"{programPath}/AllInstall.py\""]).start() +def InstallWineOnDeepin23(): + threading.Thread(target=os.system, args=[f"'{programPath}/launch.sh' deepin-terminal -e \"{programPath}/InstallWineOnDeepin23.py\""]).start() + def OpenWineBotton(): if e1.currentText() == "": wineBottonPath = setting["DefultBotton"] @@ -429,42 +432,42 @@ def InstallMonoGecko(program): wineBottonPath = setting["DefultBotton"] else: wineBottonPath = e1.currentText() - os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallMono.py' '{wineBottonPath}' {wine[o1.currentText()]} {program}") + os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallMono.py' '{wineBottonPath}' '{wine[o1.currentText()]}' {program}") def InstallNetFramework(): if e1.currentText() == "": wineBottonPath = setting["DefultBotton"] else: wineBottonPath = e1.currentText() - os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallNetFramework.py' '{wineBottonPath}' {wine[o1.currentText()]}") + os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallNetFramework.py' '{wineBottonPath}' '{wine[o1.currentText()]}'") def InstallVisualStudioCPlusPlus(): if e1.currentText() == "": wineBottonPath = setting["DefultBotton"] else: wineBottonPath = e1.currentText() - os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallVisualCPlusPlus.py' '{wineBottonPath}' {wine[o1.currentText()]}") + os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallVisualCPlusPlus.py' '{wineBottonPath}' '{wine[o1.currentText()]}'") def InstallMSXML(): if e1.currentText() == "": wineBottonPath = setting["DefultBotton"] else: wineBottonPath = e1.currentText() - os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallMsxml.py' '{wineBottonPath}' {wine[o1.currentText()]}") + os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallMsxml.py' '{wineBottonPath}' '{wine[o1.currentText()]}'") def MiniAppStore(): if e1.currentText()== "": wineBottonPath = setting["DefultBotton"] else: wineBottonPath = e1.currentText() - os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/AppStore.py' '{wineBottonPath}' {wine[o1.currentText()]}") + os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/AppStore.py' '{wineBottonPath}' '{wine[o1.currentText()]}'") def InstallOther(): if e1.currentText()== "": wineBottonPath = setting["DefultBotton"] else: wineBottonPath = e1.currentText() - os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallOther.py' '{wineBottonPath}' {wine[o1.currentText()]}") + os.system(f"'{programPath}/launch.sh' deepin-terminal -e '{programPath}/InstallOther.py' '{wineBottonPath}' '{wine[o1.currentText()]}'") def BuildExeDeb(): if e1.currentText() == "": @@ -935,6 +938,16 @@ if not os.path.exists(get_home() + "/.config/deepin-wine-runner/WineSetting.json # 如果要添加其他 wine,请在字典添加其名称和执行路径 try: wine = {"deepin-wine": "deepin-wine", "deepin-wine5": "deepin-wine5", "wine": "wine", "wine64": "wine64", "deepin-wine5 stable": "deepin-wine5-stable", "deepin-wine6 stable": "deepin-wine6-stable", "spark-wine7-devel": "spark-wine7-devel", "ukylin-wine": "ukylin-wine"} + if os.path.exists("/persistent/linglong/layers/"): # 判断是否使用 linglong + for i in os.listdir("/persistent/linglong/layers/"): + try: + dire = os.listdir(f"/persistent/linglong/layers/{i}")[-1] + arch = os.listdir(f"/persistent/linglong/layers/{i}/{dire}")[-1] + if os.path.exists(f"/persistent/linglong/layers/{i}/{dire}/{arch}/runtime/bin/deepin-wine6-stable"): + wine["基于 linglong 的 deepin-wine6-stable(不推荐)"] = f"ll-cli run {i} --exec '/bin/deepin-wine6-stable'" + break + except: + pass shellHistory = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/ShellHistory.json")).values()) findExeHistory = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/FindExeHistory.json")).values()) wineBottonHistory = list(json.loads(readtxt(get_home() + "/.config/deepin-wine-runner/WineBottonHistory.json")).values()) @@ -974,9 +987,10 @@ exe路径\' 参数 \' 5、wine 容器如果没有指定,则会默认为 ~/.wine''' updateThingsString = '''※1、修复了打包器(非基于活动脚本) control、postrm 写入文件颠倒的问题 ※2、内置一个微型的 Windows 应用商店(应用来源:腾讯软件管家) -3、更新了打包器(非基于活动脚本)调用星火 spark-wine-helper 的 run.sh 脚本格式 -4、修复了打包器(基于活动脚本)在 dde-top-panel 和 dde-globalmenu-service 下无法打开帮助提示的问题 -5、支持屏蔽 Wine 默认的 Mono、Gecko 安装器(屏蔽方法来自星火应用商店审核组和提供的新 run.sh 标准) +※3、初步支持 deepin 23 +4、更新了打包器(非基于活动脚本)调用星火 spark-wine-helper 的 run.sh 脚本格式 +5、修复了打包器(基于活动脚本)在 dde-top-panel 和 dde-globalmenu-service 下无法打开帮助提示的问题 +6、支持屏蔽 Wine 默认的 Mono、Gecko 安装器(屏蔽方法来自星火应用商店审核组和提供的新 run.sh 标准) ''' for i in information["Thank"]: thankText += f"{i}\n" @@ -1117,7 +1131,6 @@ saveDesktopFileOnLauncher.setSizePolicy(size) label_r_2.setSizePolicy(size) getProgramIcon.setSizePolicy(size) trasButton.setSizePolicy(size) -#uninstallProgram.setSizePolicy(size) wineConfig.setSizePolicy(size) returnText = QtWidgets.QTextBrowser() @@ -1154,16 +1167,19 @@ mainLayout.addWidget(programRun, 2, 1, 1, 1) menu = window.menuBar() programmenu = menu.addMenu("程序(&P)") p1 = QtWidgets.QAction("安装 wine(&I)") +installWineOnDeepin23 = QtWidgets.QAction("安装 wine(只限Deepin23)") p2 = QtWidgets.QAction("设置程序(&S)") p3 = QtWidgets.QAction("清空软件历史记录(&C)") p4 = QtWidgets.QAction("退出程序(&E)") programmenu.addAction(p1) +programmenu.addAction(installWineOnDeepin23) programmenu.addSeparator() programmenu.addAction(p2) programmenu.addAction(p3) programmenu.addSeparator() programmenu.addAction(p4) p1.triggered.connect(InstallWine) +installWineOnDeepin23.triggered.connect(InstallWineOnDeepin23) p2.triggered.connect(ProgramSetting.ShowWindow) p3.triggered.connect(CleanProgramHistory) p4.triggered.connect(window.close) diff --git a/deb/opt/apps/deepin-wine-runner/package-script.zip b/deb/opt/apps/deepin-wine-runner/package-script.zip index f7bae28fb781c9ae58235e67228b44e5e1f48b5f..72939b01d511c536445e8ddc2f5336b75f4c73e3 100755 GIT binary patch delta 609 zcmY*VOK1~O6wRIU3^+|s5|*!Z7%L`vni`mzdd+Fq$p@Fiuae)st_MVA6KZKqS6+ti3? zeNL_twJTBj`h0B$->=iKth4KNYWmkywU1BS76BGbI;hfzn{-Oev+w+*kOKT@iS8-k z*fJ5hjeG6PFVZ0w-O8?y zr5R3#TIf(Zbg~_;X7L9F1+}GH9i$SmVsL1Yw9>_UUlY*ba=xE)&-pkzE0NDD5$_7$ z7^kFz(Yh1TY8geJx<7;esD{M#&Cr1=@B7}U;%XUL)_-UkSF{~|$-UJ2vlFeDq~+zf zSdO!A4T=59wAf_VB@xXg+wbqHY9F=tj-A9lyQ4;l`QJ=efL7aVK?yex7-QW(V(O3$ zgJhNR5fkMjzLwNK=2`mf>!Ljr2n5tSM_>Q2C?y=!gTVms^lqM~$uc2MOD6a^zMGI$ zQ^buVXh08KjEZ|HNU3b1k%QJicOl7zG1@A?#jfJVj#+S7_1?BXSK&my2rqnaeijTr z?sN%S(y2_?ASP@SgZ=*nrIQX`s5|*!Z7%L`vni`mzdd+Fq$p@Fiuae)st_MVA6KZKqS6+ti3? zeNL_twJTBj`h0B$->=iKth4KNYWmkywU1BS76BGbI;hfzn{-Oev+w+*kOKT@iS8-k z*fJ5hjeG6PFVZ0w-O8?y zr5R3#TIf(Zbg~_;X7L9F1+}GH9i$SmVsL1Yw9>_UUlY*ba=xE)&-pkzE0NDD5$_7$ z7^kFz(Yh1TY8geJx<7;esD{M#&Cr1=@B7}U;%XUL)_-UkSF{~|$-UJ2vlFeDq~+zf zSdO!A4T=59wAf_VB@xXg+wbqHY9F=tj-A9lyQ4;l`QJ=efL7aVK?yex7-QW(V(O3$ zgJhNR5fkMjzLwNK=2`mf>!Ljr2n5tSM_>Q2C?y=!gTVms^lqM~$uc2MOD6a^zMGI$ zQ^buVXh08KjEZ|HNU3b1k%QJicOl7zG1@A?#jfJVj#+S7_1?BXSK&my2rqnaeijTr z?sN%S(y2_?ASP@SgZ=*nrIQX`