-
Notifications
You must be signed in to change notification settings - Fork 1
/
electron-builder.js
86 lines (84 loc) · 2.45 KB
/
electron-builder.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
const builder = require('electron-builder');
const pkg = require('./package.json');
const output = process.platform === 'darwin' ? `package-${process.env.CHANNEL}` : `package-${process.env.ARCH}-${process.env.CHANNEL}`;
builder.build({
config: {
appId: 'release.tingkelai.electron',
productName: 'tingkelai',
electronVersion: pkg.electronVersion,
directories: {
output: output,
// app: 'src', // electron 默认打包的文件夹入口
},
files: [
'src/**',
'node_modules/**/*',
'package.json',
'electron-builder.js',
'main.js',
// 'travis.sh',
],
publish: {
provider: 'generic',
url: 'https://download.tingkelai.com/pc-autoupdate/${os}/${env.CHANNEL}',
channel: '${env.CHANNEL}'
},
mac: {
category: 'public.app-category.productivity', //放到生产效率类
icon: 'src/assets/tkl.ico',
type: 'distribution',
target: ['dmg']
},
dmg: {
artifactName: 'tingkelai-mac-${env.CHANNEL}-${version}.${ext}',
background: 'src/assets/dmg-bg.png',
title: 'tingkelai ${version}',
contents: [
{
x: 30,
y: 190
},
{
x: 540 - 30 - 90 - 15 - 15,
y: 190,
type: 'link',
path: '/Applications'
}
],
window: {
width: 540,
height: 380,
}
},
win: {
target: [
{
target: 'nsis',
arch: [process.env.ARCH]
}
],
// certificateSubjectName: '南京听客来信息技术有限公司',
// certificateSha1: 'C62F13BAC984C857370B22DB8550B58002180D81',
icon: 'src/assets/tkl.ico',
publish: {
provider: 'generic',
url: 'https://download.tingkelai.com/pc-autoupdate/${os}/${env.ARCH}/${env.CHANNEL}',
channel: '${env.CHANNEL}'
}
},
nsis: {
artifactName: 'tingkelai-win-${env.ARCH}-${env.CHANNEL}-${version}.exe',
shortcutName: '听客来',
uninstallDisplayName: '听客来 ${version}',
guid: 'BE407C3D-E86D-7273-36F9-69C6E8F9F216',
installerIcon: "src/assets/tkl.ico",
uninstallerIcon: "src/assets/tkl.ico",
installerHeaderIcon: "src/assets/tkl.ico",
createDesktopShortcut: true,
createStartMenuShortcut: true,
allowToChangeInstallationDirectory: true,
oneClick: false,
perMachine: true // 与 oneClick 组合使用,出现不同的安装情况
},
}
});