mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-07 15:33:16 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e5a60cc077 | ||
|
|
4d5c57fa0b | ||
|
|
98bd4fd9b9 | ||
|
|
8b808ff9b2 | ||
|
|
4a2a495738 | ||
|
|
309816e40a | ||
|
|
79a31000df | ||
|
|
8410769fdd | ||
|
|
fd25ac0cc4 |
17
README.md
17
README.md
@@ -11,6 +11,15 @@ The goal is to achieve feature-compatibility with the old desktop app
|
|||||||
and then start adding cool features like easy support for
|
and then start adding cool features like easy support for
|
||||||
multi-account, auto-updates etc.
|
multi-account, auto-updates etc.
|
||||||
|
|
||||||
|
## Prerequisites
|
||||||
|
* node >= v6.3.1
|
||||||
|
* npm >= 3.10.3
|
||||||
|
* If you're on Debian or Ubuntu, you'll also need to install
|
||||||
|
`nodejs-legacy`:
|
||||||
|
```sh
|
||||||
|
$ sudo apt-get install nodejs-legacy
|
||||||
|
```
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
Clone the source locally:
|
Clone the source locally:
|
||||||
@@ -19,14 +28,6 @@ Clone the source locally:
|
|||||||
$ git clone https://github.com/zulip/zulip-electron
|
$ git clone https://github.com/zulip/zulip-electron
|
||||||
$ cd zulip-electron
|
$ cd zulip-electron
|
||||||
```
|
```
|
||||||
If you're on Debian or Ubuntu, you'll also need to install
|
|
||||||
`nodejs-legacy`:
|
|
||||||
|
|
||||||
Use your package manager to install `npm`.
|
|
||||||
|
|
||||||
```sh
|
|
||||||
$ sudo apt-get install npm nodejs-legacy
|
|
||||||
```
|
|
||||||
|
|
||||||
Install project dependencies:
|
Install project dependencies:
|
||||||
|
|
||||||
|
|||||||
49
app/main/autoupdater.js
Normal file
49
app/main/autoupdater.js
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
'use strict';
|
||||||
|
const {app, autoUpdater, dialog} = require('electron');
|
||||||
|
const version = app.getVersion();
|
||||||
|
const os = require('os');
|
||||||
|
const platform = os.platform() + '_' + os.arch(); // usually returns darwin_64
|
||||||
|
|
||||||
|
const updaterFeedURL = 'http://zulipdesktop.herokuapp.com/update/'+ platform + '/' + version;
|
||||||
|
|
||||||
|
function appUpdater() {
|
||||||
|
|
||||||
|
autoUpdater.setFeedURL(updaterFeedURL);
|
||||||
|
|
||||||
|
// Log whats happening
|
||||||
|
autoUpdater.on('error', err => console.log(err))
|
||||||
|
autoUpdater.on('checking-for-update', () => console.log('checking-for-update'))
|
||||||
|
autoUpdater.on('update-available', () => console.log('update-available'))
|
||||||
|
autoUpdater.on('update-not-available', () => console.log('update-not-available'))
|
||||||
|
|
||||||
|
// Ask the user if update is available
|
||||||
|
autoUpdater.on('update-downloaded', (event, releaseNotes, releaseName, releaseDate) => {
|
||||||
|
|
||||||
|
let message = app.getName() + ' ' + releaseName + ' is now available. It will be installed the next time you restart the application.';
|
||||||
|
if (releaseNotes) {
|
||||||
|
let splitNotes = releaseNotes.split(/[^\r]\n/);
|
||||||
|
message += '\n\nRelease notes:\n';
|
||||||
|
splitNotes.forEach(function (notes) {
|
||||||
|
message += notes + '\n\n';
|
||||||
|
})
|
||||||
|
};
|
||||||
|
// Ask user to update the app
|
||||||
|
dialog.showMessageBox({
|
||||||
|
type: 'question',
|
||||||
|
buttons: ['Install and Relaunch' ,'Cancel'],
|
||||||
|
defaultId: 0,
|
||||||
|
message: 'A new version of ' + app.getName() + ' has been downloaded',
|
||||||
|
detail: message
|
||||||
|
}, response => {
|
||||||
|
if (response === 0) {
|
||||||
|
setTimeout(() => autoUpdater.quitAndInstall(), 1);
|
||||||
|
}
|
||||||
|
})
|
||||||
|
})
|
||||||
|
// init for updates
|
||||||
|
autoUpdater.checkForUpdates()
|
||||||
|
}
|
||||||
|
|
||||||
|
exports = module.exports = {
|
||||||
|
appUpdater
|
||||||
|
}
|
||||||
@@ -7,9 +7,11 @@ const electronLocalshortcut = require('electron-localshortcut');
|
|||||||
const ipc = require('electron').ipcMain;
|
const ipc = require('electron').ipcMain;
|
||||||
const Configstore = require('configstore');
|
const Configstore = require('configstore');
|
||||||
const JsonDB = require('node-json-db');
|
const JsonDB = require('node-json-db');
|
||||||
|
const isDev = require('electron-is-dev');
|
||||||
const tray = require('./tray');
|
const tray = require('./tray');
|
||||||
const appMenu = require('./menu');
|
const appMenu = require('./menu');
|
||||||
const {linkIsInternal, skipImages} = require('./link-helper');
|
const {linkIsInternal, skipImages} = require('./link-helper');
|
||||||
|
const { appUpdater } = require('./autoupdater')
|
||||||
|
|
||||||
const db = new JsonDB(app.getPath('userData') + '/domain.json', true, true);
|
const db = new JsonDB(app.getPath('userData') + '/domain.json', true, true);
|
||||||
const data = db.getData('/');
|
const data = db.getData('/');
|
||||||
@@ -19,7 +21,6 @@ require('electron-debug')();
|
|||||||
|
|
||||||
const conf = new Configstore('Zulip-Desktop');
|
const conf = new Configstore('Zulip-Desktop');
|
||||||
|
|
||||||
|
|
||||||
// prevent window being garbage collected
|
// prevent window being garbage collected
|
||||||
let mainWindow;
|
let mainWindow;
|
||||||
let targetLink;
|
let targetLink;
|
||||||
@@ -198,6 +199,15 @@ app.on('ready', () => {
|
|||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
electron.shell.openExternal(url);
|
electron.shell.openExternal(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
page.once("did-frame-finish-load", () => {
|
||||||
|
if (process.platform === 'darwin' && !isDev) {
|
||||||
|
// Initate auto-updates
|
||||||
|
appUpdater()
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
ipc.on('new-domain', (e, domain) => {
|
ipc.on('new-domain', (e, domain) => {
|
||||||
|
|||||||
@@ -6,10 +6,13 @@ const {addDomain, about} = require('./windowmanager');
|
|||||||
|
|
||||||
let tray = null;
|
let tray = null;
|
||||||
|
|
||||||
const APP_ICON = path.join(__dirname, '../resources', 'Icon');
|
const APP_ICON = path.join(__dirname, '../resources/tray', 'tray');
|
||||||
|
|
||||||
const iconPath = () => {
|
const iconPath = () => {
|
||||||
return APP_ICON + (process.platform === 'win32' ? '.ico' : '.png');
|
if (process.platform === 'linux') {
|
||||||
|
return APP_ICON + 'linux.png'
|
||||||
|
}
|
||||||
|
return APP_ICON + (process.platform === 'win32' ? 'win.ico' : 'osx.png');
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.create = () => {
|
exports.create = () => {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "zulip",
|
"name": "zulip",
|
||||||
"productName": "Zulip",
|
"productName": "Zulip",
|
||||||
"version": "0.5.1",
|
"version": "0.5.2",
|
||||||
"description": "Zulip Desktop App",
|
"description": "Zulip Desktop App",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"email":"<svnitakash@gmail.com>",
|
"email":"<svnitakash@gmail.com>",
|
||||||
@@ -27,6 +27,7 @@
|
|||||||
"InstantMessaging"
|
"InstantMessaging"
|
||||||
],
|
],
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"electron-is-dev": "*",
|
||||||
"configstore": "^2.0.0",
|
"configstore": "^2.0.0",
|
||||||
"dialogs": "1.1.14",
|
"dialogs": "1.1.14",
|
||||||
"electron-context-menu": "0.4.0",
|
"electron-context-menu": "0.4.0",
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 333 B After Width: | Height: | Size: 2.6 KiB |
BIN
app/resources/tray/traylinux.png
Normal file
BIN
app/resources/tray/traylinux.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
BIN
app/resources/tray/trayosx.png
Normal file
BIN
app/resources/tray/trayosx.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 737 B |
BIN
app/resources/tray/traywin.ico
Normal file
BIN
app/resources/tray/traywin.ico
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 361 KiB |
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "zulip",
|
"name": "zulip",
|
||||||
"productName": "Zulip",
|
"productName": "Zulip",
|
||||||
"version": "0.5.1",
|
"version": "0.5.2",
|
||||||
"description": "Zulip Desktop App",
|
"description": "Zulip Desktop App",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"email":"<svnitakash@gmail.com>",
|
"email":"<svnitakash@gmail.com>",
|
||||||
@@ -40,7 +40,7 @@
|
|||||||
"linux" : {
|
"linux" : {
|
||||||
"synopsis": "Zulip Desktop App",
|
"synopsis": "Zulip Desktop App",
|
||||||
"category": "",
|
"category": "",
|
||||||
"packageCategory": "",
|
"packageCategory": "GNOME;GTK;Network;InstantMessaging",
|
||||||
"description": "Zulip Desktop Client for Linux",
|
"description": "Zulip Desktop Client for Linux",
|
||||||
"target" : ["deb", "AppImage"],
|
"target" : ["deb", "AppImage"],
|
||||||
"version" : "0.5.1",
|
"version" : "0.5.1",
|
||||||
|
|||||||
Reference in New Issue
Block a user