Commit a5f36591 authored by smile2019's avatar smile2019

检查C盘依赖文件

parent 7858fbdc
......@@ -8,3 +8,4 @@ easyOCR_usage.py
dist
build
log
product_test
......@@ -15,8 +15,10 @@ import winreg
os.environ['PYQTGRAPH_QT_LIB'] = 'PyQt5'
project_path = None
# 检查
def is_lav_filters_installed():
"""检查注册表是否注册成功
"""
try:
# 检查注册表LAVSplitter.ax
with winreg.OpenKey(winreg.HKEY_LOCAL_MACHINE, r"SOFTWARE\Classes\CLSID\{083863F1-70DE-11D0-BD40-00A0C911CE86}\Instance\{171252A0-8820-4AFE-9DF8-5C92B2D66B04}", 0, winreg.KEY_READ) as key:
......@@ -30,7 +32,18 @@ def is_lav_filters_installed():
return True
except FileNotFoundError:
return False
def is_file_copyed():
"""检查文件是否复制成功到C:\LavFilters下
"""
dir_path = "C:\LavFilters"
if os.path.exists(dir_path):
file_list = ['avcodec-lav-59.dll', 'avfilter-lav-8.dll', 'avformat-lav-59.dll', 'avutil-lav-57.dll', 'COPYING', 'install_audio.bat', 'install_splitter.bat', 'install_video.bat', 'IntelQuickSyncDecoder.dll', 'LAVAudio.ax', 'LAVFilters.Dependencies.manifest', 'LAVSplitter.ax', 'LAVVideo.ax', 'libbluray.dll', 'swresample-lav-4.dll', 'swscale-lav-6.dll', 'uninstall_audio.bat', 'uninstall_splitter.bat', 'uninstall_video.bat']
flag = True
for file in file_list:
if not os.path.exists(os.path.join(dir_path,file)):
print(file)
flag = False
return flag
def change_project_path(path):
"""用于切换当前工程路径
......@@ -42,8 +55,8 @@ def change_project_path(path):
if __name__ == '__main__':
try:
subprocess.call(['deploy.bat'])
if is_lav_filters_installed() == True:
# subprocess.call(['deploy.bat'])
if not is_lav_filters_installed() or not is_file_copyed():
QCoreApplication.setAttribute(Qt.AA_EnableHighDpiScaling)
QCoreApplication.setAttribute(Qt.AA_UseHighDpiPixmaps)
app = QApplication(sys.argv)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment