1
0
Fork 0
mirror of https://gitlab.com/futo-org/fcast.git synced 2025-06-24 21:25:23 +00:00

Fixed Windows updater with locked directories

This commit is contained in:
Michael Hollister 2024-11-18 16:31:35 -06:00
parent 86828a546f
commit 5c36ff1738

View file

@ -132,7 +132,14 @@ export class Updater {
// Electron runtime sees .asar file as directory and causes errors during copy/remove operations
process.noAsar = true
fs.rmSync(dst, { recursive: true, force: true });
if (process.platform === 'win32') {
// Cannot remove top-level directory since it might still be locked...
fs.rmSync(`${dst}\\*`, { maxRetries: 5, retryDelay: 1000, recursive: true, force: true });
}
else {
fs.rmSync(dst, { maxRetries: 5, retryDelay: 1000, recursive: true, force: true });
}
if (process.platform === 'darwin') {
// Electron framework libraries break otherwise on Mac
fs.cpSync(src, dst, { recursive: true, force: true, verbatimSymlinks: true });