On Thu, Jun 08, 2023 at 01:10:00PM +0200, Magnus Hagander wrote:
> On Thu, Jun 8, 2023 at 3:45 AM Noah Misch <n...@leadboat.com> wrote:
> > On Wed, Jun 07, 2023 at 04:47:26PM -0700, Andres Freund wrote:
> > > On 2023-06-07 16:14:07 -0700, Noah Misch wrote:
> > > >     postgres.exe is icon-free.
> > >
> > > We could also just change that.
> >
> > I would be +1 for that (only if done for all build systems).  Showing the
> > elephant in task manager feels better than showing the generic-exe icon.
> 
> I think this decision goes back all the way to the ancient times, and
> the argument was then "user should not use the postgres.exe file when
> clicking around" sort of. Back then, task manager didn't show the icon
> at all, regardless. It does now, so I'm +1 to add the icon (in all the
> build systems).

That sounds good, and it's the attached one-byte change.  That also simplifies
the Meson fix; new version attached.
Author:     Noah Misch <n...@leadboat.com>
Commit:     Noah Misch <n...@leadboat.com>

    Give postgres.exe the icon of other executables.
    
    We had left it icon-free since users won't achieve much by opening it
    from Windows Explorer.  Subsequent to that decision, Task Manager
    started to show the icon.  That shifts the balance in favor of attaching
    the icon, so do so.  No back-patch, but make this late addition to v16.
    
    Reviewed by FIXME.
    
    Discussion: https://postgr.es/m/FIXME

diff --git a/src/backend/Makefile b/src/backend/Makefile
index e4bf0fe..3c42003 100644
--- a/src/backend/Makefile
+++ b/src/backend/Makefile
@@ -10,8 +10,7 @@
 #-------------------------------------------------------------------------
 
 PGFILEDESC = "PostgreSQL Server"
-# This is a daemon process, which is why it is not labeled as an executable
-#PGAPPICON=win32
+PGAPPICON=win32
 
 subdir = src/backend
 top_builddir = ../..
Author:     Noah Misch <n...@leadboat.com>
Commit:     Noah Misch <n...@leadboat.com>

    Add win32ver data to meson-built postgres.exe.
    
    As in the older build systems, the resources object is not an input to
    postgres.def.
    
    Reviewed by FIXME.
    
    Discussion: https://postgr.es/m/FIXME

diff --git a/src/backend/meson.build b/src/backend/meson.build
index ccfc382..88a35e9 100644
--- a/src/backend/meson.build
+++ b/src/backend/meson.build
@@ -5,6 +5,7 @@ backend_sources = []
 backend_link_with = [pgport_srv, common_srv]
 
 generated_backend_sources = []
+post_export_backend_sources = []
 
 subdir('access')
 subdir('archive')
@@ -133,8 +134,15 @@ if dtrace.found() and host_system != 'darwin'
   )
 endif
 
+if host_system == 'windows'
+  post_export_backend_sources += rc_bin_gen.process(win32ver_rc, extra_args: [
+    '--NAME', 'postgres',
+    '--FILEDESC', 'PostgreSQL Server',])
+endif
+
 postgres = executable('postgres',
   backend_input,
+  sources: post_export_backend_sources,
   objects: backend_objs,
   link_args: backend_link_args,
   link_with: backend_link_with,

Reply via email to