diff --git a/2023-11-03.webp b/2023-11-03.webp new file mode 100644 index 0000000..3e88900 Binary files /dev/null and b/2023-11-03.webp differ diff --git a/IoT_Firmware_Loader.exe b/MiraV3_Firmware_Loader.exe similarity index 100% rename from IoT_Firmware_Loader.exe rename to MiraV3_Firmware_Loader.exe diff --git a/build_windows.bat b/build_windows.bat index 4fddc5f..d5e7650 100644 --- a/build_windows.bat +++ b/build_windows.bat @@ -5,7 +5,7 @@ REM Tao file .exe khong can cai Python REM ============================================ echo ======================================== -echo IoT Firmware Loader - Build for Windows +echo MiraV3 Firmware Loader - Build for Windows echo ======================================== echo. @@ -27,7 +27,9 @@ pip install PyQt6 scapy requests pyinstaller --quiet REM 4. Build .exe echo [3/4] Building executable... pyinstaller ^ - --name "IoT_Firmware_Loader" ^ + --name "MiraV3_Firmware_Loader" ^ + --icon "icon.ico" ^ + --add-data "icon.ico;." ^ --onefile ^ --windowed ^ --noconfirm ^ @@ -40,15 +42,16 @@ pyinstaller ^ --hidden-import "PyQt6.QtGui" ^ main.py + echo. echo [4/4] Build complete! echo. -if exist "dist\IoT_Firmware_Loader.exe" ( - echo ✅ SUCCESS: dist\IoT_Firmware_Loader.exe +if exist "dist\MiraV3_Firmware_Loader.exe" ( + echo ✅ SUCCESS: dist\MiraV3_Firmware_Loader.exe echo. echo File size: - for %%A in ("dist\IoT_Firmware_Loader.exe") do echo %%~zA bytes + for %%A in ("dist\MiraV3_Firmware_Loader.exe") do echo %%~zA bytes echo. echo Ban co the copy file .exe nay sang may khac va chay truc tiep. ) else ( diff --git a/icon.ico b/icon.ico new file mode 100644 index 0000000..fc20d92 Binary files /dev/null and b/icon.ico differ diff --git a/main.py b/main.py index cf4294d..82ceb60 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,5 @@ import sys +import os import socket import ipaddress import platform @@ -116,6 +117,15 @@ def get_default_network(ip): return "192.168.1.0/24" +def resource_path(relative_path): + """ Get absolute path to resource, works for dev and for PyInstaller """ + try: + base_path = sys._MEIPASS + except Exception: + base_path = os.path.abspath(".") + return os.path.join(base_path, relative_path) + + def get_machine_info(): """Collect machine info.""" hostname = socket.gethostname() @@ -501,7 +511,8 @@ class App(QWidget): def __init__(self): super().__init__() - self.setWindowTitle("IoT Firmware Loader") + self.setWindowTitle("MiraV3 Firmware Loader") + self.setWindowIcon(QIcon(resource_path("icon.ico"))) self.firmware = None self.all_devices = [] # all scan results (unfiltered) self.devices = [] # currently displayed (filtered) @@ -516,12 +527,12 @@ class App(QWidget): layout.setContentsMargins(8, 6, 8, 6) # ── Title ── - title = QLabel("⚡ IoT Firmware Loader (MiraV3)") + title = QLabel("⚡ MiraV3 Firmware Loader") title.setObjectName("title") title.setAlignment(Qt.AlignmentFlag.AlignCenter) layout.addWidget(title) - copyright_label = QLabel(f"© {datetime.datetime.now().year} Smatec — R&D Software") + copyright_label = QLabel(f"© {datetime.datetime.now().year} Smatec — R&D Software Team. v1.0.0") copyright_label.setAlignment(Qt.AlignmentFlag.AlignCenter) copyright_label.setStyleSheet( "color: #9399b2; font-size: 11px; font-weight: 500; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto;" diff --git a/run.sh b/run.sh old mode 100644 new mode 100755 index 4916c32..a6520cc --- a/run.sh +++ b/run.sh @@ -5,14 +5,13 @@ SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" cd "$SCRIPT_DIR" # Activate virtual environment -if [ -d "venv" ]; then - source venv/bin/activate -else +if [ ! -d "venv" ]; then echo "❌ Virtual environment not found. Creating..." python3 -m venv venv - source venv/bin/activate - pip install PyQt6 scapy requests fi -echo "🚀 Starting IoT Firmware Loader..." +source venv/bin/activate +pip install -r requirements.txt --quiet + +echo "🚀 Starting MiraV3 Firmware Loader..." python main.py