Re: Postmaster service code - Mailing list pgsql-hackers-win32

From Magnus Hagander
Subject Re: Postmaster service code
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE17167E@algol.sollentuna.se
Whole thread Raw
In response to Postmaster service code  ("Dave Page" <dpage@vale-housing.co.uk>)
List pgsql-hackers-win32
> I have a question to be able to finish DllRegisterServer
> function. The function must write full pathname of dll in
> registry. In a classical Windows setup program, this path is
> chosen by end-user at runtime.
> We discuss a few week (month ?) ago to store the path in
> registry too and create env variable for backward
> compatibility with existent programs.
>
> Did you remember what was the final decision ?

I think your best bet is to use GetModuleFileNameEx() and friends
(probably need to EnumProcessModules(), I can't remember if there is a
direct API call to give you the current DLL. Or you can save away the
HMODULE value in DllMain() in a global variable - that might be easier)
to find out the exact path of the DLL that regsvr32 is invoked on, and
write that path to the registry.

That way you are completely independent of where the DLL is installed,
as long as it's not moved. (And not being able to move a program/dll
after it has been installed is pretty normal)


//Magnus


pgsql-hackers-win32 by date:

Previous
From:
Date:
Subject: ssl on win32
Next
From: "Slava Ilijin"
Date:
Subject: Info