当前位置: 首页 > news >正文

图灵机器人 wordpress南宁百度seo排名

图灵机器人 wordpress,南宁百度seo排名,张家口网站建设价格,长沙做网站kaodezhu网很多electron-updater更新文章,这里只简单写一下演示代码; 为什么选择 electron-updater插件可以自动更新应用程序,同时支持多个平台;比官方要强; 官方的autoUpdater仅支持macOS 和 Windows 自动更新; 注意是自动,直接更新那种; 脚手架中是…

网很多electron-updater更新文章,这里只简单写一下演示代码;

为什么选择

electron-updater插件可以自动更新应用程序,同时支持多个平台;比官方要强;
官方的autoUpdater仅支持macOS 和 Windows 自动更新; 注意是自动,直接更新那种;

脚手架中是含有的electron-updater的
// 安装依赖如果你没有的话
npm i electron-updater
// 引入项目
const { autoUpdater } = require('electron-updater');
// 配置项
autoUpdater.forceDevUpdateConfig = true //开发环境下强制更新
autoUpdater.autoDownload = false; // 自动下载
autoUpdater.autoInstallOnAppQuit = true; // 应用退出后自动安装
封装一个简单方法
/****************  检查版本更新 start ***************** autoUpdater.checkForUpdates(); 检测是否最新版* autoUpdater.downloadUpdate(); 下载最新版
*/
// 检查是否更新
// 是否开启了检测
let isStartCheckForUpdates = false;
let customDialog: any = null;
function checkForUpdates(mainWindow, url?: string) {if (isStartCheckForUpdates) {return;}isStartCheckForUpdates = true;if (typeof url !== 'string') {url = 'https://xxx.cn/yyhDesktopUpdate/'}// 指定更新地址autoUpdater.setFeedURL(url);autoUpdater.autoDownload = false;autoUpdater.checkForUpdates();// 开始检查更新事件; 提示语: '正在检查更新';autoUpdater.on('checking-for-update', function () {});// 发现可更新版本; 提示语: 检测到新版本,准备下载autoUpdater.on('update-available', function () {if (customDialog) {customDialog.close();customDialog = null;}// 系统原生弹窗让用户选择是否更新customDialog = dialog.showMessageBox(mainWindow, {type: 'info',title: '检测到有新版本',message: '检测到新版本,是否立即更新?',buttons: ['确定', '取消'],cancelId: 1, // 指定“取消”按钮的索引}).then((result) => {customDialog = null;if (result.response === 0) {// 下载最新版autoUpdater.downloadUpdate();} else { // 用户点击了“取消”}isStartCheckForUpdates = false;}).catch(() => {customDialog = null;isStartCheckForUpdates = false;});});// 没有可更新版本事件; 提示语: '已经是最新版本';autoUpdater.on('update-not-available', function () {isStartCheckForUpdates = false;});// 更新发生错误时事件; 提示语: '软件更新异常,请重试';autoUpdater.on('error', function () {if (customDialog) {customDialog.close();customDialog = null;}// 提示用户更新失败customDialog = dialog.showMessageBox({type: 'info',title: '更新检查',message: '软件更新异常,请重试!',buttons: ['好的'],}).then(() => {customDialog = null;});});// 更新下载完毕后事件; 提示语: '下载完成,准备安装';autoUpdater.on('update-downloaded', function () {if (customDialog) {customDialog.close();customDialog = null;}// 下载后安装更新customDialog = dialog.showMessageBox({type: 'info',title: '更新完成',message: '更新已下载完成,是否立即安装应用?',buttons: ['立即安装'],}).then((result) => {customDialog = null;if (result.response === 0) {autoUpdater.quitAndInstall();}}).catch(() => {customDialog = null;});});// 更新下载进度事件; 提示语: '软件下载中,请耐心等待';autoUpdater.on('download-progress', function (progressObj) {/** progressObj {total: 1000000, // 总字节数,例如 1MBdelta: 1024, // 自上次事件以来下载的字节数,例如 1KBtransferred: 512000, // 已下载的总字节数,例如 512KBpercent: 0.5, // 下载进度的百分比,例如 50%bytesPerSecond: 2048 // 当前下载速度,例如 2KB/s}*/// 使用原生进度条if (progressObj.percent !== undefined) {mainWindow.setProgressBar(progressObj.percent);} else {mainWindow.setProgressBar(-1);}});
}
/****************  检查版本更新 end *****************/
调用
mainWindow.on('ready-to-show', () => {mainWindow.webContents.closeDevTools();mainWindow.show()// 调用检测方法checkForUpdates(mainWindow);})
软件更新win下载到哪个文件夹了
C:\Users\Administrator\AppData\Local
判断当前是那个系统_如果做系统差异化说不定用得到
/* 判断当前是那个系统* 如果 process.platform 返回的是 'darwin',则表示当前操作系统是 macOS。* 如果 process.platform 返回的是 'win32',则表示当前操作系统是 Windows。- 如果 process.arch 返回的是 'ia32',则表示当前系统是 32 位。- 如果 process.arch 返回的是 'x64',则表示当前系统是 64 位。* 如果 process.platform 返回的是 'linux',则表示当前操作系统是 Linux。
*/
http://www.15wanjia.com/news/48881.html

相关文章:

  • 网页制作工作要求快速seo优化
  • 会员充值网站怎么做app网站
  • 辛集做网站公司外贸网站建站平台
  • 做网站千篇一律深圳百度推广公司
  • 修改wordpress后台路径网站优化排名易下拉排名
  • 网站建设详细需求文档google play三件套
  • 自己做的网站怎么放到网上去链接转二维码
  • 开发网站需要什么技术2022石家庄房价
  • 企业的网站建设公司网站页面的优化
  • 网页制作与网站建设技术大全 pdf全球搜索大全
  • 如何做一名优秀的网站管理者上海全网营销推广
  • 如何快速做h5网站吸引人的营销标题
  • 网站频繁改版购买模板建站
  • 网页设计作业简单seo优化工作有哪些
  • 福州网站建设培训成都高端网站建设哪家好
  • 首钢建设二建设公司网站竞价推广套户渠道商
  • 给企业建设网站的流程图百度图片
  • 嘉兴优化网站排名百度代理服务器
  • 聊城专业做网站的公司it行业培训机构一般多少钱
  • 网站生成app最近三天的新闻大事小学生
  • 开发公司资质办理要求河南seo网站多少钱
  • 网站建设 李奥贝纳百度网盘资源搜索引擎入口
  • 深圳今天最新疫情报告高粱seo博客
  • 住房和城乡建设部监理工程师网站长沙网站优化体验
  • 手机p2p网站开发百度手机助手安卓版下载
  • 抚州 提供网站建站 公司seo关键词排名优化怎么样
  • 怎么自己制作一个好的网站百度一下你就知道123
  • 网络服务器无响应深圳网站关键词排名优化
  • 深圳均安网站制作成都疫情最新消息
  • 用高权重网站的目录做站群怎么样手机如何建立网站