Opened 8 years ago

Closed 4 years ago

#1597 closed enhancement (wontfix)

Unattended/Silent postgis installation

Reported by: kmq Owned by: robe
Priority: medium Milestone: PostGIS 2.2.0
Component: build/upgrade/install Version: 2.0.x
Keywords: Cc:

Description

I changed the postgis nsis installer script to support the /S switch which enables silent installations. Basically all MessageBoxes? get default values and the switches

  • /USERNAME=<username>
  • /PASSWORD=<password>
  • /PORT=<port>
  • /DATABASE=<database>

get read from the command line.

Attached is a patch against postgis.nsi as found in http://pgfoundry.org/frs/download.php/3146/postgis-pg84-1.5.3-installersrc.zip

Is there a chance that this can get included in the official installer ?

Attachments (1)

postgis_silent.nsi (4.7 KB) - added by kmq 8 years ago.

Download all attachments as: .zip

Change History (15)

Changed 8 years ago by kmq

Attachment: postgis_silent.nsi added

comment:1 Changed 8 years ago by kmq

Component: postgisbuild/upgrade/install
Owner: changed from pramsey to strk
Type: defectenhancement

comment:2 Changed 8 years ago by robe

Owner: changed from strk to robe

comment:3 Changed 8 years ago by pramsey

robe?

comment:4 Changed 8 years ago by robe

Yes? I asked him to put it here. Was planning to incorporate on my next release, but Hmm forgot about it for 2.0.0 oh well.

Keep it open. I'll get to it in a week or so and close out once I've tested on my local.

comment:5 Changed 8 years ago by robe

kmq - I'm not having any luck patching my nsi file with this git patch. Can you just send me the full .nsi file.

Thanks, Regina

comment:6 Changed 8 years ago by robe

nevermind. I think I just had to remove the email headers. Seems to have patched something.

comment:7 Changed 8 years ago by robe

Resolution: fixed
Status: newclosed

Okay seems to still compile so that's good. I'll cut in the changes on all the 1.5.4 and do a silent test install.

comment:8 Changed 7 years ago by yecarrillo

Resolution: fixed
Status: closedreopened

/DATABASE parameter has no effect. None database is created.

comment:9 Changed 7 years ago by kmq

What environment did you try that in ? Can you post your full commandline and any other details like the user postgres is run as, the user that issued the command and so on ?

comment:10 Changed 7 years ago by robe

yecarillo,

Can you also let us know which installer you are using. It's now packaged with the 1.5.4+, 2.0.1 versions I think. I forget if I have it in 2.0.0 or not. I might not.

comment:11 Changed 7 years ago by yecarrillo

Milestone: PostGIS 1.5.4PostGIS Future
Version: 1.5.X2.0.x

Environment: Windows 7 Professional Using NSIS Unicode for making installer

File: postgis-pg92-setup-2.0.1-1.exe

Code snipped:

...
RequestExecutionLevel admin
...

;copiar los archivos de PostGIS
Section 'PostGIS: Motor Espacial de Base de datos'
  SectionIn 1

  DetailPrint 'Sección 3 - Motor Espacial de Base de Datos PostGIS a $INSTDIR${POSTGRES_DIR}'
  DetailPrint '  instalando el motor espacial de base de datos PostGIS ${POSTGRES_VER} a $INSTDIR${POSTGRES_DIR}...'  
  
  ;http://trac.osgeo.org/postgis/ticket/1597
  SetOutPath '$TEMP'  
  ExecWait 'postgis-pg92-setup-${POSTGIS_VER}.exe /S /USERNAME=postgres /PASSWORD=postgres /PORT=${POSTGRES_PORT} /DATABASE=mafe' $0
  ;sleep 30000
  DetailPrint '  la instalación de PostGIS ${POSTGIS_VER} devolvió $0'
SectionEnd

PostGIS is successfully installed and template database is created. But, spatial database from /DATABASE isn´t created.

This the code what I put to create it, but is supposed /DATABASE do that:

...
RequestExecutionLevel admin
...
;copiar los archivos de PostGIS
Section 'PostGIS: Motor Espacial de Base de datos'
  SectionIn 1

  DetailPrint 'Sección 3 - Motor Espacial de Base de Datos PostGIS a $INSTDIR${POSTGRES_DIR}'
  DetailPrint '  instalando el motor espacial de base de datos PostGIS ${POSTGRES_VER} a $INSTDIR${POSTGRES_DIR}...'  
  
  ;http://trac.osgeo.org/postgis/ticket/1597
  SetOutPath '$TEMP'  
  ExecWait 'postgis-pg92-setup-${POSTGIS_VER}.exe /S /USERNAME=postgres /PASSWORD=postgres /PORT=${POSTGRES_PORT}' $0
  ;sleep 30000
  DetailPrint '  la instalación de PostGIS ${POSTGIS_VER} devolvió $0'

  ;Crear la base de datos de mafe
  DetailPrint '  creando la base de datos mafe...'
  ExecWait '$INSTDIR${POSTGRES_DIR}\bin\createdb.exe -h "127.0.0.1" -p "${POSTGRES_PORT}" -U "postgres" -T "template_postgis_20" --owner "postgres" mafe'
SectionEnd

comment:12 Changed 5 years ago by robe

Milestone: PostGIS FuturePostGIS 2.2.0

comment:13 Changed 5 years ago by robe

Note as of 2.1 I am no longer creating template database. However I did leave in the sample database option. I think the issue is that for silen install, its turned off. I think I need to add another option to silent install for YES/NO to create the sample database.

comment:14 Changed 4 years ago by robe

Resolution: wontfix
Status: reopenedclosed
Note: See TracTickets for help on using tickets.