Commit 09f2f27a authored by nanahira's avatar nanahira

resolve update problems, again

parent e994b1c2
Pipeline #4041 canceled with stages
in 40 seconds
...@@ -207,13 +207,22 @@ function createTray() { ...@@ -207,13 +207,22 @@ function createTray() {
// This method will be called when Electron has finished // This method will be called when Electron has finished
// initialization and is ready to create browser windows. // initialization and is ready to create browser windows.
// Some APIs can only be used after this event occurs. // Some APIs can only be used after this event occurs.
app.on('ready', () => { app.on('ready', async () => {
createWindow(); createWindow();
if (process.platform === 'win32') { if (process.platform === 'win32') {
createTray(); createTray();
} }
if (process.env['NODE_ENV'] === 'production') { if (process.env['NODE_ENV'] === 'production') {
autoUpdater.checkForUpdates(); let updateTempPath = '~/.cache/mycard-updater'
if (process.platform === 'win32') {
updateTempPath = `${process.env.LOCALAPPDATA}\\mycard-updater`
} else if (process.platform === 'darwin') {
updateTempPath = '~/Library/Application Support/Caches/mycard-updater'
}
try {
await require('fs').promises.mkdir(updateTempPath, {recursive: true});
} catch(e) {}
await autoUpdater.checkForUpdates();
} }
}); });
......
...@@ -93,6 +93,9 @@ ...@@ -93,6 +93,9 @@
"extraResources": [ "extraResources": [
"bin" "bin"
], ],
"win": {
"publisherName": "Nana Yumesaki"
},
"linux": { "linux": {
"target": [ "target": [
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment