These are the sources of the PostGIS installer for Win32.

PostgreSQL for Windows is available from 
http://pgfoundry.org/projects/pginstaller

PostGIS is available from http://www.postgis.org

The PostGIS installer for Windows is available from http://www.postgis.org/download/windows/

The installer uses Nullsoft Installation System,
available from http://nsis.sourceforge.net

This also relies on ExecDos -- which you can download from http://nsis.sourceforge.net/ExecDos_plug-in and copy the dll to your
NSIS plugins directory (where you installed NSIS)

2010-02-15 Leo Hsu and Regina Obe
FOR THOSE IN A HURRY AND WHO DON'T WANT TO BOTHER compiling their own PostGIS
But need to release as part of a bigger setup package
----------------------------------------------------------------------------------
If you just need to customize the install process for your own specific deployment.
1) Download the windows full setup from 
http://www.postgis.org/download/windows/

2) Right-click the installer exe and extract -- the exe is really just a self-extracting zip file.
Sometimes for whatever reason, the postgisgui and other files do not fully extract.  
You can copy these from the binary builds - http://www.postgis.org/download/windows/#winbinaries.
You'll know this is the case if you get an error when you go to compile the .nsi script.
3) Copy the extracted files to the distfiles folder
4) Copy the extracted contents except for the $COMMONFILES and $PLUGINSDIR to the disfiles folder.
5) Customize the inputfile.nsh and postgis.nsi to your liking leaving out whatever you want and adding in extra stuff you want.
6) Right click the .nsi file and click the compile button. 
7) Congratulations, you should have your very own version of the PostGIS setup exe.


HOW TO USE THE NEW BUILD SYSTEM
-------------------------------
--- WARNING: THE INSTRUCTIONS BELOW THIS WARNING ARE OBSOLETE AND WE HAVEN'T HAD TIME TO UPDATE THEM -- 
Short answer -- read this http://trac.osgeo.org/postgis/wiki/UsersWikiWinCompile to learn how to compile on windows
You can probably glean hints from using the win32build.sh but will have to customize it a lot for your specific needs.
--- END WARNING --
The new build system has been to designed to enable the majority of the build
process to be automated under Win32, whilst also attempting to making it easier
for other packagers to replicate the same process where required. The steps for
building a Win32 EXE package are now as follows:


1. Download and extract the postgis-1.x.x.tar.gz file from
   http://www.postgis.org


2. Copy the contents of the win32inst directory so the distfiles
   directory can be found at postgis-1.x.x/win32inst.


3. Apply any patches from the win32inst/patches directory. Note that
   the current policy is that patches which alter the functionality
   of the official releases will not be included - only patches which
   will enhance the build process will be included.


4. Execute the win32build.sh script from MingW

   cd win32inst
   ./win32build.sh

   The script will perform the following actions:
	i)	configure
	ii)	make
	iii)	Perform regression tests
	iv)	Build the JDBC drivers
	v)	Perform the JDBC regression tests
	vi)	Generate the win32dist/ output directory under postgis-1.x.x/
	vii)	Automatically generate NSIS install/uninstall file lists

   TODO: The script currently does not halt on error, so the packager should
   verify the regression test results before producing the final package.


5. Produce the final package

   The new build system works by creating an directory structure identical to
   the PostgreSQL installer directory structure under postgis-1.x.x/ called
   win32dist containing all the files that will be installed/removed. The reason
   for introducing this step are:
   
	i) the SetOutPath/File directives now match exactly, so instead of
	having to look in different locations for library DLLs, everything
	can be found under WIN32DIST_DIR.

	ii) it becomes possible to perform a "quick install" by ZIPing the
	contents of the win32dist/ directory and sending the .ZIP file to
	a client (e.g. it is this ZIP file which is required for distribution
	to the PostgreSQL installer people)

	iii) the NSIS install/uninstall file lists can be generated by
	recursively scanning the win32dist directory.


   To produce a new NSIS package, it should simply be a case of executing
   the postgis.nsi script to produce the resulting EXE installer.


Hopefully this should greatly reduce the amount of work it takes to replicate a
Win32 PostGIS build. Any problems with this should be reported to the PostGIS
mailing lists.


MCA
2006-04-17
