0

This is somewhat an update to question1 and question2. After realizing that postgres could be bundled with its database already initialized, and even with mock-up data inside (yay) I modified my NSIS installer to just copy-paste the postgres inside the installation folder of my application and then create and start it as a Service listening to a non-standard port.

The problem is that when the application is installed in the Program Files folder the Service is created, but cannot start. Either from the command line or from the Services Windows Dialog I get the following error:

The My App Postgre Server service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs.

If postgre is installed outside system folders, e.g. D:\My App\pgsql\ everything works fine - the service starts and the database is accessible trough my application.

This seems like a permission issue, but I can't get around it.

Community
  • 1
  • 1
mandarin
  • 1,316
  • 1
  • 15
  • 27
  • Did you, as Craig Ringer suggested, switch the data directory to somewhere under %PROGRAMDATA%\ ? Where is the logfile going to, and ifit exists, what does it say? In short, I suspect that it still tries to write in its installation directory, which is an issue for %PROGRAMFILES% in newer Windows. – fvu Jun 24 '15 at 10:59
  • Changing the folder to %PROGRAMDATA% gives the same error. I actually get this error even if I manually copy-paste only the pgsql folder and manually try to create and start as a Service. – mandarin Jun 24 '15 at 12:36

1 Answers1

1

As for now all the information I have encountered points that Postgres cannot be started from the Program Files or any other System folder. I have seen other similar applications using it and installing it C:\postgres in order to make it work.

mandarin
  • 1,316
  • 1
  • 15
  • 27