mirror of
https://github.com/smartfrigde/armcord.git
synced 2024-08-14 23:56:58 +00:00
Remove update.rocks updater
This commit is contained in:
parent
6df4446369
commit
5b9e1c13c0
2 changed files with 1 additions and 67 deletions
2
main.js
2
main.js
|
@ -4,7 +4,7 @@ const path = require("path");
|
||||||
const contextMenu = require("electron-context-menu");
|
const contextMenu = require("electron-context-menu");
|
||||||
const os = require("os");
|
const os = require("os");
|
||||||
require("v8-compile-cache");
|
require("v8-compile-cache");
|
||||||
require("./utils/updater");
|
|
||||||
|
|
||||||
if (os.type() == 'Linux'){
|
if (os.type() == 'Linux'){
|
||||||
var iconformat = __dirname + "/discord.png"
|
var iconformat = __dirname + "/discord.png"
|
||||||
|
|
|
@ -1,66 +0,0 @@
|
||||||
const electron = require("electron");
|
|
||||||
const APP_VERSION = require("../package.json").version;
|
|
||||||
|
|
||||||
/* IMPORTANT!
|
|
||||||
This url will need to be modified for yours */
|
|
||||||
// The url that the application is going to query for new release
|
|
||||||
const AUTO_UPDATE_URL =
|
|
||||||
'https://api.update.rocks/update/github.com/smartfrigde/armcord/stable/' + process.platform + '/' + APP_VERSION
|
|
||||||
|
|
||||||
function init() {
|
|
||||||
if (process.platform === "linux") {
|
|
||||||
/* There is no auto update for linux however you can still
|
|
||||||
notify the user that a new update has been released
|
|
||||||
our service will return an answer with the latest version. */
|
|
||||||
console.log("Auto updates not available on linux");
|
|
||||||
} else {
|
|
||||||
initDarwinWin32();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function initDarwinWin32() {
|
|
||||||
electron.autoUpdater.on("error", (err) =>
|
|
||||||
console.error(`Update error: ${err.message}`)
|
|
||||||
);
|
|
||||||
|
|
||||||
electron.autoUpdater.on("checking-for-update", () =>
|
|
||||||
console.log("Checking for update")
|
|
||||||
);
|
|
||||||
|
|
||||||
electron.autoUpdater.on("update-available", () =>
|
|
||||||
console.log("Update available")
|
|
||||||
);
|
|
||||||
|
|
||||||
electron.autoUpdater.on("update-not-available", () =>
|
|
||||||
console.log("No update available")
|
|
||||||
);
|
|
||||||
|
|
||||||
// Ask the user if he wants to update if update is available
|
|
||||||
electron.autoUpdater.on(
|
|
||||||
"update-downloaded",
|
|
||||||
(event, releaseNotes, releaseName) => {
|
|
||||||
dialog.showMessageBox(
|
|
||||||
window,
|
|
||||||
{
|
|
||||||
type: "question",
|
|
||||||
buttons: ["Update", "Cancel"],
|
|
||||||
defaultId: 0,
|
|
||||||
message: `Version ${releaseName} is available, do you want to install it now?`,
|
|
||||||
title: "Update available",
|
|
||||||
},
|
|
||||||
(response) => {
|
|
||||||
if (response === 0) {
|
|
||||||
electron.autoUpdater.quitAndInstall();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
);
|
|
||||||
|
|
||||||
electron.autoUpdater.setFeedURL(AUTO_UPDATE_URL);
|
|
||||||
electron.autoUpdater.checkForUpdates();
|
|
||||||
}
|
|
||||||
|
|
||||||
module.exports = {
|
|
||||||
init,
|
|
||||||
};
|
|
Loading…
Reference in a new issue