I would install postgresql with the NSIS installer, but I don't know how.
Can you help me please ?
I've find this code
outfile "C:\project-open\installer\install_postgres.exe"
Name "Install PostgreSQL"
!include Registry.nsh
!include LogicLib.nsh
!include MultiUser.nsh
!include Sections.nsh
!include MUI2.nsh`
!define TARGET c:\project-open
Function .onInit
StrCpy $INSTDIR "c:\project-open"
FunctionEnd
section
UserMgr::CreateAccountEx "postgres" "*******" "PostgreSQL" "PostgreSQL Database User" "Database user created by ]po[ installer" "UF_PASSWD_NOTREQD|UF_DONT_EXPIRE_PASSWD"
pop $R0
DetailPrint "After creating account: result=$R0"`
UserMgr::AddPrivilege "postgres" "SeBatchLogonRight"
pop $R0
DetailPrint "SeBatchLogonRight: result=$R0"
UserMgr::AddPrivilege "postgres" "SeServiceLogonRight"
pop $R0
DetailPrint "SeServiceLogonRight: result=$R0"
nsExec::ExecToLog '"$INSTDIR\pgsql\bin\initdb.exe" --username=postgres --locale=C --encoding=UTF8 -D "$INSTDIR\pgsql\data"'
pop $R0
DetailPrint "After initializing database: result=$R0"
nsExec::ExecToLog 'sc create postgresql-9.2 binpath= "c:\project-open\pgsql\bin\pg_ctl.exe runservice -N postgresql-9.2 -D c:/project-open/pgsql/data -w" DisplayName= "PostgreSQL 9.2" start= "demand" type= own obj= ".\postgres" password= "******" '
pop $R0
DetailPrint "After registering the service: result=$R0"sectionEnd`
but I have a problem with UserMgr::CreateAccountEx
but I've imported all files required.