Search code examples
c#postgresqldeploymentsetup-deployment

Deploying Postgresql Along Windows Application


I have WPF application which using Postgresql as Database engine. I want to install Postgresql engine and restore/attach application-Db to it.

The application's users are non-technical people and they can not install Postgresql individually.


Solution

  • The application's users are non-technical people and they can not install Postgresql individually.

    then try this , silently install PostgreSQL, we are using the similar code in our software deployment

    C:\Installer\postgresql-9.0.2-1-windows.exe  --serverport 5432 --servicename postgres_service --locale C --superaccount Myadmin --superpassword Mypassword --unattendedmodeui minimal --debuglevel 2 --mode unattended 
    

    run this as the bat file , install in the background

    1. postgresql-9.0.2-1-windows.exe

    This is your exe

    1. serverport 5432

    This is your port number where you want to install Postgres

    1. superaccount Myadmin

    You use account name

    1. superpassword Mypassword

    Your user password

    keep the rest same. This will directly install to c:\Program Files