Skip to content

Commit d023ec4

Browse files
committed
Merge branch 'develop' of https://github.com/CANBus-Triple/CANBus-Triple-App into develop
2 parents 601622a + 11c9387 commit d023ec4

File tree

4 files changed

+97
-49
lines changed

4 files changed

+97
-49
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ www/plugins
88
cordova*.js
99
node_modules
1010
cache
11+
dist
1112
build
1213
build.nw
1314
release

gulpfile.js

+62-16
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,12 @@ var electron = require('gulp-electron');
1414
var elecRebuild = require('electron-rebuild');
1515
var packageJson = require('./package.json');
1616
var install = require("gulp-install");
17-
var createInstaller = require('electron-installer-squirrel-windows');
17+
var winInstaller = require('electron-windows-installer');
1818

1919

2020

21+
var electronVersion = 'v0.36.7';
22+
2123
var paths = {
2224
sass: ['./www/sass/**/*.scss']
2325
};
@@ -166,24 +168,16 @@ gulp.task('electron-copy', ['sass', 'scripts'], function() {
166168

167169
});
168170

169-
gulp.task('electron-installer', [], function(){
170-
var opts = {
171-
"path": "release/v0.36.7/win32-x64/",
172-
"name": "CANBus Triple",
173-
"description": "CANBus Triple Desktop app http://canb.us"
174-
}
175-
createInstaller(opts, function done (err){
176-
if(err)
177-
gutil.log('electron-installer', gutil.colors.red(err), err);
178-
})
179-
});
171+
180172

181173
gulp.task('electron-install', [], function() {
182174
gulp.src(['./electron-src/package.json'])
183175
.pipe(install({production:true, ignoreScripts:true}));
184176
});
185177

