electron-squirrel-startup 是一个用于 Electron 应用程序的 npm 包,它帮助处理 Windows 平台上的 Squirrel.Windows 自动更新流程。具体来说,它允许 Electron 应用在更新后正确地重启,以确保用户获得最新的版本。 分析nsis 是否需要 "electron-squirrel-startup" 依赖: NSIS(Nullsoft Scriptable Install System)是一个...
在主进程添加main-v8.js import { app } from 'electron' if (require('electron-squirrel-startup')) { app.quit() } else if (typeof snapshotResult !== 'undefined') { global.__dirnameE = () => __dirname global.requireE = (arg) => require(arg) snapshotResult.setGlobals(global, pr...
接下来的代码是用来载入或者卸除应用的方法,一般默认就是一个退出应用的动作: // Handle creating/removing shortcuts on Windows when installing/uninstalling.if(require('electron-squirrel-startup')){// eslint-disable-line global-requireapp.quit();} 暂时我们可以不用理解electron-squirrel-startup这个模块究...
DefaultSquirrel.Windowsevent handler for yourElectronapps. Installation npm i electron-squirrel-startup Usage To handle the most common commands, such as managing desktop shortcuts, just add the following to the top of yourmain.jsand you're good to go: ...
"electron-squirrel-startup": "^1.0.0" } } 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. 23. 24. 25. 26. 使用Forge 的 make 命令来创建可分发的应用程序: npm run make
const { app, BrowserWindow } = require('electron'); if (require('electron-squirrel-startup')) { app.quit(); } let mainWindow; app.on('ready', () => { mainWindow = new BrowserWindow({ width: 800, he...
"electron-squirrel-startup": "^1.0.0" }, "config": { "forge": { "packagerConfig": { "icon": "./icon", "platform": "all" }, "makers": [ { "name": "@electron-forge/maker-zip", "platforms": [ ... ] }, { "name": "@electron-forge/maker-squirrel", ...
如果需要在使用Squirrel的Windows 上使用 Electron 的 autoUpdater ,你需要将启动路径设置为 Update.exe,并传递指定应用程序名称的参数。 例如:const appFolder = path.dirname(process.execPath) const updateExe = path.resolve(appFolder, '..', 'Update.exe') const exeName = path.basename(process.execPath)...
TypeScript definitions for electron-squirrel-startup. Latest version: 1.0.2, last published: a year ago. Start using @types/electron-squirrel-startup in your project by running `npm i @types/electron-squirrel-startup`. There are no other projects in the