-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nsis): use revertible+atomic rmdir on update and add user-confirm…
…ed retry loop (#6551) * fix(nsis): use revertible+atomic rmdir on update and retry (w/ user confirmation) Previously uninstaller would run `RMDir /r $INSTDIR` to remove the currently installed version, but this operation is not atomic and if some of the files will fail to delete it will leave them in the directory while erasing the rest. If we are updating, however, this leads us to a tricky situation where we cannot update these files, but cannot also cancel the installation. Because of the erased files the app won't be able to start if the installation won't completely at least partially. However, the downside of that is that the app can have new asar.unpacked files along with the old asar, executable, and bindings. The approach of this change is to recursive use `Rename` instead of a single `RMDir /r` in uninstaller (when `isUpdated` is true) to move the whole app directory file by file to a temporary folder. If this operation fails due to busy files - we use `CopyFiles` to restore all files that we managed to move so far. Because the whole uninstallation process becomes interrupted - the app shortcut and file associations have to be removed only *after* the successful recursive `Rename`. This error is caught by installer running in an update mode (see `installUtil.nsh`) and presented to user in a dialog. If this erro happen the installation does not proceed normally. In addition to all of the above, this patch simplifies the last resort measure in `extractAppPackage` which should now only run when old uninstaller (that still uses `RMDir /r`) leaves busy files behind. * Retry uninstall
- Loading branch information
1 parent
a138a86
commit 7b2a5e1
Showing
5 changed files
with
186 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
"app-builder-lib": patch | ||
--- | ||
|
||
fix(nsis): use revertible rmdir on update |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters