Skip to content
This repository has been archived by the owner on Mar 11, 2023. It is now read-only.

Commit

Permalink
[Backend] Support linux update checking
Browse files Browse the repository at this point in the history
  • Loading branch information
UnsignedInt8 committed Dec 15, 2021
1 parent e79a632 commit 5a33601
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions src/backend/Updater.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import path from 'path';
import { tmpdir } from 'os';
import yaml from 'yaml';

const isStoreDistribution = false;
const isStoreDistribution = true;

export async function checkUpdates() {
try {
Expand Down Expand Up @@ -174,14 +174,6 @@ async function installDMG(dmgPath: string) {
}

async function installUpdate(version: string, execPath: string) {
const approved = await App.ask({
title: i18n.t('New Update Available'),
icon: 'arrow-up-circle',
message: i18n.t('Update Message', { version }),
});

if (!approved) return;

switch (process.platform) {
case 'win32':
installWindows({ installerPath: execPath, isAdminRightsRequired: false, isForceRunAfter: true, isSilent: false });
Expand Down Expand Up @@ -209,6 +201,19 @@ export async function updateApp() {
if (!targetInfo) return;
if (!updateAvailable) return;

const approved = await App.ask({
title: i18n.t('New Update Available'),
icon: 'arrow-up-circle',
message: i18n.t('Update Message', { version: latestVersion }),
});

if (!approved) return;

if (platform === 'linux') {
shell.openExternal('https://wallet3.io');
return;
}

try {
statSync(dlPath, {});

Expand Down

0 comments on commit 5a33601

Please sign in to comment.