feat: add electron-builder (#123)

# feat :  add electron auto update

# feat : add some components url : https://github.com/RSS1101/electron-vite-react

# * feat : Add electron auto update function

# * chore : use css module conduct style isolation

# * refactor: cleanup

# * chore : electron-auto-update refinement

# * chore: cleanup

# * chore : update electron-auto-update

# * chore: typo

# * feat: add `mac.target.dmg` for electron-updater

---------

Co-authored-by: 任帅 <1064425721@qq.com>
This commit is contained in:
草鞋没号and任帅 authored and GitHub committed 2023-03-12 09:35:20 +08:00
1 parent 29d5fa95a8
commit 2f2880a9f1
12 files changed
+475 -11

No files matched your search

+6 -1
View File
@@ -1,6 +1,7 @@
import { app, BrowserWindow, shell, ipcMain } from 'electron'
import { release } from 'node:os'
import { join } from 'node:path'
import { update } from './update'
// The built directory structure
//
@@ -72,6 +73,9 @@ async function createWindow() {
if (url.startsWith('https:')) shell.openExternal(url)
return { action: 'deny' }
})
// Apply electron-updater
update(win)
}
app.whenReady().then(createWindow)
@@ -113,4 +117,5 @@ ipcMain.handle('open-win', (_, arg) => {
} else {
childWindow.loadFile(indexHtml, { hash: arg })
}
})
})