From 17aebb3256e40faee21ec35fa354072ff05b34ab Mon Sep 17 00:00:00 2001 From: ihaveahax Date: Thu, 8 Jan 2026 17:47:18 -0600 Subject: [PATCH] fix corruption issue by moving corrupted files after closing them (fixes #86) --- custominstall/__main__.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/custominstall/__main__.py b/custominstall/__main__.py index 67816b3..0bf5cfd 100644 --- a/custominstall/__main__.py +++ b/custominstall/__main__.py @@ -475,13 +475,13 @@ class CustomInstall: self.log(f'Writing {content_enc_path}...') with cia.open_raw_section(co.cindex) as s, open(content_out_path, 'wb') as o: result_hash = self.copy_with_progress(s, o, co.size, content_enc_path) - if result_hash != co.hash: - self.log(f'WARNING: Hash does not match for {content_enc_path}!') - install_state['failed'].append(display_title) - rename(temp_title_root, temp_title_root + '-corrupted') - do_continue = True - self.event.update_status(path, InstallStatus.Failed) - break + if result_hash != co.hash: + self.log(f'WARNING: Hash does not match for {content_enc_path}!') + install_state['failed'].append(display_title) + rename(temp_title_root, temp_title_root + '-corrupted') + do_continue = True + self.event.update_status(path, InstallStatus.Failed) + break if do_continue: continue