Beta versions support: SxS support, in-app env/instance display (#1606)
* Script for beta config; unique data dir, in-app env/type display To release a beta build, increment the version and add -beta-N to the end, then go through all the standard release activities. The prepare-build npm script then updates key bits of the package.json to ensure that the beta build can be installed alongside a production build. This includes a new name ('Signal Beta') and a different location for application data. Note: Beta builds can be installed alongside production builds. As part of this, a couple new bits of data are shown across the app: - Environment (development or test, not shown if production) - App Instance (disabled in production; used for multiple accounts) These are shown in: - The window title - both environment and app instance. You can tell beta builds because the app name, preceding these data bits, is different. - The about window - both environment and app instance. You can tell beta builds from the version number. - The header added to the debug log - just environment. The version number will tell us if it's a beta build, and app instance isn't helpful. * Turn on single-window mode in non-production modes Because it's really frightening when you see 'unable to read from db' errors in the console. * aply.sh: More instructions for initial setup and testing * Gruntfile: Get consistent with use of package.json datas * Linux: manually update desktop keys, since macros not available
This commit is contained in:
parent
a3fbb9a6aa
commit
c94d4efd18
13 changed files with 158 additions and 34 deletions
23
main.js
23
main.js
|
@ -3,7 +3,7 @@ const url = require('url');
|
|||
const os = require('os');
|
||||
|
||||
const _ = require('lodash');
|
||||
const electron = require('electron')
|
||||
const electron = require('electron');
|
||||
|
||||
const BrowserWindow = electron.BrowserWindow;
|
||||
const app = electron.app;
|
||||
|
@ -11,20 +11,26 @@ const ipc = electron.ipcMain;
|
|||
const Menu = electron.Menu;
|
||||
const shell = electron.shell;
|
||||
|
||||
const packageJson = require('./package.json');
|
||||
const autoUpdate = require('./app/auto_update');
|
||||
const windowState = require('./app/window_state');
|
||||
|
||||
|
||||
console.log('setting AUMID');
|
||||
app.setAppUserModelId('org.whispersystems.signal-desktop')
|
||||
const aumid = 'org.whispersystems.' + packageJson.name;
|
||||
console.log('setting AUMID to ' + aumid);
|
||||
app.setAppUserModelId(aumid);
|
||||
|
||||
// Keep a global reference of the window object, if you don't, the window will
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
// be closed automatically when the JavaScript object is garbage collected.
|
||||
let mainWindow;
|
||||
|
||||
const config = require("./app/config");
|
||||
|
||||
if (config.environment === 'production' && !process.mas) {
|
||||
// Very important to put before the single instance check, since it is based on the
|
||||
// userData directory.
|
||||
const userConfig = require('./app/user_config');
|
||||
|
||||
if (!process.mas) {
|
||||
console.log('making app single instance');
|
||||
var shouldQuit = app.makeSingleInstance(function(commandLine, workingDirectory) {
|
||||
// Someone tried to run a second instance, we should focus our window
|
||||
|
@ -36,16 +42,15 @@ if (config.environment === 'production' && !process.mas) {
|
|||
});
|
||||
|
||||
if (shouldQuit) {
|
||||
console.log('quitting');
|
||||
console.log('quitting; we are the second instance');
|
||||
app.quit();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
const userConfig = require('./app/user_config');
|
||||
const logging = require('./app/logging');
|
||||
|
||||
// this must be after we set up appPath in user_config.js
|
||||
// This must be after we set up appPath in user_config.js, so we know where logs go
|
||||
logging.initialize();
|
||||
const logger = logging.getLogger();
|
||||
|
||||
|
@ -60,6 +65,7 @@ function prepareURL(pathSegments) {
|
|||
protocol: 'file:',
|
||||
slashes: true,
|
||||
query: {
|
||||
name: packageJson.productName,
|
||||
locale: locale.name,
|
||||
version: app.getVersion(),
|
||||
buildExpiration: config.get('buildExpiration'),
|
||||
|
@ -69,6 +75,7 @@ function prepareURL(pathSegments) {
|
|||
environment: config.environment,
|
||||
node_version: process.versions.node,
|
||||
hostname: os.hostname(),
|
||||
appInstance: process.env.NODE_APP_INSTANCE,
|
||||
}
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue