def verify_integrity(install_path): """Verify installed files against expected hashes.""" all_good = True for filename, expected_hash in EXPECTED_HASHES.items(): file_path = install_path / filename if file_path.exists(): actual_hash = compute_sha256(file_path) if actual_hash != expected_hash: log.error(f"Integrity check FAILED for {filename}") all_good = False else: log.info(f"Integrity OK: {filename}") else: log.warning(f"Missing file: {filename}") all_good = False return all_good
# Step 7: Create uninstaller create_uninstaller(DEFAULT_INSTALL_PATH) umtv2-umtpro-ultimateunisoc-v0.1-installer
def install_drivers(): """Launch Unisoc driver installer if available.""" driver_installer = DEFAULT_INSTALL_PATH / "drivers" / "unisoc_driver.exe" if driver_installer.exists(): log.info("Installing Unisoc drivers...") subprocess.run([str(driver_installer), "/silent"], check=False) else: log.warning(f"Driver installer not found. Download from {DRIVER_URL}") umtv2-umtpro-ultimateunisoc-v0.1-installer
# Step 2: Extract or copy source files if args.source and Path(args.source).exists(): source_dir = extract_installer_package(args.source) else: # Assume script is running from the extracted package folder source_dir = Path.cwd() / "files" # Modify as needed if not source_dir.exists(): log.error("No source files found. Use --source or prepare 'files' folder.") sys.exit(1) umtv2-umtpro-ultimateunisoc-v0.1-installer