Skip to content

Commit ef981ab

Browse files
authored
fix: quit on decompression errors in NSIS (#5888)
Unlike 7zip, zip decompression pushes a return value on stack. If it not `success` installer should fail and display the error to the user instead of assuming that installation was successful. One of the causes of decompression errors might be a lingering child process that still uses dlls and node.js bindings so that they cannot be overwritten. In such case, prior to this patch nsis installer would update some of the non-locked files and start the app as if it had been fully updated.
1 parent 96d7813 commit ef981ab

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

packages/app-builder-lib/templates/nsis/include/extractAppPackage.nsh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@
8080
!macro decompress
8181
!ifdef ZIP_COMPRESSION
8282
nsisunz::Unzip "$PLUGINSDIR\app-$packageArch.zip" "$INSTDIR"
83+
Pop $R0
84+
StrCmp $R0 "success" +3
85+
MessageBox MB_OK|MB_ICONEXCLAMATION "$(decompressionFailed)$\n$R0"
86+
Quit
8387
!else
8488
!insertmacro extractUsing7za "$PLUGINSDIR\app-$packageArch.7z"
8589
!endif

packages/app-builder-lib/templates/nsis/messages.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,3 +110,5 @@ areYouSureToUninstall:
110110
fi: Oletko varma, että haluat poistaa ${PRODUCT_NAME} asennuksen?
111111
es: ¿Seguro que quieres desinstalar ${PRODUCT_NAME}?
112112
da: Er du sikker på, at du vil afinstallere ${PRODUCT_NAME}?
113+
decompressionFailed:
114+
en: Failed to decompress files. Please try running the installer again.

0 commit comments

Comments
 (0)