From 47b3dddfbcc7d0992847e2155d1fcdbfa18d18cd Mon Sep 17 00:00:00 2001 From: gfdgd_xi <3025613752@qq.com> Date: Wed, 5 Oct 2022 17:54:12 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=20VB=20Runtime=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E5=AE=89=E8=A3=85=E5=B7=A5=E5=85=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- AutoShell/command/installvb | 13 +++ ConfigLanguareRunner-help.json | 3 +- ConfigLanguareRunner.py | 15 ++- InstallVisualBasicRuntime.py | 86 ++++++++++++++++++ Model/__pycache__/__init__.cpython-37.pyc | Bin 1103 -> 1103 bytes .../InstallVisualBasicRuntime.cpython-37.pyc | Bin 0 -> 3527 bytes mainwindow.py | 24 +++-- 7 files changed, 126 insertions(+), 15 deletions(-) create mode 100755 AutoShell/command/installvb create mode 100755 InstallVisualBasicRuntime.py create mode 100644 __pycache__/InstallVisualBasicRuntime.cpython-37.pyc diff --git a/AutoShell/command/installvb b/AutoShell/command/installvb new file mode 100755 index 0000000..1bf2fba --- /dev/null +++ b/AutoShell/command/installvb @@ -0,0 +1,13 @@ +#!/usr/bin/env python3 +# 加入路径 +import os +import sys +programPath = os.path.split(os.path.realpath(__file__))[0] # 返回 string +sys.path.append(f"{programPath}/../../") +import ConfigLanguareRunner +# 符号转移 +argv = [] +for i in sys.argv[1:]: + argv.append(i.replace(" ", "\\ ")) +com = ConfigLanguareRunner.Command(f"{os.path.basename(sys.argv[0])} {' '.join(argv)}") +com.Run(com.GetCommandList(), os.getenv("WINEPREFIX"), os.getenv("WINE")) \ No newline at end of file diff --git a/ConfigLanguareRunner-help.json b/ConfigLanguareRunner-help.json index f249b54..10517d4 100644 --- a/ConfigLanguareRunner-help.json +++ b/ConfigLanguareRunner-help.json @@ -37,5 +37,6 @@ "killall": "杀死指定进程\n参数数量:1\n参数介绍:进程名", "control": "打开控制面板\n参数数量:0\n参数介绍:无", "taskmgr": "打开任务管理器\n参数数量:0\n参数介绍:无", - "killallwineserver": "杀死所有 Wine 程序\n参数数量:0\n参数介绍:无" + "killallwineserver": "杀死所有 Wine 程序\n参数数量:0\n参数介绍:无", + "installvb": "安装指定的 VB 运行库到指定容器\n参数数量:1\n参数介绍:在安装 Visual Basic Runtime 工具的编号,如 4 Visual Basic Runtime Visual Basic 6" } \ No newline at end of file diff --git a/ConfigLanguareRunner.py b/ConfigLanguareRunner.py index f0ef5cd..ba6c723 100755 --- a/ConfigLanguareRunner.py +++ b/ConfigLanguareRunner.py @@ -3,7 +3,7 @@ ########################################################################################### # 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 # 版本:2.1.0 -# 更新时间:2022年08月25日 +# 更新时间:2022年10月05日 # 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序 # 基于 Python3 构建 ########################################################################################### @@ -109,7 +109,8 @@ class Command(): "enabledwinecrashdialog", "disbledwinecrashdialog", "disbledWinebottlecreatelink", - "enabledWinebottlecreatelink" + "enabledWinebottlecreatelink", + "installvb" ] def __init__(self, commandString: str) -> None: @@ -391,6 +392,10 @@ class Command(): self.command = ["bat", "reg", "add", "HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings", "/v", "ProxyEnable", "/t", "REG_DWORD", "/d", "00000000", "/f"] self.Bat() + def InstallVB(self): + import InstallVisualBasicRuntime + return InstallVisualBasicRuntime.Download(self.wineBottonPath, int(self.command[1]), self.wine) + # 可以运行的命令的映射关系 # 可以被使用的命令的映射 commandList = { @@ -431,7 +436,8 @@ class Command(): "enabledwinecrashdialog": EnabledWineCrashDialog, "disbledwinecrashdialog": DisbledWineCrashDialog, "disbledWinebottlecreatelink": DisbledWineBottleCreateLink, - "enabledWinebottlecreatelink": EnabledWineBottleCreateLink + "enabledWinebottlecreatelink": EnabledWineBottleCreateLink, + "installvb": InstallVB } # 参数数列表 @@ -474,7 +480,8 @@ class Command(): "enabledwinecrashdialog": [0], "disbledwinecrashdialog": [0], "disbledWinebottlecreatelink": [0], - "enabledWinebottlecreatelink": [0] + "enabledWinebottlecreatelink": [0], + "installvb": [1] } windowsUnrun = [ "createbotton", diff --git a/InstallVisualBasicRuntime.py b/InstallVisualBasicRuntime.py new file mode 100755 index 0000000..19e7e48 --- /dev/null +++ b/InstallVisualBasicRuntime.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +# 使用系统默认的 python3 运行 +########################################################################################### +# 作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢 +# 版本:2.1.0 +# 更新时间:2022年10月05日 +# 感谢:感谢 wine 以及 deepin-wine 团队,提供了 wine 和 deepin-wine 给大家使用,让我能做这个程序 +# 基于 Python3 构建 +########################################################################################### +################# +# 引入所需的库 +################# +import os +import sys +import json +import req as requests +try: + netList = json.loads(requests.get("https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vb/list.json").text) +except: + netList = [ + ["Visual Basic 1(DOS application)", "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vb/vbrun100.exe", "vbrun100.exe"], + ["Visual Basic 2(DOS application)", "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vb/vbrun200.exe", "vbrun200.exe"], + ["Visual Basic 3", "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vb/vb3run.exe", "vb3run.exe"], + ["Visual Basic 4", "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vb/vb4run.exe", "vb4run.exe"], + ["Visual Basic 6", "https://code.gitlink.org.cn/gfdgd_xi/wine-runner-list/raw/branch/master/vb/vbrun60sp4.exe", "vbrun60sp4.exe"] + ] +def Download(wineBotton: str, id: int, wine: str) -> int: + try: + os.remove(f"/tmp/deepin-wine-runner-vb/{netList[id][2]}") + except: + pass + os.system(f"aria2c -x 16 -s 16 -d '/tmp/deepin-wine-runner-vb' -o '{netList[id][2]}' \"{netList[id][1]}\"") + os.system(f"WINEPREFIX='{wineBotton}' {wine} '/tmp/deepin-wine-runner-vb/{netList[id][2]}'") + +if __name__ == "__main__": + if "--help" in sys.argv: + print("作者:gfdgd xi、为什么您不喜欢熊出没和阿布呢") + print("版本:1.0.0") + print("本程序可以更方便的在 wine 容器中安装 Visual Basic Runtime") + sys.exit() + if len(sys.argv) <= 2 or sys.argv[1] == "" or sys.argv[2] == "": + print("您未指定需要安装 Visual Basic Runtime 的容器和使用的 wine,无法继续") + print("参数:") + print("XXX 参数一 参数二 参数三(可略)") + print("参数一为需要安装的容器,参数二为需要使用的wine,参数三为是否缓存(可略),三个参数位置不能颠倒") + sys.exit() + + homePath = os.path.expanduser('~') + print(''' + m m mmmmm + "m m" # # + # # #mmmm" + "mm" # # + ## #mmmm" + + +''') + + print("请选择以下的 Visual Basic Runtime 进行安装(不保证能正常安装运行)") + for i in range(0, len(netList)): + print(f"{i} Visual Basic Runtime {netList[i][0]}") + while True: + try: + choose = input("请输入要选择的 Visual Basic Runtime 版本(输入“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 Basic Runtime {netList[choose][0]}") + if os.path.exists(f"{homePath}/.cache/deepin-wine-runner/vb/{netList[choose][2]}"): + print("已经缓存,使用本地版本") + os.system(f"WINEPREFIX='{sys.argv[1]}' {sys.argv[2]} '{homePath}/.cache/deepin-wine-runner/vb/{netList[choose][2]}'") + input("安装结束,按回车键退出") + exit() + print("开始下载") + os.system(f"rm -rf '{homePath}/.cache/deepin-wine-runner/vb/{netList[choose][2]}'") + os.system(f"mkdir -p '{homePath}/.cache/deepin-wine-runner/vb'") + os.system(f"aria2c -x 16 -s 16 -d '{homePath}/.cache/deepin-wine-runner/vb' -o '{netList[choose][2]}' \"{netList[choose][1]}\"") + os.system(f"WINEPREFIX='{sys.argv[1]}' {sys.argv[2]} '{homePath}/.cache/deepin-wine-runner/vb/{netList[choose][2]}'") + input("安装结束,按回车键退出") \ No newline at end of file diff --git a/Model/__pycache__/__init__.cpython-37.pyc b/Model/__pycache__/__init__.cpython-37.pyc index 676678829275fdba51367b5fb3ebc737086dd84b..b0920ebac871dadb85ca2d0fe2c72620958efef6 100644 GIT binary patch delta 20 acmX@lah`+QiI!AK2l^MxW9#wdiPsg{hkj>f?AmJJWzimI z&N<&Xzwdg^_s!%)TbqZ0cKGxw(SPn>m>(%oYujM*M|kA_vJ8V6j1o-P8c`UTG#h5k z(Ghk|b`m!4BF?-Uvy13#%OVPMLyUMFG4zKW*oj>+2X^BY%)!`-J$M_8UfhP;Vcd>) z;OAnFm@CY^%ZThSLt2T4K6q!&iFe_S51rv{#EW;w**RAF5AG!BY+Kwd6-YbYGldWX zqt71qnj^|@Uj)r$2SrXHyf2RABAw&?dl`Hn&f3&Ii<(1{7i2td%Q$F{FW4jBB$GM& zTz)5h5q#VQJY6=Xn~s@&(t)W~ZVFAY1I&ATcsFS$yXP7F65+^h(8la#=9vWtMbDuR zjt?=Jk;#`xC;rtG%I{fZ!am}|zXm^%lo@0o3gB1R2eI^7u>_5Ni+5tgiWTVd#S!2~ zh|kg-2g%aNAeBEd1iQAp@5%Nl8k2T>2yF4yZDCChs8@T*F0i!6-i6puOBWHud=R*P zW8w1q@Na981oUBZZenrZm;5-m(7H%Zs1t`w{+bQFb!mNDa=A<{2DJ5?`$woHAcw9T zHCKMuXeT~qQ*gdu)yoTT2W|BKU@b;(F+IntG$&4JZ;vTTTK;_~6is0gj0s9Y5aYp= z6bnYhQ0#pi!=o7?G$Dv2AgQ8Aq(DNDm5>yf2%V84VstE&jK~U+LgQybbSHRLPKnwJ ze-UIglHgB7WFgA;9U6G^Ek2S?CxmE35mI80HuMbDj-LU``g(hVBttZB6V+@-|Np^` z{w6zWRC`lAj%e>ZQ}>U6|EBYv@iX;#v&y5-Smn_MmGybE%46EQ&(urMc&t}WA2mH~ zH;=ha_c(PAy`v{mijop_R=~QG(z;tBiYkdw2fgjk=-3L+Yw*bDpqo6PFnNTL!k$A= zJXo_lK)FW@lqauMo~)7tI0tq#;;_@ETxNQ@7tHiFaV_U)!gA+W=v$k3JXR8829j{w zDQ$m9Nv1=XkhCBM8q*B&sR}PCMteCT36cINAIR{1$M}G3_L%oSnbFS&QoLVt`1!6X z0uhfii(gV z!Stlg4WuT-L@I*!gG|{A9fMeO0J-6J2ubi}XLN3KG#L@Z(NWDE2#k?LT74CkiyOI0 z_Tr=U+h+OVGs2JA^TonyaV=YXc)4_8saUvT+{~4}zEl3_Z^ot7(l?97$FtR2n?_;E z`1>7|`cR&}T*`e7BKm^8!Cv*xump5@X~tN+YFu3@uH7xo|GRYaVez}o^6d|e+!9ZZ zjyIMc8lQmt`^NHg<@1YtQ`XzQNp27(wLqsc>JSxtVX2h+sx*7aSiW7&Wh?j2KZTp8 z>P#(Qb8%y{e0>R4Ozn@>XG{Ocm;QC5y!J(T?Y>H{xpDPE>Ba-_L+t@-czBq%R*Hpe zZMHgFn-!)Hfp6s-cYD;CIxiq0c8zw`EdYhKwAI-@x=@rO=V+4iOzKYhITUtC千万不要中断后不删除源的情况下 apt upgrade !!!中断后只需重新打开脚本输入 repair 或者随意安装一个 Wine(会自动执行恢复操作)即可 以及此脚本安装的 Wine 无法保证 100% 能使用,以及副作用是会提示 N: 鉴于仓库 'https://community-packages.deepin.com/beige beige InRelease' 不支持 'i386' 体系结构,跳过配置文件 'main/binary-i386/Packages' 的获取。''' -updateThingsString = '''※1、自动配置解释器支持 bash 语法(新版底层调用 bash,旧版任然使用旧版解析引擎) -※2、修复缺失 wimtools 依赖导致无法正常安装的问题 -※3、修复基于生态适配活动脚本打包器对话框过多影响使用的问题,并支持指定不同的包名和容器名 -※4、7z 文件解压不会自动替换文件然后卡死以及因此导致程序闪退的问题 -※5、修复安装更多 Wine 终端调用问题和图标问题 -※6、支持 openkylin -7、支持通过 exe 路径自动生成 Wine 容器路径 -8、支持禁用/启用 wine 容器是否生成快捷方式的功能以及启用/禁用程序崩溃提示对话框 -9、支持设置 wine 容器代理 -10、自动配置脚本支持使用 --help 参数查看帮助 +updateThingsString = '''※1、新增 VB Runtime 组件安装工具 ''' for i in information["Thank"]: thankText += f"{i}\n" @@ -2107,12 +2105,14 @@ wm1_2 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "在指定wine wm1_3 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "在指定wine、指定容器安装 MSXML")) wm1_4 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "在指定wine、指定容器安装 gecko")) wm1_5 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "在指定wine、指定容器安装 mono")) +wm1_7 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "在指定wine、指定容器安装 Visual Basic Runtime")) wm1_6 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "在指定wine、指定容器安装其它运行库")) wm1.addAction(wm1_1) wm1.addAction(wm1_2) wm1.addAction(wm1_3) wm1.addAction(wm1_4) wm1.addAction(wm1_5) +wm1.addAction(wm1_7) wm1.addAction(wm1_6) wm2 = wineOption.addMenu(QtCore.QCoreApplication.translate("U", "在指定 Wine、容器运行基础应用")) wm2_1 = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "打开指定wine、指定容器的控制面板")) @@ -2188,6 +2188,7 @@ wm1_2.triggered.connect(lambda: threading.Thread(target=InstallVisualStudioCPlus 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()) +wm1_7.triggered.connect(lambda: threading.Thread(target=InstallVB).start()) wm1_6.triggered.connect(lambda: threading.Thread(target=InstallOther).start()) wm2_1.triggered.connect(lambda: RunWineProgram("control")) wm2_2.triggered.connect(lambda: RunWineProgram("iexplore' 'https://www.deepin.org")) @@ -2272,6 +2273,8 @@ help.addAction(h2) help.addAction(h3) help.addAction(h4) help.addSeparator() +wikiHelp = QtWidgets.QAction(QtCore.QCoreApplication.translate("U", "程序 Wiki")) +help.addAction(wikiHelp) videoHelp = help.addMenu(QtCore.QCoreApplication.translate("U", "视频教程")) easyHelp = QtWidgets.QAction("简易使用教程") buildHelp = QtWidgets.QAction("打包教程") @@ -2296,6 +2299,7 @@ runStatusWebSize.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdg h2.triggered.connect(helps) h3.triggered.connect(UpdateThings) h4.triggered.connect(ThankWindow) +wikiHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://gfdgd-xi.github.io/wine-runner-wiki")) easyHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://www.bilibili.com/video/BV1ma411972Y")) buildHelp.triggered.connect(lambda: webbrowser.open_new_tab("https://www.bilibili.com/video/BV1EU4y1k7zr")) h5.triggered.connect(UpdateWindow.ShowWindow)