Set notifyOnly:true on Windows builds
This commit is contained in:
@@ -28,10 +28,9 @@
|
|||||||
"test": "npm-run-all test:* lint:*",
|
"test": "npm-run-all test:* lint:*",
|
||||||
"test:app": "cross-env NODE_ENV=production npm run build && mocha -r babel-register --reporter mocha-circleci-reporter --recursive test/specs",
|
"test:app": "cross-env NODE_ENV=production npm run build && mocha -r babel-register --reporter mocha-circleci-reporter --recursive test/specs",
|
||||||
"package:all": "cross-env NODE_ENV=production npm-run-all check-build-config package:windows package:mac package:linux",
|
"package:all": "cross-env NODE_ENV=production npm-run-all check-build-config package:windows package:mac package:linux",
|
||||||
"package:windows": "cross-env NODE_ENV=production npm-run-all check-build-config build && build --win --x64 --ia32 --publish=never && npm run manipulate-windows-zip",
|
"package:windows": "cross-env NODE_ENV=production npm-run-all check-build-config build && build --win --x64 --ia32 --publish=never",
|
||||||
"package:mac": "cross-env NODE_ENV=production npm-run-all check-build-config build && build --mac --publish=never",
|
"package:mac": "cross-env NODE_ENV=production npm-run-all check-build-config build && build --mac --publish=never",
|
||||||
"package:linux": "cross-env NODE_ENV=production npm-run-all check-build-config build && build --linux --x64 --ia32 --publish=never",
|
"package:linux": "cross-env NODE_ENV=production npm-run-all check-build-config build && build --linux --x64 --ia32 --publish=never",
|
||||||
"manipulate-windows-zip": "node scripts/manipulate_windows_zip.js",
|
|
||||||
"lint:js": "eslint --ignore-path .gitignore --ignore-pattern node_modules --ext .js --ext .jsx .",
|
"lint:js": "eslint --ignore-path .gitignore --ignore-pattern node_modules --ext .js --ext .jsx .",
|
||||||
"fix:js": "eslint --ignore-path .gitignore --ignore-pattern node_modules --quiet --ext .js --ext .jsx . --fix",
|
"fix:js": "eslint --ignore-path .gitignore --ignore-pattern node_modules --quiet --ext .js --ext .jsx . --fix",
|
||||||
"check-build-config": "node -r babel-register scripts/check_build_config.js"
|
"check-build-config": "node -r babel-register scripts/check_build_config.js"
|
||||||
|
@@ -1,3 +0,0 @@
|
|||||||
{
|
|
||||||
"notifyOnly": true
|
|
||||||
}
|
|
@@ -653,7 +653,7 @@ app.on('ready', () => {
|
|||||||
session.defaultSession.setPermissionRequestHandler(permissionRequestHandler(mainWindow, permissionManager));
|
session.defaultSession.setPermissionRequestHandler(permissionRequestHandler(mainWindow, permissionManager));
|
||||||
|
|
||||||
if (buildConfig.enableAutoUpdater) {
|
if (buildConfig.enableAutoUpdater) {
|
||||||
const updaterConfig = autoUpdater.loadConfig(path.resolve(app.getAppPath(), '../app-updater-config.json'));
|
const updaterConfig = autoUpdater.loadConfig();
|
||||||
autoUpdater.initialize(appState, mainWindow, updaterConfig.isNotifyOnly());
|
autoUpdater.initialize(appState, mainWindow, updaterConfig.isNotifyOnly());
|
||||||
ipcMain.on('check-for-updates', autoUpdater.checkForUpdates);
|
ipcMain.on('check-for-updates', autoUpdater.checkForUpdates);
|
||||||
mainWindow.once('show', () => {
|
mainWindow.once('show', () => {
|
||||||
|
@@ -2,7 +2,6 @@
|
|||||||
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
import fs from 'fs';
|
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
|
|
||||||
import {app, BrowserWindow, dialog, ipcMain, shell} from 'electron';
|
import {app, BrowserWindow, dialog, ipcMain, shell} from 'electron';
|
||||||
@@ -167,15 +166,14 @@ function checkForUpdates(isManual = false) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class AutoUpdaterConfig {
|
class AutoUpdaterConfig {
|
||||||
constructor(file) {
|
constructor() {
|
||||||
try {
|
this.data = {};
|
||||||
this.data = JSON.parse(fs.readFileSync(file));
|
|
||||||
} catch (err) {
|
|
||||||
this.data = {};
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
isNotifyOnly() {
|
isNotifyOnly() {
|
||||||
|
if (process.platform === 'win32') {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (this.data.notifyOnly === true) {
|
if (this.data.notifyOnly === true) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -183,8 +181,8 @@ class AutoUpdaterConfig {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function loadConfig(file) {
|
function loadConfig() {
|
||||||
return new AutoUpdaterConfig(file);
|
return new AutoUpdaterConfig();
|
||||||
}
|
}
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
Reference in New Issue
Block a user