Skip to content

Commit 4182297

Browse files
committed
tweaks
1 parent f699edc commit 4182297

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ npm run win32:dev/simu/prod
2424
npm run win64:dev/simu/prod
2525

2626
# build for production with mac
27-
npm run mac
27+
npm run mac:dev/simu/prod
2828

2929
# check update for npm packages, please install 'npm install npm-check-updates -g' at first
3030
npm run update
@@ -33,3 +33,5 @@ npm run update
3333
For OS X Users: If you get `Failed to start Cocoa app main loop`, you need to upgrade wine to the latest devel
3434

3535
```brew install wine --devel```
36+
37+
注:目前通过‘npm run win64’等自动编译的软件不支持中文名(setup-win.iss -> MyAppName),可通过‘npm run pack64’等先打包再运行dist/iss文件启动InnoSetup-Unicode手动编译。

gulpfile.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ const gulp = require('gulp')
22
const inno = require('gulp-inno')
33
const rename = require("gulp-rename")
44
const replace = require('gulp-replace')
5-
// const convert = require('gulp-convert-encoding')
5+
const bom = require('gulp-bom')
66
const exec = require('child_process').exec
77
const config = require('./app/package.json')
88
// var argv = process.argv.slice(2)
@@ -22,13 +22,20 @@ gulp.task('dev', ['env'], function(cb){
2222
})
2323
})
2424

25+
gulp.task('mac', ['env'], function(cb){
26+
exec('electron-packager ./app client --platform darwin --arch x64 --out dist/ --icon ./build/favicon.icns --overwrite --download.mirror https://npm.taobao.org/mirrors/electron/ --asar', function(err) {
27+
if (err) return cb(err)
28+
cb()
29+
})
30+
})
31+
2532
gulp.task('pack64', ['env'], function(cb){
2633
exec('electron-packager ./app client --platform=win32 --arch=x64 --out=dist/ --icon=./build/favicon.ico --overwrite --download.mirror=https://npm.taobao.org/mirrors/electron/ --asar', function(err) {
2734
if (err) return cb(err)
2835

2936
gulp
3037
.src('./build/setup-win.iss')
31-
// .pipe(convert({to: 'GBK'}))
38+
.pipe(bom())
3239
.pipe(replace('${version}', config.version))
3340
.pipe(replace('${sourcePath}', 'client-win32-x64'))
3441
.pipe(replace('${outputName}', 'client-win64-' + config.version + '-' + getShortName(process.env.NODE_ENV)))
@@ -53,7 +60,7 @@ gulp.task('pack32', ['env'], function(cb){
5360

5461
gulp
5562
.src('./build/setup-win.iss')
56-
// .pipe(convert({to: 'GBK'}))
63+
.pipe(bom())
5764
.pipe(replace('${version}', config.version))
5865
.pipe(replace('${sourcePath}', 'client-win32-ia32'))
5966
.pipe(replace('${outputName}', 'client-win32-' + config.version + '-' + getShortName(process.env.NODE_ENV)))

package.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,17 @@
1717
"win64:dev": "cross-env NODE_ENV=development gulp build64",
1818
"win64:simu": "cross-env NODE_ENV=simulation gulp build64",
1919
"win64:prod": "cross-env NODE_ENV=production gulp build64",
20+
"mac:dev": "cross-env NODE_ENV=development gulp mac",
21+
"mac:simu": "cross-env NODE_ENV=simulation gulp mac",
22+
"mac:prod": "cross-env NODE_ENV=production gulp mac",
2023
"update": "ncu -u -a"
2124
},
2225
"devDependencies": {
2326
"cross-env": "^4.0.0",
2427
"electron": "^1.4.16",
2528
"electron-packager": "^8.6.0",
2629
"gulp": "^3.9.1",
30+
"gulp-bom": "^1.0.0",
2731
"gulp-inno": "^0.1.0",
2832
"gulp-rename": "^1.2.2",
2933
"gulp-replace": "^0.5.4"

0 commit comments

Comments
 (0)