feat(electron): add persistent auth, auto-updater, and NAS copy script
- Integrate electron-store for persistent PocketBase auth backup across localStorage clears and app reinstalls - Switch build target from portable to nsis to generate latest.yml for electron-updater generic provider - Add user confirmation dialogs before download and before install - Add post-build script to copy .exe/.yml/.nupkg to NAS share and local electron-update/ directory for nginx volume mount - Mount ./electron-update into frontend nginx containers via docker-compose for automatic update file serving Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
+20
-4
@@ -7,11 +7,15 @@
|
||||
"start": "electron .",
|
||||
"start:dev": "electron . --env=dev",
|
||||
"start:uat": "electron . --env=uat",
|
||||
"build": "electron-builder --win",
|
||||
"build:portable": "electron-builder --win portable"
|
||||
"build": "electron-builder --win && node scripts/copy-to-nas.js",
|
||||
"build:portable": "electron-builder --win portable && node scripts/copy-to-nas.js",
|
||||
"copy-to-nas": "node scripts/copy-to-nas.js"
|
||||
},
|
||||
"dependencies": {
|
||||
"electron-store": "^8.2"
|
||||
"electron-store": "^8.2",
|
||||
"electron-updater": "^6.8.3",
|
||||
"png-to-ico": "^3.0.1",
|
||||
"sharp": "^0.34.5"
|
||||
},
|
||||
"devDependencies": {
|
||||
"electron": "^35.0",
|
||||
@@ -26,12 +30,24 @@
|
||||
"win": {
|
||||
"target": [
|
||||
{
|
||||
"target": "portable",
|
||||
"target": "nsis",
|
||||
"arch": ["x64"]
|
||||
}
|
||||
],
|
||||
"icon": "build/icon.ico"
|
||||
},
|
||||
"nsis": {
|
||||
"oneClick": false,
|
||||
"allowToChangeInstallationDirectory": true,
|
||||
"createDesktopShortcut": true,
|
||||
"createStartMenuShortcut": true,
|
||||
"shortcutName": "GameGroup"
|
||||
},
|
||||
"publish": {
|
||||
"provider": "generic",
|
||||
"url": "http://nas.wjl-work.top:7034/electron-update/",
|
||||
"channel": "latest"
|
||||
},
|
||||
"files": [
|
||||
"main.js",
|
||||
"preload.js",
|
||||
|
||||
Reference in New Issue
Block a user