Visual Studio Installer Projects with Postgresql

Asked

Viewed 128 times

1

I am starting a Windows Form C#project, a commercial application that the user downloads, installs and uses, without complications. It is possible to configure Visual Studio Installer Projects to install Postgresql together without the user noticing, totally transparent?

  • 1

    See if it’s not worth doing a UWP project instead of Winforms.

  • Hello @Thiagolunardi, thanks for the tip. I have to ensure compatibility with at least Windows XP. Reason: Many small business customers who don’t want to trade their hardware.

2 answers

2

Using Powershell from VSI, it is possible yes:

Simple installation:

Import-Module Install-Postgres
Install-Postgres -User "postgres" -Password "ChangeMe!"

With more parameterizations:

Install-Postgres  
-User "postgres"  
-Password "ChangeMe!"  
-InstallUrl "http://get.enterprisedb.com/postgresql/postgresql-9.3.5-1-windows-x64.exe"  
-InstallPath "C:\Program Files\PostgreSQL\9.3"  
-DataPath "C:\Program Files\PostgreSQL\9.3\data"  
-Locale "Romanian, Romania"  
-Port 5432  
-ServiceName "postgresql"

Source: http://blog.veritech.io/2014/10/postgresql-unattended-install.html

2


You can group Postgresql binaries into your application, but not incorporate them into the same process. You will need to invoke initdb, pg_ctl, etc. in your application and manage postgres startup and shutdown.

It works well, but it can’t be complicated.

Do not use standard port 5432 or send the official postgres installer and run it in silent mode. This confuses users a lot when they wonder where "postgres" came from and they informed about the mailing lists about our "adware" or "stealth installation" or whatever. Instead, group the binaries of . zip, the pre-compiled installation tree, or whatever. And don’t run on port 5432.

Remember to include the MSVC runtime for the postgres binaries you’re using, if they need a different one for your app.

There is much advice on how to do this in more detail.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.