summaryrefslogtreecommitdiff
path: root/setup
diff options
context:
space:
mode:
authorSimon Lejeune <sle@openerp.com>2016-09-25 14:00:04 +0200
committerSimon Lejeune <sle@openerp.com>2016-09-30 12:05:49 +0200
commit7f8ad73618fdd3af77c2587cf4b87659681990a0 (patch)
tree2481c9817df6eb3ec0cc71ca762de12c171f461f /setup
parent71705e13476c749ea0ba0aff7702f745d65d595e (diff)
[REF] packaging: windows: don't hardcode service name
Correctly pass it to the nsis script the same way it was done for the version and python version. this was a source of error at each release.
Diffstat (limited to 'setup')
-rwxr-xr-xsetup/package.py2
-rw-r--r--setup/win32/Makefile3
-rw-r--r--setup/win32/Makefile.servicename1
-rwxr-xr-xsetup/win32/setup.nsi5
4 files changed, 7 insertions, 4 deletions
diff --git a/setup/package.py b/setup/package.py
index 76f6d5cd0f8..743e9c63f18 100755
--- a/setup/package.py
+++ b/setup/package.py
@@ -199,6 +199,8 @@ class KVMWinBuildExe(KVM):
f.write("VERSION=%s\n" % self.o.version_full)
with open(join(self.o.build_dir, 'setup/win32/Makefile.python'), 'w') as f:
f.write("PYTHON_VERSION=%s\n" % self.o.vm_winxp_python_version.replace('.', ''))
+ with open(join(self.o.build_dir, 'setup/win32/Makefile.servicename'), 'w') as f:
+ f.write("SERVICENAME=%s\n" % nt_service_name)
self.ssh("mkdir -p build")
self.rsync('%s/ %s@127.0.0.1:build/server/' % (self.o.build_dir, self.login))
diff --git a/setup/win32/Makefile b/setup/win32/Makefile
index ab8bc88831d..c0d33c904b1 100644
--- a/setup/win32/Makefile
+++ b/setup/win32/Makefile
@@ -1,5 +1,6 @@
include Makefile.version
include Makefile.python
+include Makefile.servicename
SERVER_DIRECTORY=../..
FILES_DIRECTORY=release
@@ -7,7 +8,7 @@ FILES_DIRECTORY=release
LAUNCH_PY2EXE_SERVICE=/cygdrive/c/python${PYTHON_VERSION}/python.exe win32_setup.py py2exe
LAUNCH_PY2EXE=/cygdrive/c/python${PYTHON_VERSION}/python.exe setup.py py2exe
-MAKENSIS_ARGUMENTS=/DVERSION=$(VERSION)
+MAKENSIS_ARGUMENTS=/DVERSION=$(VERSION) /DSERVICENAME=${SERVICENAME}
LAUNCH_MAKENSIS=/cygdrive/c/cygwin/makensis $(MAKENSIS_ARGUMENTS) setup.nsi
diff --git a/setup/win32/Makefile.servicename b/setup/win32/Makefile.servicename
new file mode 100644
index 00000000000..bf47e07d731
--- /dev/null
+++ b/setup/win32/Makefile.servicename
@@ -0,0 +1 @@
+SERVICENAME= \ No newline at end of file
diff --git a/setup/win32/setup.nsi b/setup/win32/setup.nsi
index dc0552dc4ec..a243c39b12a 100755
--- a/setup/win32/setup.nsi
+++ b/setup/win32/setup.nsi
@@ -236,11 +236,10 @@ Section $(TITLE_OpenERP_Server) SectionOpenERP_Server
nsExec::Exec '"$INSTDIR\server\openerp-server.exe" --stop-after-init --logfile "$INSTDIR\server\openerp-server.log" -s'
nsExec::Exec '"$INSTDIR\service\win32_service.exe" -auto -install'
- # TODO: don't hardcode the service name
- nsExec::Exec "net stop odoo-server-10.0"
+ nsExec::Exec "net stop ${SERVICENAME}"
sleep 2
- nsExec::Exec "net start odoo-server-10.0"
+ nsExec::Exec "net start ${SERVICENAME}"
sleep 2
SectionEnd