186-
gulp.task('electron-build', ['electron-copy'], function() {
178+
gulp.task('electron-build', ['electron-build:osx', 'electron-build:linux', 'electron-build:win']);
179+
180+
gulp.task('electron-build:osx', ['electron-copy'], function() {
187181

188182
gulp.src("")
189183
.pipe(electron({
@@ -192,17 +186,51 @@ gulp.task('electron-build', ['electron-copy'], function() {
192186
release: './release',
193187
cache: './cache',
194188
asar: true,
195-
version: 'v0.36.7',
189+
version: electronVersion,
196190
packaging: true,
197-
platforms: [/*'win32-ia32',*/ 'win32-x64', 'darwin-x64', /*'linux-x64'*/],
191+
platforms: ['darwin-x64', /*'linux-x64'*/],
198192
platformResources: {
199193
darwin: {
200194
CFBundleDisplayName: packageJson.name,
201195
CFBundleIdentifier: packageJson.name,
202196
CFBundleName: packageJson.name,
203197
CFBundleVersion: packageJson.version,
204198
icon: 'build_assets/nw.icns'
205-
},
199+
}
200+
}
201+
}))
202+
.pipe(gulp.dest(""));
203+
});
204+
205+
gulp.task('electron-build:linux', ['electron-copy'], function() {
206+
gulp.src("")
207+
.pipe(electron({
208+
src: './electron-src',
209+
packageJson: packageJson,
210+
release: './release',
211+
cache: './cache',
212+
asar: true,
213+
version: electronVersion,
214+
packaging: true,
215+
platforms: ['linux-x64'],
216+
platformResources: {}
217+
}))
218+
.pipe(gulp.dest(""));
219+
});
220+
221+
gulp.task('electron-build:win', ['electron-copy'], function() {
222+
223+
gulp.src("")
224+
.pipe(electron({
225+
src: './electron-src',
226+
packageJson: packageJson,
227+
release: './release',
228+
cache: './cache',
229+
asar: true,
230+
version: electronVersion,
231+
packaging: true,
232+
platforms: ['win32-x64'],
233+
platformResources: {
206234
win: {
207235
"version-string": packageJson.version,
208236
"file-version": packageJson.version,
@@ -213,3 +241,21 @@ gulp.task('electron-build', ['electron-copy'], function() {
213241
}))
214242
.pipe(gulp.dest(""));
215243
});
244+
245+
246+
gulp.task('create-windows-installer', function(done) {
247+
winInstaller({
248+
productName: 'CANBusTriple',
249+
appDirectory: './release/'+electronVersion+'/win32-x64/',
250+
outputDirectory: './dist',
251+
arch: 'x64',
252+
authors: 'CANBus Triple Community',
253+
iconUrl: 'http://canb.us/favicon.ico',
254+
setupIcon: 'build_assets/cbt.ico',
255+
title: "CANBus Triple",
256+
exe: "CANBusTriple.exe",
257+
remoteReleases: 'https://github.com/CANBus-Triple/CANBus-Triple-App/releases/download/v0.3.1/RELEASES',
258+
certificateFile: 'c:/Users/IEUser/Desktop/MyKey.pfx',
259+
certificatePassword: 'pimp666'
260+
}).then(done).catch(done);
261+
});

package.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,10 @@
1818
"browser-sync": "^2.9.1",
1919
"connect": "*",
2020
"del": "^2.0.2",
21-
"electron-installer-squirrel-windows": "^1.2.2",
21+
"electron-builder": "^2.6.0",
2222
"electron-prebuilt": "^0.36.7",
2323
"electron-rebuild": "^1.1.2",
24+
"electron-windows-installer": "^1.2.2",
2425
"gulp": "^3.9.0",
2526
"gulp-concat": "^2.6.0",
2627
"gulp-electron": "0.0.9",

www/js/scripts.js

+32-32
Original file line numberDiff line numberDiff line change
@@ -760,6 +760,38 @@ angular.module('cbt')
760760
'use strict';
761761

762762

763+
angular.module('cbt')
764+
.controller('HomeController', function ($scope, $state, appVersion) {
765+
766+
$scope.version = appVersion;
767+
768+
$scope.items = [
769+
{
770+
name: 'Watch CAN Packets',
771+
icon: 'ion-settings',
772+
sref: 'logger',
773+
},
774+
{
775+
name: 'Pipe CAN packets to Wireshark',
776+
icon: 'ion-arrow-right-c',
777+
sref: 'pipe',
778+
},
779+
{
780+
name: 'Settings',
781+
icon: 'ion-gear-b',
782+
sref: 'settings',
783+
},
784+
];
785+
786+
$scope.listItemClick = function(n){
787+
$state.go( $scope.items[n].sref );
788+
}
789+
790+
});
791+
792+
'use strict';
793+
794+
763795
angular.module('cbt')
764796
.controller('HWStatusController', function ($rootScope, $scope, $state, $http, $interval, $timeout, $ionicModal, HardwareService) {
765797

@@ -914,38 +946,6 @@ angular.module('cbt')
914946
'use strict';
915947

916948

917-
angular.module('cbt')
918-
.controller('HomeController', function ($scope, $state, appVersion) {
919-
920-
$scope.version = appVersion;
921-
922-
$scope.items = [
923-
{
924-
name: 'Watch CAN Packets',
925-
icon: 'ion-settings',
926-
sref: 'logger',
927-
},
928-
{
929-
name: 'Pipe CAN packets to Wireshark',
930-
icon: 'ion-arrow-right-c',
931-
sref: 'pipe',
932-
},
933-
{
934-
name: 'Settings',
935-
icon: 'ion-gear-b',
936-
sref: 'settings',
937-
},
938-
];
939-
940-
$scope.listItemClick = function(n){
941-
$state.go( $scope.items[n].sref );
942-
}
943-
944-
});
945-
946-
'use strict';
947-
948-
949949
angular.module('cbt')
950950

951951
.run(function($templateCache, MenuService){

0 commit comments

Comments
 (0)