Fixed exrtaction bug for WinRing driver to enable MSR Support on Windows OS.

This commit is contained in:
justin committed 2025-11-20 16:48:31 -07:00
1 parent c53c772722
commit 6e5fcddc64
1 file changed
+11 -2
+11 -2
View File
@@ -283,7 +283,7 @@ class MoneroMiner:
continue
# Extract file
source = zip_ref.open(member)
with zip_ref.open(member) as source:
target_path = os.path.join(self.script_dir, target_name)
# Create subdirectories if needed
@@ -297,6 +297,7 @@ class MoneroMiner:
elif 'WinRing0' in target_name or target_name.endswith('.sys'):
print(f" ✓ {target_name} (driver)")
# Ensure ZIP file is closed before attempting to delete
xmrig_path = os.path.join(self.script_dir, 'xmrig.exe')
print(f"\nXMRig installed successfully at: {xmrig_path}")
print("WinRing0 drivers extracted for MSR MOD support")
@@ -316,9 +317,17 @@ class MoneroMiner:
os.chmod(xmrig_path, 0o755)
print(f"XMRig installed successfully at: {xmrig_path}")
# Clean up
# Clean up - add a small delay on Windows to ensure file handles are released
if is_zip:
time.sleep(0.5)
try:
os.remove(local_filename)
print("Cleaned up temporary files.")
except Exception as cleanup_error:
print(f"Note: Could not remove temporary file {local_filename}")
print(f" You can manually delete it later.")
# Don't fail the installation if cleanup fails
return True