Fix Unicode encoding error on Windows in build_usb_creator.py

- Replace Unicode checkmark characters (✓) with ASCII [OK] text
- Replace Unicode X marks (✗) with ASCII [ERROR] text
- Fixes UnicodeEncodeError with 'charmap' codec on Windows systems
- Updated both build_usb_creator.py and BUILD_INSTRUCTIONS.md files
parent 4dc65b5e
...@@ -62,14 +62,14 @@ dist\MBetterUSBCreator.exe ...@@ -62,14 +62,14 @@ dist\MBetterUSBCreator.exe
## Features ## Features
- Cross-platform (Linux/Windows) - [OK] Cross-platform (Linux/Windows)
- ISO file selection and validation - [OK] ISO file selection and validation
- USB device auto-detection - [OK] USB device auto-detection
- Optional root password configuration - [OK] Optional root password configuration
- Optional OpenVPN config integration - [OK] Optional OpenVPN config integration
- Progress indicators and logging - [OK] Progress indicators and logging
- Safe USB device selection (prevents system disk selection) - [OK] Safe USB device selection (prevents system disk selection)
- Standalone executable (no Python installation required) - [OK] Standalone executable (no Python installation required)
## Usage ## Usage
......
...@@ -32,9 +32,9 @@ def check_dependencies(): ...@@ -32,9 +32,9 @@ def check_dependencies():
try: try:
import_name = import_tests.get(package_name, package_name) import_name = import_tests.get(package_name, package_name)
__import__(import_name) __import__(import_name)
print(f" {package_name} found") print(f"[OK] {package_name} found")
except ImportError: except ImportError:
print(f" {package_name} missing") print(f"[ERROR] {package_name} missing")
missing_packages.append(package_name) missing_packages.append(package_name)
if missing_packages: if missing_packages:
...@@ -45,7 +45,7 @@ def check_dependencies(): ...@@ -45,7 +45,7 @@ def check_dependencies():
print(" pip3 install -r requirements.txt") print(" pip3 install -r requirements.txt")
return False return False
print(" All dependencies satisfied") print("[OK] All dependencies satisfied")
return True return True
def create_spec_file(): def create_spec_file():
...@@ -118,7 +118,7 @@ if sys.platform == 'darwin': ...@@ -118,7 +118,7 @@ if sys.platform == 'darwin':
with open('usb_creator.spec', 'w') as f: with open('usb_creator.spec', 'w') as f:
f.write(spec_content) f.write(spec_content)
print(" PyInstaller spec file created") print("[OK] PyInstaller spec file created")
def build_executable(): def build_executable():
"""Build the standalone executable using PyInstaller""" """Build the standalone executable using PyInstaller"""
...@@ -132,7 +132,7 @@ def build_executable(): ...@@ -132,7 +132,7 @@ def build_executable():
subprocess.run(cmd, check=True) subprocess.run(cmd, check=True)
print(" Build completed successfully!") print("[OK] Build completed successfully!")
# Show output location # Show output location
dist_dir = Path("dist") dist_dir = Path("dist")
...@@ -142,13 +142,13 @@ def build_executable(): ...@@ -142,13 +142,13 @@ def build_executable():
exe_path = dist_dir / "MBetterUSBCreator" exe_path = dist_dir / "MBetterUSBCreator"
if exe_path.exists(): if exe_path.exists():
print(f" Executable created: {exe_path}") print(f"[OK] Executable created: {exe_path}")
print(f" Size: {exe_path.stat().st_size / 1024 / 1024:.1f} MB") print(f" Size: {exe_path.stat().st_size / 1024 / 1024:.1f} MB")
else: else:
print(" Executable not found in expected location") print("[ERROR] Executable not found in expected location")
except subprocess.CalledProcessError as e: except subprocess.CalledProcessError as e:
print(f" Build failed: {e}") print(f"[ERROR] Build failed: {e}")
return False return False
return True return True
...@@ -164,7 +164,7 @@ pyinstaller>=5.0.0 ...@@ -164,7 +164,7 @@ pyinstaller>=5.0.0
with open('requirements.txt', 'w') as f: with open('requirements.txt', 'w') as f:
f.write(requirements) f.write(requirements)
print(" requirements.txt created") print("[OK] requirements.txt created")
def create_build_instructions(): def create_build_instructions():
"""Create build instructions for different platforms""" """Create build instructions for different platforms"""
...@@ -233,14 +233,14 @@ dist\\MBetterUSBCreator.exe ...@@ -233,14 +233,14 @@ dist\\MBetterUSBCreator.exe
## Features ## Features
- Cross-platform (Linux/Windows) - [OK] Cross-platform (Linux/Windows)
- ISO file selection and validation - [OK] ISO file selection and validation
- USB device auto-detection - [OK] USB device auto-detection
- Optional root password configuration - [OK] Optional root password configuration
- Optional OpenVPN config integration - [OK] Optional OpenVPN config integration
- Progress indicators and logging - [OK] Progress indicators and logging
- Safe USB device selection (prevents system disk selection) - [OK] Safe USB device selection (prevents system disk selection)
- Standalone executable (no Python installation required) - [OK] Standalone executable (no Python installation required)
## Usage ## Usage
...@@ -261,7 +261,7 @@ The created USB will: ...@@ -261,7 +261,7 @@ The created USB will:
with open('BUILD_INSTRUCTIONS.md', 'w') as f: with open('BUILD_INSTRUCTIONS.md', 'w') as f:
f.write(instructions) f.write(instructions)
print(" BUILD_INSTRUCTIONS.md created") print("[OK] BUILD_INSTRUCTIONS.md created")
def main(): def main():
print("MBetter USB Creator - Build Script") print("MBetter USB Creator - Build Script")
...@@ -270,9 +270,9 @@ def main(): ...@@ -270,9 +270,9 @@ def main():
if len(sys.argv) > 1 and sys.argv[1] == "--check-deps": if len(sys.argv) > 1 and sys.argv[1] == "--check-deps":
print("Checking dependencies only...") print("Checking dependencies only...")
if check_dependencies(): if check_dependencies():
print(" All dependencies available") print("[OK] All dependencies available")
else: else:
print(" Missing dependencies found") print("[ERROR] Missing dependencies found")
return return
# Create build files # Create build files
...@@ -288,13 +288,13 @@ def main(): ...@@ -288,13 +288,13 @@ def main():
# Build executable # Build executable
if build_executable(): if build_executable():
print("\n" + "=" * 40) print("\n" + "=" * 40)
print(" BUILD SUCCESSFUL!") print("[OK] BUILD SUCCESSFUL!")
print(" Standalone executable created in dist/ directory") print("[OK] Standalone executable created in dist/ directory")
print(" See BUILD_INSTRUCTIONS.md for usage details") print("[OK] See BUILD_INSTRUCTIONS.md for usage details")
else: else:
print("\n" + "=" * 40) print("\n" + "=" * 40)
print(" BUILD FAILED!") print("[ERROR] BUILD FAILED!")
print(" Check error messages above") print("[ERROR] Check error messages above")
if __name__ == '__main__': if __name__ == '__main__':
main() main()
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