diff --git a/InstallFoxpro.py b/InstallFoxpro.py new file mode 100755 index 0000000..ec3bbd8 --- /dev/null +++ b/InstallFoxpro.py @@ -0,0 +1,105 @@ +#!/usr/bin/env python3 +# 使用系统默认的 python3 运行 +########################################################################################### +# 作者:gfdgd xi +# 版本:2.1.0 +# 更新时间:2022年08月25日 +# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序 +# 基于 Python3 构建 +########################################################################################### +################# +# 引入所需的库 +################# +import os +import sys +import json +import updatekiller +import req as requests +try: + sourcesList = [ + "http://Visual FoxPro.wine-runner.gfdgdxi.top/list.json", + "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/Visual FoxPro/list.json" + ] + change = False + for i in sourcesList: + try: + netList = json.loads(requests.get(i).text) + change = True + break + except: + pass + if not change: + netList = json.loads(requests.get(sourcesList[0]).text) +except: + print("使用离线列表") + netList = [ + ["3.0 Runtime Service Pack 1", "http://FoxPro.wine-runner.gfdgdxi.top/VFP3SP1RT.exe", "VFP3SP1RT.exe"], + ["5.0 Runtime Service Pack 1", "http://FoxPro.wine-runner.gfdgdxi.top/VFP5SP1RT.exe", "VFP5SP1RT.exe"], + ["6.0 Runtime Service Pack 5", "http://FoxPro.wine-runner.gfdgdxi.top/VFP6SP5RT.exe", "VFP6SP5RT.exe"], + ["7.0 Runtime Service Pack 0", "http://FoxPro.wine-runner.gfdgdxi.top/VFP7SP0RT.exe", "VFP7SP0RT.exe"], + ["7.0 Runtime Service Pack 1", "http://FoxPro.wine-runner.gfdgdxi.top/VFP7SP1RT.exe", "VFP7SP1RT.exe"], + ["8.0 Runtime Service Pack 0", "http://FoxPro.wine-runner.gfdgdxi.top/VFP8SP0RT.exe", "VFP8SP0RT.exe"], + ["8.0 Runtime Service Pack 1", "http://FoxPro.wine-runner.gfdgdxi.top/VFP8SP1RT.exe", "VFP8SP1RT.exe"], + ["9.0 Runtime Service Pack 1", "http://FoxPro.wine-runner.gfdgdxi.top/VFP9SP1RT.exe", "VFP9SP1RT.exe"], + ["9.0 Runtime Service Pack 2 with Hotfixes", "http://FoxPro.wine-runner.gfdgdxi.top/VFP9SP2RT.exe", "VFP9SP2RT.exe"] + ] +def Download(wineBotton: str, id: int, wine: str) -> int: + try: + os.remove(f"/tmp/deepin-wine-runner-FoxPro/{netList[id][2]}") + except: + pass + os.system(f"aria2c -x 16 -s 16 -d '/tmp/deepin-wine-runner-FoxPro' -o '{netList[id][2]}' \"{netList[id][1]}\"") + return os.system(f"WINEPREFIX='{wineBotton}' {wine} '/tmp/deepin-wine-runner-FoxPro/{netList[id][2]}'") + +if __name__ == "__main__": + if "--help" in sys.argv: + print("作者:gfdgd xi") + print("版本:1.0.0") + print("本程序可以更方便的在 wine 容器中安装 Visual FoxPro") + sys.exit() + if len(sys.argv) <= 2 or sys.argv[1] == "" or sys.argv[2] == "": + print("您未指定需要安装 Visual FoxPro 的容器和使用的 wine,无法继续") + print("参数:") + print("XXX 参数一 参数二 参数三(可略)") + print("参数一为需要安装的容器,参数二为需要使用的wine,参数三为是否缓存(可略),三个参数位置不能颠倒") + sys.exit() + + homePath = os.path.expanduser('~') + print(''' + mmmmmm mmmmm + # mmm m m # "# m mm mmm + #mmmmm #" "# #m# #mmm#" #" " #" "# + # # # m#m # # # # + # "#m#" m" "m # # "#m#" + + +''') + + print("请选择以下的 Visual FoxPro 进行安装(不保证能正常安装运行)") + for i in range(0, len(netList)): + print(f"{i} Visual FoxPro {netList[i][0]}") + while True: + try: + choose = input("请输入要选择的 Visual FoxPro 版本(输入“exit”退出):").lower() + if choose == "exit": + break + choose = int(choose) + except: + print("输入错误,请重新输入") + continue + if 0 <= choose and choose < len(netList): + break + if choose == "exit": + exit() + print(f"您选择了 Visual FoxPro {netList[choose][0]}") + if os.path.exists(f"{homePath}/.cache/deepin-wine-runner/vcpp/{netList[choose][2]}"): + print("已经缓存,使用本地版本") + os.system(f"WINEPREFIX='{sys.argv[1]}' {sys.argv[2]} '{homePath}/.cache/deepin-wine-runner/vcpp/{netList[choose][2]}'") + input("安装结束,按回车键退出") + exit() + print("开始下载") + os.system(f"rm -rf '{homePath}/.cache/deepin-wine-runner/vcpp/{netList[choose][2]}'") + os.system(f"mkdir -p '{homePath}/.cache/deepin-wine-runner/vcpp'") + os.system(f"aria2c -x 16 -s 16 -d '{homePath}/.cache/deepin-wine-runner/vcpp' -o '{netList[choose][2]}' \"{netList[choose][1]}\"") + os.system(f"WINEPREFIX='{sys.argv[1]}' {sys.argv[2]} '{homePath}/.cache/deepin-wine-runner/vcpp/{netList[choose][2]}'") + input("安装结束,按回车键退出") \ No newline at end of file diff --git a/Makefile b/Makefile index bdaa04d..cb9404c 100755 --- a/Makefile +++ b/Makefile @@ -50,6 +50,8 @@ package: rm -rfv deb/opt/apps/deepin-wine-runner/wine/winelist.json cp -rv req deb/opt/apps/deepin-wine-runner cp -rv pardus-chroot deb/opt/apps/deepin-wine-runner + cp -rv WineLib deb/opt/apps/deepin-wine-runner + cp -rv InstallFoxpro.py deb/opt/apps/deepin-wine-runner cp -rv BuildDesktop.py deb/opt/apps/deepin-wine-runner cp -rv ChangePassword.sh deb/opt/apps/deepin-wine-runner cp -rv trans deb/opt/apps/deepin-wine-runner diff --git a/WineLib/remove.sh b/WineLib/remove.sh index 2e7d2bb..8c12010 100755 --- a/WineLib/remove.sh +++ b/WineLib/remove.sh @@ -9,4 +9,6 @@ fi sudo rm -rfv lib sudo rm -rfv lib64 sudo rm -rfv usr -sudo chmod 777 -Rv . \ No newline at end of file +sudo chmod 777 -Rv . +echo 删除完成!按回车键退出 +read \ No newline at end of file diff --git a/mainwindow.py b/mainwindow.py index 1d9f1d9..d9765dc 100755 --- a/mainwindow.py +++ b/mainwindow.py @@ -899,6 +899,13 @@ def InstallVB(): wineBottonPath = e1.currentText() OpenTerminal(f"'{programPath}/InstallVisualBasicRuntime.py' '{wineBottonPath}' '{wine[o1.currentText()]}' {int(setting['RuntimeCache'])}") +def InstallFoxPro(): + if e1.currentText() == "": + wineBottonPath = setting["DefultBotton"] + else: + wineBottonPath = e1.currentText() + OpenTerminal(f"'{programPath}/InstallFoxpro.py' '{wineBottonPath}' '{wine[o1.currentText()]}' {int(setting['RuntimeCache'])}") + def InstallVisualStudioCPlusPlus(): if e1.currentText() == "": wineBottonPath = setting["DefultBotton"] @@ -2455,13 +2462,15 @@ updateThingsString = transla.transe("U", '''※1、简易打包器支持选择 W ※6、更换 Box86 源并支持安装 Box64(如果为 aarch64 架构) ※7、新增 Wine 自建源(支持 Debian10、Deepin20) ※8、修改 WineHQ 安装器使其支持选择国内清华大学镜像源或 WineHQ 官方源 -9、新增自动构建:https://github.com/gfdgd-xi/deep-wine-runner/actions/workflows/auto-building.yml(只供尝鲜) -10、新增 Wine 日构建(在“安装更多 Wine”处可以获取,目前有 i386、amd64、i386+amd64、amd64+wow64 mode、aarch64) -11、优化容器清理脚本 -12、修复部分组件没完全换源的问题,部分组件支持自动换可用源''') +※9、新增 Visual FoxPro 安装器 +※10、新增安装局部运行库以解决部分低版本系统运行高版本 Wine 的问题且不与其他运行库和兼容层冲突 +11、新增自动构建:https://github.com/gfdgd-xi/deep-wine-runner/actions/workflows/auto-building.yml(只供尝鲜) +12、新增 Wine 日构建(在“安装更多 Wine”处可以获取,目前有 i386、amd64、i386+amd64、amd64+wow64 mode、aarch64) +13、优化容器清理脚本 +14、修复部分组件没完全换源的问题,部分组件支持自动换可用源''') for i in information["Thank"]: thankText += f"{i}\n" -updateTime = "2023年07月06日" +updateTime = "2023年07月11日" aboutProgram = transla.transe("U", """<p>Wine运行器是一个能让Linux用户更加方便地运行Windows应用的程序,内置了对Wine图形化的支持、各种Wine工具、自制的Wine程序打包器和运行库安装工具等。</p> <p>它同时还内置了基于VirtualBox制作的、专供小白使用的Windows虚拟机安装工具,可以做到只需下载系统镜像并点击安装即可,无需考虑虚拟机的安装、创建、分区等操作。</p> <pre> @@ -2788,6 +2797,7 @@ wineOption.addSeparator() wm1 = wineOption.addMenu(transla.transe("U", "在指定 Wine、容器安装组件")) wm1_1 = QtWidgets.QAction(transla.transe("U", "在指定wine、指定容器安装 .net framework")) wm1_2 = QtWidgets.QAction(transla.transe("U", "在指定wine、指定容器安装 Visual Studio C++")) +wm1_8 = QtWidgets.QAction(transla.transe("U", "在指定wine、指定容器安装 Visual FoxPro")) wm1_3 = QtWidgets.QAction(transla.transe("U", "在指定wine、指定容器安装 MSXML")) wm1_4 = QtWidgets.QAction(transla.transe("U", "在指定wine、指定容器安装 gecko")) wm1_5 = QtWidgets.QAction(QtGui.QIcon.fromTheme("mono"), transla.transe("U", "在指定wine、指定容器安装 mono")) @@ -2795,6 +2805,7 @@ wm1_7 = QtWidgets.QAction(transla.transe("U", "在指定wine、指定容器安 wm1_6 = QtWidgets.QAction(transla.transe("U", "在指定wine、指定容器安装其它运行库")) wm1.addAction(wm1_1) wm1.addAction(wm1_2) +wm1.addAction(wm1_8) wm1.addAction(wm1_3) wm1.addAction(wm1_4) wm1.addAction(wm1_5) @@ -2902,6 +2913,7 @@ w10.triggered.connect(SetDeepinFileDialogRecovery) w11.triggered.connect(lambda: RunWinetricks()) wm1_1.triggered.connect(lambda: threading.Thread(target=InstallNetFramework).start()) wm1_2.triggered.connect(lambda: threading.Thread(target=InstallVisualStudioCPlusPlus).start()) +wm1_8.triggered.connect(lambda: threading.Thread(target=InstallFoxPro).start()) wm1_3.triggered.connect(lambda: threading.Thread(target=InstallMSXML).start()) wm1_4.triggered.connect(lambda: threading.Thread(target=InstallMonoGecko, args=["gecko"]).start()) wm1_5.triggered.connect(lambda: threading.Thread(target=InstallMonoGecko, args=["mono"]).start())