Skip to content

Commit

Permalink
Added installation scripts for Cygwin environments. The server cannot…
Browse files Browse the repository at this point in the history
… run as a daemon, so this feature has been disabled on Cygwin platforms
  • Loading branch information
jmdaweb committed Jul 29, 2016
1 parent c2a65d9 commit 87cd7d4
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 4 deletions.
2 changes: 2 additions & 0 deletions Cygwin/NVDARemoteServer
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/bash
python /usr/share/NVDARemoteServer/server.py $*
28 changes: 28 additions & 0 deletions Cygwin/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
if ! test -e ../server.py
then
echo This script must be run from Cygwin directory inside the NVDA Remote Server source folder. Exiting.
exit 1
fi
if test -e /usr/bin/NVDARemoteServer
then
echo NVDA Remote Server is already installed. Exiting...
exit 1
fi
echo installing...
cp NVDARemoteServer /usr/bin
cp uninstall.sh /usr/bin/NVDARemoteUninstall
cp ../NVDARemoteCertificate /usr/bin
mkdir /usr/share/NVDARemoteServer
cp ../server.py ../daemon.py ../server.pem /usr/share/NVDARemoteServer
cp ../manual/NVDARemoteServer.1 ../manual/NVDARemoteCertificate.1 /usr/share/man/man1
mkdir /usr/share/doc/NVDARemoteServer
cp ../LICENSE /usr/share/doc/NVDARemoteServer
if test $? -eq 0
then
echo NVDA Remote Server has been installed succesfully.
exit 0
else
echo There was a problem installing NVDA Remote Server. Please, run the uninstall script and try again.
exit 1
fi
7 changes: 7 additions & 0 deletions Cygwin/uninstall.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/bin/bash
echo Uninstalling NVDA Remote Server...
rm -rf /usr/share/NVDARemoteServer
rm -rf /usr/share/doc/NVDARemoteServer
rm -f /usr/bin/NVDARemoteServer /usr/bin/NVDARemoteCertificate /usr/bin/NVDARemoteUninstall /usr/share/man/man1/NVDARemoteServer.1 /usr/share/man/man1/NVDARemoteCertificate /var/log/NVDARemoteServer.log
echo NVDA Remote Server has been uninstalled.
exit 0
6 changes: 2 additions & 4 deletions server.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def bar(*args, **kw):

ssl.wrap_socket = sslwrap(ssl.wrap_socket)
debug=False
logfile=""
logfile="NVDARemoteServer.log"
import traceback
def printError():
exc, type, trace=sys.exc_info()
Expand Down Expand Up @@ -348,10 +348,9 @@ def run(self):
if 'debug' in sys.argv:
debug=True
sys.stdout=codecs.getwriter("utf-8")(sys.stdout)
logfile="NVDARemoteServer.log"
srv=Server(6837)
srv.run()
elif (platform.system()=='Linux')|(platform.system()=='Darwin')|(platform.system().startswith('CYGWIN'))|(platform.system().startswith('MSYS')):
elif (platform.system()=='Linux')|(platform.system()=='Darwin')|(platform.system().startswith('MSYS')):
dm=serverDaemon('/var/run/NVDARemoteServer.pid')
if len(sys.argv) == 2:
if 'start' == sys.argv[1]:
Expand All @@ -370,6 +369,5 @@ def run(self):
print "usage: %s start|stop|restart" % sys.argv[0]
sys.exit(2)
else:
logfile="NVDARemoteServer.log"
srv=Server(6837)
srv.run()

0 comments on commit 87cd7d4

Please sign in to comment.