Archive: Postgres Silent Install Failure


Postgres Silent Install Failure
Part of my installer executes a PostgreSQL silent installer.

The line of code that does this looks like this:

execWait "MSIEXEC /i $\"postgresql-8.1-int.msi$\" /qb ADDLOCAL=server, nls, postgis, pljava, psql, pgadmin, jdbc, npgsql, psqlodbc, pgoledb, includefiles, libfiles, msvclibs, pgxs, binfiles INTERNALLAUNCH=1 DOSERVICE=1 CREATESERVICEUSER=0 DOINITDB=1 SERVICEDOMAIN=$\"%COMPUTERNAME%$\" SERVICEACCOUNT=$\"postgres$\" SERVICEPASSWORD=$\"randompass1$\" SERVICENAME=$\"PostgreSQL Database Server 8.1$\" SUPERUSER=$\"postgres$\" SUPERPASSWORD=$\"randompass2$\" LOCALE=C ENCODING=SQL_ASCII LISTENPORT=5432 PERMITREMOTE=1 PL_PGSQL=1 PL_PERL=1 PL_PERLU=1 PL_TCL=0 PL_TCLU=0 PL_PYTHONU=0 PL_JAVA=1 BASEDIR=$\"$INSTDIR\PostgreSQL\8.1$\""

When I run this line of code (minus the execWait) directly in the cmd window it works fine. However when ran from the nullsoft installer the Postgres installer starts up and then throws an error saying: "User account ***9633;***9633;***9633;***9633;***9633;***9633;***9633;s***9633;***9633;***9633;***9633;\***9633;***9633;***9633;***9633;***9633;W does not exist"

So it seems that for some reason nullsoft installer messes with the command line arguments of msiexec, and instead of reading "postgres" as the user it uses a random unknown string (always the same one).

Any ideas why this happens?

Thanks.

hi,

i have the same issue, have you find the solution ?

guillaume


It's been a long time since I worked on this, but if I remember well I didn't manage to get that particular line of code working. Instead, I placed that code into a batch file, and then I called that batch file from the installer. So in the installer script I had:

ExecWait "silentPostgresInstall.bat"

I hope that helps. It worked for me.


Thanks !
In fact, i have tried this method before your answer and it works.I was curious to know if there were "better" solutions, seems not.

thanks again.


you can use Process Explorer to verify the command line passed by NSIS installer to MsiExec process


I've had similar problems running a silent PostgreSQL install. The batch file workaround worked for me, although it would be great if this problem was fixed.

As a result of the batch file workaround, I then had to then figure out how to avoid a command prompt window opening while the batch file ran (used nsExec).

A silent Java install runs with no problems from within NSIS. The error I would get from the postgresql install was "Internal account lookup failure. No mapping between account names and security IDs was done.", although in my efforts to get it to work I also stumbled on the error mentioned in the first post.

I can't figure out whether this is a problem in the postgresql installer or whether something about being run from within NSIS affects its attempts to create or administer the postgres system user.

Is there anyone who knows enough about NSIS internals to figure this one out?


Hello,
I have to do the postgres Install Using NSIS Installer.
I have to :
Uninstall postgres(If installed)
delete pguser(if account there)
Install postgres
add pguser to local group
stop postgres
start postgres


I am installing 8.1.4 on a Windows XP SP2 virtual machine (VMWare). It seems that if I specify BASEDIR=<path> in my command line, and <path> is NOT the default install path, I get the error "internal account lookup failure" immediately after the postgres user account is created. If I leave the BASEDIR statement out of the command line, the install succeeds.

When performing the initial installation, Simple File Sharing was enabled. My installation was disabling Simple File Sharing, but not until after the PostgreSQL install was complete. However, if I disable Simple File Sharing prior to installing PostgreSQL, I can specify a BASEDIR and I do not receive the error message indicated above.

Thus, it appears the Simple File Sharing setting interferes with the PostgreSQL installation's ability to set permissions on the \<BASEDIR> folder.

To disable Simple File Sharing, change the registry setting:

HKLM\SYSTEM\CurrentControlSet\Control\Lsa\forceguest = 0

Or uncheck the "Tools > Folder Options > View > Use simple file sharing" option from Windows Explorer.


