Re: RESOLVED: msi installer: CREATESERVICEUSER and uninstall

Поиск
Список
Период
Сортировка
От Dirk.Moebius@dorma.com
Тема Re: RESOLVED: msi installer: CREATESERVICEUSER and uninstall
Дата
Msg-id OF296E8282.8BFE973F-ONC1257305.002C249D-C1257305.002C342E@dorma.com
обсуждение исходный текст
Ответ на msi installer: CREATESERVICEUSER and uninstall  (Dirk.Moebius@dorma.com)
Список pgsql-admin
Just for the record:

I solved the problem by checking myself whether the user 'postgres'
actually exists before running the msi installer. I do this by running the

following WSH script doing an ADO query:


Private Function userExists ( ByVal domain, ByVal username )
    ' checks whether a certain user exists
    ' see
http://www.microsoft.com/technet/scriptcenter/resources/qanda/sept05/hey0907.mspx

    On Error Resume Next
    Set objUser = GetObject("WinNT://" & domain & "/" & username)
    If Err.Number = 0 Then
        WScript.Echo "The user account '" & username & "' exists in the
domain '" & domain & "'"
        userExists = 0
    ElseIf Err.Number = -2147022676 Then
        WScript.Echo "The user account '" & username & "' does not exist
in the domain '" & domain & "'"
        userExists = 1
    Else
        WScript.Echo "The user account status of '" & username & "' in
domain '" & domain & "' could not be determined"
        userExists = 2
    End If
End Function

WScript.Quit(userExists(args(0), args(1)))


Explanation: Whenever this script exits with 0, the user does exists, and
I set CREATESERVICEUSER=0, otherwise 1.
If anyone knows about a more elegant solution, please let me know.

Regards,
Dirk.


pgsql-admin-owner@postgresql.org schrieb am 18.06.2007 09:09:59:

> Hi,
>
> the msi installer for Windows automatically creates a user 'postgres' if


> CREATESERVICEUSER=1. Is it possible to do the following:
>
> 1) don't create the user, if it already exists, and continue with
> installation, instead of showing the error message 'user postgres
already
> exists'.
>
> 2) during uninstallation, delete the user 'postgres' automatically, when


> it has been created during installation.
>
> Thanks,
> Dirk Moebius

--
Dirk Moebius
Software Consultant
MBB Gelma GmbH, Bonn, Germany
http://www.mbb-gelma.de/


В списке pgsql-admin по дате отправления:

Предыдущее
От: Jeff Frost
Дата:
Сообщение: Re: Upgrade from 8.1.4 to 8.1.9
Следующее
От: "Jerry Crocker"
Дата:
Сообщение: pgAdminIII via VPN