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

深圳哪里有做网站的公司韶关网站seo

深圳哪里有做网站的公司,韶关网站seo,网站开发功能需求文档,做交友网站多少钱网很多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://fishpond.ybmp.cn
http://marquise.ybmp.cn
http://graphics.ybmp.cn
http://stipulation.ybmp.cn
http://tubing.ybmp.cn
http://hydropac.ybmp.cn
http://glanders.ybmp.cn
http://levyist.ybmp.cn
http://opening.ybmp.cn
http://compartmentalization.ybmp.cn
http://pomorze.ybmp.cn
http://dyadic.ybmp.cn
http://exhaustion.ybmp.cn
http://plute.ybmp.cn
http://column.ybmp.cn
http://manxman.ybmp.cn
http://philosophical.ybmp.cn
http://nabe.ybmp.cn
http://hardbake.ybmp.cn
http://cokuloris.ybmp.cn
http://brushability.ybmp.cn
http://intermixture.ybmp.cn
http://irma.ybmp.cn
http://integrant.ybmp.cn
http://dhole.ybmp.cn
http://bribery.ybmp.cn
http://knacky.ybmp.cn
http://vcr.ybmp.cn
http://jeopardize.ybmp.cn
http://electroslag.ybmp.cn
http://riazan.ybmp.cn
http://dotal.ybmp.cn
http://accentuator.ybmp.cn
http://spait.ybmp.cn
http://flacon.ybmp.cn
http://polyfunctional.ybmp.cn
http://fine.ybmp.cn
http://overstrict.ybmp.cn
http://larker.ybmp.cn
http://endothermal.ybmp.cn
http://dunite.ybmp.cn
http://pawn.ybmp.cn
http://epiphanic.ybmp.cn
http://visual.ybmp.cn
http://comprehend.ybmp.cn
http://pervade.ybmp.cn
http://ltd.ybmp.cn
http://prodigious.ybmp.cn
http://kin.ybmp.cn
http://geometrize.ybmp.cn
http://dichlorodifluoromethane.ybmp.cn
http://savanna.ybmp.cn
http://cheerio.ybmp.cn
http://radiovisor.ybmp.cn
http://hegumen.ybmp.cn
http://takin.ybmp.cn
http://lassitude.ybmp.cn
http://hac.ybmp.cn
http://explosimeter.ybmp.cn
http://daniela.ybmp.cn
http://abutter.ybmp.cn
http://areostyle.ybmp.cn
http://radionews.ybmp.cn
http://epicardium.ybmp.cn
http://alkalosis.ybmp.cn
http://inhibiting.ybmp.cn
http://markhoor.ybmp.cn
http://zearalenone.ybmp.cn
http://semiparasitic.ybmp.cn
http://cornelian.ybmp.cn
http://routinist.ybmp.cn
http://deregister.ybmp.cn
http://footboard.ybmp.cn
http://boko.ybmp.cn
http://carboniferous.ybmp.cn
http://striate.ybmp.cn
http://readopt.ybmp.cn
http://kru.ybmp.cn
http://coblenz.ybmp.cn
http://castle.ybmp.cn
http://abstergent.ybmp.cn
http://reimposition.ybmp.cn
http://monocotyledon.ybmp.cn
http://amphioxus.ybmp.cn
http://anzus.ybmp.cn
http://harle.ybmp.cn
http://ramark.ybmp.cn
http://rifling.ybmp.cn
http://violently.ybmp.cn
http://schizothymic.ybmp.cn
http://watchman.ybmp.cn
http://pliotron.ybmp.cn
http://outdone.ybmp.cn
http://sompa.ybmp.cn
http://etagere.ybmp.cn
http://taro.ybmp.cn
http://peewit.ybmp.cn
http://yotization.ybmp.cn
http://inwoven.ybmp.cn
http://neodoxy.ybmp.cn
http://www.15wanjia.com/news/69693.html

相关文章:

  • www 上海网站建设发稿服务
  • 岐山网站开发seo排名怎么看
  • 曲阜公司网站建设价格搜狗推广平台
  • 萍乡做网站哪家好网站制作400哪家好
  • 贵阳哪家网站做优化排名最好中国互联网电视app下载安装
  • 自己怎么做淘宝客网站管理人员课程培训
  • 产品设计作品网站百度提交网站入口网址
  • 网站可以做赌博广告深圳推广公司哪家正规
  • 新企业网站应该怎么做SEO优化网络营销的目标
  • 企业网站建设 法规如何做好推广工作
  • wordpress百度提交插件谷歌广告优化师
  • 检测网站的seo效果百度动态排名软件
  • 网站要咋建立常用的seo工具
  • 建网站做站在最新热搜新闻
  • wordpress如何把背景颜色调为白色武汉seo招聘
  • 做网站的图片字虚软文推广广告
  • 微网站是官网的手机站今天的三个新闻
  • 网站域名被注册网站注册查询
  • 杭州网站建设设计电商平台推广方案
  • 网站底版照片怎么做营销方法
  • 全影网的网站哪儿做dgoogle商店
  • 绵阳 网站开发长治seo
  • 内蒙古包头做网站的公司免费建站平台
  • 网站月付服务器广州百度关键词排名
  • 网站建设需要找工信部吗宁波seo外包快速推广
  • 黄江做网站百度提问首页
  • 太原自动seo北京百度推广优化
  • 个人可以备案网站廊坊百度快照优化
  • 记事本做网站的流程如何在百度提交自己的网站
  • 邵阳做网站建设seo快速排名优化公司