diff --git a/demo/index.html b/demo/index.html
index ac07b374..f137e858 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -42,7 +42,7 @@
- Screen Snippet (note: currently only works on mac):
+ Screen Snippet:
snippet output:
@@ -130,7 +130,7 @@
}
function snippetError(err) {
- alert('error getting snippet', err);
+ alert('error getting snippet' + err);
}
});
diff --git a/installer/Symphony-x64.aip b/installer/Symphony-x64.aip
index ed691a84..53a84285 100644
--- a/installer/Symphony-x64.aip
+++ b/installer/Symphony-x64.aip
@@ -1,417 +1,417 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-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ScreenSnippet.js
@@ -1,11 +1,13 @@
'use strict';
+const electron = require('electron');
+const app = electron.app;
const childProcess = require('child_process');
const fs = require('fs');
const os = require('os');
const path = require('path');
-const { isMac } = require('../utils/misc.js');
+const { isMac, isDevEnv } = require('../utils/misc.js');
// static ref to child process, only allow one screen snippet at time, so
// hold ref to prev, so can kill before starting next snippet.
@@ -43,13 +45,19 @@ class ScreenSnippet {
captureUtil = '/usr/sbin/screencapture';
captureUtilArgs = [ '-i', '-s', '-t', 'jpg', outputFileName ];
} else {
- // for now screen snippet on windows is not supported,
- // waiting on open sourcing for custom screen snippter util.
- reject(this._createWarn('windows not supported'));
- // custom built windows screen capture tool, that is
- // located in same directory as running exec.
- //captureUtil = './ScreenSnippet.exe';
- //captureUtilArgs = [ outputFileName ];
+ // use custom built windows screen capture tool
+ if (isDevEnv) {
+ // for dev env pick up tool from node nodules
+ captureUtil =
+ path.join(__dirname,
+ '../../node_modules/screen-snippet/bin/Release/ScreenSnippet.exe');
+ } else {
+ // for production gets installed next to exec.
+ let execPath = path.dirname(app.getPath('exe'));
+ captureUtil = path.join(execPath, 'ScreenSnippet.exe');
+ }
+
+ captureUtilArgs = [ outputFileName ];
}
// only allow one screen capture at a time.
diff --git a/package.json b/package.json
index 093134cd..ca2ee458 100644
--- a/package.json
+++ b/package.json
@@ -87,5 +87,8 @@
"keymirror": "0.1.1",
"electron-context-menu": "^0.8.0",
"winreg": "^1.2.3"
+ },
+ "optionalDependencies": {
+ "screen-snippet": "git+ssh://github.com/symphonyoss/ScreenSnippet.git#v1.0.0"
}
}