Corrected version to 0.4.0 and put AboutPanel only if platform is darwin

This commit is contained in:
Kylart 2017-04-28 09:35:07 +02:00
parent 9450a41a01
commit 4d5b6e0661
3 changed files with 9 additions and 143 deletions

View File

@ -1,137 +0,0 @@
/**
* Created by Kylart on 16/04/2017.
*/
/**
* First check electron-packager api:
* https://github.com/electron-userland/electron-packager/blob/master/docs/api.md
*
* Then electron-installer dmg:
* https://github.com/mongodb-js/electron-installer-dmg
*
* Then windows-installer
* https://github.com/electron/windows-installer
*
* Then maybe ? (Linux)
* https://github.com/unindented/electron-installer-debian
*/
const {join} = require('path')
// packages
const packager = require('electron-packager')
const materialPath = join(__dirname, '..', 'build', 'material')
// Installers
const createDMG = require('electron-installer-dmg')
const createDebInstaller = require('electron-installer-debian')
const targz = require('tar.gz')
const createWinInstaller = require('electron-winstaller').createWindowsInstaller
const colors = require('colors')
const packOptions = {
name: 'KawAnime',
dir: join(__dirname, '..', '..'),
out: join(__dirname, '..', 'build', 'dists'),
appCopyright: `© 2016 - ${(new Date()).getYear() + 1900} Kylart`,
all: true,
icon: join(materialPath, 'icon'),
overwrite: true
// Check for signing app
}
const dmgOptions = {
appPath: join(materialPath, '..', 'dists', 'KawAnime-darwin-x64', 'KawAnime.app'),
name: 'KawAnime',
background: join(materialPath, 'background.png'),
icon: join(materialPath, 'icon.icns'),
overwrite: true,
out: join(materialPath, '..', 'dists'),
"icon-size": 80
}
const debOptions = (version) => {
return {
productName: 'KawAnime',
src: join(materialPath, '..', 'dists', `KawAnime-linux-${version}`),
dest: join(materialPath, '..', 'dists'),
arch: version === 'x64' ? 'amd64' : 'x32',
icon: join(materialPath, 'icon.png')
}
}
const winConfig = (version) => {
return {
appDirectory: join(materialPath, '..', 'dists', `KawAnime-win32-${version}`),
outputDirectory: join(materialPath, '..', 'dists'),
authors: 'Kylart',
exe: 'KawAnime.exe',
noMsi: true,
setupExe: 'KawAnime.exe'
}
}
const makeDMG = () => {
console.log('[Builder]: Creating DMG...'.yellow)
createDMG(dmgOptions, function done(err) {
if (err)
{
console.log('[Builder]: An error occurred while creating DMG.'.red)
throw err
}
console.log('[Builder]: Successfully built DMG!'.green)
})
}
const makeDebInstaller = (version) => {
console.log(`[Builder]: Creating ${version} Deb package...`.yellow)
createDebInstaller(debOptions(version), (err) => {
if (err)
{
console.log(`[Builder]: An error occurred while creating ${version} Deb package!`.red)
throw err
}
console.log(`[Builder]: Successfully built ${version} Deb package!`.green)
})
}
const makeTarGZ = () => {
console.log('[Builder]: Creating tar.gz for armv7l...'.yellow)
targz().compress(join(materialPath, '..', 'dists', 'KawAnime-linux-armv7l'), join(materialPath, '..', 'dists', 'KawAnime.tar.gz'))
.then(function () {
console.log('[Builder]: Successfully built armv7l tar.gz!'.green);
})
.catch(function (err) {
console.log('[Builder]: An error occurred while making armv7l tar.gz!'.red)
throw err
})
}
const buildDists = () => {
makeDMG()
makeDebInstaller('x64')
makeDebInstaller('ia32')
makeTarGZ()
}
const pack = () => {
packager(packOptions, function done_callback(err, appPaths) {
if (err)
{
console.log('[Builder]: An occurred while packaging KawAnime!'.red)
throw err
}
appPaths.forEach((path) => {
console.log(`[Builder]: Successfully built ${path}!`.green)
})
buildDists()
})
}
(() => pack())()

View File

@ -51,7 +51,7 @@
<h1 class="title" v-bind:style="sidebarTitle">
<strong>かわニメ - </strong>
<a href="#">v0.3.0</a>
<a href="#">v0.4.0</a>
</h1>
<div class="links">

View File

@ -91,11 +91,14 @@ const newWin = () => {
}
app.on('ready', () => {
if (process.platform === 'darwin')
{
app.setAboutPanelOptions({
applicationName: 'KawAnime',
applicationVersion: '0.3.0',
applicationVersion: '0.4.0',
copyright: 'Kylart 2016-2017'
})
}
Menu.setApplicationMenu(menu)