Create a working minimal cygwin with postgres install.
Delete unwanted utilities and files.
Test if you can start, stop, initdb, and query Postgres.
Use the attached pgsql.iss script to make the install.
Notes:
My version of the console program may be different than what is up on winmaster. I sent all my changes to Igor, but I have never been able to compile what he sends back. I'm not sure what compiler he is using, I am building mine with gcc and MSVC.
The registry entries are very important, make sure you don't mess with them too much.
You asked how I managed the "run as service" issue. I handled it by ignoring it. I do not setup the run as service option because, IMHO, it is too hard to ensure that the setup works without any problems. I modified the console program to take care of the issues of running PostgreSQL under cygwin, including cygipc. If I were to add "run as a service" I would write a service program that wrapped the cygwin and cygipc details in much the same way as the console program does.
Further thoughts about "run as service." My install is aimed at Windows power users, not back office guys. PostgreSQL with cygwin is not ready for the back office, the biggest problems are the limit of concurrent connections and performance. I don't trust cygwin as a reliable service, so adding the option "run as a service" may just encourage them to do so. I think that would do more harm than not having the option. When PostgreSQL has a native Windows version, I'll add it. Until then, I think of it more as a "desktop" version for small offices and developers. The "server" version currently only runs on UNIX
Justin Clift wrote:
mlw wrote:Sorry, I think there was a misunderstanding. What were you looking for?
Sorry Mark, I just thought you were busy.
Was wondering if you were going to make a project of it somewhere, so we can get things together and have a really decent release for Windows when 7.4 comes out. :)
I used inno setup as well. If you want I can send my install script.That would be really cool. :) How did you handle the user and "Log on as a service" aspects of it? :)I thought I was being very forth coming.
Yep, you 100% have a really good attitude, that's why I thought you were busy.
:)
I even help out on the Windows PG console window.
Took a look at it, and the three buttons seem permanently greyed out in the download from the WinMaster project. Wasn't sure if it was a configuration issue on my part, or if the code hadn't been fleshed out yet.
Interested in making a project on GBorg or something for the "complete Windows installer" as a place to work out of?
:-)
Regards and best wishes,
Justin Clift
; PostgreSQL for Windows by Mohawk Software ; Copyright (C) 2002-2003 Mark L. Woodward ; ; This file is free software; you can redistribute it and/or ; modify it under the terms of the GNU General Public ; License as published by the Free Software Foundation; either ; version 2 of the License, or (at your option) any later version. ; ; This file is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ; Library General Public License for more details. ; ; You should have received a copy of the GNU General Public ; License along with this file; if not, write to the Free ; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, ; MA 02111-1307, USA ; ; If you want support or to commercially license this file, the author ; can be reached at [EMAIL PROTECTED] [Setup] AppName=PostgreSQL AppVerName=PostgreSQL 7.3 for Windows AppPublisher=Mohawk Software AppPublisherURL=http://www.mohawksoft.com AppSupportURL=http://www.mohawksoft.com AppUpdatesURL=http://www.mohawksoft.com DefaultDirName={sd}\PostgreSQL DisableStartupPrompt=yes DefaultGroupName=PostgreSQL AllowNoIcons=yes SourceDir=e:\pginstall\source OutputBaseFilename=pgsetup OutputDir=e:\pginstall\PostgreSQL [Registry] Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2"; ValueType: String; ValueName: "cygdrive prefix"; ValueData: "/disks"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2"; ValueType: dword; ValueName: "cygdrive flags"; ValueData: "34"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/"; ValueType: String; ValueName: "native"; ValueData: "{app}"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/"; ValueType: dword; ValueName: "flags"; ValueData: "$0A"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin"; ValueType: String; ValueName: "native"; ValueData: "{app}/bin"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/bin"; ValueType: dword; ValueName: "flags"; ValueData: "$0A"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib"; ValueType: String; ValueName: "native"; ValueData: "{app}/lib"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/lib"; ValueType: dword; ValueName: "flags"; ValueData: "$0A"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/X11R6/lib/X11/fonts"; ValueType: String; ValueName: "native"; ValueData: "{app}\\usr\\X11R6\\lib\\X11\\fonts"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\mounts v2\/usr/X11R6/lib/X11/fonts"; ValueType: dword; ValueName: "flags"; ValueData: "$0A"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "SOFTWARE\Cygnus Solutions\Cygwin\Program Options"; Flags: uninsdeletekeyifempty ; Registry entries for PostgreSQL Server Console Root: HKLM; Subkey: "Software\CygConsole"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\PostgreSQL"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\PostgreSQL"; ValueType: String; ValueName: "command"; ValueData: "{app}/bin/bash --login -c ""postmaster -D /data"" "; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\PostgreSQL"; ValueType: String; ValueName: "prerun"; ValueData: "{app}/bin/ipc-daemon.exe"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\PostgreSQL"; ValueType: String; ValueName: "kill"; ValueData: "{app}/bin/kill.exe"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\PostgreSQL"; ValueType: String; ValueName: "pidfile"; ValueData: "{app}/data/postmaster.pid"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\PostgreSQL"; ValueType: String; ValueName: "bindir"; ValueData: "{app}/bin"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\PostgreSQL"; ValueType: String; ValueName: "logfile"; ValueData: "{app}\postgresql.log"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\PostgreSQL"; ValueType: String; ValueName: "logout"; ValueData: "TRUE"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\PostgreSQL"; ValueType: String; ValueName: "title"; ValueData: "PostgreSQL Server"; Flags: uninsdeletekeyifempty ; Registry entries for pgsetup Root: HKLM; Subkey: "Software\CygConsole\pgsetup"; ValueType: String; ValueName: "command"; ValueData: "{app}/bin/bash --login -c ""pgsetup.sh {username}"" "; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\pgsetup"; ValueType: String; ValueName: "prerun"; ValueData: "{app}/bin/ipc-daemon.exe"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\pgsetup"; ValueType: String; ValueName: "kill"; ValueData: ""; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\pgsetup"; ValueType: String; ValueName: "pidfile"; ValueData: ""; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\pgsetup"; ValueType: String; ValueName: "bindir"; ValueData: "{app}/bin"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\pgsetup"; ValueType: String; ValueName: "title"; ValueData: "Creating Database Environment"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\pgsetup"; ValueType: String; ValueName: "stopquit"; ValueData: "TRUE"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\pgsetup"; ValueType: String; ValueName: "shutdown"; ValueData: "PostgreSQL Shutdown"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\pgsetup"; ValueType: String; ValueName: "logfile"; ValueData: "{app}\setup.log"; Flags: uninsdeletekeyifempty Root: HKLM; Subkey: "Software\CygConsole\pgsetup"; ValueType: String; ValueName: "logout"; ValueData: "TRUE"; Flags: uninsdeletekeyifempty [Components] Name: pgsql; Description: "Install PostgreSQL Database Environment"; types: full compact custom; ExtraDiskSpaceRequired: 32657356 Name: initdb; Description: "Create initial database (This is required to use PostgreSQL)"; types: full compact custom ; ExtraDiskSpaceRequired: 24478715; Name: unix; Description: "Text Console Administration Tools (For Power Users)"; ExtraDiskSpaceRequired: 1024; types: full compact; [Tasks] Name: lowperf; Description: "Light performance (Uses less memory)"; GroupDescription: "Performance"; Components: pgsql; Flags: exclusive unchecked ; Name: userperf; Description: "Standard performance"; GroupDescription: "Performance"; Flags: exclusive ; Components: pgsql Name: highperf; Description: "High performance (Uses more memory)"; GroupDescription: "Performance"; Flags: exclusive unchecked ; Components: pgsql Name: open; Description: "No Network Security (All clients can connect)"; GroupDescription: "Network Security"; Flags: exclusive unchecked ; Components: pgsql Name: user; Description: "Only local users can access database"; GroupDescription: "Network Security"; Flags: exclusive ; Components: pgsql Name: closed; Description: "Very secure (User must configure system)"; GroupDescription: "Network Security"; Flags: exclusive unchecked ; Components: pgsql Name: startmenu; Description: "Put PostgreSQL in Startup Folder"; GroupDescription: "Startup Options"; Components: pgsql;Flags: exclusive unchecked ; [Files] Source: "PostgreSQL\*.*"; DestDir: "{app}"; CopyMode: alwaysoverwrite; Flags: recursesubdirs; Components: pgsql Source: "cygconsole.exe"; DestDir: "{app}\bin"; CopyMode: alwaysoverwrite ; Components: pgsql Source: "pgsetup.sh"; DestDir: "{app}\bin"; CopyMode: alwaysoverwrite; Components: pgsql Source: "pgsql.bat"; DestDir: "{app}\bin"; CopyMode: alwaysoverwrite; Components: pgsql Source: "pgshell.bat"; DestDir: "{app}\bin"; CopyMode: alwaysoverwrite; Components: pgsql Source: "profile"; DestDir: "{app}\etc"; CopyMode: alwaysoverwrite; Components: pgsql ; Choose which postgresql.conf.sample to install Source: "postgresql.conf.highperf"; DestDir: "{app}/usr/share/postgresql"; DestName: postgresql.conf.sample; Tasks: highperf ; Components: pgsql Source: "postgresql.conf.user"; DestDir: "{app}/usr/share/postgresql"; DestName: postgresql.conf.sample; Tasks: userperf ; Components: pgsql Source: "postgresql.conf.sample"; DestDir: "{app}/usr/share/postgresql"; DestName: postgresql.conf.sample; Tasks: lowperf ; Components: pgsql ; Choose which pg_hba.conf.sample to install Source: "pg_hba.conf.user"; DestDir: "{app}/usr/share/postgresql"; DestName: pg_hba.conf.sample; Tasks: user ; Components: pgsql Source: "pg_hba.conf.open"; DestDir: "{app}/usr/share/postgresql"; DestName: pg_hba.conf.sample; Tasks: open ; Components: pgsql Source: "pg_hba.conf.closed"; DestDir: "{app}/usr/share/postgresql"; DestName: pg_hba.conf.sample; Tasks: closed ; Components: pgsql [Icons] Name: "{group}\PostgreSQL Server"; Filename: "{app}\bin\cygconsole.exe" ; WorkingDir: "{app}\bin"; Parameters: "PostgreSQL"; Components: pgsql ; Flags: runminimized; Name: "{userstartup}\PostgreSQL Server"; Filename: "{app}\bin\cygconsole.exe" ; WorkingDir: "{app}\bin"; Parameters: "PostgreSQL"; Components: pgsql; Tasks: startmenu; Name: "{group}\PSQL Samples"; Filename: "{app}\bin\pgsql.bat" ; WorkingDir: "{app}\bin"; Parameters: "{app}\bin samples" ; Components: unix Name: "{group}\PSQL Public"; Filename: "{app}\bin\pgsql.bat" ; WorkingDir: "{app}\bin"; Parameters: "{app}\bin public" ; Components: unix Name: "{group}\PostgreSQL System Console"; Filename: "{app}\bin\pgshell.bat" ; WorkingDir: "{app}\bin"; Parameters: "{app}\bin" ; Components: unix; [run] Filename: "{app}\bin\cygconsole"; Description: "Creating Database Structure"; Parameters: "pgsetup"; Components: initdb [Messages] WelcomeLabel2=This program installs The PostgreSQL Server
---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]