0

My application bundles PostgreSQL 9.5.0 and runs initdb.exe manually. It works fine in the most clients. This A client also installed my application successfully before, but after rebooting their Windows (2008), they got below error. They intentionally just ran "initdb.exe' without any options.

c:\Users\Administrator> "C:\Program Files (x86)\myapp\pgsql\bin\initdb.exe"
The program "postgres" is needed by initdb but was not found in the same directory as "C:\Program Files (x86)\myapp\pgsql\bin\initdb.exe".
Check your installation.

My installer (inno setup) runs below one as well to grant privileges. (%1 points installation directory). icacls %1 /grant Everyone:(OI)(CI)F

Someone says that I should try with a non-privileged user as following but I have to reproduce this issue in my local env, and I don't have any issue with Admin or other non-privileged user.

runas /user:username "initdb -D ..." 

Can you guide me how I can resolve this issue?

Sigularity
  • 917
  • 2
  • 12
  • 28
  • "9.5.0". I don't specifically know of any fixes in later patch releases, but the first thing you should do is update to the latest patch release 9.5.9. The responsible function in the postgres sources is `find_other_exec` if you want to look into what could be happening. Try running with the working directory as the bin directory. – Craig Ringer Oct 27 '17 at 01:26
  • find_other_exec. Good point. How can I check with the function(?)? Can you please let me know about it in more detail? – Sigularity Oct 27 '17 at 02:14
  • Did you mean I should test to run initdb.exe after changing the directory into 'bin'? – Sigularity Oct 27 '17 at 02:28
  • Yes, that's what I mean. And `find_other_exec` is the relevant C function in the PostgreSQL source code, in case you were trying to study the source code to understand the possible causes. – Craig Ringer Oct 27 '17 at 02:40
  • Ok. I see. Let me try that. Thanks. – Sigularity Oct 27 '17 at 02:41

0 Answers0