Skip to content

Commit

Permalink
removing admin permission for installing the native client on Windows…
Browse files Browse the repository at this point in the history
… (thanks to @inbasic comment)
  • Loading branch information
andy-portmen committed Apr 23, 2017
1 parent 45be3e3 commit 793bc52
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 55 deletions.
2 changes: 1 addition & 1 deletion host.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ var https = lazyRequire('./follow-redirects').https;
var server, files = [], sprocess = [];

var config = {
version: '0.3.5'
version: '0.3.6'
};
// closing node when parent process is killed
process.stdin.resume();
Expand Down
33 changes: 5 additions & 28 deletions windows/install.bat
Original file line number Diff line number Diff line change
@@ -1,39 +1,16 @@
@echo off

call :isAdmin

if %errorlevel% == 0 (
goto :run
) else (
echo .
echo .
echo ************ERROR*****************
echo *******Run as administrator*******
echo **********************************
echo .
echo .
pause
)

exit /b

:isAdmin
fsutil dirty query %systemdrive% >nul
exit /b

:run

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 "%ProgramFiles%\com.add0n.node\manifest-chrome.json" /f
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 Firefox Registry
echo .. Key: HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.node
for %%f in ("%PROGRAMFILES%") do SET SHORT_PATH=%%~sf
REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%SHORT_PATH%\com.add0n.node\manifest-firefox.json" /f
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

pushd "%~dp0"
cd app
..\node.exe install.js "%ProgramFiles%"
..\node.exe install.js "%LocalAPPData%"

pause
29 changes: 3 additions & 26 deletions windows/uninstall.bat
Original file line number Diff line number Diff line change
@@ -1,37 +1,14 @@
@echo off

call :isAdmin

if %errorlevel% == 0 (
goto :run
) else (
echo .
echo .
echo ************ERROR*****************
echo *******Run as administrator*******
echo **********************************
echo .
echo .
pause
)

exit /b

:isAdmin
fsutil dirty query %systemdrive% >nul
exit /b

:run

echo .. Deleting Chrome Registry
REG DELETE "HKCU\Software\Google\Chrome\NativeMessagingHosts\com.add0n.node" /f

echo .. Deleting Firefox Registry
for %%f in ("%PROGRAMFILES%") do SET SHORT_PATH=%%~sf
REG DELETE "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.node" /f
for %%f in ("%LocalAPPData%") do SET SHORT_PATH=%%~sf
REG DELETE "HKCU\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.node" /f

echo .. Deleting com.add0n.node
RMDIR /Q /S "%ProgramFiles%\com.add0n.node"
RMDIR /Q /S "%LocalAPPData%\com.add0n.node"

echo.
echo ^>^>^> Done! ^<^<^<
Expand Down

1 comment on commit 793bc52

@dj-hidem
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@@ -1,39 +1,16 @@
@echo off

-call :isAdmin

-if %errorlevel% == 0 (

  • goto :run
    -) else (
  • echo .
  • echo .
  • echo ERROR*****
  • echo Run as administrator
  • echo **********************************
  • echo .
  • echo .
  • pause
    -)

-exit /b

-:isAdmin
-fsutil dirty query %systemdrive% >nul
-exit /b

-:run

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 "%ProgramFiles%\com.add0n.node\manifest-chrome.json" /f
+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 Firefox Registry
-echo .. Key: HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.node
-for %%f in ("%PROGRAMFILES%") do SET SHORT_PATH=%%~sf
-REG ADD "HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\NativeMessagingHosts\com.add0n.node" /ve /t REG_SZ /d "%SHORT_PATH%\com.add0n.node\manifest-firefox.json" /f
+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

pushd "%~dp0"
cd app
-..\node.exe install.js "%ProgramFiles%"
+..\node.exe install.js "%LocalAPPData%"

pause

Please sign in to comment.