You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found some code on the Electron docs to handle a second instance being opened up. It looks like this
const gotTheLock = app.requestSingleInstanceLock()
if (!gotTheLock) {
app.quit()
} else {
app.on('second-instance', (event, commandLine, workingDirectory) => {
// Someone tried to run a second instance, we should focus our window.
if (myWindow) {
if (myWindow.isMinimized()) myWindow.restore()
myWindow.focus()
}
})
// Create myWindow, load the rest of the app, etc...
app.whenReady().then(() => {
})
}
The problem I'm encountering is when the second instance of my app quits, it deletes all the files in my resources folder, so extraFiles.js gets deleted. The only thing left is app.asar. It also deletes a good amount of other files in the main directory. Is there any way to get around this?
The text was updated successfully, but these errors were encountered:
…unch (#6093)
* Allowing boolean flag to `unpackDirName` to utilize `$PLUGINSDIR` (unique to per-app-launch) when set explicitly to `true`. Implements #5764, #5382, #4105
I am building a portable target on Windows. I need to include some extra files, so my package.json looks like this
I found some code on the Electron docs to handle a second instance being opened up. It looks like this
The problem I'm encountering is when the second instance of my app quits, it deletes all the files in my resources folder, so extraFiles.js gets deleted. The only thing left is
app.asar
. It also deletes a good amount of other files in the main directory. Is there any way to get around this?The text was updated successfully, but these errors were encountered: