diff --git a/.gitignore b/.gitignore index 10cb38d..c9f7fb9 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,7 @@ __pycache__/ # Distribution / packaging .Python +.idea/ build/ develop-eggs/ dist/ diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 171fb50..0000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,6 +0,0 @@ -/shelf/ -/workspace.xml -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml diff --git a/.idea/.name b/.idea/.name deleted file mode 100644 index 2bd033e..0000000 --- a/.idea/.name +++ /dev/null @@ -1 +0,0 @@ -TWLMagician.py diff --git a/.idea/TWLMagician-main.iml b/.idea/TWLMagician-main.iml deleted file mode 100644 index d9e99f3..0000000 --- a/.idea/TWLMagician-main.iml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/Custom.xml b/.idea/inspectionProfiles/Custom.xml deleted file mode 100644 index ebf07a3..0000000 --- a/.idea/inspectionProfiles/Custom.xml +++ /dev/null @@ -1,56 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml deleted file mode 100644 index 0c1cb67..0000000 --- a/.idea/inspectionProfiles/profiles_settings.xml +++ /dev/null @@ -1,6 +0,0 @@ - - - - \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml deleted file mode 100644 index e7d1150..0000000 --- a/.idea/misc.xml +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml deleted file mode 100644 index 29c2090..0000000 --- a/.idea/modules.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - - - - \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml deleted file mode 100644 index 44002bf..0000000 --- a/.idea/vcs.xml +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/patches/OTA.exe b/Res/OTA.exe similarity index 100% rename from patches/OTA.exe rename to Res/OTA.exe diff --git a/unlaunch.zip b/Res/unlaunch.zip similarity index 100% rename from unlaunch.zip rename to Res/unlaunch.zip diff --git a/Res/version.bin b/Res/version.bin new file mode 100644 index 0000000..f67d00f Binary files /dev/null and b/Res/version.bin differ diff --git a/TWLMagician.py b/TWLMagician.py index 0e534e7..a2af03b 100644 --- a/TWLMagician.py +++ b/TWLMagician.py @@ -2,7 +2,7 @@ # coding=utf-8 # TWLMagician -# Version 1.3.2 +# Version 1.3.3 # Author: R-YaTian # Original "HiyaCFW-Helper" Author: mondul @@ -35,7 +35,7 @@ ssl._create_default_https_context = ssl._create_unverified_context ntime_tmp = None downloadfile = False -version_number = 130 +version_number = 133 # Check Update @@ -43,11 +43,11 @@ def get_version(): if loc == 'zh_cn' or (loca == 'zh_hans' and region == 'cn'): version_url = 'https://gitee.com/ryatian/mirrors/raw/master/' else: - version_url = 'https://raw.githubusercontent.com/R-YaTian/TWLMagician/main/' + version_url = 'https://raw.githubusercontent.com/R-YaTian/TWLMagician/main/Res/' try: with urlopen(version_url + 'version.bin') as src0, open('version.bin', 'wb') as dst0: copyfileobj(src0, dst0, show_progress=False) - with open('version.bin', 'r') as ftmp: + with open('version.bin', 'rb') as ftmp: version_str = ftmp.read() remove('version.bin') return int(version_str) @@ -70,6 +70,8 @@ def WriteRestartCmd(): def check_update(): printl(_('检查更新中...')) + if path.isfile('OTA.exe'): + remove('OTA.exe') new_version = get_version() if new_version == -1: printl(_('检查更新失败')) @@ -90,10 +92,8 @@ def check_update(): if loc == 'zh_cn' or (loca == 'zh_hans' and region == 'cn'): ota_url = 'https://gitee.com/ryatian/mirrors/releases/download/Res/' else: - ota_url = 'https://raw.githubusercontent.com/R-YaTian/TWLMagician/main/patches/' + ota_url = 'https://raw.githubusercontent.com/R-YaTian/TWLMagician/main/Res/' try: - if path.isfile('OTA.exe'): - remove('OTA.exe') with urlopen(ota_url + ota_fname) as src0, open('OTA.exe', 'wb') as dst0: copyfileobj(src0, dst0) WriteRestartCmd() @@ -1972,7 +1972,7 @@ def unlaunch_proc(self): ) as src, open(filename, 'wb') as dst: copyfileobj(src, dst) else: - with urlopen('https://raw.githubusercontent.com/R-YaTian/TWLMagician/main/unlaunch.zip' + with urlopen('https://raw.githubusercontent.com/R-YaTian/TWLMagician/main/Res/unlaunch.zip' ) as src, open(filename, 'wb') as dst: copyfileobj(src, dst) except SystemExit: @@ -2458,6 +2458,7 @@ def transfer_main(self): check_update() root = Tk(className="Magician") if sysname == 'Linux' else Tk() +root.iconbitmap("icon.ico") printl(_('TWLMagician启动中...')) selfPath = path.dirname(path.abspath(argv[0])) diff --git a/build.bat b/build.bat index 0a429c5..dc46942 100644 --- a/build.bat +++ b/build.bat @@ -23,6 +23,5 @@ del *.pyd rmdir /S /Q C:\Users\Public\Run_TWLMagician.dist copy /Y ..\pack\x64\TaskbarLib.dll .\dist\TaskbarLib.dll -copy /Y ..\pack\x64\tk86t.dll .\dist\tk86t.dll copy /Y ..\pack\x64\api-ms-win-core-path-l1-1-0.dll .\dist\api-ms-win-core-path-l1-1-0.dll pause diff --git a/build32.bat b/build32.bat index 630a51c..f9f1ad4 100644 --- a/build32.bat +++ b/build32.bat @@ -10,7 +10,7 @@ call nuitka37.bat --msvc=14.1 --module --no-pyi-file --remove-output --nowarn-mn call nuitka37.bat --msvc=14.1 --module --no-pyi-file --remove-output --nowarn-mnemonic=old-python-windows-console --output-dir=bootstrap pyutils.py cd bootstrap -call nuitka37.bat --standalone --onefile --onefile-no-compression --noinclude-dlls=tk86t.dll --include-data-files=../pack/x86/TaskbarLib.dll=TaskbarLib.dll --include-data-files=../pack/x86/tk86t.dll=tk86t.dll --msvc=14.1 --remove-output --enable-plugin=tk-inter --nofollow-import-to=dbm --nofollow-import-to=distutils --nofollow-import-to=py_compile --nofollow-import-to=argparse --nowarn-mnemonic=old-python-windows-console --windows-icon-from-ico=..\icon.ico Run_TWLMagician.py +call nuitka37.bat --standalone --onefile --onefile-no-compression --include-data-files=../pack/x86/TaskbarLib.dll=TaskbarLib.dll --msvc=14.1 --remove-output --enable-plugin=tk-inter --nofollow-import-to=dbm --nofollow-import-to=distutils --nofollow-import-to=py_compile --nofollow-import-to=argparse --nowarn-mnemonic=old-python-windows-console --windows-icon-from-ico=..\icon.ico Run_TWLMagician.py rename .\Run_TWLMagician.exe TWLMagician.exe rmdir /S /Q py_langs diff --git a/icon.icns b/icon.icns index 92be095..6f3d02e 100644 Binary files a/icon.icns and b/icon.icns differ diff --git a/icon.ico b/icon.ico index bb02ec7..8d283b5 100644 Binary files a/icon.ico and b/icon.ico differ diff --git a/icon.png b/icon.png new file mode 100644 index 0000000..aa0d367 Binary files /dev/null and b/icon.png differ diff --git a/pack/after.cmd b/pack/after.cmd deleted file mode 100644 index ba4fc45..0000000 --- a/pack/after.cmd +++ /dev/null @@ -1,3 +0,0 @@ -@echo off -del OTA.exe -del %0 diff --git a/pack/x64/tk86t.dll b/pack/x64/tk86t.dll deleted file mode 100644 index d3e9947..0000000 Binary files a/pack/x64/tk86t.dll and /dev/null differ diff --git a/pack/x86/tk86t.dll b/pack/x86/tk86t.dll deleted file mode 100644 index 9de6229..0000000 Binary files a/pack/x86/tk86t.dll and /dev/null differ diff --git a/py_langs b/py_langs index bacafe5..2ad3e82 160000 --- a/py_langs +++ b/py_langs @@ -1 +1 @@ -Subproject commit bacafe5c4f9742332aef767fd7da54df8a713e17 +Subproject commit 2ad3e82e63e946dc0b2a1379b55a3a32478dc65b diff --git a/version.bin b/version.bin deleted file mode 100644 index fd03ab2..0000000 --- a/version.bin +++ /dev/null @@ -1 +0,0 @@ -130