Skip to content

Commit 84fd212

Browse files
committed
modified for portable
1 parent c3fff31 commit 84fd212

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

settings-renderer.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -402,7 +402,11 @@ function keyDownTriggerRemover() {
402402
var aes = require("crypto-js/aes");
403403
var encoding = require("crypto-js/enc-utf8");
404404
var copyToClipboard = require("copy-to-clipboard");
405-
var statistics = new Store({ name: 'statistics' });
405+
if (process.env.NODE_ENV == "portable") {
406+
statistics = new Store({ cwd: require("electron").remote.app.getPath('exe').replace("wnr.exe", ""), name: 'wnr-statistics' });
407+
} else {
408+
statistics = new Store({ name: 'statistics' });
409+
}
406410
function settingsBackup(mode) {
407411
var cipherText = aes.encrypt(JSON.stringify((mode == "statistics") ? statistics.store : store.store), (mode == "statistics") ? String("She's awesome.") : String("We all love wnr, so please do not use this passcode to do bad things."));
408412
copyToClipboard(cipherText.toString());

0 commit comments

Comments
 (0)