From 82cb59168a82de75bef58d5e67b541e8c23e3e40 Mon Sep 17 00:00:00 2001 From: Bart Baas Date: Thu, 3 Dec 2015 12:07:25 +0100 Subject: [PATCH 1/6] Update installer for MapProxy version 1.8.1 --- SetupMapProxy.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SetupMapProxy.nsi b/SetupMapProxy.nsi index 5f0523d..d1a4f37 100755 --- a/SetupMapProxy.nsi +++ b/SetupMapProxy.nsi @@ -21,7 +21,7 @@ ; Define your application name !define APPNAME "MapProxy" !define COMPANY "Baas geo-information" -!define VERSION 1.8.0 +!define VERSION 1.8.1 !define SEQ 0 !define APPNAMEANDVERSION "${APPNAME} ${VERSION}" !define GITPAGE "http://github.com/bartbaas/mapproxywindows" From 895d11e9a821b65a97aac0987dc43f562f30843c Mon Sep 17 00:00:00 2001 From: Bart Baas Date: Thu, 3 Dec 2015 12:07:59 +0100 Subject: [PATCH 2/6] Update project page url --- SetupMapProxy.nsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SetupMapProxy.nsi b/SetupMapProxy.nsi index d1a4f37..6f6bb04 100755 --- a/SetupMapProxy.nsi +++ b/SetupMapProxy.nsi @@ -24,7 +24,7 @@ !define VERSION 1.8.1 !define SEQ 0 !define APPNAMEANDVERSION "${APPNAME} ${VERSION}" -!define GITPAGE "http://github.com/bartbaas/mapproxywindows" +!define GITPAGE "http://baasgeo.github.io/mapproxywindows/" !define SETTINGSREGPATH "Software\Baasgeo\${APPNAME}" !define UNINSTALLREGPATH "Software\Microsoft\Windows\CurrentVersion\Uninstall" From f80e1d79f58db10b8eb20864d45009a4d0bfccf6 Mon Sep 17 00:00:00 2001 From: Bart Baas Date: Wed, 24 Feb 2016 12:57:24 +0100 Subject: [PATCH 3/6] Disable autoreload --- SetupMapProxy.nsi | 2 +- mapproxy_srv.py | 146 +++++++++++++++++++++++++--------------------- 2 files changed, 82 insertions(+), 66 deletions(-) diff --git a/SetupMapProxy.nsi b/SetupMapProxy.nsi index 6f6bb04..31c9b05 100755 --- a/SetupMapProxy.nsi +++ b/SetupMapProxy.nsi @@ -22,7 +22,7 @@ !define APPNAME "MapProxy" !define COMPANY "Baas geo-information" !define VERSION 1.8.1 -!define SEQ 0 +!define SEQ 1 !define APPNAMEANDVERSION "${APPNAME} ${VERSION}" !define GITPAGE "http://baasgeo.github.io/mapproxywindows/" !define SETTINGSREGPATH "Software\Baasgeo\${APPNAME}" diff --git a/mapproxy_srv.py b/mapproxy_srv.py index 7395420..46405c3 100755 --- a/mapproxy_srv.py +++ b/mapproxy_srv.py @@ -1,66 +1,82 @@ -""" -The most basic (working) CherryPy 3.2 WSGI Windows service possible. -Requires Mark Hammond's pywin32 package. - -Taken from here: http://tools.cherrypy.org/wiki/WindowsService and modified. -License and copyright unknown. No licence or warranty claimed on my behalf. -Inquire with source mentioned above regarding either. - -To see a list of options for installing, removing, starting, and stopping your service. - python this_file.py -To install your new service type: - python this_file.py install -Then type: - python this_file.py start - -If you get "Access Denied" you need to be admin to install, remove, start, stop. -( To run cmd as admin: Windows Key > "cmd" > CTRL+SHIFT+ENTER ) -""" -import pywintypes, pythoncom, win32api, win32serviceutil, win32service -from logging.config import fileConfig -import os.path -import sys -from cherrypy import wsgiserver -from mapproxy.wsgiapp import make_wsgi_app -if sys.hexversion > 0x03000000: - import winreg -else: - import _winreg as winreg - -# globals -version='1.0.0' -rootkey=winreg.HKEY_LOCAL_MACHINE -subkey=r'SOFTWARE\COMPANY\APP\NUM' -server_ip='0.0.0.0' - -class MyService(win32serviceutil.ServiceFramework): - """NT Service.""" - - _svc_name_ = 'MapProxy-' + version - _svc_display_name_ = 'MapProxy ' + version - _svc_description_ = 'This service runs the MapProxy tile server' - - def SvcDoRun(self): - key=winreg.OpenKey(rootkey, subkey, 0, winreg.KEY_READ) - port_to_bind=int(winreg.QueryValueEx(key, 'Port')[0]) - data_dir=str(winreg.QueryValueEx(key, 'DataDir')[0]) - app_config=data_dir + r'\mapproxy.yaml' - log_conf=data_dir + r'\log.ini' - - fileConfig(log_conf, {'here': data_dir}) - application=make_wsgi_app(app_config) - d=wsgiserver.WSGIPathInfoDispatcher({'/mapproxy': application}) - self.server=wsgiserver.CherryPyWSGIServer( (server_ip, port_to_bind), d, numthreads=10, server_name=None, max=-1, request_queue_size=2048, timeout=10, shutdown_timeout=5) - self.server.start() - - def SvcStop(self): - self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) - if self.server: - self.server.stop() - - self.ReportServiceStatus(win32service.SERVICE_STOPPED) - # very important for use with py2exe - # otherwise the Service Controller never knows that it is stopped ! - -if __name__ == '__main__': +""" +The most basic (working) CherryPy 3.2 WSGI Windows service possible. +Requires Mark Hammond's pywin32 package. + +Taken from here: http://tools.cherrypy.org/wiki/WindowsService and modified. +License and copyright unknown. No licence or warranty claimed on my behalf. +Inquire with source mentioned above regarding either. + +To see a list of options for installing, removing, starting, and stopping your service. + python this_file.py +To install your new service type: + python this_file.py install +Then type: + python this_file.py start + +If you get "Access Denied" you need to be admin to install, remove, start, stop. +( To run cmd as admin: Windows Key > "cmd" > CTRL+SHIFT+ENTER ) +""" +import pywintypes, pythoncom, win32api, win32serviceutil, win32service +from logging.config import fileConfig +import os.path +import sys +import cherrypy +from cherrypy import wsgiserver +from mapproxy.wsgiapp import make_wsgi_app +if sys.hexversion > 0x03000000: + import winreg +else: + import _winreg as winreg + +# globals +version='1.0.0' +rootkey=winreg.HKEY_LOCAL_MACHINE +subkey=r'SOFTWARE\COMPANY\APP\NUM' +server_ip='0.0.0.0' + +class MyService(win32serviceutil.ServiceFramework): + """NT Service.""" + + _svc_name_ = 'MapProxy-' + version + _svc_display_name_ = 'MapProxy ' + version + _svc_description_ = 'This service runs the MapProxy tile server' + + def SvcDoRun(self): + key=winreg.OpenKey(rootkey, subkey, 0, winreg.KEY_READ) + port_to_bind=int(winreg.QueryValueEx(key, 'Port')[0]) + data_dir=str(winreg.QueryValueEx(key, 'DataDir')[0]) + app_config=data_dir + r'\mapproxy.yaml' + log_conf=data_dir + r'\log.ini' + + cherrypy.config.update({ + 'global':{ + 'log.screen': False, + 'tools.log_tracebacks.on': True, + 'engine.autoreload.on': False, + 'engine.SIGHUP': None, + 'engine.SIGTERM': None + } + }) + + fileConfig(log_conf, {'here': data_dir}) + application=make_wsgi_app(app_config) + d=wsgiserver.WSGIPathInfoDispatcher({'/mapproxy': application}) + self.server=wsgiserver.CherryPyWSGIServer( (server_ip, port_to_bind), d, numthreads=10, server_name=None, max=-1, request_queue_size=2048, timeout=10, shutdown_timeout=5) + # Infinite loop serving requests + try: + self.server.start() + except Exception as e: + # Log an error event + servicemanager.LogErrorMsg("MapProxy failed to start:\n%s" % e) + + def SvcStop(self): + self.ReportServiceStatus(win32service.SERVICE_STOP_PENDING) + if self.server: + self.server.stop() + + self.ReportServiceStatus(win32service.SERVICE_STOPPED) + # very important for use with py2exe + # otherwise the Service Controller never knows that it is stopped ! + +if __name__ == '__main__': win32serviceutil.HandleCommandLine(MyService) \ No newline at end of file From 23edbb36f8dd2fe08592d151be5207c5ebadb295 Mon Sep 17 00:00:00 2001 From: Bart Baas Date: Thu, 4 Aug 2016 16:25:11 +0200 Subject: [PATCH 4/6] Update installer for MapProxy version 1.9.0 --- SetupMapProxy.nsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/SetupMapProxy.nsi b/SetupMapProxy.nsi index 31c9b05..d6e8269 100755 --- a/SetupMapProxy.nsi +++ b/SetupMapProxy.nsi @@ -21,8 +21,8 @@ ; Define your application name !define APPNAME "MapProxy" !define COMPANY "Baas geo-information" -!define VERSION 1.8.1 -!define SEQ 1 +!define VERSION 1.9.0 +!define SEQ 0 !define APPNAMEANDVERSION "${APPNAME} ${VERSION}" !define GITPAGE "http://baasgeo.github.io/mapproxywindows/" !define SETTINGSREGPATH "Software\Baasgeo\${APPNAME}" From 54678ecb69450cf48fc31a402d8f0697d5f1565e Mon Sep 17 00:00:00 2001 From: Bart Baas Date: Thu, 23 Feb 2017 16:12:12 +0100 Subject: [PATCH 5/6] Update installer for MapProxy version 1.9.1 Update installer for MapProxy version 1.9.1 and NSIS 3 --- SetupMapProxy.nsi | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/SetupMapProxy.nsi b/SetupMapProxy.nsi index d6e8269..4d8338b 100755 --- a/SetupMapProxy.nsi +++ b/SetupMapProxy.nsi @@ -21,7 +21,7 @@ ; Define your application name !define APPNAME "MapProxy" !define COMPANY "Baas geo-information" -!define VERSION 1.9.0 +!define VERSION 1.9.1 !define SEQ 0 !define APPNAMEANDVERSION "${APPNAME} ${VERSION}" !define GITPAGE "http://baasgeo.github.io/mapproxywindows/" @@ -92,18 +92,6 @@ VIAddVersionKey CompanyName "${COMPANY}" VIAddVersionKey LegalCopyright "${COMPANY}" VIAddVersionKey Comments "${GITPAGE}" -; Install options page headers -LangString TEXT_DATADIR_TITLE ${LANG_ENGLISH} "${APPNAME} Data Directory" -LangString TEXT_DATADIR_SUBTITLE ${LANG_ENGLISH} "${APPNAME} Data Directory path selection" -LangString TEXT_TYPE_TITLE ${LANG_ENGLISH} "Type of Installation" -LangString TEXT_TYPE_SUBTITLE ${LANG_ENGLISH} "Select the type of installation" -LangString TEXT_READY_TITLE ${LANG_ENGLISH} "Ready to Install" -LangString TEXT_READY_SUBTITLE ${LANG_ENGLISH} "${APPNAME} is ready to be installed" -LangString TEXT_CREDS_TITLE ${LANG_ENGLISH} "${APPNAME} Administrator" -LangString TEXT_CREDS_SUBTITLE ${LANG_ENGLISH} "Set administrator credentials" -LangString TEXT_PORT_TITLE ${LANG_ENGLISH} "${APPNAME} Web Server Port" -LangString TEXT_PORT_SUBTITLE ${LANG_ENGLISH} "Set the port that ${APPNAME} will respond on" - ; Interface Settings !define MUI_ICON "mapproxy.ico" !define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\win-uninstall.ico" @@ -152,6 +140,18 @@ Page custom Ready ; Summary page !insertmacro MUI_LANGUAGE "English" !insertmacro MUI_RESERVEFILE_LANGDLL +; Install options page headers +LangString TEXT_DATADIR_TITLE ${LANG_ENGLISH} "${APPNAME} Data Directory" +LangString TEXT_DATADIR_SUBTITLE ${LANG_ENGLISH} "${APPNAME} Data Directory path selection" +LangString TEXT_TYPE_TITLE ${LANG_ENGLISH} "Type of Installation" +LangString TEXT_TYPE_SUBTITLE ${LANG_ENGLISH} "Select the type of installation" +LangString TEXT_READY_TITLE ${LANG_ENGLISH} "Ready to Install" +LangString TEXT_READY_SUBTITLE ${LANG_ENGLISH} "${APPNAME} is ready to be installed" +LangString TEXT_CREDS_TITLE ${LANG_ENGLISH} "${APPNAME} Administrator" +LangString TEXT_CREDS_SUBTITLE ${LANG_ENGLISH} "Set administrator credentials" +LangString TEXT_PORT_TITLE ${LANG_ENGLISH} "${APPNAME} Web Server Port" +LangString TEXT_PORT_SUBTITLE ${LANG_ENGLISH} "Set the port that ${APPNAME} will respond on" + ; Check the user type, and quit if it's not an administrator. ; Taken from Examples/UserInfo that ships with NSIS. Function CheckUserType From 10e69debab62b00d7e87707d3b309b748f307e6a Mon Sep 17 00:00:00 2001 From: Bart Baas Date: Mon, 31 Jul 2017 10:03:39 +0200 Subject: [PATCH 6/6] Update installer for MapProxy version 1.10.0 Increment mapproxy version, changed to Pillow, added lxml --- SetupMapProxy.nsi | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SetupMapProxy.nsi b/SetupMapProxy.nsi index 4d8338b..c495288 100755 --- a/SetupMapProxy.nsi +++ b/SetupMapProxy.nsi @@ -1,5 +1,5 @@ /** - * Copyright (c) 2014 Baas geo-information + * Copyright (c) 2014-2017 Baas geo-information * * MapProxy Windows installer creation file. * @@ -21,7 +21,7 @@ ; Define your application name !define APPNAME "MapProxy" !define COMPANY "Baas geo-information" -!define VERSION 1.9.1 +!define VERSION 1.10.0 !define SEQ 0 !define APPNAMEANDVERSION "${APPNAME} ${VERSION}" !define GITPAGE "http://baasgeo.github.io/mapproxywindows/" @@ -109,7 +109,7 @@ VIAddVersionKey Comments "${GITPAGE}" !define MUI_ABORTWARNING ; Optional text settings here -!define MUI_FINISHPAGE_LINK " Installer created and maintained by B. Baas $\n ${GITPAGE}" +!define MUI_FINISHPAGE_LINK " Installer created and maintained by Baas geo-information $\n ${GITPAGE}" !define MUI_FINISHPAGE_LINK_LOCATION "${GITPAGE}" !define MUI_WELCOMEPAGE_TEXT "This wizard will guide you through the installation of ${APPNAMEANDVERSION}. \r\n\r\n\ It is recommended that you close all other applications before starting Setup.\ @@ -524,7 +524,7 @@ Section "Main" SectionMain File /r PortablePython\App ; Install mapproxy - nsExec::ExecToLog '"$INSTDIR\App\Scripts\easy_install.exe" -f "eggs" mapproxy==${VERSION} Shapely==1.2.17 pyproj==1.9.3 cherrypy==3.7.0' + nsExec::ExecToLog '"$INSTDIR\App\Scripts\easy_install.exe" -f "eggs" mapproxy==${VERSION} Shapely==1.2.17 pyproj==1.9.3 Pillow==4.2.1 cherrypy==3.8.2' nsExec::ExecToLog '"$INSTDIR\App\Scripts\mapproxy-util.exe" --version' ${If} $IsExisting == 1 Detailprint "Using existing data directory: $\r$\n$DataDir" @@ -567,7 +567,7 @@ Section -FinishSection SetShellVarContext all CreateDirectory "$SMPROGRAMS\$StartMenuFolder" CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} Homepage.lnk" "http://mapproxy.org" - CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} Installer.lnk" "http://bartbaas.github.io/MapProxyWindows/" + CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} Installer.lnk" "https://baasgeo.github.io/mapproxywindows/" ${ConfigWrite} "$INSTDIR\open_admin.py" "subkey=" "r'${SETTINGSREGPATH}\${VERSION}'" $R0 CreateShortCut "$SMPROGRAMS\$StartMenuFolder\${APPNAME} Web Admin Page.lnk" \