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:
parent
86828a546f
commit
5c36ff1738
1 changed files with 8 additions and 1 deletions
|
@ -132,7 +132,14 @@ export class Updater {
|
||||||
|
|
||||||
// Electron runtime sees .asar file as directory and causes errors during copy/remove operations
|
// Electron runtime sees .asar file as directory and causes errors during copy/remove operations
|
||||||
process.noAsar = true
|
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') {
|
if (process.platform === 'darwin') {
|
||||||
// Electron framework libraries break otherwise on Mac
|
// Electron framework libraries break otherwise on Mac
|
||||||
fs.cpSync(src, dst, { recursive: true, force: true, verbatimSymlinks: true });
|
fs.cpSync(src, dst, { recursive: true, force: true, verbatimSymlinks: true });
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue