mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-09-22 15:04:47 +00:00
emit prepare-for-update
This commit is contained in:
@@ -426,6 +426,7 @@ namespace ElectronNET.API
|
||||
/// <param name="isForceRunAfter">Run the app after finish even on silent install. Not applicable for macOS. Ignored if `isSilent` is set to `false`.</param>
|
||||
public void QuitAndInstall(bool isSilent = false, bool isForceRunAfter = false)
|
||||
{
|
||||
BridgeConnector.EmitSync("prepare-for-update");
|
||||
BridgeConnector.EmitSync("autoUpdaterQuitAndInstall", isSilent, isForceRunAfter);
|
||||
}
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ app.on('will-finish-launching', () => {
|
||||
})
|
||||
});
|
||||
|
||||
app.on('before-quit-for-update', () => {
|
||||
function prepareForUpdate() {
|
||||
ignoreApiProcessClosed = true;
|
||||
|
||||
app.removeAllListeners("window-all-closed");
|
||||
@@ -73,7 +73,9 @@ app.on('before-quit-for-update', () => {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
app.on('before-quit-for-update', () => { prepareForUpdate(); });
|
||||
|
||||
const manifestJsonFile = require(manifestJsonFilePath);
|
||||
|
||||
@@ -307,6 +309,8 @@ function startSocketApiBridge(port) {
|
||||
}
|
||||
});
|
||||
|
||||
socket.on('prepare-for-update', () => { prepareForUpdate(); });
|
||||
|
||||
socket.on('register-app-open-file-event', (id) => {
|
||||
global['electronsocket'] = socket;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user