當前位置: 首頁>>代碼示例>>TypeScript>>正文


TypeScript electron-updater.autoUpdater類代碼示例

本文整理匯總了TypeScript中electron-updater.autoUpdater的典型用法代碼示例。如果您正苦於以下問題:TypeScript autoUpdater類的具體用法?TypeScript autoUpdater怎麽用?TypeScript autoUpdater使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了autoUpdater類的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的TypeScript代碼示例。

示例1: listenForUpdates

	function listenForUpdates() {
		autoUpdater.on('update-available', (updateInfo) => {
			if (!settings.get('autoUpdate')) {
				return;
			}
			showNotification('A new update is ready to download', 
				`Version ${updateInfo.version} is can be downloaded, click to start download`, () => {
					autoUpdater.downloadUpdate();
					setProgress(1);
					autoUpdater.signals.progress((info) => {
						setProgress(info.percent);
					});

					autoUpdater.signals.updateDownloaded((info) => {
						removeProgressBar();

						showNotification('Done downloading update', 
							'Click here to install and relaunch now', () => {
								app.relaunch();
								autoUpdater.quitAndInstall();
							});
					});
				});
		});
	}
開發者ID:SanderRonde,項目名稱:youtube-music-app,代碼行數:25,代碼來源:updater.ts

示例2: checkForUpdates

	export async function checkForUpdates() {
		showNotification('Checking for updates...');
		if (!listening) {
			setFeed();
		}
		autoUpdater.checkForUpdates();
	}
開發者ID:SanderRonde,項目名稱:youtube-music-app,代碼行數:7,代碼來源:updater.ts

示例3:

ipcMain.on('app-ui-ready', () => {
  // Check for updates after the UI is loaded; otherwise the UI may miss the
  //'update-downloaded' event.
  if (!debugMode) {
    autoUpdater.checkForUpdates();
  }
});
開發者ID:fang2x,項目名稱:outline-server,代碼行數:7,代碼來源:index.ts

示例4: checkForUpdates

function checkForUpdates() {
  try {
    autoUpdater.checkForUpdates();
  } catch (e) {
    console.error(`Failed to check for updates`, e);
  }
}
開發者ID:hlyu368,項目名稱:outline-client,代碼行數:7,代碼來源:index.ts

示例5: initAutoUpdater

export function initAutoUpdater() {
  if (process.env.NTERACT_DESKTOP_DISABLE_AUTO_UPDATE !== "1") {
    const log = require("electron-log");
    log.transports.file.level = "info";
    autoUpdater.logger = log;
    autoUpdater.checkForUpdatesAndNotify();
  }
}
開發者ID:nteract,項目名稱:nteract,代碼行數:8,代碼來源:auto-updater.ts

示例6: setFeed

	function setFeed() {
		autoUpdater.setFeedURL({
			provider: 'github',
			repo: 'media-app',
			owner: 'SanderRonde'
		} as GithubOptions);
	}
開發者ID:SanderRonde,項目名稱:youtube-music-app,代碼行數:7,代碼來源:updater.ts

示例7:

export const runAutoUpdaterService = (window: BrowserWindow) => {
  autoUpdater.on('update-downloaded', ({ version }) => {
    window.webContents.send(UPDATE_AVAILABLE, version);
  });

  ipcMain.on(UPDATE_RESTART_AND_INSTALL, () => {
    autoUpdater.quitAndInstall();
  });

  ipcMain.on(UPDATE_CHECK, () => {
    if (process.env.ENV !== 'dev') {
      autoUpdater.checkForUpdates();
    }
  });
};
開發者ID:laquereric,項目名稱:wexond,代碼行數:15,代碼來源:auto-updater.ts

示例8: setProgress

				`Version ${updateInfo.version} is can be downloaded, click to start download`, () => {
					autoUpdater.downloadUpdate();
					setProgress(1);
					autoUpdater.signals.progress((info) => {
						setProgress(info.percent);
					});

					autoUpdater.signals.updateDownloaded((info) => {
						removeProgressBar();

						showNotification('Done downloading update', 
							'Click here to install and relaunch now', () => {
								app.relaunch();
								autoUpdater.quitAndInstall();
							});
					});
				});
開發者ID:SanderRonde,項目名稱:youtube-music-app,代碼行數:17,代碼來源:updater.ts

示例9: createWindow

app.on('ready', () => {
  // TODO: Run this periodically, e.g. every 4-6 hours.
  autoUpdater.checkForUpdates();

  if (debugMode) {
    Menu.setApplicationMenu(Menu.buildFromTemplate([{
      label: 'Developer',
      submenu: [{role: 'reload'}, {role: 'forcereload'}, {role: 'toggledevtools'}]
    }]));
  }

  // Set the app to launch at startup to reset the system proxy configuration
  // in case of a showdown while proxying.
  app.setLoginItemSettings({openAtLogin: true, args: [Options.AUTOSTART]});

  if (process.argv.includes(Options.AUTOSTART)) {
    app.quit();  // Quitting the app will reset the system proxy configuration before exiting.
  } else {
    createWindow();
  }
});
開發者ID:fang2x,項目名稱:outline-client,代碼行數:21,代碼來源:index.ts

示例10: constructor

 private constructor() {
     autoUpdater.on('checking-for-update', () => {
         console.log('Checking for update...');
     })
     autoUpdater.on('update-available', (info) => {
         console.log('Update available.');
     })
     autoUpdater.on('update-not-available', (info) => {
         console.log('Update not available.');
     })
     autoUpdater.on('error', (err) => {
         console.log('Error in auto-updater. ' + err);
     })
     autoUpdater.on('download-progress', (progressObj) => {
         let log_message = "Download speed: " + progressObj.bytesPerSecond;
         log_message = log_message + ' - Downloaded ' + progressObj.percent + '%';
         log_message = log_message + ' (' + progressObj.transferred + "/" + progressObj.total + ')';
         console.log(log_message);
     })
     autoUpdater.on('update-downloaded', (info) => {
         console.log('Update downloaded');
     });
 }
開發者ID:jazzkell,項目名稱:barcode-to-pc-server,代碼行數:23,代碼來源:update.handler.ts


注:本文中的electron-updater.autoUpdater類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。