diff --git a/package.json b/package.json index ace3c441..b3b6fa74 100644 --- a/package.json +++ b/package.json @@ -20,6 +20,7 @@ "dev": "concurrently \"BROWSER=none npm start\" \"wait-on $npm_package_config_cra_dev_serv && ELECTRON_START_URL=$npm_package_config_cra_dev_serv electron .\"", "dist": "react-scripts build && build --c.extraMetadata.main=build/electron.js", "dist:mac": "./sign/mac.sh", + "dist:win": ".\\sign\\win.bat", "eject": "react-scripts eject", "lint": "eslint --cache public && eslint --cache src", "pack": "build --c.extraMetadata.main=build/electron.js", diff --git a/public/analytics.js b/public/analytics.js index 570e473f..95150519 100644 --- a/public/analytics.js +++ b/public/analytics.js @@ -6,22 +6,24 @@ const { noop } = require('lodash') const settings = require('electron-settings') const isDev = require('electron-is-dev') -const visitor = ua(settings.get('app.trackingId')) +let visitor const analytics = {} -visitor.set('ds', 'app') -visitor.set('an', app.getName()) -visitor.set('av', app.getVersion()) - analytics.screenview = function (...args) { + if (!visitor) return visitor.screenview(...args).send() } analytics.event = function (...args) { + if (!visitor) return visitor.event(...args).send() } analytics.init = function (userAgent) { + visitor = ua(settings.get('app.trackingId')) + visitor.set('ds', 'app') + visitor.set('an', app.getName()) + visitor.set('av', app.getVersion()) visitor.set('ua', userAgent) analytics.event('App', 'App initiated') } diff --git a/sign/win.bat b/sign/win.bat new file mode 100644 index 00000000..092b5714 --- /dev/null +++ b/sign/win.bat @@ -0,0 +1,10 @@ +@echo off +echo Building and signing application for Windows + +SET CSC_LINK=as.p12 + +set /p PASSWORD="Insert the certificate password and press enter: " + +SET CSC_KEY_PASSWORD=%PASSWORD% + +npm run dist