0.0.5 • Published 4 months ago

vue-electron-updater v0.0.5

Weekly downloads
-
License
ISC
Repository
-
Last release
4 months ago

vue-electron-updater

Just a simple package to allow Electron + Vue application can play the updater smoothly

Install

yarn add vue-electron-updater

Usage

To use this, we need to install the function in main and preload scripts.

In the main script we can install the setup via the setup method from ApplicationAutoUpdater instance like this.

import { BrowserWindow, ipcMain } from 'electron';
import { autoUpdater } from 'electron-updater';
import { ApplicationAutoUpdater } from 'vue-electron-updater/main';

const applicationUpdater = new ApplicationAutoUpdater(
  autoUpdater,
  new BrowserWindow({
  }), 
  ipcMain
);
applicationUpdater.setup({
  isDev: true,
  port: 5050
});

In the preload script, we can install the setup via the function setupPreload.

import { contextBridge, ipcRenderer } from 'electron';
import { setupPreload } from 'vue-electron-updater/preload';

setupPreload(contextBridge, ipcRenderer);

In Vue, we need to install the plugin:

import { createApplicationUpdater } from 'vue-electron-updater/vue';

app.use(createApplicationUpdater());

License

MIT © Sang Nguyen