Thread: Install Postgre while installing Other software.

Install Postgre while installing Other software.

From
Iñigo Barandiaran
Date:
Hi all!
I'm trying to use Postgre as a DataBase manager of a Software I'm developing. I would like to know how to integrate an installation of Postgre in the installation of my own software. I mean, I need to firstly install Postgre, and when it finishes The rest of the installation of my software would continue. I've done some test with postgresql-8.3.5-1-windows.exe (on-click installer) but when it finishes and tries to run the server it crashes. Do any of you knows why this occurs?.  I tried this version because I think it would be easiest for the user because It only shows one or two windows to the users, and they dont need to select many options.
Do you have any experience in the distribution of a Postgre installation in your own developed software? How would you do it?

Thank you in advance for your help.

Best,
Iñigo.

Re: Install Postgre while installing Other software.

From
Raymond O'Donnell
Date:
On 07/02/2009 15:40, Iñigo Barandiaran wrote:
> I'm trying to use Postgre as a DataBase manager of a Software I'm
> developing. I would like to know how to integrate an installation of Postgre
> in the installation of my own software. I mean, I need to firstly install

The community installer (pgInstaller) has a silent-install option which
I understand is intended for just this scenario.

BTW, the accepted abbreviation of PostgreSQL is "postgres", not "postgre".

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

Re: Install Postgre while installing Other software.

From
Iñigo Barandiaran
Date:
Hi Raymond!

Thanks for your answer. I'm going to take a look to the silent option you mentioned.
Any link related with this topic would be very appreciated.

Thanks in advance!

Best,

2009/2/7 Raymond O'Donnell <rod@iol.ie>
On 07/02/2009 15:40, Iñigo Barandiaran wrote:
> I'm trying to use Postgre as a DataBase manager of a Software I'm
> developing. I would like to know how to integrate an installation of Postgre
> in the installation of my own software. I mean, I need to firstly install

The community installer (pgInstaller) has a silent-install option which
I understand is intended for just this scenario.

BTW, the accepted abbreviation of PostgreSQL is "postgres", not "postgre".

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

Re: Install Postgre while installing Other software.

From
Iñigo Barandiaran
Date:
Hi.

I've found this page about silent install that was very usefull for me: http://pginstaller.projects.postgresql.org/silent.html

Now, I've found another problem. I'm able to install PostgreSQL with my software in silent mode, but the problem comes when I do un-install. The problem is related with service account.
I'm currently using the followin settings for install:

msiexec /i postgresql-8.3-int.msi  /qr INTERNALLAUNCH=1 DOINITDB=1 CREATESERVICEUSER=1 ADDLOCAL=server,psql,pgadmin BASEDIR="c:\postgres" SERVICEDOMAIN="%COMPUTERNAME%" SERVICEPASSWORD="AnyPassWord" SUPERPASSWORD="AnyPassWord2

If I do un-install the service account is not removed, so next time I try to install the software again the service account name (posgres) exists so It can not be created again, so the installation progress stops, rolling back.
Do you know how can I remove posgres service account while un-installing? or maybe Do you know how to chek if the postgres user exist while installing, so therefore the installation process could create or login with that user?

Thank in advance!

2009/2/7 Iñigo Barandiaran <ibarandiaran@vicomtech.org>
Hi Raymond!

Thanks for your answer. I'm going to take a look to the silent option you mentioned.
Any link related with this topic would be very appreciated.

Thanks in advance!

Best,

2009/2/7 Raymond O'Donnell <rod@iol.ie>

On 07/02/2009 15:40, Iñigo Barandiaran wrote:
> I'm trying to use Postgre as a DataBase manager of a Software I'm
> developing. I would like to know how to integrate an installation of Postgre
> in the installation of my own software. I mean, I need to firstly install

The community installer (pgInstaller) has a silent-install option which
I understand is intended for just this scenario.

BTW, the accepted abbreviation of PostgreSQL is "postgres", not "postgre".

Ray.


------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------


Re: Install Postgre while installing Other software.

From
John R Pierce
Date:
Iñigo Barandiaran wrote:
> If I do un-install the service account is not removed, so next time I
> try to install the software again the service account name (posgres)
> exists so It can not be created again, so the installation progress
> stops, rolling back.
> Do you know how can I remove posgres service account while
> un-installing? or maybe Do you know how to chek if the postgres user
> exist while installing, so therefore the installation process could
> create or login with that user?

    NET USER POSTGRES /DELETE


or some sort of WSH WMI magic....

the problem with reusing an existing service account, you don't know its
password

silly question, what will your installer do if there is a preexisting
Postgres install on the target system?




Re: Install Postgre while installing Other software.

From
Iñigo Barandiaran
Date:
Thank you all for your answers!.

This solve one of my problems :) THANKS!!!

John, thats a very good question. I've already thought about that, but I've no idea how to act yet. Becuase, as you said, if there is already a posgre Database server installed in the target system, and I dont know the password, what can i do? I can not delete the existing user account because I would be affecting other software. What about if I create another service user account, with a different name, such as MyPostgreUserAccount? That way I ensure that I'm creating/deleting the Postgre User of my application. What do you think?

Thanks in advance!!

2009/2/8 John R Pierce <pierce@hogranch.com>
Iñigo Barandiaran wrote:
If I do un-install the service account is not removed, so next time I try to install the software again the service account name (posgres) exists so It can not be created again, so the installation progress stops, rolling back.
Do you know how can I remove posgres service account while un-installing? or maybe Do you know how to chek if the postgres user exist while installing, so therefore the installation process could create or login with that user?

  NET USER POSTGRES /DELETE


or some sort of WSH WMI magic....

the problem with reusing an existing service account, you don't know its password

silly question, what will your installer do if there is a preexisting Postgres install on the target system?




--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Re: Install Postgre while installing Other software.

From
Iñigo Barandiaran
Date:
Hi John.

Thanks for your comment.

You are right. I als think that option A is the best, but the problem, as you mentioned, it is only suitable for knowlegeable, that  I might is not the general case. The "normal" end user only wants to use the software without knowing anything about data bases etc. I think the only suitable option is C, taking into account that maybe is not the most efficient, in terms of memmory or disc consumptions.

And thanks for the comment about IO port. You are right. If we installl a separate paralell distribution, we should change the IO port defined by default.

Thanks again!!!!!!!!

2009/2/8 John R Pierce <pierce@hogranch.com>
Iñigo Barandiaran wrote:
Thank you all for your answers!.

This solve one of my problems :) THANKS!!!

John, thats a very good question. I've already thought about that, but I've no idea how to act yet. Becuase, as you said, if there is already a posgre Database server installed in the target system, and I dont know the password, what can i do? I can not delete the existing user account because I would be affecting other software. What about if I create another service user account, with a different name, such as MyPostgreUserAccount? That way I ensure that I'm creating/deleting the Postgre User of my application. What do you think?

if you install a seperate copy of postgres, in its own directory, with its own service account, you'll also need to change its IO port.


perhaps a better option would be to notify the user that postgres was already installed on the system, and ask the user if

  A) they want to use the existing postgres (which would have to be version 8.something you require naturally) and if so, what the postgres account password is so you can create your databases (note this isn't the service account password, this is the password of the postgres database superuser.

or,
  B) if they don't want the current postgres, tell them they can uninstall it via add/remove and restart your installler

or,
  C) said seperate parallel installation, with its own dir, port, and account.


obviously, option A) is only suitable for the knowlegeable user.