Skip to content

Commit

Permalink
Merge master into electron-medtronic600. Bump version to qa.17
Browse files Browse the repository at this point in the history
  • Loading branch information
Lennart Goedhart committed Mar 26, 2018
2 parents 01a98f1 + 81d9178 commit 3d2718b
Show file tree
Hide file tree
Showing 30 changed files with 2,866 additions and 780 deletions.
6 changes: 4 additions & 2 deletions app/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "tidepool-uploader",
"productName": "tidepool-uploader",
"version": "2.2.5-600series-qa.16",
"version": "2.2.5-600series-qa.17",
"description": "Tidepool Project Universal Uploader",
"main": "./main.js",
"author": {
Expand All @@ -10,9 +10,11 @@
},
"license": "BSD-2-Clause",
"dependencies": {
"drivelist": "5.1.8",
"keytar": "4.0.4",
"node-hid": "0.5.7",
"serialport": "5.0.0"
"serialport": "5.0.0",
"usb": "1.3.1"
},
"optionalDependencies": {
"winreg": "1.2.4"
Expand Down
13 changes: 10 additions & 3 deletions app/reducers/devices.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ const devices = {
name: 'Medtronic 523, 723 or 530G',
selectName: 'Medtronic 523, 723, 530G (Bayer Contour Next Link)',
source: {type: 'device', driverId: 'Medtronic'},
enabled: {mac: true, win: true}
enabled: {mac: true, win: true, linux: true}
},
medtronic600: {
instructions: 'Pair your Bayer Contour Next Link 2.4 with your Medtronic pump and connect to your computer',
Expand All @@ -46,7 +46,7 @@ const devices = {
key: 'omnipod',
name: 'Insulet OmniPod',
source: {type: 'block', driverId: 'InsuletOmniPod', extension: '.ibf'},
enabled: {mac: true, win: true}
enabled: {mac: true, win: true, linux: true}
},
dexcom: {
instructions: 'Plug in receiver with micro-USB',
Expand Down Expand Up @@ -89,7 +89,7 @@ const devices = {
key: 'bayercontournext',
name: 'Bayer Contour Next',
source: {type: 'device', driverId: 'BayerContourNext'},
enabled: {mac: true, win: true}
enabled: {mac: true, win: true, linux: true}
},
animas: {
instructions: 'Suspend and align back of pump with IR dongle front',
Expand All @@ -98,6 +98,13 @@ const devices = {
source: {type: 'device', driverId: 'Animas'},
enabled: {mac: true, win: true}
},
onetouchverio: {
instructions: 'Plug in meter with micro-USB',
name: 'OneTouch Verio & Verio Flex',
key: 'onetouchverio',
source: {type: 'device', driverId: 'OneTouchVerio'},
enabled: {linux: true, mac: true, win: false}
},
onetouchverioiq: {
instructions: 'Plug in meter with mini-USB',
name: 'OneTouch VerioIQ',
Expand Down
44 changes: 26 additions & 18 deletions app/utils/drivers.darwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,22 +27,21 @@ export function checkVersion(dispatch) {

dispatch(sync.checkingForDriverUpdate());

function setInstallOpts(iconsPath, scriptPath, driverPath) {
function setInstallOpts(iconsPath, scriptPath, extractPath) {
const options = {
name: 'Tidepool Driver Installer',
icns: iconsPath
};
const execString = scriptPath.replace(/ /g, '\\ ') + ' ' + driverPath.replace(/ /g, '\\ ');
const execString = scriptPath.replace(/ /g, '\\ ') + ' ' + extractPath.replace(/ /g, '\\ ');
dispatch(sync.driverUpdateShellOpts({options,execString}));
}

function readVersion(dPath, driver) {
function readVersion(pListFile) {
try {
const list = plist.parse(fs.readFileSync(path.join(dPath, driver, '/Contents/Info.plist'), 'utf8'));
const version = list.CFBundleVersion;
return version;
const list = plist.parse(fs.readFileSync(pListFile, 'utf8'));
return list.CFBundleVersion;
} catch (error) {
if(error.code ==='ENOENT') {
if (error.code === 'ENOENT') {
return 'Not found';
} else {
console.log(error);
Expand All @@ -51,11 +50,16 @@ export function checkVersion(dispatch) {
}
}

function hasOldDriver(dPath, driverList) {
let installedVersion;
function hasOldDriver(dPath, driverList, installPath, pListFile) {
let installedVersion, currentVersion;
for (const driver of driverList) {
const currentVersion = readVersion(dPath, driver);
installedVersion = readVersion('/Library/Extensions/', driver);
if (pListFile === null) {
currentVersion = readVersion(path.join(dPath, driver, driver + '.plist'));
installedVersion = readVersion(path.join(installPath, driver + '.plist'));
} else {
currentVersion = readVersion(path.join(dPath, driver, pListFile));
installedVersion = readVersion(path.join(installPath, driver, pListFile));
}
console.log(driver,'version: Installed =', installedVersion, ', Current =', currentVersion);

if(currentVersion !== installedVersion) {
Expand All @@ -68,26 +72,30 @@ export function checkVersion(dispatch) {
}

const appFolder = path.dirname(remote.app.getAppPath());
let zipPath = path.join(appFolder,'driver/extensions.zip');
let extractPath = path.join(appFolder,'driver/');
let driverPath = path.join(extractPath,'extensions');
let iconsPath = path.join(appFolder,'/Tidepool Uploader.icns');
let scriptPath = path.join(appFolder,'driver/updateDrivers.sh');
let zipPath = path.join(appFolder, 'driver/extensions.zip');
let extractPath = path.join(appFolder, 'driver/');
let driverPath = path.join(extractPath, 'extensions');
let helperPath = path.join(extractPath, 'helpers');
let iconsPath = path.join(appFolder, '/Tidepool Uploader.icns');
let scriptPath = path.join(appFolder, 'driver/updateDrivers.sh');

if (isDev) {
const rootDir = path.resolve(appFolder, '../../../../../../');
zipPath = path.resolve(rootDir, 'resources/mac/extensions.zip');
extractPath = path.resolve(rootDir, 'build/driver/');
driverPath = path.join(extractPath, 'extensions');
helperPath = path.join(extractPath, 'helpers');
iconsPath = path.join(rootDir, 'resources/icon.icns');
scriptPath = path.resolve(rootDir, 'resources/mac/updateDrivers.sh');
}

decompress(zipPath, extractPath).then(files => {
const driverList = fs.readdirSync(driverPath).filter(e => path.extname(e) === '.kext' );
const helperList = fs.readdirSync(helperPath).filter(e => e[0] !== '.');

if (hasOldDriver(driverPath, driverList)) {
setInstallOpts(iconsPath, scriptPath, driverPath);
if (hasOldDriver(driverPath, driverList, '/Library/Extensions/', '/Contents/Info.plist') ||
hasOldDriver(helperPath, helperList, '/Library/LaunchDaemons/', null)) {
setInstallOpts(iconsPath, scriptPath, extractPath);
}
});

Expand Down
1 change: 1 addition & 0 deletions app/utils/rollbar.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import Rollbar from 'rollbar/dist/rollbar.umd';
let rollbar = new Rollbar({
accessToken: '1843589282464f4facd43f794c8201a8',
captureUncaught: true,
enabled: process.env.NODE_ENV === 'production',
payload: {
environment: 'electron_renderer',
client: {
Expand Down
96 changes: 72 additions & 24 deletions app/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ ansi-regex@^2.0.0:
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"

aproba@^1.0.3:
version "1.1.2"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.1.2.tgz#45c6629094de4e96f693ef7eab74ae079c240fc1"
version "1.2.0"
resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"

are-we-there-yet@~1.1.2:
version "1.1.4"
Expand All @@ -28,6 +28,12 @@ are-we-there-yet@~1.1.2:
delegates "^1.0.0"
readable-stream "^2.0.6"

argparse@^1.0.7:
version "1.0.9"
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.9.tgz#73d83bc263f86e97f8cc4f6bae1b0e90a7d22c86"
dependencies:
sprintf-js "~1.0.2"

asn1@~0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.3.tgz#dac8787713c9966849fc8180777ebe9c1ddf3b86"
Expand Down Expand Up @@ -62,7 +68,7 @@ bcrypt-pbkdf@^1.0.0:
dependencies:
tweetnacl "^0.14.3"

[email protected], bindings@^1.3.0:
[email protected], bindings@^1.2.1, bindings@^1.3.0:
version "1.3.0"
resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.3.0.tgz#b346f6ecf6a95f5a815c5839fc7cdb22502f1ed7"

Expand Down Expand Up @@ -114,8 +120,8 @@ combined-stream@^1.0.5, combined-stream@~1.0.5:
delayed-stream "~1.0.0"

commander@^2.11.0:
version "2.11.0"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.11.0.tgz#157152fd1e7a6c8d98a5b715cf376df928004563"
version "2.12.2"
resolved "https://registry.yarnpkg.com/commander/-/commander-2.12.2.tgz#0f5946c427ed9ec0d91a46bb9def53e54650e555"

[email protected]:
version "0.0.1"
Expand All @@ -141,7 +147,7 @@ dashdash@^1.12.0:
dependencies:
assert-plus "^1.0.0"

debug@^2.2.0, debug@^2.6.6:
debug@^2.2.0, debug@^2.6.0, debug@^2.6.6:
version "2.6.9"
resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f"
dependencies:
Expand All @@ -160,8 +166,18 @@ delegates@^1.0.0:
resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"

detect-libc@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.2.tgz#71ad5d204bf17a6a6ca8f450c61454066ef461e1"
version "1.0.3"
resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"

[email protected]:
version "5.1.8"
resolved "https://registry.yarnpkg.com/drivelist/-/drivelist-5.1.8.tgz#76f0d5f747e36544b5fa77ff914ff9a97877b01f"
dependencies:
bindings "^1.2.1"
debug "^2.6.0"
js-yaml "^3.4.1"
lodash "^4.16.4"
nan "^2.6.2"

ecc-jsbn@~0.1.1:
version "0.1.1"
Expand All @@ -175,6 +191,10 @@ end-of-stream@^1.0.0, end-of-stream@^1.1.0:
dependencies:
once "^1.4.0"

esprima@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.0.tgz#4499eddcd1110e0b218bacf2fa7f7f59f55ca804"

expand-template@^1.0.2:
version "1.1.0"
resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-1.1.0.tgz#e09efba977bf98f9ee0ed25abd0c692e02aec3fc"
Expand All @@ -183,10 +203,14 @@ extend@~3.0.0:
version "3.0.1"
resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.1.tgz#a755ea7bc1adfcc5a31ce7e762dbaadc5e636444"

[email protected], extsprintf@^1.2.0:
[email protected]:
version "1.3.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.3.0.tgz#96918440e3041a7a414f8c52e3c574eb3c3e1e05"

extsprintf@^1.2.0:
version "1.4.0"
resolved "https://registry.yarnpkg.com/extsprintf/-/extsprintf-1.4.0.tgz#e2689f8f356fad62cca65a3a91c5df5f9551692f"

forever-agent@~0.6.1:
version "0.6.1"
resolved "https://registry.yarnpkg.com/forever-agent/-/forever-agent-0.6.1.tgz#fbc71f0c41adeb37f96c577ad1ed42d8fdacca91"
Expand Down Expand Up @@ -306,8 +330,8 @@ inherits@2, inherits@~2.0.0, inherits@~2.0.3:
resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de"

ini@~1.3.0:
version "1.3.4"
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.4.tgz#0537cb79daf59b59a1a517dff706c86ec039162e"
version "1.3.5"
resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.5.tgz#eee25f56db1c9ec6085e0c22778083f596abf927"

is-fullwidth-code-point@^1.0.0:
version "1.0.0"
Expand All @@ -327,6 +351,13 @@ isstream@~0.1.2:
version "0.1.2"
resolved "https://registry.yarnpkg.com/isstream/-/isstream-0.1.2.tgz#47e63f7af55afa6f92e1500e690eb8b8529c099a"

js-yaml@^3.4.1:
version "3.10.0"
resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.10.0.tgz#2e78441646bd4682e963f22b6e92823c309c62dc"
dependencies:
argparse "^1.0.7"
esprima "^4.0.0"

jsbn@~0.1.0:
version "0.1.1"
resolved "https://registry.yarnpkg.com/jsbn/-/jsbn-0.1.1.tgz#a5e654c2e5a2deb5f201d96cefbca80c0ef2f513"
Expand Down Expand Up @@ -364,6 +395,10 @@ [email protected]:
dependencies:
nan "2.5.1"

lodash@^4.16.4:
version "4.17.4"
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.4.tgz#78203a4d1c328ae1d86dca6460e369b57f4055ae"

mime-db@~1.30.0:
version "1.30.0"
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.30.0.tgz#74c643da2dd9d6a45399963465b26d5ca7d71f01"
Expand Down Expand Up @@ -402,13 +437,15 @@ [email protected]:
version "2.5.1"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.5.1.tgz#d5b01691253326a97a2bbee9e61c55d8d60351e2"

nan@^2.6.2:
version "2.7.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.7.0.tgz#d95bf721ec877e08db276ed3fc6eb78f9083ad46"
nan@^2.6.2, nan@^2.8.0:
version "2.8.0"
resolved "https://registry.yarnpkg.com/nan/-/nan-2.8.0.tgz#ed715f3fe9de02b57a5e6252d90a96675e1f085a"

node-abi@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.1.1.tgz#c9cda256ec8aa99bcab2f6446db38af143338b2a"
version "2.1.2"
resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-2.1.2.tgz#4da6caceb6685fcd31e7dd1994ef6bb7d0a9c0b2"
dependencies:
semver "^5.4.1"

[email protected]:
version "0.5.7"
Expand All @@ -418,7 +455,7 @@ [email protected]:
nan "^2.6.2"
prebuild-install "^2.2.2"

node-pre-gyp@^0.6.36:
node-pre-gyp@^0.6.30, node-pre-gyp@^0.6.36:
version "0.6.39"
resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.6.39.tgz#c00e96860b23c0e1420ac7befc5044e1d78d8649"
dependencies:
Expand Down Expand Up @@ -496,8 +533,8 @@ performance-now@^0.2.0:
resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-0.2.0.tgz#33ef30c5c77d4ea21c5a53869d91b56d8f2555e5"

prebuild-install@^2.2.2:
version "2.3.0"
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-2.3.0.tgz#19481247df728b854ab57b187ce234211311b485"
version "2.4.1"
resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-2.4.1.tgz#c28ba1d1eedc17fbd6b3229a657ffc0fba479b49"
dependencies:
expand-template "^1.0.2"
github-from-package "0.0.0"
Expand All @@ -523,8 +560,8 @@ promirepl@^1.0.1:
resolved "https://registry.yarnpkg.com/promirepl/-/promirepl-1.0.1.tgz#2951aaeba2bf3fe2274ff63a16d94c04ca60872e"

pump@^1.0.0, pump@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.2.tgz#3b3ee6512f94f0e575538c17995f9f16990a5d51"
version "1.0.3"
resolved "https://registry.yarnpkg.com/pump/-/pump-1.0.3.tgz#5dfe8311c33bbf6fc18261f9f34702c47c08a954"
dependencies:
end-of-stream "^1.1.0"
once "^1.3.1"
Expand Down Expand Up @@ -595,7 +632,7 @@ safe-buffer@^5.0.1, safe-buffer@~5.1.0, safe-buffer@~5.1.1:
version "5.1.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.1.tgz#893312af69b2123def71f57889001671eeb2c853"

semver@^5.3.0:
semver@^5.3.0, semver@^5.4.1:
version "5.4.1"
resolved "https://registry.yarnpkg.com/semver/-/semver-5.4.1.tgz#e059c09d8571f0540823733433505d3a2f00b18e"

Expand Down Expand Up @@ -633,6 +670,10 @@ [email protected]:
dependencies:
hoek "2.x.x"

sprintf-js@~1.0.2:
version "1.0.3"
resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c"

sshpk@^1.7.0:
version "1.13.1"
resolved "https://registry.yarnpkg.com/sshpk/-/sshpk-1.13.1.tgz#512df6da6287144316dc4c18fe1cf1d940739be3"
Expand Down Expand Up @@ -698,8 +739,8 @@ tar-pack@^3.4.0:
uid-number "^0.0.6"

tar-stream@^1.1.2:
version "1.5.4"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.5.4.tgz#36549cf04ed1aee9b2a30c0143252238daf94016"
version "1.5.5"
resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-1.5.5.tgz#5cad84779f45c83b1f2508d96b09d88c7218af55"
dependencies:
bl "^1.0.0"
end-of-stream "^1.0.0"
Expand Down Expand Up @@ -738,6 +779,13 @@ unzip-response@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/unzip-response/-/unzip-response-1.0.2.tgz#b984f0877fc0a89c2c773cc1ef7b5b232b5b06fe"

[email protected]:
version "1.3.1"
resolved "https://registry.yarnpkg.com/usb/-/usb-1.3.1.tgz#b5f8c360a53bf28f5c9fbc12d64c7f61e4346ab7"
dependencies:
nan "^2.8.0"
node-pre-gyp "^0.6.30"

util-deprecate@~1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
Expand Down
Loading

0 comments on commit 3d2718b

Please sign in to comment.