Skip to content

Commit

Permalink
fixes #89
Browse files Browse the repository at this point in the history
  • Loading branch information
andy-portmen committed Jun 28, 2020
1 parent ac09cce commit a3dbc63
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 30 deletions.
1 change: 0 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ exports.ids = {
'mgmnomlncpmfgelhofilonnecmbdaoia', // Open in Brave (Chrome) [By @brian-girko]
'pfenoignchfmjmphnpfihgockdhejcjf', // Open in Sumatra (Chrome)
'ojmcfmboidiokgkgmilnmjnjkdbgakpn', // Open in Sumatra (Opera)
'alighchillgifpgaigbgnmhnndoecalj', // TESSST
],
firefox: [
'{b8fa78dd-dae1-4839-9d0e-ce5e213083ce}', // Open in GIMP
Expand Down
2 changes: 1 addition & 1 deletion host.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ let files = [];
const sprocess = [];

const config = {
version: '0.8.9'
version: '0.9.0'
};
// closing node when parent process is killed
process.stdin.resume();
Expand Down
2 changes: 1 addition & 1 deletion messaging.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ util.inherits(Output, stream.Transform);

Output.prototype._transform = function(chunk, encoding, done) {
const len = Buffer.alloc(4);
const buf = new Buffer(JSON.stringify(chunk));
const buf = Buffer.from(JSON.stringify(chunk), 'utf8');

len.writeUInt32LE(buf.length, 0);

Expand Down
63 changes: 36 additions & 27 deletions windows/install.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,38 +2,47 @@

SET PATH=C:\Windows\System32;%PATH%

ECHO .. Writting to Chrome Registry
ECHO .. Key: HKCU\Software\Google\Chrome\NativeMessagingHosts\com.add0n.node
REG ADD "HKCU\Software\Google\Chrome\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%LocalAPPData%\com.add0n.node\manifest-chrome.json" /f
IF EXIST "%~dp0\app\install.js" (GOTO :EXISTING) ELSE GOTO :MISSING

ECHO .. Writting to Chromium Registry
ECHO .. Key: HKEY_CURRENT_USER\Software\Chromium\NativeMessagingHosts\com.add0n.node
REG ADD "HKEY_CURRENT_USER\Software\Chromium\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%LocalAPPData%\com.add0n.node\manifest-chrome.json" /f
:EXISTING
ECHO .. Writting to Chrome Registry
ECHO .. Key: HKCU\Software\Google\Chrome\NativeMessagingHosts\com.add0n.node
REG ADD "HKCU\Software\Google\Chrome\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%LocalAPPData%\com.add0n.node\manifest-chrome.json" /f

ECHO .. Writting to Edge Registry
ECHO .. Key: HKEY_CURRENT_USER\Software\Microsoft\Edge\NativeMessagingHosts\com.add0n.node
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Edge\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%LocalAPPData%\com.add0n.node\manifest-chrome.json" /f
ECHO .. Writting to Chromium Registry
ECHO .. Key: HKEY_CURRENT_USER\Software\Chromium\NativeMessagingHosts\com.add0n.node
REG ADD "HKEY_CURRENT_USER\Software\Chromium\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%LocalAPPData%\com.add0n.node\manifest-chrome.json" /f

ECHO .. Writting to Firefox Registry
ECHO .. Key: HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.node
FOR %%f in ("%LocalAPPData%") do SET SHORT_PATH=%%~sf
REG ADD "HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%SHORT_PATH%\com.add0n.node\manifest-firefox.json" /f
ECHO .. Writting to Edge Registry
ECHO .. Key: HKEY_CURRENT_USER\Software\Microsoft\Edge\NativeMessagingHosts\com.add0n.node
REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Edge\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%LocalAPPData%\com.add0n.node\manifest-chrome.json" /f

ECHO .. Writting to Waterfox Registry
ECHO .. Key: HKCU\SOFTWARE\Waterfox\NativeMessagingHosts\com.add0n.node
REG ADD "HKCU\SOFTWARE\Waterfox\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%SHORT_PATH%\com.add0n.node\manifest-firefox.json" /f
ECHO .. Writting to Firefox Registry
ECHO .. Key: HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.node
FOR %%f in ("%LocalAPPData%") do SET SHORT_PATH=%%~sf
REG ADD "HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%SHORT_PATH%\com.add0n.node\manifest-firefox.json" /f

ECHO .. Writting to Thunderbird Registry
ECHO .. Key: HKCU\SOFTWARE\Thunderbird\NativeMessagingHosts\com.add0n.node
REG ADD "HKCU\SOFTWARE\Thunderbird\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%SHORT_PATH%\com.add0n.node\manifest-firefox.json" /f
ECHO .. Writting to Waterfox Registry
ECHO .. Key: HKCU\SOFTWARE\Waterfox\NativeMessagingHosts\com.add0n.node
REG ADD "HKCU\SOFTWARE\Waterfox\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%SHORT_PATH%\com.add0n.node\manifest-firefox.json" /f

pushd "%~dp0"
CD app
ECHO .. Writting to Thunderbird Registry
ECHO .. Key: HKCU\SOFTWARE\Thunderbird\NativeMessagingHosts\com.add0n.node
REG ADD "HKCU\SOFTWARE\Thunderbird\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%SHORT_PATH%\com.add0n.node\manifest-firefox.json" /f

IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
..\node\x64\node.exe install.js "%LocalAPPData%"
) ELSE (
..\node\x86\node.exe install.js "%LocalAPPData%"
)
pushd "%~dp0"
CD app

PAUSE
IF "%PROCESSOR_ARCHITECTURE%"=="AMD64" (
..\node\x64\node.exe install.js "%LocalAPPData%"
) ELSE (
..\node\x86\node.exe install.js "%LocalAPPData%"
)

GOTO :COMMON

:MISSING
ECHO To run the installer, please first unzip the archive

:COMMON
PAUSE

0 comments on commit a3dbc63

Please sign in to comment.