Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Preserve existing configuration files during installation.

This is achieved by renaming any existing configuration files as a pre-install step.
As a post-install step and renamed files are then moved back to their original position (overwriting the config files that came with the installer).
  • Loading branch information...
commit 2b1640622f05ba67fb4c984e05a19fe9d59ac2bb 1 parent e71f1ff
Sander Niemeijer authored April 09, 2013
2  extra/macosx/diskimage/Installation.txt
... ...
@@ -1,8 +1,6 @@
1 1
 Installation of the Hiawatha webserver
2 2
 =======================================
3 3
 
4  
-If you've already installed the Hiawatha webserver on this machine, make a backup of the files in /usr/local/etc/hiawatha or /etc/hiawatha.
5  
-
6 4
 Double-click the .pkg file to start the installation and follow the instructions on the screen. This will install Hiawatha in /usr/local. The configuration files can be found in /usr/local/etc/hiawatha.
7 5
 
8 6
 Open a Terminal and execute 'sudo /usr/local/sbin/hiawatha' to start the Hiawatha webserver.
11  extra/macosx/scripts/postinstall
... ...
@@ -0,0 +1,11 @@
  1
+#!/bin/sh
  2
+
  3
+cd /usr/local/etc/hiawatha
  4
+
  5
+files="cgi-wrapper.conf hiawatha.conf index.xslt mimetype.conf"
  6
+
  7
+for file in $files ; do
  8
+  if [ -f $file.installer.backup ]; then
  9
+     mv $file.installer.backup $file
  10
+  fi
  11
+done
11  extra/macosx/scripts/preinstall
... ...
@@ -0,0 +1,11 @@
  1
+#!/bin/sh
  2
+
  3
+cd /usr/local/etc/hiawatha
  4
+
  5
+files="cgi-wrapper.conf hiawatha.conf index.xslt mimetype.conf"
  6
+
  7
+for file in $files ; do
  8
+  if [ -f $file ]; then
  9
+     mv $file $file.installer.backup
  10
+  fi
  11
+done
2  extra/make_macosx_package
@@ -55,7 +55,7 @@ cp ../extra/macosx/org.hiawatha-webserver.httpd.plist root/Library/LaunchDaemons
55 55
 echo "-- Building package"
56 56
 cp -r ../extra/macosx/diskimage .
57 57
 version=`grep VERSION config.h | cut -f2 -d'"'`
58  
-pkgbuild --root root --version ${version} --identifier org.hiawatha-webserver.httpd hiawatha.pkg
  58
+pkgbuild --root root --scripts ../extra/macosx/scripts --version ${version} --identifier org.hiawatha-webserver.httpd hiawatha.pkg
59 59
 productbuild --distribution ../extra/macosx/Distribution.xml --resources ../extra/macosx diskimage/hiawatha-${version}.pkg 
60 60
 echo "-- Buiding disk image"
61 61
 hdiutil create ../"Hiawatha ${version}".dmg -srcfolder diskimage -volname "Hiawatha ${version}" -ov

0 notes on commit 2b16406

Please sign in to comment.
Something went wrong with that request. Please try again.