支持自定义移除组件

This commit is contained in:
gfdgd xi 2023-07-11 22:05:06 +08:00
parent 66ace92775
commit b31c4bf134
3 changed files with 17 additions and 11 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
CURRENT_DIR=$(cd $(dirname $0); pwd) CURRENT_DIR=$(cd $(dirname $0); pwd)
cd $CURRENT_DIR cd $CURRENT_DIR
if [[ -f $CURRENT_DIR/usr/lib/ld-linux-x86-64.so.2 ]]; then if [[ -f $CURRENT_DIR/usr/ ]]; then
echo 运行库已安装,按回车键退出 echo 运行库已安装,按回车键退出
read read
exit exit
@ -11,7 +11,7 @@ if [[ $? != 0 ]]; then
echo 安装包下载失败!按回车键退出 echo 安装包下载失败!按回车键退出
read read
fi fi
sudo chmod 777 -Rv . chmod 777 -Rv .
tar -xvf /tmp/library.tar.xz tar -xvf /tmp/library.tar.xz
rm -vf /tmp/library.tar.xz rm -vf /tmp/library.tar.xz
echo 安装完成!按回车键退出 echo 安装完成!按回车键退出

View File

@ -1,14 +1,14 @@
#!/bin/bash #!/bin/bash
CURRENT_DIR=$(cd $(dirname $0); pwd) CURRENT_DIR=$(cd $(dirname $0); pwd)
cd $CURRENT_DIR cd $CURRENT_DIR
if [[ ! -f $CURRENT_DIR/usr/lib/ld-linux-x86-64.so.2 ]]; then if [[ ! -f $CURRENT_DIR/usr/ ]]; then
echo 运行库未安装,按回车键退出 echo 运行库未安装,按回车键退出
read read
exit exit
fi fi
sudo rm -rfv lib rm -rfv lib
sudo rm -rfv lib64 rm -rfv lib64
sudo rm -rfv usr rm -rfv usr
sudo chmod 777 -Rv . chmod 777 -Rv .
echo 删除完成!按回车键退出 echo 删除完成!按回车键退出
read read

View File

@ -3071,10 +3071,16 @@ if os.path.exists(f"{programPath}/WineLib/usr"):
diyRunnerLib.setEnabled(True) diyRunnerLib.setEnabled(True)
statusRunnerLib.setText("当前状态:已安装") statusRunnerLib.setText("当前状态:已安装")
libPathList = [] libPathList = []
def AddLib(number, name): mapLink = []
def AddRunnerLib(number, name):
global diyRunnerLib
action = QtWidgets.QAction(f"{name}") action = QtWidgets.QAction(f"{name}")
action.triggered.connect(lambda: print(int(str(number)))) mapLink.append(action)
action.triggered.connect(lambda: AddRunnerLib(int(str(number))))
diyRunnerLib.addAction(action) diyRunnerLib.addAction(action)
def DelRunnerLib(number):
os.system(f"rm -rf '{libPathList[number]}'")
mapLink[number].setDisabled(True)
for libPath in [f"{programPath}/WineLib/usr/lib", f"{programPath}/WineLib/usr/lib64"]: for libPath in [f"{programPath}/WineLib/usr/lib", f"{programPath}/WineLib/usr/lib64"]:
for i in os.listdir(libPath): for i in os.listdir(libPath):
if not os.path.isdir(f"{libPath}/{i}"): if not os.path.isdir(f"{libPath}/{i}"):
@ -3084,12 +3090,12 @@ if os.path.exists(f"{programPath}/WineLib/usr"):
except: except:
continue continue
libPathList.append(f"{libPath}/{i}") libPathList.append(f"{libPath}/{i}")
AddLib(len(libPathList), f"{i}") AddRunnerLib(len(libPathList) - 1, f"{i}")
else: else:
if not os.path.exists(f"{libPath}/{i}/libc.so.6"): if not os.path.exists(f"{libPath}/{i}/libc.so.6"):
continue continue
libPathList.append(f"{libPath}/{i}/") libPathList.append(f"{libPath}/{i}/")
AddLib(len(libPathList), f"{i}/") AddRunnerLib(len(libPathList) - 1, f"{i}/")
print(libPathList) print(libPathList)
if os.path.exists(f"{programPath}/InstallRuntime"): if os.path.exists(f"{programPath}/InstallRuntime"):
installLib.addSeparator() installLib.addSeparator()