Skip to content
This repository was archived by the owner on May 24, 2025. It is now read-only.

Commit 6fba219

Browse files
committed
Portable executable update checker release
Added update checker for portable executables
1 parent 2dcf93f commit 6fba219

File tree

4 files changed

+14
-10
lines changed

4 files changed

+14
-10
lines changed

.github/workflows/workflow.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,12 @@ jobs:
3232
- name: Lint with flake8
3333
run: |
3434
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
35-
flake8 . --count --exit-zero --max-complexity=40 --max-line-length=300 --statistics
35+
flake8 . --count --max-complexity=40 --max-line-length=300 --statistics
3636
3737
- name: Build executable
3838
run: |
39-
pyinstaller --onefile --clean --name "exitlag-auto-signup v3.${{ github.run_number }}.exe" main.py
39+
echo "__version__ = 'v3.${{ github.run_number }}'" > version.py
40+
pyinstaller --onefile --clean --add-data "version.py:." --name "exitlag-auto-signup v3.${{ github.run_number }}.exe" main.py
4041
4142
- name: Upload Executable
4243
uses: actions/upload-artifact@v3

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ build/
88
dist/
99
*.exe
1010
assignVer.py
11+
*.spec
12+
version.py

lib/lib.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,26 @@
11
import time
22
import requests
3+
import sys
34
from DrissionPage import ChromiumPage
45

56

67
class Main:
78
async def checkUpdate(self):
89
try:
9-
# Get the latest version from GitHub API
1010
resp = requests.get(
1111
"https://api.github.com/repos/qing762/exitlag-auto-signup/releases/latest"
1212
)
1313
latestVer = resp.json()["tag_name"]
1414

15-
# Read the current version from version.txt
16-
with open("version.txt", "r") as file:
17-
currentVer = file.read().strip()
15+
if getattr(sys, 'frozen', False):
16+
import version
17+
currentVer = version.__version__
18+
else:
19+
with open("version.txt", "r") as file:
20+
currentVer = file.read().strip()
1821

19-
# Compare versions
2022
if currentVer < latestVer:
21-
print(f"Update available: {latestVer}\nYou can download the latest version from: https://github.com/qing762/exitlag-auto-signup/releases/latest\n")
23+
print(f"Update available: {latestVer} (Current version: {currentVer})\nYou can download the latest version from: https://github.com/qing762/exitlag-auto-signup/releases/latest\n")
2224
else:
2325
pass
2426
except Exception as e:
@@ -74,7 +76,6 @@ def locate_cf_button(self):
7476
if button:
7577
return button
7678
else:
77-
# If the button is not found, search it recursively
7879
self.log_message("Basic search failed. Searching for button recursively.")
7980
ele = self.driver.ele("tag:body")
8081
iframe = self.search_recursively_shadow_root_with_iframe(ele)

version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
v3.85
1+
v3.86

0 commit comments

Comments
 (0)