Subject: bug#77495: [PATCH] Include additional version metadata during Windows install

From: Sean Bright <[email-masked]>
Date: Thu, 03 Apr 2025 15:11:17 +0000

Hello friends,

I install emacs on Windows using the winget tool. This tool queries
the Windows registry for the current installed version of emacs, but
the NSIS installer does not create the appropriate values resulting in
the current version being reported as 'Unknown.' The attached patch
fixes that and additionally sets the Publisher value to "Free Software
Foundation, Inc."

This prevents winget from reinstalling the same version during every
invocation of 'winget update' but it also improves the appearance of
GNU Emacs in the 'Add or Remove Programs' interface[1].

Kind regards,
Sean

1. https://seanbright.com/emacs-win-metadata.png
From be14aaf0a4e9fa6ae131f237648f1a7cd15295e7 Mon Sep 17 00:00:00 2001
From: Sean Bright <[email-masked]>
Date: Wed, 2 Apr 2025 13:52:06 -0400
Subject: [PATCH] Include additional version metadata during Windows install

* admin/nt/dist-build/emacs.nsi: Add the DisplayVersion and Publisher
  values to the Uninstall registry key.

Copyright-paperwork-exempt: yes
---
 admin/nt/dist-build/emacs.nsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/admin/nt/dist-build/emacs.nsi b/admin/nt/dist-build/emacs.nsi
index 4a5de4f85f9..441d6ea639b 100644
--- a/admin/nt/dist-build/emacs.nsi
+++ b/admin/nt/dist-build/emacs.nsi
@@ -72,6 +72,8 @@ Section
 
   # add registry key to enable uninstall from control panel
   WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "GNU Emacs ${VERSION_BRANCH}"
+  WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${VERSION_BRANCH}"
+  WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "Free Software Foundation, Inc."
   WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "$\"$UninstallerPath$\""
 
   ;Create shortcuts
-- 
2.43.0