summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--etc/Makefile.am7
-rw-r--r--etc/windows/couchdb.iss.tpl18
2 files changed, 23 insertions, 2 deletions
diff --git a/etc/Makefile.am b/etc/Makefile.am
index 2ff298ad..f83b0efb 100644
--- a/etc/Makefile.am
+++ b/etc/Makefile.am
@@ -28,7 +28,7 @@ nobase_sysconf_DATA = $(default_sysconf_data) $(init_sysconf_data)
EXTRA_DIST = $(init_sysconf_data)
if WINDOWS
-EXTRA_DIST += windows/setup-couchdb-@version@.exe
+EXTRA_DIST += windows/setup-couchdb-@version@.exe.md5
endif
CLEANFILES = $(init_DATA) $(default_sysconf_data) $(launchd_DATA)
@@ -84,6 +84,7 @@ windows/couchdb.iss: windows/couchdb.iss.tpl FORCE
-e "s|%package_name%|@package_name@|g" \
-e "s|%locallibbindir%|`cygpath -m @locallibbindir@`|g" \
-e "s|%version%|@version@|g" \
+ -e "s|%erts_version%|`$(ERL) -version 2>&1 | $(SED) 's/[^0-9\.]//g'`|g" \
-e "s|%openssl_bin_dir%|@openssl_bin_dir@|g" \
-e "s|%msvc_redist_dir%|@msvc_redist_dir@|g" \
-e "s|%msvc_redist_name%|@msvc_redist_name@|g" \
@@ -95,6 +96,10 @@ windows/setup-couchdb-@version@.exe: windows/couchdb.iss windows/README.txt FORC
$(INNO_COMPILER_EXECUTABLE) /q $<
@echo Windows Installer is at: `cygpath -a -w windows/setup-couchdb-@version@.exe`
+windows/setup-couchdb-@version@.exe.md5: windows/setup-couchdb-@version@.exe
+ md5sum $< > $@
+ @echo Windows Installer is at: `cygpath -a -w windows/setup-couchdb-@version@.exe`
+
FORCE:
endif
diff --git a/etc/windows/couchdb.iss.tpl b/etc/windows/couchdb.iss.tpl
index b673113e..6efee0aa 100644
--- a/etc/windows/couchdb.iss.tpl
+++ b/etc/windows/couchdb.iss.tpl
@@ -30,7 +30,7 @@ Source: "%locallibbindir%\..\*.*"; DestDir: "{app}"; Flags: ignoreversion uninsr
; bin dir
Source: "%locallibbindir%\*.*"; DestDir: "{app}\bin"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs
; other dirs copied '*.*'
-Source: "%locallibbindir%\..\erts-5.7.2\*.*"; DestDir: "{app}\erts-5.7.2"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs
+Source: "%locallibbindir%\..\erts-%erts_version%\*.*"; DestDir: "{app}\erts-%erts_version%"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs
Source: "%locallibbindir%\..\lib\*.*"; DestDir: "{app}\lib"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs
Source: "%locallibbindir%\..\share\*.*"; DestDir: "{app}\share"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs
Source: "%locallibbindir%\..\releases\*.*"; DestDir: "{app}\releases"; Flags: ignoreversion uninsrestartdelete restartreplace recursesubdirs
@@ -62,7 +62,23 @@ Name: "{group}\Start CouchDB"; Filename: "{app}\bin\couchdb.bat"
Name: "{group}\Futon (CouchDB web interface)"; Filename: "http://127.0.0.1:5984/_utils"
Name: "{group}\CouchDB Web Site"; Filename: "http://couchdb.apache.org/"
+[Tasks]
+Name: service; Description: "Install couchdb as a Windows service"
+Name: service\start; Description: "Start the service after installation"
+
[Run]
Filename: "{tmp}\%msvc_redist_name%"; Parameters: "/q"
; This is erlang's Install.exe which updates erl.ini correctly.
Filename: "{app}\Install.exe"; Parameters: "-s"; Flags: runhidden
+
+; Commands for a service
+; First attempt to nuke an existing service of this name, incase they are
+; reinstalling without uninstalling
+Filename: "{app}\erts-%erts_version%\bin\erlsrv.exe"; Parameters: "remove ""%package_name%"""; Tasks: service
+; add a new one
+Filename: "{app}\erts-%erts_version%\bin\erlsrv.exe"; Parameters: "add ""%package_name%"" -w ""{app}\bin"" -ar ""-sasl errlog_type error -s couch"" -c ""%package_name% %version%"""; Tasks: service
+; and start it if requested
+Filename: "{app}\erts-%erts_version%\bin\erlsrv.exe"; Parameters: "start ""%package_name%"""; Tasks: service\start
+
+[UninstallRun]
+Filename: "{app}\erts-%erts_version%\bin\erlsrv.exe"; Parameters: "remove ""%package_name%"""; Tasks: service