File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -738,7 +738,12 @@ async function applyLightweightUpdate() {
738738 }
739739
740740 const tempFile = path . join ( tempDir , key )
741- fs . writeFileSync ( tempFile , data )
741+ // Use originalFs for .asar files to bypass Electron's ASAR interception
742+ if ( key . endsWith ( '.asar' ) ) {
743+ originalFs . writeFileSync ( tempFile , data )
744+ } else {
745+ fs . writeFileSync ( tempFile , data )
746+ }
742747 downloadedFiles . push ( { tempFile, destFile : path . join ( resourcesPath , key ) , key } )
743748 filesDone ++
744749 }
@@ -759,8 +764,8 @@ async function applyLightweightUpdate() {
759764 }
760765 }
761766
762- // Clean up temp files
763- try { fs . rmSync ( tempDir , { recursive : true , force : true } ) } catch { /* ignore */ }
767+ // Clean up temp files using originalFs.rmSync for .asar compatibility
768+ try { originalFs . rmSync ( tempDir , { recursive : true , force : true } ) } catch { /* ignore */ }
764769
765770 updateState = { ...updateState , downloading : false , progress : 100 }
766771 notifyUpdateState ( )
You can’t perform that action at this time.
0 commit comments