Merge branch 'windows-installer' into dev

This commit is contained in:
Yuya Ochiai 2016-06-17 23:19:55 +09:00
commit f98f1fbab2
4 changed files with 36 additions and 21 deletions

View file

@ -34,6 +34,7 @@
#### Windows
- Added the tooltip text for the tray icon in order to show count of unread channels/mantions.
- Added installers (experimemtal)
#### OS X
- Added colored badges to the menu icon when there are unread channels/mentions.

View file

@ -28,7 +28,8 @@ dependencies:
- tar zcvf $CIRCLE_ARTIFACTS/mattermost-desktop-linux-ia32.tar.gz -C release mattermost-desktop-linux-ia32
- tar zcvf $CIRCLE_ARTIFACTS/mattermost-desktop-linux-x64.tar.gz -C release mattermost-desktop-linux-x64
- cp release/*.deb $CIRCLE_ARTIFACTS/
- cp release/windows-installer/mattermost-setup.exe $CIRCLE_ARTIFACTS/
- cp release/windows-installer-ia32/mattermost-setup-ia32.exe $CIRCLE_ARTIFACTS/
- cp release/windows-installer-x64/mattermost-setup-x64.exe $CIRCLE_ARTIFACTS/
test:
post:

View file

@ -14,6 +14,9 @@ var electron = require('electron-connect').server.create({
path: './dist'
});
var packager = require('electron-packager');
const fs = require('fs');
const distPackageAuthor = 'Mattermost, Inc.'
var sources = ['**/*.js', '**/*.json', '**/*.css', '**/*.html', '!**/node_modules/**', '!dist/**', '!release/**', '!**/test_config.json'];
@ -77,9 +80,15 @@ gulp.task('prettify:jsx:verify', function() {
});
gulp.task('build', ['sync-meta', 'webpack', 'copy'], function() {
return gulp.src('src/package.json')
.pipe(gulp.dest('dist'));
gulp.task('build', ['sync-meta', 'webpack', 'copy'], function(cb) {
const appPackageJson = require('./src/package.json');
const distPackageJson = Object.assign({}, appPackageJson, {
author: {
name: distPackageAuthor,
email: 'noreply'
}
});
fs.writeFile('./dist/package.json', JSON.stringify(distPackageJson, null, ' '), cb);
});
gulp.task('webpack', ['webpack:main', 'webpack:browser', 'webpack:webview']);
@ -192,8 +201,8 @@ function makePackage(platform, arch, callback) {
"app-version": packageJson.version,
icon: 'resources/icon',
"version-string": {
CompanyName: packageJson.author.name,
LegalCopyright: 'Copyright (c) 2015 - 2016' + packageJson.author.name,
CompanyName: distPackageAuthor,
LegalCopyright: `Copyright (c) 2015 - 2016 ${packageJson.author.name}`,
FileDescription: packageJson.description,
OriginalFilename: packageJson.productName + '.exe',
ProductVersion: packageJson.version,
@ -239,6 +248,5 @@ gulp.task('sync-meta', function() {
appPackageJson.description = packageJson.description;
appPackageJson.author = packageJson.author;
appPackageJson.license = packageJson.license;
var fs = require('fs');
fs.writeFileSync('./src/package.json', JSON.stringify(appPackageJson, null, ' ') + '\n');
});

View file

@ -4,35 +4,40 @@ const createWindowsInstaller = require('electron-winstaller').createWindowsInsta
const path = require('path')
const rimraf = require('rimraf')
deleteOutputFolder()
const archList = ['ia32', 'x64'];
archList.forEach((arch) => {
deleteOutputFolder(arch)
.then(getInstallerConfig)
.then(createWindowsInstaller)
.catch((error) => {
console.error(error.message || error)
process.exit(1)
})
})
function getInstallerConfig() {
function getInstallerConfig(arch) {
const rootPath = path.join(__dirname, '..')
const outPath = path.join(rootPath, 'release')
return Promise.resolve({
appDirectory: path.join(outPath, 'Mattermost-win32-x64'),
appDirectory: path.join(outPath, `Mattermost-win32-${arch}`),
authors: 'Mattermost, Inc.',
owners: 'Mattermost, Inc.',
iconUrl: 'https://raw.githubusercontent.com/mattermost/desktop/master/resources/icon.ico',
//loadingGif: path.join(rootPath, 'assets', 'img', 'loading.gif'),
noMsi: true,
outputDirectory: path.join(outPath, 'windows-installer'),
setupExe: 'mattermost-setup.exe',
outputDirectory: path.join(outPath, `windows-installer-${arch}`),
setupExe: `mattermost-setup-${arch}.exe`,
setupIcon: path.join(rootPath, 'resources', 'icon.ico'),
skipUpdateIcon: true,
exe: 'Mattermost.exe'
})
}
function deleteOutputFolder() {
function deleteOutputFolder(arch) {
return new Promise((resolve, reject) => {
rimraf(path.join(__dirname, '..', 'out', 'windows-installer'), (error) => {
error ? reject(error) : resolve()
rimraf(path.join(__dirname, '..', 'out', `windows-installer-${arch}`), (error) => {
error ? reject(error) : resolve(arch)
})
})
}