After digging deeper, it seems that the Simple File Sharing setting is not the key to the problem. It has a lot to do with the SERVICEDOMAIN and BASEDIR settings.

- If I do not specify BASEDIR or SERVICEDOMAIN, the installation succeeds.

- If I specify BASEDIR but not SERVICEDOMAIN, the installation never succeeds regardless of the state of the Simple File Sharing setting.

- I have never been able to get the installation to succeed using SERVICEDOMAIN="%COMPUTERNAME%" - it fails every time with the same "Internal account lookup failure" error.

- If I specify SERVICEDOMAIN and pass the name of the computer as read from the Windows Registry (i.e. SERVICEDOMAIN="MYCOMPUTER"), I am also able to specify BASEDIR regardless of the state of the Simple File Sharing setting and the installation seems to succeed every time!

Hope this helps!


After more extensive testing on various operating systems (2K SP4, XP SP2, Server 2003, and Vista Business), here is information regarding the use of different "silent mode" switches in combination with the SERVICEDOMAIN and BASEDIR switches:


Using the command line: (do not specify SERVICEDOMAIN or BASEDIR)
msiexec /i "<path>\postgresql-8.1-int.msi" <UIType> INTERNALLAUNCH=1 SERVICEPASSWORD="<pwd>" CREATESERVICEUSER=1 SUPERPASSWORD="<pwd>" ENCODING=UTF8 ADDLOCAL=server,psql,pgadmin

where <UIType> =
/qr - install succeeds on 2K/XP/Server 2003/Vista
/qn - install fails on XP/Server 2003 (assumed "Internal account lookup failure" error)
/qb - install fails on 2K/XP/Server 2003 with "Internal account lookup failure" error



Using the command line: (specify both SERVICEDOMAIN and BASEDIR)
msiexec /i "<path>\postgresql-8.1-int.msi" <UIType> INTERNALLAUNCH=1 SERVICEDOMAIN="<ComputerName>" SERVICEPASSWORD="<pwd>" CREATESERVICEUSER=1 SUPERPASSWORD="<pwd>" ENCODING=UTF8 ADDLOCAL=server,psql,pgadmin BASEDIR="C:\PostgreSQL"

where <ComputerName> is setting read from Windows Registry and <UIType> =
/qr - install succeeds on 2K/XP/Vista but fails on Server 2003 with "Internal account lookup failure" error
/qn - install succeeds on XP but fails on Server 2003 (assumed "Internal account lookup failure" error)
/qb - install succeeds on 2K/XP but fails on Server 2003 with "Internal account lookup failure" error



Using the command line: (specify BASEDIR, do not specify SERVICEDOMAIN)
msiexec /i "<path>\postgresql-8.1-int.msi" <UIType> INTERNALLAUNCH=1 SERVICEPASSWORD="<pwd>" CREATESERVICEUSER=1 SUPERPASSWORD="<pwd>" ENCODING=UTF8 ADDLOCAL=server,psql,pgadmin BASEDIR="C:\PostgreSQL"

where <UIType> =
/qr - install succeeds on 2K/XP/Server 2003/Vista
/qn - install fails on XP/Server 2003 (assumed "Internal account lookup failure" error)
/qb - install fails on 2K/XP/Server 2003 with "Internal account lookup failure" error


I have tried to run the same silent installer on the command line - without ever using NSIS - and I get the exact same error - "User account â–¡â–¡â–¡â–¡â–¡â–¡â–¡sâ–¡â–¡â–¡â–¡\â–¡â–¡â–¡â–¡â–¡W does not exist". This looks more like a Postgres .msi installer problem - not an NSIS problem..... Has anyone solved this problem?


Thready,

i know it's a late answer but here is my one cents:

Do not create the user account thanks to Posgresql installer.
Do it by hand in a batch file.

For exemple :
net user postgres password /passwordreq:yes /PASSWORDCHG:no /add

Guillaume


How to uninstall postgres
Hi all, I had install postgresql server in nsis in silent mode and i want to uninstall it from the installer,
How


Answer is here: http://forums.winamp.com/showthread....=1#post2812056


Our experience with the create user was that the password for the new postgresql user was not passing the domain password policy.