Skip to content

Commit 85a3e55

Browse files
fix(nsis): cleanup temporary 7z folder (#6793)
Before attempting to extract files with non-discriminating `Nsis7z::Extract` that ignores the errors remove the temporary folder so that we don't require twice as much disk space for this last resort measure. Additionally, replace `Quit` with a `Goto DoneExtract7za` so that the last resort measure actually works.
1 parent 95910f8 commit 85a3e55

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

.changeset/fifty-schools-arrive.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"app-builder-lib": patch
3+
---
4+
5+
fix(nsis): cleanup temporary 7z folder before the last resort extraction. Fix last resort extraction exiting early.

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

+9-1
Original file line numberDiff line numberDiff line change
@@ -113,13 +113,21 @@
113113
# Try copying a few times before asking for a user action.
114114
Goto RetryExtract7za
115115
${else}
116-
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "$(appCannotBeClosed)" /SD IDCANCEL IDRETRY RetryExtract7za
116+
MessageBox MB_RETRYCANCEL|MB_ICONEXCLAMATION "$(appCannotBeClosed)" /SD IDRETRY IDCANCEL AbortExtract7za
117117
${endIf}
118118

119119
# As an absolutely last resort after a few automatic attempts and user
120120
# intervention - we will just overwrite everything with `Nsis7z::Extract`
121121
# even though it is not atomic and will ignore errors.
122+
123+
# Clear the temporary folder first to make sure we don't use twice as
124+
# much disk space.
125+
RMDir /r "$PLUGINSDIR\7z-out"
126+
122127
Nsis7z::Extract "${FILE}"
128+
Goto DoneExtract7za
129+
130+
AbortExtract7za:
123131
Quit
124132

125133
RetryExtract7za:

0 commit comments

Comments
 (0)