Thread: Standalone Windows Installation
Hi. I want to use Postgres without installation. The problem is the dependencies on the Visual C dll (msvcrt). As far as I know it would be possible to include a manifest file (only for libpq.dll?) and bundle the dlls from c:\windows\WinSxS into the bin directory of Postgres. Is this correct? Does anybody have (tested) such a manifest file? Jörn
Jörn Heid wrote: > Hi. > > I want to use Postgres without installation. The problem is the > dependencies on the Visual C dll (msvcrt). > As far as I know it would be possible to include a manifest file (only > for libpq.dll?) and bundle the dlls from c:\windows\WinSxS into the bin > directory of Postgres. That should work fine according to my understanding of the Windows dynamic linker's behavour. I'm actually not even sure you'll need the manifest, in that IIRC it should be embedded in the DLL if it was built with a recent VC++. You should also be able to bundle a private copy of the required VC++ runtime in the bin directory; it does not need to be installed in WinSxS. I've done this with small Windows binaries I've distributed at various points with no issues. If you do this, make sure you do NOT put the PostgreSQL bin directory on the PATH, as you may confuse any parallel installation of the official PostgreSQL distribution. You should also use a different port to the default, and if practical not listen on non-loopback TCP/IP interfaces. -- Craig Ringer
Jörn Heid wrote: > Hi. > > I want to use Postgres without installation. The problem is the > dependencies on the Visual C dll (msvcrt). > As far as I know it would be possible to include a manifest file (only > for libpq.dll?) and bundle the dlls from c:\windows\WinSxS into the > bin directory of Postgres. > Is this correct? Does anybody have (tested) such a manifest file? > > Jörn You just need to copy the contents of the redist/x86 under the %VCINSTALLDIR% in your distribution directory, where all dlls/executables are present. VCINSTALLDIR should be similar to C:\Program Files\Microsoft Visual Studio 8\VC, depending on your Visual Studio Installation. This directory contains: * Microsoft.VCxx.CRT * Microsoft.VCxx.ATL ..., etc No need to copy the c:\windows\WinSxS contents. Hope this should solve your problem. Regards, Ashesh
Thanks Ashesh for your answer. I will try to do so although I first have to install VC (or can I just use the directories from WinSxS?). Is there another possibility without setting an environment variable? Think of the simplest distribution of just copying files (e.g. to a USB stick) and "pg_ctrl.exe start" will work out of the box... Cheers, Jörn Ashesh D Vashi schrieb: > Jörn Heid wrote: >> Hi. >> >> I want to use Postgres without installation. The problem is the >> dependencies on the Visual C dll (msvcrt). >> As far as I know it would be possible to include a manifest file >> (only for libpq.dll?) and bundle the dlls from c:\windows\WinSxS into >> the bin directory of Postgres. >> Is this correct? Does anybody have (tested) such a manifest file? >> >> Jörn > You just need to copy the contents of the redist/x86 under the > %VCINSTALLDIR% in your distribution directory, where all > dlls/executables are present. > VCINSTALLDIR should be similar to C:\Program Files\Microsoft Visual > Studio 8\VC, depending on your Visual Studio Installation. > This directory contains: > * Microsoft.VCxx.CRT > * Microsoft.VCxx.ATL > ..., etc > > No need to copy the c:\windows\WinSxS contents. > > Hope this should solve your problem. > > Regards, > Ashesh > -- Dipl.-Inform. Med. Jörn Heid Zentrum für virtuelle Patienten / Centre for Virtual Patients Universitätsklinikum Heidelberg Hygiene-Institut Im Neuenheimer Feld 324 69120 Heidelberg Tel.: +49-(0)7131-504-481 Fax: +49-(0)7131-252-470
Jörn Heid wrote: > Thanks Ashesh for your answer. > > I will try to do so although I first have to install VC (or can I just > use the directories from WinSxS?). Is there another possibility > without setting an environment variable? Think of the simplest > distribution of just copying files (e.g. to a USB stick) and > "pg_ctrl.exe start" will work out of the box... I thought - you have built the binaries from sources. So, I was talking about VC installation. My solution should work perfectly, when you have built the binaries from sources using Visual Studio. Redistribution (copying) of these binaries should work anywhere. (You may need to add dependent dll(s) in the distribution package. i.e. ssl, krb5) Regards, Ashesh EnterpriseDB: http://www.enterprisedb.com > > Cheers, > Jörn > > Ashesh D Vashi schrieb: >> Jörn Heid wrote: >>> Hi. >>> >>> I want to use Postgres without installation. The problem is the >>> dependencies on the Visual C dll (msvcrt). >>> As far as I know it would be possible to include a manifest file >>> (only for libpq.dll?) and bundle the dlls from c:\windows\WinSxS >>> into the bin directory of Postgres. >>> Is this correct? Does anybody have (tested) such a manifest file? >>> >>> Jörn >> You just need to copy the contents of the redist/x86 under the >> %VCINSTALLDIR% in your distribution directory, where all >> dlls/executables are present. >> VCINSTALLDIR should be similar to C:\Program Files\Microsoft Visual >> Studio 8\VC, depending on your Visual Studio Installation. >> This directory contains: >> * Microsoft.VCxx.CRT >> * Microsoft.VCxx.ATL >> ..., etc >> >> No need to copy the c:\windows\WinSxS contents. >> >> Hope this should solve your problem. >> >> Regards, >> Ashesh >> >
Okay, that's a misunderstanding. I don't want to build it from the sources. I want to take the official pre-built "postgres without installer" package and put it on a Windows machine to make it work. That doesn't work (while it should IMHO) because of the dependencies. So I just want to add some manifest/folders/dlls to make it work with the standard binaries. I hope it would be possible as I don't want to rebuild all on each postgres update. Jörn Ashesh D Vashi schrieb: > Jörn Heid wrote: >> Thanks Ashesh for your answer. >> >> I will try to do so although I first have to install VC (or can I >> just use the directories from WinSxS?). Is there another possibility >> without setting an environment variable? Think of the simplest >> distribution of just copying files (e.g. to a USB stick) and >> "pg_ctrl.exe start" will work out of the box... > I thought - you have built the binaries from sources. So, I was > talking about VC installation. > My solution should work perfectly, when you have built the binaries > from sources using Visual Studio. > Redistribution (copying) of these binaries should work anywhere. (You > may need to add dependent dll(s) in the distribution package. i.e. > ssl, krb5) > > Regards, > Ashesh > > EnterpriseDB: http://www.enterprisedb.com > >> >> Cheers, >> Jörn >> >> Ashesh D Vashi schrieb: >>> Jörn Heid wrote: >>>> Hi. >>>> >>>> I want to use Postgres without installation. The problem is the >>>> dependencies on the Visual C dll (msvcrt). >>>> As far as I know it would be possible to include a manifest file >>>> (only for libpq.dll?) and bundle the dlls from c:\windows\WinSxS >>>> into the bin directory of Postgres. >>>> Is this correct? Does anybody have (tested) such a manifest file? >>>> >>>> Jörn >>> You just need to copy the contents of the redist/x86 under the >>> %VCINSTALLDIR% in your distribution directory, where all >>> dlls/executables are present. >>> VCINSTALLDIR should be similar to C:\Program Files\Microsoft Visual >>> Studio 8\VC, depending on your Visual Studio Installation. >>> This directory contains: >>> * Microsoft.VCxx.CRT >>> * Microsoft.VCxx.ATL >>> ..., etc >>> >>> No need to copy the c:\windows\WinSxS contents. >>> >>> Hope this should solve your problem. >>> >>> Regards, >>> Ashesh >>> >> > -- Dipl.-Inform. Med. Jörn Heid Zentrum für virtuelle Patienten / Centre for Virtual Patients Universitätsklinikum Heidelberg Hygiene-Institut Im Neuenheimer Feld 324 69120 Heidelberg Tel.: +49-(0)7131-504-481 Fax: +49-(0)7131-252-470 heid@medicase.de http://www.medicase.de
So, nobody knows how to make the official "Postgres without Installer" to work with a normal Windows installation? Jörn Jörn Heid schrieb: > Okay, that's a misunderstanding. > I don't want to build it from the sources. I want to take the official > pre-built "postgres without installer" package and put it on a Windows > machine to make it work. That doesn't work (while it should IMHO) > because of the dependencies. So I just want to add some > manifest/folders/dlls to make it work with the standard binaries. I > hope it would be possible as I don't want to rebuild all on each > postgres update. > > Jörn > > Ashesh D Vashi schrieb: >> Jörn Heid wrote: >>> Thanks Ashesh for your answer. >>> >>> I will try to do so although I first have to install VC (or can I >>> just use the directories from WinSxS?). Is there another possibility >>> without setting an environment variable? Think of the simplest >>> distribution of just copying files (e.g. to a USB stick) and >>> "pg_ctrl.exe start" will work out of the box... >> I thought - you have built the binaries from sources. So, I was >> talking about VC installation. >> My solution should work perfectly, when you have built the binaries >> from sources using Visual Studio. >> Redistribution (copying) of these binaries should work anywhere. (You >> may need to add dependent dll(s) in the distribution package. i.e. >> ssl, krb5) >> >> Regards, >> Ashesh >> >> EnterpriseDB: http://www.enterprisedb.com >> >>> >>> Cheers, >>> Jörn >>> >>> Ashesh D Vashi schrieb: >>>> Jörn Heid wrote: >>>>> Hi. >>>>> >>>>> I want to use Postgres without installation. The problem is the >>>>> dependencies on the Visual C dll (msvcrt). >>>>> As far as I know it would be possible to include a manifest file >>>>> (only for libpq.dll?) and bundle the dlls from c:\windows\WinSxS >>>>> into the bin directory of Postgres. >>>>> Is this correct? Does anybody have (tested) such a manifest file? >>>>> >>>>> Jörn >>>> You just need to copy the contents of the redist/x86 under the >>>> %VCINSTALLDIR% in your distribution directory, where all >>>> dlls/executables are present. >>>> VCINSTALLDIR should be similar to C:\Program Files\Microsoft Visual >>>> Studio 8\VC, depending on your Visual Studio Installation. >>>> This directory contains: >>>> * Microsoft.VCxx.CRT >>>> * Microsoft.VCxx.ATL >>>> ..., etc >>>> >>>> No need to copy the c:\windows\WinSxS contents. >>>> >>>> Hope this should solve your problem. >>>> >>>> Regards, >>>> Ashesh
On Fri, 03 Oct 2008 21:02:27 +0200 Jörn Heid <heid@hs-heilbronn.de> wrote: > So, nobody knows how to make the official "Postgres without > Installer" to work with a normal Windows installation? http://www.postgresql.org/docs/faqs.FAQ_MINGW.html Have fun. Joshua D. Drake -- The PostgreSQL Company since 1997: http://www.commandprompt.com/ PostgreSQL Community Conference: http://www.postgresqlconference.org/ United States PostgreSQL Association: http://www.postgresql.us/
Thanks for your answer but here's the longer question as asked in the posts before: How can I use the official "Postgres without installer" distribution without compiling the sources for myself and without having to install the redistribution application of the VC dlls so that I can distribute an "all-inside" folder with all needed binaries, dlls and so on for all Windows installations? Is it possible perhaps with a manifest file and bundled dlls or is it impossible? Jörn Joshua Drake schrieb: > On Fri, 03 Oct 2008 21:02:27 +0200 > Jörn Heid <heid@hs-heilbronn.de> wrote: > > >> So, nobody knows how to make the official "Postgres without >> Installer" to work with a normal Windows installation? >> > > http://www.postgresql.org/docs/faqs.FAQ_MINGW.html > > Have fun. > > > Joshua D. Drake > > > -- Dipl.-Inform. Med. Jörn Heid Zentrum für virtuelle Patienten / Centre for Virtual Patients Universitätsklinikum Heidelberg Hygiene-Institut Im Neuenheimer Feld 324 69120 Heidelberg Tel.: +49-(0)7131-504-481 Fax: +49-(0)7131-252-470
Jörn
a Microsoft Windows Installer is supposed to do:
a)configure any/all server binaries to work as a Windows Service (take a look at Admin/CPanel/Services) ..
b)retain these configurations in the windows registry as identified by CLSID (a unique ID which tracks
the binaries characteristics such as version,location,size,which Windows Groups/users can access) as well
as any dependencies these binaries may have to report to to Win32 dependency manager
When the Windows Installer is out of synch with the installed MS binary as what happens when you install a Windows Service Pack your install may only partially install leaving the installation in a unusable state where you would then have to
1)clean out the registry for all of the entries for the program (exes) and all of its associated dependent dlls
2)delete the installation root folder (and all associated programs)
3)delete any/all links/aliases to those programs
so what started off with a Installer version mismatch can easily turn into hours or even a day long task especially with binaries who may drop into windows/system32 folder (as is the case when jsvc with msvcrt -this is the MAIN runtime library for MS)
In a perfect world where all environments, all resources and all capabilties of the operator are known the windows installer works as intended..change any version of any characteristic of the above requirements one iota and the installer breaks the install..
I vote Postgres sans Windows Installer
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.
> Date: Fri, 3 Oct 2008 21:25:53 +0200
> From: heid@hs-heilbronn.de
> To: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Standalone Windows Installation
>
> Thanks for your answer but here's the longer question as asked in the
> posts before:
>
> How can I use the official "Postgres without installer" distribution
> without compiling the sources for myself and without having to install
> the redistribution application of the VC dlls so that I can distribute
> an "all-inside" folder with all needed binaries, dlls and so on for all
> Windows installations? Is it possible perhaps with a manifest file and
> bundled dlls or is it impossible?
>
> Jörn
>
> Joshua Drake schrieb:
> > On Fri, 03 Oct 2008 21:02:27 +0200
> > Jörn Heid <heid@hs-heilbronn.de> wrote:
> >
> >
> >> So, nobody knows how to make the official "Postgres without
> >> Installer" to work with a normal Windows installation?
> >>
> >
> > http://www.postgresql.org/docs/faqs.FAQ_MINGW.html
> >
> > Have fun.
> >
> >
> > Joshua D. Drake
> >
> >
> >
>
> --
> Dipl.-Inform. Med. Jörn Heid
>
> Zentrum für virtuelle Patienten / Centre for Virtual Patients
> Universitätsklinikum Heidelberg
> Hygiene-Institut
> Im Neuenheimer Feld 324
> 69120 Heidelberg
>
> Tel.: +49-(0)7131-504-481
> Fax: +49-(0)7131-252-470
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
Stay up to date on your PC, the Web, and your mobile phone with Windows Live. See Now
a Microsoft Windows Installer is supposed to do:
a)configure any/all server binaries to work as a Windows Service (take a look at Admin/CPanel/Services) ..
b)retain these configurations in the windows registry as identified by CLSID (a unique ID which tracks
the binaries characteristics such as version,location,size,which Windows Groups/users can access) as well
as any dependencies these binaries may have to report to to Win32 dependency manager
When the Windows Installer is out of synch with the installed MS binary as what happens when you install a Windows Service Pack your install may only partially install leaving the installation in a unusable state where you would then have to
1)clean out the registry for all of the entries for the program (exes) and all of its associated dependent dlls
2)delete the installation root folder (and all associated programs)
3)delete any/all links/aliases to those programs
so what started off with a Installer version mismatch can easily turn into hours or even a day long task especially with binaries who may drop into windows/system32 folder (as is the case when jsvc with msvcrt -this is the MAIN runtime library for MS)
In a perfect world where all environments, all resources and all capabilties of the operator are known the windows installer works as intended..change any version of any characteristic of the above requirements one iota and the installer breaks the install..
I vote Postgres sans Windows Installer
Martin
______________________________________________
Disclaimer and confidentiality note
Everything in this e-mail and any attachments relates to the official business of Sender. This transmission is of a confidential nature and Sender does not endorse distribution to any party other than intended recipient. Sender does not necessarily endorse content contained within this transmission.
> Date: Fri, 3 Oct 2008 21:25:53 +0200
> From: heid@hs-heilbronn.de
> To: pgsql-general@postgresql.org
> Subject: Re: [GENERAL] Standalone Windows Installation
>
> Thanks for your answer but here's the longer question as asked in the
> posts before:
>
> How can I use the official "Postgres without installer" distribution
> without compiling the sources for myself and without having to install
> the redistribution application of the VC dlls so that I can distribute
> an "all-inside" folder with all needed binaries, dlls and so on for all
> Windows installations? Is it possible perhaps with a manifest file and
> bundled dlls or is it impossible?
>
> Jörn
>
> Joshua Drake schrieb:
> > On Fri, 03 Oct 2008 21:02:27 +0200
> > Jörn Heid <heid@hs-heilbronn.de> wrote:
> >
> >
> >> So, nobody knows how to make the official "Postgres without
> >> Installer" to work with a normal Windows installation?
> >>
> >
> > http://www.postgresql.org/docs/faqs.FAQ_MINGW.html
> >
> > Have fun.
> >
> >
> > Joshua D. Drake
> >
> >
> >
>
> --
> Dipl.-Inform. Med. Jörn Heid
>
> Zentrum für virtuelle Patienten / Centre for Virtual Patients
> Universitätsklinikum Heidelberg
> Hygiene-Institut
> Im Neuenheimer Feld 324
> 69120 Heidelberg
>
> Tel.: +49-(0)7131-504-481
> Fax: +49-(0)7131-252-470
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
Stay up to date on your PC, the Web, and your mobile phone with Windows Live. See Now
What are the differes between ST_Intersects and ST_Touches?
The 1st query return something, but the 2nd return 0.
select road.link_id from road where
Intersects (
Buffer(GeometryFromText('POINT(-88.02083 41.956982)',4326), .001),
the_geom
)
Intersects (
Buffer(GeometryFromText('POINT(-88.02083 41.956982)',4326), .001),
the_geom
)
select road.link_id from road where
Touches (
Buffer(GeometryFromText('POINT(-88.02083 41.956982)',4326), .001),
the_geom
)
Touches (
Buffer(GeometryFromText('POINT(-88.02083 41.956982)',4326), .001),
the_geom
)
Thanks.
_CYW_
On Fri, Oct 3, 2008 at 6:53 PM, Martin Gainty <mgainty@hotmail.com> wrote: > so what started off with a Installer version mismatch can easily turn into > hours or even a day long task especially with binaries who may drop into > windows/system32 folder (as is the case when jsvc with msvcrt -this is the > MAIN runtime library for MS) > > In a perfect world where all environments, all resources and all capabilties > of the operator are known the windows installer works as intended..change > any version of any characteristic of the above requirements one iota and the > installer breaks the install.. > > I vote Postgres sans Windows Installer I just prefer to use an os with a package manager. I cannot believe Microsoft hasn't bothered to at least steal one yet.
On Sat, Oct 4, 2008 at 8:02 AM, Scott Marlowe <scott.marlowe@gmail.com> wrote: > I just prefer to use an os with a package manager. I cannot believe > Microsoft hasn't bothered to at least steal one yet. Why would they? To the extend that such functionality would be required on WIndows, where it's far, far less common to use a myriad of dependencies from different sources, it's handled by merge modules and the installer, which are used to ensure consistent deployment of dependencies, whilst keeping the installer self-contained and free of user visible dependencies. -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com
On Sat, Oct 4, 2008 at 1:53 AM, Martin Gainty <mgainty@hotmail.com> wrote: > When the Windows Installer is out of synch with the installed MS binary as > what happens when you install a Windows Service Pack your install may only > partially install leaving the installation in a unusable state where you > would then have to > 1)clean out the registry for all of the entries for the program (exes) and > all of its associated dependent dlls > 2)delete the installation root folder (and all associated programs) > 3)delete any/all links/aliases to those programs None of which applies to PostgreSQL (or a Windows Service Pack). The only shared DLLs which PostgreSQL 8.3 uses are are the VC++ 8 runtimes, which are installed as versioned assemblies. Multiple versions of the runtimes can be installed simultaneously, and the binaries bind automatically to the correct version. PostgreSQL 8.2 used the MSVC++ 6 runtimes, which have never had a non-backwards compatible update. This applies also to other components such as COM objects and ActiveX controls which may also be updated with a service pack. Any compatibility breaks are accompanied by a CLSID and filename change specifically to ensure that both versions can coexist to prevent breakage of third party apps. The kind of breakage you refer to typically comes from third party apps that install libraries in shared locations and break compatibility without regard for the consequences. We were guilty of this with PostgreSQL 8.0, in which we installed completely un-versioned SSL libraries as well as libpq.dll in %SYSTEM32%. Suffice it to say, we fixed this. -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com
On Fri, Oct 3, 2008 at 8:25 PM, Jörn Heid <heid@hs-heilbronn.de> wrote: > Thanks for your answer but here's the longer question as asked in the posts > before: > > How can I use the official "Postgres without installer" distribution without > compiling the sources for myself and without having to install the > redistribution application of the VC dlls so that I can distribute an > "all-inside" folder with all needed binaries, dlls and so on for all Windows > installations? Is it possible perhaps with a manifest file and bundled dlls > or is it impossible? It should be possible by including the contents of the runtime directory (normally found in C:\Windows\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700) and the corresponding manifest found in C:\Windows\WinSxS\Manifests (probably renamed to Microsoft.VC80.CRT.manifest) in the PostgreSQL bin directory. This is essentially what we do with pgAdmin. We did run into some problems with this method with the server though and found it was more reliable to install them as side by side assemblies in the global cache. I forget the details, but it might have been that libraries in the PG lib directory weren't correctly finding the runtimes in the bin directory (which would usually work for regular DLLs). -- Dave Page EnterpriseDB UK: http://www.enterprisedb.com
Thanks. I will try it out. This sounds like the solution I was looking for. Dave Page schrieb: > On Fri, Oct 3, 2008 at 8:25 PM, Jörn Heid <heid@hs-heilbronn.de> wrote: > >> Thanks for your answer but here's the longer question as asked in the posts >> before: >> >> How can I use the official "Postgres without installer" distribution without >> compiling the sources for myself and without having to install the >> redistribution application of the VC dlls so that I can distribute an >> "all-inside" folder with all needed binaries, dlls and so on for all Windows >> installations? Is it possible perhaps with a manifest file and bundled dlls >> or is it impossible? >> > > It should be possible by including the contents of the runtime > directory (normally found in > C:\Windows\WinSxS\x86_Microsoft.VC80.CRT_1fc8b3b9a1e18e3b_8.0.50727.762_x-ww_6b128700) > and the corresponding manifest found in C:\Windows\WinSxS\Manifests > (probably renamed to Microsoft.VC80.CRT.manifest) in the PostgreSQL > bin directory. This is essentially what we do with pgAdmin. > > We did run into some problems with this method with the server though > and found it was more reliable to install them as side by side > assemblies in the global cache. I forget the details, but it might > have been that libraries in the PG lib directory weren't correctly > finding the runtimes in the bin directory (which would usually work > for regular DLLs). > > -- Dipl.-Inform. Med. Jörn Heid Zentrum für virtuelle Patienten / Centre for Virtual Patients Universitätsklinikum Heidelberg Hygiene-Institut Im Neuenheimer Feld 324 69120 Heidelberg Tel.: +49-(0)7131-504-481 Fax: +49-(0)7131-252-470